/* Bestattungsinstitut Sporer – Nachbau der Startseite */

:root {
  --primary: #a3243b;
  --primary-dark: #8a1e32;
  --text: #666;
  --text-dark: #333;
  --muted: #999;
  --bg: #f9fafa;
  --bg-header: #f7f7f7;
  --card: #fff;
  --shadow: 0 5px 15px rgba(0, 0, 0, .08);
  --container: 1200px;
  --gutter: 15px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

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

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body { margin: 0; background: var(--bg); }

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

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

h1, h2, h3, .h2 {
  margin: 0 0 20px;
  font-weight: 400;
  color: var(--primary);
}
h2, .h2 { font-size: 1.7rem; line-height: 1.3; }
h3 { font-size: 1.5rem; line-height: 1.4; }

p { margin: 0 0 20px; }
p:last-child { margin-bottom: 0; }

.text-primary { color: var(--primary); }

:focus-visible { outline: 2px dotted var(--text-dark); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 10px; z-index: 1000;
  background: #fff; color: var(--text-dark); padding: 10px 15px;
}
.skip-link:focus { left: 10px; }

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

/* ---------- Button ---------- */
.button {
  display: inline-block;
  padding: 0 30px;
  line-height: 38px;
  font-size: .875rem;
  text-transform: uppercase;
  background: var(--primary);
  color: #fff;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color .1s ease-in-out;
}
.button:hover { background: var(--primary-dark); }

.icon-button {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

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

.headerbar {
  background: var(--bg-header);
  padding: 20px var(--gutter);
  display: flex; justify-content: center;
}
.headerbar .logo img { width: 350px; }

.navbar {
  background-image: linear-gradient(to bottom, #fff, #f3f3f3);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04);
}
.nav {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter);
  max-width: var(--container);
  display: flex; justify-content: center; flex-wrap: wrap;
}
.nav > li { position: relative; }
.nav > li > a {
  display: flex; align-items: center;
  min-height: 46px;
  padding: 0 10px;
  color: #000;
  font-size: 1.063rem;
  transition: color .1s, background-color .1s;
}
.nav > li > a:hover,
.nav > li.has-sub:hover > a { color: var(--primary); }
.nav > li.active > a { background: var(--primary); color: #fff; }

.dropdown {
  position: absolute; top: 100%; left: 0; z-index: 100;
  width: 200px; padding: 25px;
  margin-top: 0;
  background: var(--bg);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .15);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.dropdown ul { list-style: none; margin: 0; padding: 0; }
.dropdown a { display: block; padding: 5px 0; color: var(--muted); }
.dropdown a:hover { color: var(--text); }
.nav > li.has-sub:hover .dropdown,
.nav > li.has-sub:focus-within .dropdown,
.nav > li.has-sub.open .dropdown { opacity: 1; visibility: visible; transform: none; }

/* ---------- Header Mobile ---------- */
.header-mobile {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 80px;
  padding: 0 var(--gutter);
  background-image: linear-gradient(to bottom, #fff, #f3f3f3);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 2px 4px rgba(0, 0, 0, .04);
}
.header-mobile .logo img { width: 180px; padding: 6px 0; }
.header-mobile .icon-button { width: 44px; height: 44px; }

.nav-toggle {
  width: 44px; height: 44px; padding: 14px 11px;
  background: var(--primary); border: 0; border-radius: 2px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
  flex-shrink: 0;
}
.nav-toggle span { display: block; height: 2px; background: currentColor; }

/* Offcanvas */
.offcanvas { position: fixed; inset: 0; z-index: 200; }
.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: min(300px, 85vw);
  overflow-y: auto;
  background: #222; color: rgba(255, 255, 255, .7);
  padding: 60px 25px 25px;
  transform: translateX(-100%);
  transition: transform .3s ease-out;
}
.offcanvas.open .offcanvas-overlay { opacity: 1; }
.offcanvas.open .offcanvas-bar { transform: none; }
.offcanvas-close {
  position: absolute; top: 10px; right: 10px;
  width: 44px; height: 44px;
  background: none; border: 0; color: rgba(255, 255, 255, .7);
  font-size: 2rem; line-height: 1; cursor: pointer;
}
.nav-mobile, .nav-mobile .sub { list-style: none; margin: 0; padding: 0; }
.nav-mobile > li + li { border-top: 1px solid rgba(255, 255, 255, .2); }
.nav-mobile > li > a,
.sub-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  font-size: 1.25rem; line-height: 1.5;
  color: rgba(255, 255, 255, .7);
  background: none; border: 0; font-family: inherit; text-align: left; cursor: pointer;
}
.nav-mobile > li.active > a,
.nav-mobile a:hover, .sub-toggle:hover { color: #fff; }
.chev {
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); margin-right: 4px; margin-top: -6px;
  transition: transform .2s;
}
.sub-toggle[aria-expanded="true"] .chev { transform: rotate(-135deg); margin-top: 4px; }
.nav-mobile .sub { display: none; padding: 0 0 10px 15px; }
.nav-mobile .sub.open { display: block; }
.nav-mobile .sub a { display: block; padding: 6px 0; color: rgba(255, 255, 255, .5); }

/* ---------- Cards ---------- */
main { padding-top: 15px; }
.card {
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 15px;
}
.card-padding { padding: 30px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); }

.slideshow {
  position: relative; overflow: hidden;
  aspect-ratio: 8 / 7;
  touch-action: pan-y;
  background: #ddd;
}
.slides { list-style: none; margin: 0; padding: 0; }
.slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity .7s ease;
  overflow: hidden;
}
.slide.is-active { opacity: 1; z-index: 1; }
.slide img {
  width: 100%; height: 100%; object-fit: cover;
}
.slide.is-active img { animation: kenburns 15s linear forwards; }
@keyframes kenburns { from { transform: scale(1.2); } to { transform: scale(1); } }

.slidenav {
  position: absolute; top: 50%; z-index: 2;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
  color: rgba(255, 255, 255, .8);
  opacity: 0; transition: opacity .2s, color .1s;
}
.slidenav:hover { color: #fff; }
.slidenav.prev { left: 10px; }
.slidenav.next { right: 10px; }
.slideshow:hover .slidenav,
.slidenav:focus-visible { opacity: 1; }

.dotnav {
  position: absolute; left: 0; right: 0; bottom: 20px; z-index: 2;
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center; gap: 12px;
}
.dotnav button {
  width: 14px; height: 14px; padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .9);
  background: transparent; cursor: pointer;
  transition: background-color .2s;
  position: relative;
}
.dotnav button::after { content: ""; position: absolute; inset: -12px; } /* größere Touch-Fläche */
.dotnav button.is-active,
.dotnav button:hover { background: rgba(255, 255, 255, .9); }

.hero-text {
  text-align: center;
  padding: 40px 20px;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-text h1 { font-size: clamp(1.7rem, 6vw, 2.1rem); margin-bottom: 30px; }
.hero-phone { color: #000; margin: 0; font-size: clamp(1.7rem, 6vw, 2.1rem); }
.hero-phone a {
  display: inline-flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.hero-phone svg { width: 1.2em; height: 1.2em; }

/* Zitat */
blockquote {
  margin: 0;
  font-size: 1.25rem; line-height: 1.5;
  font-style: italic; color: var(--text-dark);
}
blockquote p { margin-bottom: 10px; }
blockquote footer { font-size: .875rem; color: var(--text); }
blockquote footer::before { content: "— "; }
blockquote cite { font-style: italic; }

/* Trauerfälle */
.trauerfaelle-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px;
}
.trauerfaelle-head h2 { margin: 0; }
#asp-content:not(:empty) { margin-top: 30px; }

/* ---------- Unterseiten ---------- */
.nav-mobile > li.has-sub.active > .sub-toggle { color: #fff; }

.page-layout {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 0 30px;
  align-items: start;
  padding-bottom: 15px;
}

.page-hero {
  position: relative; margin: 0 0 15px;
  overflow: hidden; background: #ddd;
  aspect-ratio: 2 / 1;
}
.page-hero img { width: 100%; height: 100%; object-fit: cover; }
.page-hero figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 15px 20px;
  background: rgba(0, 0, 0, .7);
  color: rgba(255, 255, 255, .8);
  font-size: .875rem;
}

.article { padding: 30px 20px; }
.article h1 { font-size: 2.2rem; line-height: 1.2; margin-bottom: 30px; }
.article h2 { font-size: 1.5rem; }
.article h3 { font-size: 1.25rem; margin-top: 30px; }
.article h4 { font-size: 1.1rem; font-weight: 400; color: var(--text-dark); margin: 0 0 10px; }
.article ul { padding-left: 20px; margin: 0 0 20px; }
.article li + li { margin-top: 4px; }
.article a:not(.button) { color: var(--primary); overflow-wrap: anywhere; }
.article a:not(.button):hover { text-decoration: underline; }
.article hr { border: 0; border-top: 1px solid #e5e5e5; margin: 20px 0; }
.text-right { text-align: right; }

.partner { margin: 0 0 20px; }
.partner p { margin-bottom: 8px; }

.icon-list { list-style: none; padding: 0 !important; }
.icon-list svg { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; }

.team-grid {
  display: grid; gap: 30px;
  grid-template-columns: minmax(0, 1fr);
}
.team-member { margin: 0; text-align: center; }
.team-member img {
  margin: 0 auto 15px;
  border-radius: 5px;
  transition: transform .2s ease-out;
}
.team-member:hover img { transform: scale(1.03); }
.team-member .h5 { font-size: 1rem; color: var(--primary); margin: 0 0 10px; }
.team-member p { font-size: .8125rem; line-height: 1.8; text-align: left; }

.subnav ul { list-style: none; margin: 0; padding: 0; }
.subnav a { display: block; padding: 5px 0; color: var(--muted); }
.subnav a:hover, .subnav li.active a { color: var(--text-dark); }
.subnav { padding: 20px 15px; }

.help { text-align: center; }
.help .h3 { font-size: 1.5rem; line-height: 1.4; margin: 0 0 30px; }
.help-phone { color: #000; margin: 0 !important; }
.help-phone a { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.help-phone svg { width: 1.4em; height: 1.4em; }

@media (min-width: 640px) {
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article { padding: 40px; }
  .article h1 { font-size: 2.6rem; }
}

@media (min-width: 960px) {
  .page-layout { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
  .page-hero { aspect-ratio: 16 / 9; }
  .page-hero figcaption { padding: 25px 30px; font-size: 1rem; }
  .help .h3 { font-size: 1.4rem; }
}

/* ---------- Cookie-Zustimmung ---------- */
.cookie-banner {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .4);
}
.cookie-box {
  width: 100%; max-width: 440px;
  padding: 30px 25px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 14px 25px rgba(0, 0, 0, .16);
  text-align: center;
  font-size: .875rem;
}
.cookie-title { font-size: 1.25rem; color: var(--primary); margin: 0 0 10px; }
.cookie-box a { color: var(--primary); text-decoration: underline; }
.cookie-actions {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin-top: 20px;
}
.button-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.button-outline:hover { background: var(--bg); }

/* ---------- Footer ---------- */
.site-footer { padding-bottom: 15px; }
.contact {
  display: grid; grid-template-columns: minmax(0, 1fr);
  margin-bottom: 0;
}
.contact-text { padding: 40px 30px; display: flex; flex-direction: column; justify-content: center; }
.contact-text h3 { margin-bottom: 25px; }
.contact-text p { font-size: .9375rem; }
.contact-text svg {
  width: 20px; height: 20px;
  vertical-align: -4px; margin-right: 2px;
}
.contact-text a:hover { color: var(--primary); }

.map { position: relative; min-height: 350px; background: #e8eef0; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 15px;
  padding: 30px; text-align: center; font-size: .875rem;
  background: linear-gradient(rgba(249, 250, 250, .85), rgba(249, 250, 250, .85)),
              repeating-linear-gradient(45deg, #dfe7ea 0 2px, transparent 2px 22px);
}
.map-placeholder p { margin: 0; max-width: 340px; }
.map-placeholder a { color: var(--primary); text-decoration: underline; }

.footer-bar {
  background: var(--bg-header);
  box-shadow: var(--shadow);
  padding: 15px;
}
.footer-bar ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 20px;
}
.footer-bar a {
  display: inline-block; padding: 6px 0;
  font-size: .875rem; color: #222;
}
.footer-bar a:hover { color: var(--primary); }

/* ---------- Ab Tablet ---------- */
@media (min-width: 640px) {
  .footer-bar li:first-child { flex-basis: auto; }
}
@media (max-width: 639px) {
  .footer-bar li:first-child { flex-basis: 100%; text-align: center; }
  .card-padding { padding: 25px 20px; }
  .trauerfaelle-head .button { margin-left: auto; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .header-mobile { display: none; }
  .header-desktop { display: block; }

  main { padding-top: 15px; }
  .hero { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .slideshow { aspect-ratio: auto; height: 100%; min-height: 340px; }
  .hero-text h1, .hero-phone { font-size: 1.7rem; }

  .contact { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .contact-text { padding: 40px; }
  .map { min-height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slide.is-active img { animation: none; }
  .slide, .offcanvas-bar, .offcanvas-overlay, .dropdown { transition: none; }
}
