/* ============================================
   Meine Canna Hobby Zucht — Stylesheet
   ============================================ */

:root {
  --color-bg: #faf7f0;
  --color-bg-alt: #f1ece0;
  --color-surface: #ffffff;
  --color-text: #2f2a20;
  --color-text-muted: #6b6255;
  --color-primary: #7a8c3f;      /* Blattgrün */
  --color-primary-dark: #56642b;
  --color-accent: #c1552c;       /* Canna-Blütenorange/-rot */
  --color-accent-2: #d99a1b;     /* Gelbton, an Canna-Blüten angelehnt */
  --color-border: #e3dbc8;
  --shadow-soft: 0 2px 10px rgba(47, 42, 32, 0.08);
  --shadow-hover: 0 6px 20px rgba(47, 42, 32, 0.14);
  --radius: 14px;
  --max-width: 960px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

/* Banner-Foto als Hintergrund auf allen Seiten, mit hellerem Verlauf (nur
   so viel Abdunklung wie für lesbaren weißen Text nötig) und dem
   Drachen-Logo links & rechts vom Text. */
.site-header {
  background: linear-gradient(rgba(30, 26, 15, 0.22), rgba(30, 26, 15, 0.22)),
              url("Banner.jpeg") center 60% / cover no-repeat;
  color: #fff;
  padding: 40px 0 32px;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.site-header .subtitle {
  margin: 0;
  font-size: 1rem;
  opacity: 0.95;
  font-style: italic;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

/* Der gesamte Banner-Inhalt (Logo + Titel) ist als Link zur Startseite
   klickbar (.header-link) — Farbe/Unterstreichung des globalen a-Stils
   werden hier bewusst zurückgesetzt (Text bleibt weiß, keine
   Unterstreichung, auch bei Hover/Fokus), damit sich am Aussehen des
   Banners nichts ändert. */
.header-link,
.header-link:hover,
.header-link:focus-visible {
  display: block;
  color: #fff;
  text-decoration: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 12px;
  flex-wrap: wrap;
}

/* Grüner Kreis (statt weiß) hinter dem Logo, mit hellem Ring drumherum,
   damit er sich auch vor helleren/grünen Bildbereichen des Banners klar
   abhebt. */
.header-logo {
  width: 108px;
  height: 108px;
  flex-shrink: 0;
  object-fit: contain;
  background: #3C8929;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

@media (max-width: 560px) {
  .header-logo {
    width: 70px;
    height: 70px;
    padding: 7px;
  }
  .header-inner {
    gap: 14px;
  }
}

.site-nav {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 12px 24px;
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.site-nav a {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--color-accent);
  text-decoration: none;
}

/* ---------- Main content ---------- */

main {
  padding: 48px 0 24px;
}

.intro {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
  font-size: 1.08rem;
  color: var(--color-text);
}

.intro p + p {
  margin-top: 1em;
}

section + section {
  margin-top: 56px;
}

h2 {
  font-size: 1.5rem;
  color: var(--color-primary-dark);
  text-align: center;
  margin-bottom: 6px;
}

.section-hint {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin: 0 0 28px;
  font-style: italic;
}

/* ---------- Gallery: Tortenstück-Kreis ---------- */

.pie-gallery-wrap {
  display: flex;
  justify-content: center;
  padding: 20px 90px 40px;
}

.pie-circle {
  position: relative;
  width: min(560px, 90vw);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  /* Kein overflow:hidden mehr: jedes Tortenstück ist bereits per
     clip-path exakt begrenzt, dadurch kann die Zoom-Vorschau über
     den Kreisrand hinaus "ausfahren". */
  box-shadow: var(--shadow-hover);
  background: var(--color-bg-alt);
}

.pie-slice {
  position: absolute;
  inset: 0;
  display: block;
  cursor: pointer;
  overflow: hidden;
}

.pie-slice-inner {
  position: absolute;
  inset: -2%;
  background-size: cover;
  background-position: center;
  transition: filter 0.25s ease;
}

.pie-slice:hover .pie-slice-inner,
.pie-slice:focus-visible .pie-slice-inner {
  filter: brightness(1.08);
}

.pie-slice-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.82);
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(47, 42, 32, 0.15);
  transition: opacity 0.2s ease;
}

/* Das Ausblenden des Labels beim Hover/Fokus übernimmt jetzt JavaScript
   (zeigeVorschau()/versteckeVorschau() in script.js) — die Labels hängen
   seit der Foto-Beschriftung nicht mehr im per clip-path begrenzten
   .pie-slice-Element, damit auch längere Sortennamen nicht am Rand der
   Tortenspitze abgeschnitten werden. Eine reine CSS-Regel über den
   :hover-Deszendenten-Selektor würde sie deshalb nicht mehr erreichen. */

.pie-divider-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 50%;
  /* Der 30deg-Rhythmus hier ist nur ein Startwert für 12 Stücke.
     script.js (buildPieGallery) überschreibt "background" per Inline-Style
     mit dem tatsächlichen Winkel pro Stück (360 / anzahl), damit die
     Trennlinien bei jeder Stückzahl exakt auf die Tortenstückgrenzen
     treffen. */
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 255, 255, 0.85) 0deg 1deg,
    transparent 1deg 30deg
  );
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
  z-index: 1;
}

.pie-center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}

/* ---------- Hover-Vorschau: fährt wie ein Modal rechteckig aus ---------- */

.pie-preview {
  position: absolute;
  width: 320px;
  height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: 0 12px 32px rgba(47, 42, 32, 0.28);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.18);
  transform-origin: center;
  transition: transform 0.32s cubic-bezier(0.22, 0.85, 0.32, 1.15), opacity 0.22s ease;
  z-index: 10;
}

.pie-preview.is-active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.pie-preview-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.pie-preview-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.92);
  font-family: "Helvetica Neue", Arial, sans-serif;
  text-align: center;
}

.pie-preview-caption .name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

/* Die Ausfahr-Vorschau ist eine Zusatzspielerei für Zeigegeräte mit
   echtem Hover (Maus). Auf Touch-Geräten bleibt es beim einfachen Tippen. */
@media (hover: none) {
  .pie-preview {
    display: none;
  }
}

/* ---------- Sales / trade text block ---------- */

.info-block {
  max-width: 720px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.info-block p + p {
  margin-top: 1em;
}

.info-block .cta {
  margin-top: 18px;
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.info-block .cta:hover,
.info-block .cta:focus-visible {
  background: #a3441f;
  text-decoration: none;
}

/* ---------- Simple content pages (Kontakt / Impressum / Rechtliches) ---------- */

.page-content {
  max-width: 680px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow-soft);
}

.page-content h1 {
  color: var(--color-primary-dark);
  margin-top: 0;
}

.page-content h2 {
  text-align: left;
  margin-top: 36px;
}

.page-content h2:first-of-type {
  margin-top: 0;
}

.page-content h3 {
  font-size: 1.15rem;
  color: var(--color-primary-dark);
  margin: 22px 0 6px;
}

.page-content h4 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 16px 0 4px;
}

.page-content ul {
  margin: 8px 0 12px;
  padding-left: 22px;
}

.page-content li {
  margin-bottom: 4px;
}

.placeholder-note {
  background: #fdf3e2;
  border: 1px dashed var(--color-accent-2);
  border-radius: 10px;
  padding: 14px 18px;
  color: #7a5a12;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

dl.contact-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
}

dl.contact-fields dt {
  font-weight: bold;
  color: var(--color-text-muted);
}

dl.contact-fields dd {
  margin: 0;
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---------- Detail page (Sorte) ---------- */

.sorte-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sorte-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  cursor: zoom-in;
}

/* ---------- Lightbox: zeigt das ganze Foto beim Klick ---------- */

.sorte-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 10, 0.85);
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}

.sorte-lightbox.is-active {
  display: flex;
}

.sorte-lightbox canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Pfeil-Buttons zum Blättern zum vorherigen/nächsten Foto derselben Sorte
   (zusätzlich zu den Pfeiltasten der Tastatur). Werden per JS ausgeblendet,
   wenn die Sorte nur ein einzelnes Foto hat. */
.sorte-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 101;
  transition: background 0.15s ease;
}

.sorte-lightbox-nav:hover,
.sorte-lightbox-nav:focus-visible {
  background: rgba(255, 255, 255, 0.32);
}

.sorte-lightbox-prev {
  left: 16px;
}

.sorte-lightbox-next {
  right: 16px;
}

@media (max-width: 560px) {
  .sorte-lightbox-nav {
    width: 42px;
    height: 42px;
    font-size: 1.5rem;
  }
  .sorte-lightbox-prev {
    left: 6px;
  }
  .sorte-lightbox-next {
    right: 6px;
  }
}

.detail-image-placeholder {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(47, 42, 32, 0.45);
  font-size: 2.6rem;
}

.pdf-download {
  display: inline-block;
  margin-top: 4px;
  background: var(--color-accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.pdf-download::before {
  content: "⬇ ";
}

.pdf-download:hover,
.pdf-download:focus-visible {
  background: #a3441f;
  text-decoration: none;
}

.back-link {
  display: inline-block;
  margin-top: 22px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
}

.back-link::before {
  content: "← ";
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  padding: 24px 0;
  text-align: center;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.site-footer nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 0;
  margin: 0 0 8px;
  flex-wrap: wrap;
}

.site-footer nav a {
  color: var(--color-text-muted);
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--color-accent);
}

@media (max-width: 480px) {
  .page-content,
  .info-block {
    padding: 22px 20px;
  }
}
