/*
 * Bilder der Woche – Website (Übersicht + Seite je Wanderung). Taurerwirt-Design: Navy/Gold, eckig,
 * Crimson Pro (Überschriften) + Barlow Condensed (Text). Nur auf Seiten mit dem Element geladen.
 */

/* Einblenden der Website (.fade) für dieses Element aus – sonst erscheint das große Bild verspätet (LCP) */
.frame-type-twbilderwoche_galerie.fade { visibility: visible; }
.frame-type-twbilderwoche_galerie.fadeIn { animation: none; }

.twbw {
  --twbw-navy: var(--tw-navy, #293349);
  --twbw-gold: var(--tw-gold, #d2be6f);
  --twbw-hell: #f4f2ee;
  --twbw-leise: #5c616c;
  width: min(100% - 2 * var(--tw-side, 24px), 1240px);
  margin: clamp(20px, 3vw, 40px) auto clamp(48px, 7vw, 100px);
  text-align: left;
}
.twbw *, .twbw *::before, .twbw *::after { box-sizing: border-box; border-radius: 0; }
/* Handy: die Inhaltsspalte hat schon 24 px Rand – Fotos nicht noch schmäler machen */
@media (max-width: 699px) { .twbw { width: 100%; } }
.twbw img { max-width: 100%; }
.twbw [hidden] { display: none !important; } /* sonst gewinnt z. B. display: inline-flex der Knöpfe */
.twbw a:focus-visible, .twbw button:focus-visible { outline: 3px solid #b8962e; outline-offset: 3px; }

.twbw-dachzeile { margin: 0 0 6px; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--twbw-leise); }
.twbw-dachzeile__datum { display: block; } /* „Neueste Wanderung“ / Datum untereinander (kein „·“ am Zeilenanfang am Handy) */
.twbw-untertitel { margin: 0 0 10px; font-family: var(--font-family-headings, 'Crimson Pro', Georgia, serif); font-style: italic; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.25; color: var(--twbw-navy); }
.twbw-info { margin: 0 0 18px; color: var(--twbw-leise); font-size: 17px; }
.twbw-leer { padding: 40px 20px; text-align: center; background: var(--twbw-hell); color: var(--twbw-leise); }

.twbw-knopf {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 24px;
  border: 2px solid var(--twbw-navy); background: var(--twbw-navy); color: #fff !important;
  font-size: 17px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; text-decoration: none !important;
  cursor: pointer; transition: background-color .2s, color .2s;
}
.twbw-knopf:hover { background: #fff; color: var(--twbw-navy) !important; }
.twbw-knopf--rand { background: #fff; color: var(--twbw-navy) !important; }
.twbw-knopf--rand:hover { background: var(--twbw-navy); color: #fff !important; }

/* Neueste Wanderung */
.twbw-neu { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); background: var(--twbw-hell); }
.twbw-neu__bild { display: block; overflow: hidden; min-height: 100%; }
.twbw-neu__bild img { display: block; width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .8s ease; }
.twbw-neu__text { padding: clamp(22px, 3.2vw, 44px); display: flex; flex-direction: column; justify-content: center; }
.twbw-neu__titel { margin: 0 0 8px; font-family: var(--font-family-headings, 'Crimson Pro', Georgia, serif); font-weight: 500; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; }
.twbw-neu__titel a { color: var(--twbw-navy); text-decoration: none; }
.twbw-neu__titel a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.twbw-auszug { margin: 0 0 12px; color: #333; }
.twbw-neu .twbw-knopf { align-self: flex-start; }
.twbw-neu__streifen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 22px; }
.twbw-neu__streifen a { display: block; overflow: hidden; }
.twbw-neu__streifen img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s ease; }
@media (max-width: 899px) {
  .twbw-neu { grid-template-columns: 1fr; }
  .twbw-neu__bild img { height: auto; }
}

/* Archiv */
.twbw-archiv { margin-top: clamp(48px, 7vw, 90px); }
.twbw-archiv__titel { margin: 0 0 22px; font-family: var(--font-family-headings, 'Crimson Pro', Georgia, serif); font-weight: 500; font-size: clamp(28px, 3vw, 40px); color: var(--twbw-navy); text-align: center; }
.twbw-kacheln { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.twbw-kachel { margin: 0; padding: 0; }
.twbw-kachel::before { content: none; }
.twbw-kachel__link { position: relative; display: block; overflow: hidden; background: var(--twbw-navy); color: #fff; text-decoration: none; }
.twbw-kachel__bild { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s ease; }
.twbw-kachel__text { position: absolute; inset: auto 0 0 0; padding: 64px 16px 14px; background: linear-gradient(rgba(20, 26, 40, 0), rgba(20, 26, 40, .62) 38%, rgba(20, 26, 40, .92)); text-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
.twbw-kachel__datum { display: block; font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--twbw-gold); }
.twbw-kachel__titel { display: block; font-family: var(--font-family-headings, 'Crimson Pro', Georgia, serif); font-style: italic; font-size: 26px; line-height: 1.12; }
.twbw-kachel__anzahl { display: block; margin-top: 2px; font-size: 15px; color: #e3e5ea; }
.twbw-mehr { margin: 26px 0 0; text-align: center; }

/* Seite einer Wanderung */
.twbw--woche { margin-top: 0; }
.twbw-zurueck { margin: 0 0 4px; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; }
.twbw-zurueck a { color: var(--twbw-navy); text-decoration: none; font-weight: 600; }
.twbw-zurueck a:hover { text-decoration: underline; }
.twbw-kopf { width: auto; margin: clamp(8px, 2vw, 20px) auto clamp(18px, 3vw, 32px); }
.twbw-kopf .twbw-dachzeile, .twbw-kopf .twbw-info { text-align: center; }
.twbw-kopf .twbw-untertitel { text-align: center; margin-top: 10px; }
.twbw-bericht { max-width: 760px; margin: 0 auto clamp(22px, 3vw, 36px); font-size: 19px; line-height: 1.55; text-align: center; color: #333; }
.twbw-bericht p { margin: 0; }

.twbw-fotos { list-style: none; margin: 0; padding: 0; }
.twbw-foto { margin: 0; padding: 0; }
.twbw-foto::before { content: none; }
.twbw-foto__link { display: block; overflow: hidden; background: #e8e5de; }
.twbw-foto__link img { display: block; width: 100%; height: auto; transition: transform .6s ease; }
.twbw-foto__text { margin: 8px 0 0; font-size: 16px; font-style: italic; color: var(--twbw-leise); }

/* Fotoreihen: gleich hohe Reihen, jedes Foto im ganzen Format (Breite ∝ Seitenverhältnis --s).
   --h = Zielhöhe einer Reihe. Tablet/Handy: aus der Breite des Elements gerechnet (100vw − 2 × 24 px Innenabstand
   der Inhaltsspalte − Seitenrand), damit auch zwei 16:9-Fotos nebeneinander passen (Handy) bzw. drei 4:3-Fotos (Tablet) */
.twbw-fotos--reihen { --h: min(260px, calc((91.6vw - 48px) / 3.6)); display: flex; flex-wrap: wrap; gap: 8px; }
.twbw-fotos--reihen::after { content: ''; flex-grow: 999999; }
.twbw-fotos--reihen .twbw-foto { flex: var(--s) 1 calc(var(--s) * var(--h)); min-width: 0; }
.twbw-fotos--reihen .twbw-foto__link img { aspect-ratio: var(--s); object-fit: cover; }
.twbw-fotos--reihen .twbw-foto__text, .twbw-fotos--quadrate .twbw-foto__text { display: none; }
@media (max-width: 999px) { .twbw-fotos--reihen { --h: calc((100vw - 48px - 2 * var(--tw-side, 24px)) / 4.4); } }
@media (max-width: 699px) { .twbw-fotos--reihen { --h: calc((100vw - 48px) / 3.7); gap: 4px; } }

/* Quadrate */
.twbw-fotos--quadrate { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(47%, 230px), 1fr)); gap: 8px; }
.twbw-fotos--quadrate .twbw-foto__link img { aspect-ratio: 1; object-fit: cover; }
@media (max-width: 699px) { .twbw-fotos--quadrate { gap: 4px; } }

/* Mosaik: Spalten (3, bis 999 px Breite 2), jedes Foto im ganzen Format */
.twbw-fotos--mosaik { columns: 3; column-gap: 10px; }
.twbw-fotos--mosaik .twbw-foto { break-inside: avoid; margin-bottom: 10px; }
@media (max-width: 999px) { .twbw-fotos--mosaik { columns: 2; } }
@media (max-width: 599px) { .twbw-fotos--mosaik { column-gap: 6px; } .twbw-fotos--mosaik .twbw-foto { margin-bottom: 6px; } }

/* Große Bilder untereinander */
.twbw-fotos--gross { display: grid; gap: clamp(22px, 3.5vw, 44px); max-width: 1040px; margin-inline: auto; }
.twbw-fotos--gross .twbw-foto__text { text-align: center; }

/* Ältere / neuere Wanderung */
.twbw-blaettern { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(36px, 5vw, 64px); border-top: 1px solid #d8d4cb; padding-top: 22px; }
.twbw-blaettern__link { display: block; padding: 14px 16px; background: var(--twbw-hell); color: var(--twbw-navy); text-decoration: none; transition: background-color .2s; }
.twbw-blaettern__link:hover { background: #ebe7de; }
.twbw-blaettern__link strong { display: block; font-family: var(--font-family-headings, 'Crimson Pro', Georgia, serif); font-style: italic; font-weight: 500; font-size: 24px; line-height: 1.15; }
.twbw-blaettern__link small { display: block; color: var(--twbw-leise); font-size: 15px; }
.twbw-blaettern__link--aelter { grid-column: 2; text-align: right; }
@media (max-width: 599px) { .twbw-blaettern { grid-template-columns: 1fr; } .twbw-blaettern__link--aelter { grid-column: auto; } }

/* ---------- Effekte – im Element einzeln schaltbar (Rene 01.12.) ---------- */
/* Hover-Zoom: nur mit Maus/Trackpad (am Handy gibt es kein Darüberfahren), dazu bei Tastatur-Fokus */
@media (hover: hover) and (pointer: fine) {
  .twbw--fx-hover .twbw-neu__bild:hover img { transform: scale(1.04); }
  .twbw--fx-hover .twbw-neu__streifen a:hover img { transform: scale(1.08); }
  .twbw--fx-hover .twbw-kachel__link:hover .twbw-kachel__bild { transform: scale(1.06); }
  .twbw--fx-hover .twbw-foto__link:hover img { transform: scale(1.06); }
  .twbw--fx-hover .twbw-foto__link:hover::after { opacity: 1; transform: none; }
}
.twbw--fx-hover .twbw-neu__streifen a:focus-visible img,
.twbw--fx-hover .twbw-kachel__link:focus-visible .twbw-kachel__bild,
.twbw--fx-hover .twbw-foto__link:focus-visible img { transform: scale(1.06); }
/* Lupe auf Fotos, die die Großansicht öffnen */
.twbw--fx-hover .twbw-foto__link { position: relative; }
.twbw--fx-hover .twbw-foto__link::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px;
  background: rgba(41, 51, 73, .82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d2be6f' stroke-width='2.2'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.4 15.4 21 21M10.5 7.6v5.8M7.6 10.5h5.8'/%3E%3C/svg%3E") center / 28px no-repeat;
  opacity: 0; transform: scale(.85); transition: opacity .3s ease, transform .3s ease; pointer-events: none;
}
.twbw--fx-hover .twbw-foto__link:focus-visible::after { opacity: 1; transform: none; }
/* Ken Burns: Titelbild der neuesten Wanderung zoomt langsam (Eigenschaft „scale“ – verträgt sich mit dem Hover-Zoom) */
.twbw--fx-kenburns .twbw-neu__bild img { animation: twbw-kb 22s ease-in-out infinite alternate; transform-origin: 55% 45%; }
@keyframes twbw-kb { from { scale: 1; } to { scale: 1.1; } }
/* Einblenden beim Scrollen (effekte.js): erst wenn das Skript bereit ist – ohne JavaScript ist alles sofort da;
   was beim Laden schon im Bild ist, bekommt sofort „ist-da“ */
.twbw-fx-bereit .twbw-fx-item { transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--fx-v, 0ms); }
.twbw-fx-bereit .twbw-fx-item:not(.ist-da) { opacity: 0; transform: translateY(22px); }

@media (prefers-reduced-motion: reduce) {
  .twbw img { transition: none !important; transform: none !important; animation: none !important; }
  .twbw-fx-bereit .twbw-fx-item { opacity: 1 !important; transform: none !important; transition: none !important; }
}
@media print {
  .twbw-mehr, .twbw-blaettern, .twbw-zurueck { display: none; }
  .twbw-kachel[hidden], .twbw-foto[hidden] { display: block !important; }
}
