/* ===========================================================================
   Jana Theile · Wohntraum — styles.css
   Design direction C: Natürlich & Botanisch
   =========================================================================== */

:root {
  /* Brand palette */
  --c-bg:        #F4F2EA;  /* off-white background        */
  --c-sand:      #D8CFBB;  /* sand / section surfaces     */
  --c-sand-soft: #E8E2D2;
  --c-sage:      #8A9A7B;  /* sage accent (decor only)    */
  --c-sage-dark: #62704C;  /* sage for small text/links (~4.6:1 on light) */
  --c-text:      #3A3F32;  /* deep green text             */
  --c-muted:     #5C6050;  /* muted text (~4.8:1 on light) */
  --c-white:     #FFFFFF;
  --c-line:      #E3DDCC;  /* hairline borders            */
  --c-footer:    #322F24;  /* dark footer                 */
  --c-btn:       #677650;  /* button bg: white ~4.7:1 (soft, readable) */
  --c-btn-hover: #566340;
  --c-besuch:    #677650;  /* "Besuch" section bg: white ~4.7:1 */

  /* Typography */
  --font-head: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing scale */
  --sp-1: .5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2.5rem;
  --sp-5: 4rem;
  --sp-6: 6rem;

  --radius: 8px;
  --radius-sm: 5px;
  --maxw: 1160px;
  --shadow-soft: 0 14px 40px -22px rgba(58, 63, 50, .45);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* --- Reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.12; letter-spacing: .2px; }

/* --- Helpers ------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

.eyebrow {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--c-sage-dark);
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--c-text); color: #fff; padding: .75rem 1.25rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--c-sage); outline-offset: 3px; border-radius: 3px; }

/* --- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* --- Header / Navigation ------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 242, 234, .82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--c-line); background: rgba(244, 242, 234, .94); }
.nav-bar { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }
.wordmark { font-family: var(--font-head); font-size: 1.35rem; font-weight: 600; letter-spacing: .3px; }
.wordmark span { color: var(--c-muted); font-weight: 500; }
.primary-nav { display: flex; align-items: center; gap: 1.9rem; }
.primary-nav a {
  font-size: .92rem; font-weight: 500; color: var(--c-text);
  position: relative; padding: .25rem 0;
}
.primary-nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px;
  height: 2px; background: var(--c-sage); transition: right .3s var(--ease);
}
.primary-nav a:not(.nav-cta):hover::after,
.primary-nav a:not(.nav-cta):focus-visible::after { right: 0; }
.nav-cta {
  border: 1px solid var(--c-sage); color: var(--c-sage-dark);
  padding: .5rem 1.15rem !important; border-radius: 999px;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.nav-cta:hover, .nav-cta:focus-visible { background: var(--c-sage); color: #fff; }

.nav-toggle { display: none; width: 44px; height: 44px; flex-direction: column; gap: 5px; align-items: center; justify-content: center; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--c-text); transition: transform .3s var(--ease), opacity .2s; }

/* --- Hero ---------------------------------------------------------------- */
.hero { position: relative; min-height: clamp(560px, 88vh, 860px); display: flex; align-items: center; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(105deg, rgba(216,207,187,.92) 0%, rgba(216,207,187,.55) 42%, rgba(58,63,50,.18) 100%);
}
.hero-inner { position: relative; padding-block: clamp(3rem, 9vw, 6rem); }
.hero-eyebrow { color: var(--c-sage-dark); }
.hero-title {
  font-size: clamp(3rem, 9vw, 6.2rem); font-weight: 600; line-height: 1.02;
  margin: .6rem 0 1.1rem; color: #2f2c20; letter-spacing: -.5px;
}
.hero-title em { font-style: italic; color: var(--c-sage-dark); }
.hero-lead { max-width: 30rem; font-size: 1.12rem; color: #494632; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }

.btn {
  display: inline-block; font-weight: 600; font-size: .95rem;
  padding: .85rem 1.7rem; border-radius: 999px;
  transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--c-btn); color: #fff; box-shadow: 0 12px 26px -14px rgba(52,57,44,.6); }
.btn-primary:hover { background: var(--c-btn-hover); }
.btn-ghost { border: 1.5px solid var(--c-sage-dark); color: var(--c-sage-dark); font-weight: 600; }
.btn-ghost:hover { background: rgba(255,255,255,.6); }

/* --- Responsive nav ------------------------------------------------------ */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 72px 0 auto 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--c-bg); border-bottom: 1px solid var(--c-line);
    padding: .5rem 1.5rem 1.5rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
  }
  .primary-nav a { width: 100%; padding: .95rem 0 !important; border-bottom: 1px solid var(--c-line); font-size: 1.05rem; }
  .primary-nav a:last-child { border-bottom: 0; }
  .nav-cta { border: 0; border-radius: 0; color: var(--c-sage-dark); }
  .nav-cta:hover { background: none; color: var(--c-sage-dark); }
  .site-header.nav-open .primary-nav { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* --- Section heading ----------------------------------------------------- */
.section-head { text-align: center; max-width: 40rem; margin: 0 auto clamp(2.5rem, 5vw, 3.5rem); }
.section-head h2 { font-size: clamp(2rem, 4.4vw, 3rem); margin-top: .5rem; }
.link-arrow { color: var(--c-sage-dark); font-weight: 600; font-size: .95rem; display: inline-flex; gap: .4rem; }
.link-arrow span { transition: transform .25s var(--ease); }
.link-arrow:hover span { transform: translateX(4px); }

/* --- Willkommen ---------------------------------------------------------- */
.willkommen-grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.willkommen-text h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); margin: .5rem 0 1.3rem; }
.willkommen-text p { margin-bottom: 1.1rem; color: #4b4e3f; }
.willkommen-text .link-arrow { margin-top: .4rem; }
.willkommen-media { position: relative; }
.willkommen-media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
}
.willkommen-media::after {
  content: ""; position: absolute; inset: auto -18px -18px auto;
  width: 62%; height: 62%; border: 1px solid var(--c-sage);
  border-radius: var(--radius); z-index: -1;
}

/* --- Rubriken ------------------------------------------------------------ */
.rubriken { background: linear-gradient(180deg, var(--c-bg) 0%, #efece0 100%); }
.rubrik-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.rubrik-card {
  background: var(--c-white); border: 1px solid var(--c-line);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  scroll-margin-top: 90px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.rubrik-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-soft); }
.rubrik-img { aspect-ratio: 3 / 2; overflow: hidden; }
.rubrik-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.rubrik-card:hover .rubrik-img img { transform: scale(1.05); }
.rubrik-body { padding: 1.6rem 1.6rem 1.9rem; }
.rubrik-body h3 { font-size: 1.7rem; margin-bottom: .6rem; }
.rubrik-body p { color: #55584a; font-size: .98rem; }

@media (max-width: 860px) {
  .willkommen-grid { grid-template-columns: 1fr; }
  .willkommen-media { order: -1; max-width: 460px; }
  .willkommen-media img { aspect-ratio: 16 / 11; }
  .willkommen-media::after { display: none; }
  .rubrik-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
}

/* --- Galerie ------------------------------------------------------------- */
.galerie { background: var(--c-bg); }
.section-sub { color: var(--c-muted); margin-top: .6rem; }
/* Editorial mosaic: one large image, two wide, four square — tiles a
   perfect 4x3 grid with no gaps and varied sizes. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.gallery-item {
  padding: 0; margin: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  display: block; background: var(--c-sand);
  aspect-ratio: 1 / 1;
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s var(--ease), filter .4s var(--ease);
}
.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.05); filter: saturate(1.08); }
.g-big  { grid-column: span 2; grid-row: span 2; aspect-ratio: 1 / 1; }
.g-wide { grid-column: span 2; grid-row: span 1; aspect-ratio: 2 / 1; }

@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .g-big  { grid-column: span 2; grid-row: span 2; aspect-ratio: 1 / 1; }
  .g-wide { grid-column: span 2; grid-row: span 1; aspect-ratio: 2 / 1; }
}

/* --- Lightbox ------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(35, 33, 24, .92); padding: 4vmin;
  opacity: 0; transition: opacity .25s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox-img {
  max-width: 100%; max-height: 92vh; width: auto; height: auto;
  border-radius: var(--radius); box-shadow: 0 30px 80px -30px rgba(0,0,0,.7);
}
.lightbox-close {
  position: absolute; top: max(1rem, 3vmin); right: max(1rem, 3vmin);
  width: 48px; height: 48px; font-size: 2rem; line-height: 1;
  color: #fff; border-radius: 50%; background: rgba(255,255,255,.12);
  transition: background .2s var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.25); }

/* --- Besuch -------------------------------------------------------------- */
.besuch { background: var(--c-besuch); color: #fff; }
.besuch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: stretch; }
.besuch-eyebrow { color: rgba(255,255,255,.8); }
.besuch-info h2 { color: #fff; font-size: clamp(2rem, 4.2vw, 3rem); margin: .5rem 0 1.3rem; }
.besuch-address { font-style: normal; font-size: 1.15rem; line-height: 1.7; margin-bottom: 1.4rem; }
.besuch-contact { list-style: none; padding: 0; margin: 0 0 1.8rem; }
.besuch-contact li { display: flex; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid rgba(255,255,255,.22); }
.besuch-contact span { min-width: 84px; opacity: .82; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; align-self: center; }
.besuch-contact a { font-size: 1.05rem; font-weight: 500; }
.besuch-contact a:hover { text-decoration: underline; }
.besuch-hours h3 { font-size: 1.4rem; margin-bottom: .7rem; }
.besuch-hours dl { margin: 0 0 1.9rem; }
.besuch-hours dl > div { display: flex; justify-content: space-between; max-width: 22rem; padding: .35rem 0; border-bottom: 1px solid rgba(255,255,255,.18); }
.besuch-hours dt { opacity: .9; }
.besuch-hours dd { margin: 0; font-weight: 600; }
.btn-light { background: #fff; color: var(--c-sage-dark); }
.btn-light:hover { background: var(--c-bg); }
.besuch-map { border-radius: var(--radius); overflow: hidden; min-height: 360px; box-shadow: var(--shadow-soft); }
.besuch-map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; }

@media (max-width: 860px) {
  .besuch-grid { grid-template-columns: 1fr; }
  .besuch-map { min-height: 300px; }
}

/* --- Footer -------------------------------------------------------------- */
.site-footer { background: var(--c-footer); color: #cfc9b6; padding-block: 3rem 1.6rem; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem; flex-wrap: wrap; padding-bottom: 1.8rem; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand .wordmark { color: #f3efe2; font-size: 1.3rem; }
.footer-brand .wordmark span { color: #a59e88; }
.footer-brand p { margin-top: .4rem; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: #9a937c; }
.footer-links { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.footer-links a { font-size: .92rem; color: #cfc9b6; transition: color .2s var(--ease); }
.footer-links a:hover { color: #fff; }
.footer-base {
  margin-top: 1.4rem; font-size: .82rem; color: #b0a98d;
  display: flex; justify-content: space-between; align-items: center;
  gap: .5rem 1.5rem; flex-wrap: wrap;
}
.footer-credit { color: #8f8972; }
.footer-credit a { color: #a59e88; transition: color .2s var(--ease); }
.footer-credit a:hover, .footer-credit a:focus-visible { color: #fff; }

/* --- Legal pages --------------------------------------------------------- */
.legal { padding-top: clamp(2.5rem, 6vw, 4rem); }
.legal-inner { max-width: 720px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin: .4rem 0 1.8rem; }
.legal h2 { font-size: 1.45rem; margin: 2.2rem 0 .6rem; }
.legal p { color: #4b4e3f; margin-bottom: 1rem; }
.legal a:not(.link-arrow):not(.nav-cta) { color: var(--c-sage-dark); text-decoration: underline; }
.legal-back { margin-top: 2.6rem; }
.legal-nav { gap: 0; }

/* --- Reveal animation ---------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
[data-reveal].in-view { opacity: 1; transform: none; }
