/* Farbwelt des alten Auftritts, modernisiert:
   #990000 -> --wine, #CCCC99 -> --sand, #FFFFCC -> --cream */
:root {
  --wine: #8a1a1a;
  --wine-dark: #5c0f0f;
  --sand: #c9c69a;
  --cream: #faf7ef;
  --ink: #1c1a17;
  --muted: #6b6459;
  --line: #e4dfd2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.6 "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

.wrap { width: min(1100px, 92vw); margin: 0 auto; }

/* Textlinks: weinrot statt Browser-Blau, Unterstrich erst bei Hover/Fokus.
   Lange Listen bleiben dadurch ruhig, die Zugehoerigkeit ist trotzdem klar. */
a {
  color: var(--wine);
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-skip-ink: auto;
}
a:hover { color: var(--wine-dark); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
  border-radius: 2px;
}
a:visited { color: var(--wine-dark); }
/* Im Fliesstext bleibt der Unterstrich, sonst gehen Links zwischen Text unter. */
.prose a, .page-body a, .article-body a { text-decoration: underline; }
.prose a:hover, .page-body a:hover, .article-body a:hover { text-decoration-thickness: 2px; }

.site-header { background: var(--wine-dark); border-bottom: 3px solid var(--sand); }
.header-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 2rem; padding: 1rem 0; }
.brand { color: #fff; text-decoration: none; font-size: 1.45rem; letter-spacing: .12em; text-transform: uppercase; }
.brand span { display: block; font-size: .62rem; letter-spacing: .3em; color: var(--sand); }
.main-nav a { color: var(--cream); text-decoration: none; margin-left: 1.6rem; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; }
.main-nav a:hover { color: var(--sand); }

main { padding: 2.5rem 0 4rem; }
h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--wine-dark); margin: 0 0 .4rem; }
h2 { color: var(--wine); margin-top: 2.4rem; }

.hero { padding: 3rem 0 2rem; border-bottom: 1px solid var(--line); }
.hero p { color: var(--muted); max-width: 46ch; }

.button {
  display: inline-block; margin-top: 1rem; padding: .7rem 1.4rem;
  background: var(--wine); color: #fff; text-decoration: none;
  border-radius: 2px; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
}
.button:hover { background: var(--wine-dark); }
.button-quiet { background: transparent; color: var(--wine-dark); border: 1px solid var(--wine); }
.button-quiet:hover { background: var(--sand); color: var(--wine-dark); }

.wine-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.wine-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--sand); padding: 1rem 1.1rem; }
.wine-card a { text-decoration: none; color: inherit; }
.wine-name { display: block; font-weight: 600; color: var(--wine-dark); }
.wine-meta { display: block; font-size: .85rem; color: var(--muted); }

.entity-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.entity-card { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--sand); padding: 1rem 1.1rem; }
.entity-card a { text-decoration: none; color: inherit; }

.region-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.region-list li { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--sand); padding: .7rem 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.region-list a { color: var(--wine-dark); font-weight: 600; text-decoration: none; }

.filter-form { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.5rem 0; }
.filter-form input, .filter-form select { padding: .5rem .6rem; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; }
.filter-form button { padding: .5rem 1rem; border: 0; background: var(--wine); color: #fff; font: inherit; cursor: pointer; }
.filter-form button:hover { background: var(--wine-dark); }

/* Bilder bleiben in ihrer natürlichen Größe: kleine Scans werden nicht auf
   Kachelbreite hochskaliert, große nur auf den verfügbaren Raum verkleinert. */
.thumb { display: block; width: auto; max-width: 100%; max-height: 140px; height: auto; object-fit: contain; margin-bottom: .7rem; background: var(--cream); }
.detail-photo { display: block; width: auto; max-width: 100%; max-height: 420px; height: auto; margin: 1rem 0; border: 1px solid var(--line); background: #fff; }
.detail-media { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.detail-etiket { display: block; width: auto; max-width: 200px; max-height: 300px; height: auto; object-fit: contain; margin: 1rem 0; border: 1px solid var(--line); background: #fff; }
.media-frame { display: block; margin-bottom: .7rem; }
.media-frame > .thumb,
.media-frame > .detail-photo,
.media-frame > .detail-etiket { margin-bottom: 0; }

/* Ruhiger Platzhalter, wenn kein Bild gesetzt ist oder die Datei nicht lädt. */
.media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-height: 120px; margin-bottom: .7rem; padding: 1rem;
  background: var(--cream); border: 1px solid var(--line); color: var(--wine-dark);
  text-align: center;
}
.media-placeholder.detail-photo,
.media-placeholder.detail-etiket { max-width: 320px; min-height: 200px; }
.media-initial { font-size: 2.2rem; line-height: 1; color: var(--wine); }
.media-caption { margin-top: .5rem; font-size: .9rem; color: var(--muted); font-style: normal; }

/* Regionskarte: quadratischer Kartenausschnitt mit Bildnachweis darunter. */
.region-map { margin: 1.4rem 0; }
.region-map img { display: block; width: min(512px, 100%); height: auto; border: 1px solid var(--line); background: #fff; }
.region-map figcaption { margin-top: .4rem; font-size: .8rem; color: var(--muted); }
.region-map figcaption a { color: var(--muted); }
.media-note { display: block; margin: -.3rem 0 .7rem; font-size: .9rem; color: var(--muted); font-style: normal; }
.winery-about { max-width: 68ch; }
.winery-wines { margin: .4rem 0 1.2rem; }
.winery-wines a { color: var(--wine); }
.same-region { margin-top: 2.4rem; }

.detail .prose { max-width: 68ch; }
.muted { color: var(--muted); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.2rem; margin: 1rem 0; }
dl.facts dt { color: var(--muted); font-size: .9rem; }
dl.facts dd { margin: 0; }
.pager { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; }
.pager a { color: var(--wine); }

.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0; color: var(--muted); font-size: .85rem; }

/* Hauptmenü klebt beim Scrollen oben (auf Wunsch: primäres Menü immer erreichbar),
   der Pfeil unten rechts springt zurück an den Seitenanfang. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  transition: box-shadow .15s ease;
}
.site-header.is-stuck { box-shadow: 0 6px 18px rgba(28, 26, 23, .22); }

/* Mobil: eine Zeile mit Hamburger; das Menue klappt als Panel unter der
   Leiste auf. Ohne JavaScript bleibt die Navigation sichtbar (progressive
   enhancement), der Button wird dann gar nicht erst angezeigt. */
.nav-toggle { display: none; }

@media (max-width: 699px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem 0;
  }
  .brand { font-size: 1.05rem; }
  .brand span { display: none; }

  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
  }
  .js .nav-toggle:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }
  .nav-toggle-bars { display: flex; flex-direction: column; gap: 4px; }
  .nav-toggle-bars span { display: block; width: 20px; height: 2px; background: currentColor; }

  .main-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    order: 3;
  }
  .main-nav a {
    margin: 0;
    padding: .7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    font-size: .8rem;
  }

  .js .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: .35rem 1rem .8rem;
    background: var(--wine-dark);
    border-top: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 10px 24px rgba(28, 26, 23, .3);
  }
  .js .main-nav.is-open { display: flex; }
  .js .main-nav a { padding: .85rem .25rem; font-size: .85rem; }
}

.to-top {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 901;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--wine-dark);
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(28, 26, 23, .28);
}
.to-top.is-visible { display: block; }
.to-top:hover { background: var(--wine-dark); }
.to-top:focus-visible { outline: 3px solid var(--sand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .site-header, .to-top { transition: none; }
}
