/* ============================================================
   Design für hinterhoelzl.de
   Minimalistisch, fotozentriert, hell mit dunklen Akzenten.
   ============================================================ */

:root {
  --bg: #fbfbfa;
  --bg-alt: #f1f0ed;
  --ink: #16150f;
  --ink-soft: #5a584f;
  --line: #e1ddd6;
  --accent: #16150f;
  --gold: #c0995a;
  --gold-soft: rgba(192, 153, 90, 0.4);
  --white: #ffffff;
  --max: 1280px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* <picture>-Wrapper sollen sich wie das Bild verhalten (Layout unverändert) */
.hero picture, .cat-card picture, .g-item picture { display: block; width: 100%; height: 100%; }
.post-card picture, .post picture, .about-grid picture { display: block; width: 100%; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.1; }

/* ---------------- Einblend-Animationen ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal-on .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .75s ease, transform .75s cubic-bezier(.2, .7, .2, 1);
    will-change: opacity, transform;
  }
  .reveal-on .reveal.in { opacity: 1; transform: none; }
}

/* ---------------- Header / Navigation ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(251, 251, 250, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 40px; width: auto; display: block; }
@media (max-width: 540px) { .brand-logo { height: 30px; } }

.site-nav { display: flex; gap: clamp(1rem, 2.2vw, 2.1rem); flex-wrap: wrap; }
.site-nav a {
  font-size: .82rem; letter-spacing: .03em; color: var(--ink-soft);
  position: relative; padding-bottom: 2px; transition: color .2s;
}
.site-nav a:hover, .site-nav a.active { color: var(--ink); }
.site-nav a.active::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px; background: var(--gold);
}

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: .3s; }

/* ---------------- Hero ---------------- */
.hero { position: relative; height: min(86vh, 760px); overflow: hidden; background: var(--ink); }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  color: var(--white); padding: 1.5rem;
  background: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.30) 55%, rgba(0,0,0,.5));
  text-shadow: 0 1px 24px rgba(0,0,0,.35);
}
.hero-overlay h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 500; letter-spacing: .02em; }
.hero-logo { width: min(560px, 82vw); height: auto; filter: drop-shadow(0 2px 20px rgba(0,0,0,.4)); }
.hero-overlay p { max-width: 36rem; margin: 1.4rem auto 1.8rem; font-size: 1.02rem; opacity: .92; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-block; padding: .8rem 1.9rem; font-size: .78rem; letter-spacing: .14em;
  text-transform: uppercase; background: var(--white); color: var(--ink);
  border: 1px solid var(--white); transition: .25s;
}
.btn:hover { background: transparent; color: var(--white); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--white); }

/* ---------------- Sections ---------------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1.2rem, 4vw, 3rem); }
.section-alt { max-width: none; background: var(--bg-alt); }
.section-alt > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section.narrow, .section.about, .post { max-width: 760px; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head::before, .page-head::before {
  content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 1.1rem;
  background: url(/static/icon-gold.png) center / contain no-repeat;
}
.section-head h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
.section-head h2::after, .page-head h1::after {
  content: ""; display: block; width: 64px; height: 2px; background: var(--gold); margin: 1rem auto 0;
}
.section-head p { color: var(--ink-soft); margin-top: .6rem; }
.center { text-align: center; margin-top: 3rem; }

/* ---------------- Full-Bleed-Bänder ---------------- */
.band {
  height: clamp(280px, 56vh, 560px);
  background-size: cover; background-position: center;
  background-repeat: no-repeat; background-color: var(--ink);
}
@media (min-width: 900px) and (hover: hover) {
  .band { background-attachment: fixed; }   /* Parallax nur am Desktop */
}

.page-head {
  text-align: center; padding: clamp(3rem, 7vw, 5rem) 1.5rem clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.page-head p { color: var(--ink-soft); margin-top: .6rem; }

/* ---------------- Kategorie-Karten (Mosaik mit Feature) ---------------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 240px; gap: 1rem; }
.cat-card { position: relative; overflow: hidden; background: var(--bg-alt); height: 100%; }
.cat-card.cat-feature { grid-column: span 2; grid-row: span 2; }
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.cat-card:hover img { transform: scale(1.06); }
@media (max-width: 900px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .cat-card.cat-feature { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 540px) {
  .cat-grid { grid-template-columns: 1fr; grid-auto-rows: 230px; }
  .cat-card.cat-feature { grid-column: span 1; }
}
.cat-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.6rem; color: var(--ink-soft); background: var(--bg-alt); }
.cat-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem;
  color: var(--white); background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0));
}
.cat-meta h3 { font-size: 1.7rem; }
.cat-meta span { font-size: .76rem; letter-spacing: .04em; opacity: .9; }

/* ---------------- Galerie (Mosaik-Raster) ---------------- */
.gallery {
  max-width: var(--max); margin: 0 auto; padding: clamp(2rem,5vw,4rem) clamp(1.2rem,4vw,3rem);
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 215px;
  grid-auto-flow: dense; gap: .8rem;
}
.g-item { position: relative; cursor: zoom-in; overflow: hidden; background: var(--bg-alt); }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.g-item:hover img { transform: scale(1.05); }
.g-item.wide    { grid-column: span 2; }
.g-item.tall    { grid-row: span 2; }
.g-item.feature { grid-column: span 2; grid-row: span 2; }
.g-item figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .9rem 1rem; color: #fff; font-size: .8rem;
  background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0));
  opacity: 0; transition: opacity .3s;
}
.g-item:hover figcaption { opacity: 1; }

@media (max-width: 1100px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .g-item.feature { grid-column: span 2; grid-row: span 2; }
}
@media (max-width: 760px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; gap: .6rem; }
}
@media (max-width: 460px) {
  .gallery { grid-auto-rows: 135px; }
  .g-item.feature, .g-item.wide { grid-column: span 2; }
}

/* ---------------- Blog ---------------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }
.post-card { background: var(--white); border: 1px solid var(--line); transition: .25s; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,0,0,.08); }
.post-card img { aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.post-card-body { padding: 1.4rem; }
.post-date { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.post-card h3 { font-size: 1.4rem; margin: .4rem 0 .6rem; }
.post-card p { color: var(--ink-soft); font-size: .92rem; }

.post-header { text-align: center; padding: clamp(3rem,7vw,5rem) 1.5rem 1.5rem; }
.post-header h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-top: .5rem; }
.post-cover { width: 100%; max-height: 70vh; object-fit: cover; margin-bottom: 2.5rem; }
.post { margin: 0 auto; padding-bottom: 4rem; }
.post .prose, .post .back { padding: 0 clamp(1.2rem,4vw,1.5rem); }
.back { margin-top: 3rem; }

/* ---------------- Prose (Fließtext) ---------------- */
.prose { font-size: 1.06rem; color: #2c2b25; }
.prose p { margin-bottom: 1.2rem; }
.prose h2 { font-size: 1.8rem; margin: 2rem 0 .8rem; }
.prose h3 { font-size: 1.4rem; margin: 1.6rem 0 .6rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--gold-soft); transition: color .2s; }
.prose a:hover { color: var(--gold); text-decoration-color: var(--gold); }
.prose strong { font-weight: 500; }

/* ---------------- About ---------------- */
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 3rem; align-items: start; }
.about-grid.no-portrait { grid-template-columns: 1fr; }
.portrait { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.about-teaser { text-align: center; }
.about-teaser-inner { max-width: 620px; margin: 0 auto; }
.about-teaser h2 { font-size: clamp(2rem,4.5vw,3rem); }
.about-teaser p { color: var(--ink-soft); margin: 1rem 0 1.8rem; }

.empty { text-align: center; color: var(--ink-soft); padding: 4rem 1.5rem; }

/* ---------------- Kontaktformular ---------------- */
.contact-form { display: flex; flex-direction: column; gap: 1.2rem; margin-top: 2.5rem; }
.contact-form label { display: flex; flex-direction: column; gap: .4rem; font-size: .82rem;
  letter-spacing: .04em; color: var(--ink-soft); text-transform: uppercase; }
.contact-form input, .contact-form textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); padding: .8rem 1rem; border-radius: 2px; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft);
}
.contact-form button { align-self: flex-start; cursor: pointer; margin-top: .4rem; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin: 0; font-size: .95rem; min-height: 1.2em; }
.form-status.ok  { color: #2e6b3e; }
.form-status.err { color: #a23a2e; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--ink); color: #cfcdc4; margin-top: 2rem; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: clamp(3rem,6vw,4.5rem) clamp(1.2rem,4vw,3rem) 2rem; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-mark { width: 50px; height: auto; margin-bottom: .9rem; }
.footer-cols h4 { font-size: 1.5rem; color: #fff; }
.footer-cols p { font-size: .85rem; margin-top: .3rem; }
.footer-cols nav { display: flex; flex-direction: column; gap: .55rem; }
.footer-cols nav a { font-size: .85rem; color: #cfcdc4; transition: color .2s; }
.footer-cols nav a:hover { color: var(--gold); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12);
  font-size: .8rem; color: #908e85;
}
.footer-bottom .ig:hover { color: #fff; }

/* ---------------- "Nach oben"-Button ---------------- */
.to-top {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 60;
  width: 50px; height: 50px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--ink) url(/static/icon-gold.png) center / 26px 26px no-repeat;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0; visibility: hidden; transform: translateY(12px) rotate(0deg);
  transition: opacity .3s, transform .5s, visibility .3s;
}
.to-top.show { opacity: .92; visibility: visible; transform: translateY(0); }
.to-top:hover { opacity: 1; transform: translateY(0) rotate(60deg); }

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(15,14,10,.95);
  display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lb-img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: none; border: 0; color: #fff; cursor: pointer;
  opacity: .7; transition: opacity .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; }
.lb-close { top: 1.2rem; right: 1.6rem; font-size: 2.4rem; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 3.4rem; padding: 0 1.2rem; }
.lb-prev { left: .5rem; } .lb-next { right: .5rem; }
.lb-bar {
  position: absolute; bottom: 1.1rem; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  flex-wrap: wrap; padding: 0 1.5rem; text-align: center;
}
.lb-caption { color: #ddd; font-size: .9rem; }
.lb-contact {
  font-size: .8rem; letter-spacing: .06em; color: #fff;
  border: 1px solid rgba(255,255,255,.45); padding: .5rem 1.1rem; border-radius: 2px;
  transition: background .2s, color .2s;
}
.lb-contact:hover { background: #fff; color: var(--ink); }

/* ---------------- Mobile ---------------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .site-nav.open { max-height: 80vh; }
  .site-nav a { padding: .9rem clamp(1.2rem,4vw,3rem); border-top: 1px solid var(--line); width: 100%; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; }
}
