/* ==========================================================================
   Jäger Bestattungen – statischer Nachbau
   ========================================================================== */

:root {
  --primary: #9d0937;
  --primary-dark: #7f072c;
  --secondary: #fca218;
  --secondary-dark: #e8900a;
  --text: #303030;
  --muted: #666;
  --border: #e5e5e5;
  --card: rgba(255, 255, 255, .95);
  --radius: 5px;
  --font: "Times New Roman", Times, serif;
  --container: 960px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  background: #f3f3f3;
}

body { margin: 0; min-height: 100vh; }

/* Fester Hintergrund (Steg am Meer) */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #f3f3f3;
}
@media (min-width: 960px) {
  .page-bg {
    background: #6b5a6a url(../img/bg.jpg) center / cover no-repeat;
    background-image: image-set(url(../img/bg.webp) type("image/webp"), url(../img/bg.jpg) type("image/jpeg"));
  }
}

img, video { max-width: 100%; height: auto; vertical-align: middle; }
a { color: var(--primary); text-decoration: none; }
a:hover, a:focus-visible { color: var(--primary-dark); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }

h1, h2, h3, h4, h5, h6 { font-family: var(--font); font-weight: 400; line-height: 1.3; margin: 0 0 .6em; color: var(--text); }
h1 { font-size: 2.6rem; color: var(--primary); line-height: 1.2; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.3rem; }
.h3 { font-size: 1.5rem; }
.h4 { font-size: 1.3rem; }
p, ul, ol, dl, figure, blockquote { margin: 0 0 1.1em; }
ul { padding-left: 1.4em; }
li + li { margin-top: .15em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5em 0; }
strong { font-weight: 700; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: #fff; padding: .5em 1em; }
.skip-link:focus { left: 1rem; top: 1rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .45em 1em;
  font: inherit; font-size: .9rem; line-height: 1.4;
  color: #fff; background: var(--primary);
  border: 0; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: background-color .15s;
}
.button:hover, .button:focus-visible { background: var(--primary-dark); color: #fff; text-decoration: none; }
.button-secondary { background: var(--secondary); }
.button-secondary:hover, .button-secondary:focus-visible { background: var(--secondary-dark); }
.button-outline { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.button-outline:hover, .button-outline:focus-visible { background: var(--primary); color: #fff; }
.button .chev { font-size: 1.1em; line-height: 1; }

/* ==========================================================================
   Header Mobile
   ========================================================================== */
.header-mobile {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.2rem;
  height: 56px; padding: 0 15px;
  background: var(--primary); color: #fff;
}
.nav-toggle {
  display: flex; align-items: center; gap: .6rem;
  padding: 0; border: 0; background: none; color: #fff;
  font: inherit; font-size: 1.15rem; cursor: pointer;
}
.nav-toggle .bars { display: inline-flex; flex-direction: column; gap: 5px; width: 20px; }
.nav-toggle .bars span { display: block; height: 2px; background: currentColor; }
.header-mobile .logo img { display: block; width: 140px; height: 23px; }

@media (min-width: 960px) { .header-mobile, .offcanvas { display: none !important; } }

/* Offcanvas */
.offcanvas { position: fixed; inset: 0; z-index: 100; }
.offcanvas[hidden] { display: none; }
.offcanvas-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .1); opacity: 0; transition: opacity .3s; }
.offcanvas-bar {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: 270px; max-width: 85vw; overflow-y: auto;
  padding: 20px;
  background: #222; color: #fff;
  transform: translateX(-100%); transition: transform .3s ease;
}
.offcanvas.open .offcanvas-bar { transform: none; }
.offcanvas.open .offcanvas-overlay { opacity: 1; }
.offcanvas-close {
  position: absolute; top: 4px; right: 6px;
  width: 36px; height: 36px; padding: 0;
  border: 0; background: none; color: rgba(255, 255, 255, .6);
  font-size: 30px; line-height: 1; cursor: pointer;
}
.offcanvas-close:hover { color: #fff; }

.nav-mobile, .nav-mobile ul { list-style: none; margin: 0; padding: 0; }
.nav-mobile > li { border-bottom: 1px solid rgba(255, 255, 255, .2); padding: 10px 0; }
.nav-mobile > li:last-child { border-bottom: 0; }
.nav-mobile > li + li { margin-top: 0; }
.nav-mobile a { display: block; color: rgba(255, 255, 255, .6); font-size: 1.05rem; padding: 2px 0; }
.nav-mobile a:hover, .nav-mobile a:focus-visible, .nav-mobile .active > a { color: #fff; text-decoration: none; }
.nav-mobile ul { padding: 8px 0 0 15px; }
.nav-mobile ul li { margin: 0; }
.nav-mobile .home img { width: 20px; height: 18px; }

/* ==========================================================================
   Header Desktop
   ========================================================================== */
.header-desktop { display: none; }

@media (min-width: 960px) {
  .header-desktop { display: block; padding-top: 70px; margin-bottom: 25px; }

  .navbar { background: var(--primary); border-radius: var(--radius) var(--radius) 0 0; }
  .nav { display: flex; list-style: none; margin: 0; padding: 0; }
  .nav > li { position: relative; margin: 0; }
  .nav > li > a {
    display: flex; align-items: center;
    height: 55px; padding: 0 15px;
    color: #fff; font-size: 1.1rem;
    transition: background-color .15s, color .15s;
  }
  .nav > li:first-child > a { border-top-left-radius: var(--radius); }
  .nav > li > a:hover, .nav > li > a:focus-visible, .nav > li.open > a { color: #fff; background: rgba(0, 0, 0, .12); text-decoration: none; }
  .nav > li.active > a { background: var(--secondary); color: #fff; }
  .nav .home img { display: block; width: 20px; height: 18px; }

  .dropdown {
    position: absolute; top: 100%; left: 0; z-index: 40;
    min-width: 230px; padding: 12px 0;
    background: #fff; box-shadow: 0 5px 12px rgba(0, 0, 0, .15);
    border-radius: 0 0 var(--radius) var(--radius);
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
  }
  .nav > li:hover > .dropdown, .nav > li:focus-within > .dropdown, .nav > li.open > .dropdown { opacity: 1; visibility: visible; transform: none; }
  .dropdown ul { list-style: none; margin: 0; padding: 0; }
  .dropdown li { margin: 0; }
  .dropdown a { display: block; padding: 4px 22px; color: var(--muted); }
  .dropdown a:hover, .dropdown a:focus-visible, .dropdown .active > a { color: var(--primary); text-decoration: none; }

  .headerbar {
    display: grid; grid-template-columns: 1fr 1.4fr; align-items: center; gap: 30px;
    padding: 25px 40px 20px;
    background: var(--card);
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .headerbar .logo img { display: block; width: 266px; height: auto; }
  .headerbar-info { text-align: center; }
  .headerbar-info p { margin: 0; }
  .headerbar-phone { margin-top: 1em !important; color: var(--primary); font-weight: 700; }
  .headerbar-phone a { color: inherit; }
  .headerbar-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 15px 30px; margin-top: 1em; }
}

/* ==========================================================================
   Main
   ========================================================================== */
main { display: block; }
.card {
  background: #fff;
  padding: 25px 15px;
}
@media (min-width: 640px) { .card { padding: 30px; } }
@media (min-width: 960px) {
  .card { background: var(--card); border-radius: var(--radius); padding: 20px 15px 30px; }
}

.page-head { margin-bottom: 1.6em; }
.page-head h1 { margin-bottom: .1em; }
.page-head .subtitle { font-size: 1.55rem; line-height: 1.3; margin: 0; }
@media (max-width: 639px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }
  .page-head .subtitle { font-size: 1.3rem; }
}

/* Raster */
.grid { display: grid; gap: 30px; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-1-2 { grid-template-columns: 1fr 2fr; }
  .grid-2-1 { grid-template-columns: 3fr 2fr; }
}
@media (min-width: 960px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.grid > * { min-width: 0; }

/* Bilder neben Text */
.float-left, .float-right { display: block; margin: 0 auto 1em; }
@media (min-width: 640px) {
  .float-left { float: left; margin: .3em 1.5em 1em 0; max-width: 45%; }
  .float-right { float: right; margin: .3em 0 1em 1.5em; max-width: 45%; }
}
.clearfix::after { content: ""; display: table; clear: both; }

/* Chronik-Fotos: Bildunterschrift ist im Foto eingebrannt – figcaption nur für Screenreader/Suchmaschinen */
figure.photo { width: fit-content; }
figure.photo figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rounded { border-radius: var(--radius); }

/* ==========================================================================
   Startseite
   ========================================================================== */
.heading-line {
  display: flex; align-items: center; gap: 20px;
  font-size: 1.6rem; font-weight: 700; color: var(--primary); text-align: center;
  margin: .4em 0 1.4em;
}
.heading-line::before, .heading-line::after { content: ""; flex: 1; border-top: 1px solid rgba(157, 9, 55, .25); }
@media (max-width: 959px) {
  .heading-line { display: block; font-size: 1.6rem; }
  .heading-line::before, .heading-line::after { display: none; }
}
.home-teaser { color: var(--primary); font-weight: 700; font-size: 1.05rem; margin-bottom: 1.4em; }

.home-grid { display: grid; gap: 30px; }
@media (min-width: 960px) { .home-grid { grid-template-columns: 1fr 1fr 2fr; gap: 40px; } }
.home-address { text-align: center; }
.home-address img { display: block; width: 266px; margin: 0 auto 1.2em; }
@media (min-width: 960px) { .home-address img { width: 100%; } }

.seals { display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; gap: 15px; list-style: none; padding: 0; margin: 1.5em 0; }
.seals li { margin: 0; text-align: center; }
.seals img { max-height: 100px; width: auto; }
.seals li:first-child img { max-height: 104px; border: 1px solid #ccc; border-radius: 2px; padding: 4px; background: #fff; }

.phone-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 2px 15px 2px 6px; min-height: 40px;
  background: var(--primary); color: #fff;
}
.phone-bar a { color: #fff; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--primary) !important;
  transition: background-color .15s;
}
.icon-button:hover, .icon-button:focus-visible { background: #f0f0f0; text-decoration: none; }

/* ==========================================================================
   Unterseiten-Bausteine
   ========================================================================== */

/* Akkordeon (Leistungen) */
.accordion details { margin-bottom: 15px; }
.accordion summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: var(--primary); color: #fff;
  font-size: 1.3rem; cursor: pointer; list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-size: 1.6rem; line-height: 1; font-weight: 700; }
.accordion details[open] summary::after { content: "\2212"; }
.accordion .content { padding: 20px 20px 5px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 20px 30px; list-style: none; padding: 0; margin: 0 0 1em; }
.thumbs li { margin: 0; }
.thumbs a { display: block; border-radius: var(--radius); overflow: hidden; }
.thumbs img { display: block; width: 100%; transition: transform .2s, opacity .2s; }
.thumbs a:hover img, .thumbs a:focus-visible img { opacity: .85; }
.thumbs-urnen { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.thumbs-urnen img { aspect-ratio: 2 / 3; object-fit: cover; }
.thumbs-saerge img { aspect-ratio: 110 / 78; object-fit: cover; }

/* Bildergalerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; list-style: none; padding: 0; margin: 0; }
.gallery li { margin: 0; }
.gallery a { display: block; overflow: hidden; border-radius: var(--radius); }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.04); }

/* Trauerhalle */
.halle-thumbs { display: grid; gap: 20px; list-style: none; padding: 0; margin: 0 0 1em; grid-template-columns: repeat(3, 1fr); }
@media (min-width: 640px) { .halle-thumbs { grid-template-columns: 1fr; max-width: 160px; } }
.halle-thumbs li { margin: 0; }
.halle-thumbs a { display: block; border-radius: var(--radius); overflow: hidden; }
.halle-thumbs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* Team */
.team-member img { display: block; width: 100%; max-width: 360px; border-radius: var(--radius); margin-bottom: 1em; }
.team-member h3 { margin-bottom: .1em; }
.team-member .role { color: var(--muted); margin-bottom: .8em; }

/* Listen */
.link-list { list-style: none; padding: 0; }
.link-list li { margin: 0 0 1em; }
.link-list strong { display: block; }
.music-list { columns: 1; }
.product-list { list-style: none; padding: 0; }
.product-list li { padding: .5em 0; border-bottom: 1px solid var(--border); margin: 0; }
.product-list li:last-child { border-bottom: 0; }

/* Video */
.video-wrap video { display: block; width: 100%; background: #000; border-radius: var(--radius); }

/* Externe Inhalte (erst nach Zustimmung) */
.consent-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8em;
  min-height: 260px; padding: 25px;
  background: #f3f3f3; border: 1px dashed #ccc; border-radius: var(--radius);
  text-align: center; font-size: .95rem;
}
.consent-placeholder p { margin: 0; max-width: 34em; }
.embed iframe { display: block; width: 100%; border: 0; }
.map iframe { height: 420px; }
.portal iframe { height: 320px; }
.portal .consent-placeholder { min-height: 220px; }

/* Formulare */
.form-row { margin-bottom: 1em; }
.form-row label, .form-row .label { display: block; margin-bottom: .2em; }
.form-row .req { color: var(--primary); }
.form-row input[type=text], .form-row input[type=email], .form-row input[type=tel], .form-row select, .form-row textarea {
  display: block; width: 100%;
  padding: .55em .75em;
  font: inherit; color: var(--text);
  background: #f8f8f8; border: 1px solid #ccc; border-radius: 0;
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.radio-group { display: flex; gap: 1.5em; }
.radio-group label, .check label { display: inline-flex; align-items: baseline; gap: .4em; margin: 0; }
.check label { font-size: .85rem; line-height: 1.6; }
.form-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form-submit { width: 100%; justify-content: center; padding: .7em 1em; font-size: 1rem; }
.form-status { padding: .8em 1em; border-radius: var(--radius); margin-bottom: 1em; }
.form-status[hidden] { display: none; }
.form-status.ok { background: #edf7ee; color: #1e5e27; border: 1px solid #b8dfbd; }
.form-status.error { background: #fbeef1; color: var(--primary-dark); border: 1px solid #ebc0cc; }

.route-form { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1.5em; }
.route-form input { flex: 1 1 220px; padding: .5em .75em; font: inherit; background: #f8f8f8; border: 1px solid #ccc; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin: 0 auto; }
.footer-card { background: #fff; padding: 30px 15px 20px; border-top: 1px solid var(--border); }
@media (min-width: 640px) { .footer-card { padding: 30px 40px 20px; } }
@media (min-width: 960px) {
  .site-footer { margin: 25px auto 70px; }
  .footer-card { background: rgba(255, 255, 255, .88); border-radius: var(--radius); border-top: 0; }
}
.footer-title { font-size: 1.6rem; font-style: italic; margin: 0 0 .6em; }
.footer-grid { display: grid; gap: 1.2em; }
.footer-grid p { margin: 0; }
.footer-grid img { width: 79px; height: auto; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .footer-grid { grid-template-columns: .6fr 1fr 1fr 1fr; gap: 30px; } }
.footer-grid a { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .3em 1.2em; list-style: none; padding: 0; margin: 1.5em 0 0; }
.footer-links li { margin: 0; }
.footer-links a { color: var(--text); }
.footer-links a:hover { color: var(--primary); }
.copyright { text-align: center; font-size: .8rem; color: var(--muted); margin: .8em 0 0; }

/* ==========================================================================
   Cookie-Banner
   ========================================================================== */
.cookie-banner {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 15px; background: rgba(0, 0, 0, .45);
}
.cookie-box {
  width: 100%; max-width: 520px;
  padding: 25px 25px 20px;
  background: #fff; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
  font-size: .95rem;
}
.cookie-title { font-size: 1.35rem; color: var(--primary); margin: 0 0 .5em; }
.cookie-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 1.2em; }

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(0, 0, 0, .9); color: #fff;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox figure { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; margin: 0; padding: 50px 60px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { margin-top: 10px; text-align: center; font-size: .95rem; }
.lightbox button {
  position: absolute; display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0;
  border: 0; background: rgba(0, 0, 0, .3); color: #fff;
  font-size: 28px; line-height: 1; cursor: pointer; border-radius: var(--radius);
}
.lightbox button:hover { background: rgba(255, 255, 255, .15); }
.lightbox .lb-close { top: 10px; right: 10px; }
.lightbox .lb-count { position: absolute; top: 18px; left: 0; right: 0; margin: 0; text-align: center; font-size: .9rem; color: rgba(255, 255, 255, .8); pointer-events: none; }
a[data-lightbox] { cursor: zoom-in; }
a.lb-auto { display: inline-block; }
a.lb-auto.float-left, a.lb-auto.float-right { display: block; }
a.lb-auto > img, a.lb-auto > picture > img { display: block; }
.lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 639px) { .lightbox figure { padding: 60px 10px; } .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 10px; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .header-mobile, .offcanvas, .navbar, .headerbar-buttons, .cookie-banner, .page-bg { display: none !important; }
  .header-desktop { display: block; padding: 0; }
}

/* Rechen-Captcha */
.captcha-q { display: block; font-weight: 700; color: var(--primary); }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.form-row .captcha-row input { width: 7em; flex: 0 0 auto; }
