/* ==========================================================================
   Medugorac Design — Stylesheet
   Aufbau:  1) Schriften  2) Variablen  3) Grundgerüst  4) Kopf/Wordmark
            5) Navigation  6) Slideshow  7) Inhaltsseiten  8) Footer
            9) Responsive
   Farben & Abstände sind als CSS-Variablen unter :root zentral editierbar.
   ========================================================================== */

/* 1) Schriften ----------------------------------------------------------- */
@font-face {
  font-family: "Basier Square";
  src: url("../fonts/basiersquare-medium.woff2") format("woff2"),
       url("../fonts/basiersquare-medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* 2) Variablen ----------------------------------------------------------- */
:root {
  --bg:        #f4f4f3;
  --fg:        #15161a;
  --muted:     #8a8d93;
  --line:      #e1e1de;
  --accent:    #15161a;
  --maxw:      1280px;
  --nav-h:     92px;          /* Höhe der fest fixierten Navigation (unten) */
  --gap:       clamp(1.25rem, 4vw, 3rem);
  --radius:    2px;
  --font-head: "Basier Square", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease:      cubic-bezier(.4, 0, .2, 1);
}

/* 3) Grundgerüst --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--nav-h);   /* Platz für die fixierte Navigation */
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: clamp(1rem, .65rem + .6vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--bg);
  padding: .6em 1em;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gap);
}

/* 4) Kopf / Wordmark ----------------------------------------------------- */
.site-header {
  padding-top: clamp(1.5rem, 4vw, 3rem);
  padding-bottom: clamp(1rem, 3vw, 2rem);
}
.wordmark {
  display: inline-block;
  margin: 0;
  margin-left: auto;
  text-align: right;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(2rem, 1rem + 5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark b { font-weight: 500; display: block; }
.site-header .shell { display: flex; }

/* 5) Navigation (unten) -------------------------------------------------- */
.site-nav {
  position: fixed;            /* immer am unteren Rand – springt nicht mehr */
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--bg);      /* deckt darunter durchscrollenden Text ab */
  padding-block: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--line);
}
.site-nav .shell {
  display: flex;
  align-items: baseline;
  gap: clamp(1.5rem, 6vw, 5rem);
}
.site-nav a {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.05rem, .8rem + .6vw, 1.35rem);
  text-decoration: none;
  color: var(--fg);
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s var(--ease), opacity .2s var(--ease);
}
.site-nav a:hover { opacity: .6; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--fg); }
.nav-legal {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .15rem;
}
.nav-legal a {
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--muted);
  text-decoration: none;
}
.nav-legal a:hover { color: var(--fg); border-bottom-color: transparent; }

/* 6) Slideshow ----------------------------------------------------------- */
.stage {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slideshow {
  position: relative;
  width: 100%;
  max-width: 780px;
  margin-inline: auto;
}
.slides {
  position: relative;
  width: 100%;
  aspect-ratio: 554 / 418;          /* einheitliches Seitenverhältnis */
  margin-inline: auto;
  overflow: hidden;
  background: #ececea;
  border-radius: var(--radius);
}
/* Auf größeren Schirmen Höhe an den Viewport koppeln, damit Wordmark,
   Bild und Navigation gemeinsam sichtbar bleiben (wie im Original). */
@media (min-width: 761px) {
  .slides {
    width: auto;
    height: clamp(300px, calc(100dvh - 360px), 500px);
  }
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
}
.slide.is-active {
  opacity: 1;                 /* Ruhezustand = sichtbar (robust, auch ohne Animation) */
  visibility: visible;
  z-index: 2;
  animation: slideIn .6s var(--ease);   /* Einblenden nur als Verschönerung */
}
@keyframes slideIn { from { opacity: 0; } to { opacity: 1; } }

.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* unscharfer Platzhalter (LQIP) liegt hinter dem scharfen Bild und wird
   vom undurchsichtigen Vollbild vollständig verdeckt, sobald es geladen ist. */
.slide .lqip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: blur(14px);
  transform: scale(1.04);
  z-index: 1;
}
.slide .full { position: relative; z-index: 2; }

/* Steuerung */
.slide-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22%;
  min-width: 64px;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 5;
  display: grid;
  place-items: center;
  color: var(--fg);
  opacity: 0;
  transition: opacity .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.slideshow:hover .slide-btn,
.slide-btn:focus-visible { opacity: 1; }
.slide-btn.prev { left: 0; justify-content: flex-start; padding-left: 1rem; }
.slide-btn.next { right: 0; justify-content: flex-end; padding-right: 1rem; }
.slide-btn svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(255,255,255,.6)); }
.slide-btn:hover svg { transform: scale(1.12); }
.slide-btn svg { transition: transform .2s var(--ease); }

.slide-counter {
  margin-top: .9rem;
  font-family: var(--font-head);
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.slide-counter b { color: var(--fg); font-weight: 500; }

@media (hover: none) {
  .slide-btn { opacity: 1; }   /* auf Touch immer sichtbar */
}

/* 7) Inhaltsseiten ------------------------------------------------------- */
.page {
  flex: 1 0 auto;
  padding-block: clamp(1rem, 3vw, 2rem) clamp(2rem, 5vw, 4rem);
}
.about-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) 1.4fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}
.about-figure { margin: 0; }
.about-figure img { width: 100%; border-radius: var(--radius); }
.about-figure figcaption { margin-top: .6rem; font-size: .8rem; color: var(--muted); }

.prose { max-width: 60ch; }
.prose h1 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}
.prose .lede { font-size: 1.1em; color: var(--fg); }
.prose p { margin: 0 0 1rem; }
.prose h2 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.05rem;
  margin: 2rem 0 .5rem;
}
.prose a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.prose ul { margin: 0 0 1rem; padding-left: 1.1rem; }
.prose li { margin-bottom: .3rem; }
.prose small, .prose .muted { color: var(--muted); }

/* Kontaktseite */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}
.contact-card h1 {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: clamp(1.4rem, 1rem + 2vw, 2rem);
  margin: 0 0 1.25rem;
}
.contact-card p { margin: 0 0 .35rem; }
.contact-card a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.contact-card .row-gap { margin-top: 1.1rem; }
.contact-figure img { width: 100%; border-radius: var(--radius); }

/* Rechtstexte */
.legal { max-width: 70ch; }
.legal h1 { font-family: var(--font-head); font-weight: 500; font-size: clamp(1.6rem,1rem+2.4vw,2.4rem); margin: 0 0 1.5rem; }
.legal h2 { font-family: var(--font-head); font-weight: 500; font-size: 1.1rem; margin: 1.75rem 0 .4rem; }
.legal p { margin: 0 0 1rem; }
.legal address { font-style: normal; margin: 0 0 1rem; }
.legal a { color: var(--fg); }
.legal small { color: var(--muted); }

/* 404 */
.notfound { text-align: center; padding-block: 6vh; }
.notfound h1 { font-family: var(--font-head); font-size: clamp(3rem,10vw,6rem); margin: 0; }

/* 8) Footer -------------------------------------------------------------- */
/* (Footer-Funktion erfüllt die untere Navigation) */

/* 9) Responsive ---------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --nav-h: 132px; }   /* Navigation bricht hier auf zwei Zeilen um */
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .contact-figure { order: -1; }
  .site-nav .shell { flex-wrap: wrap; gap: 1.1rem 1.75rem; }
  .nav-legal { width: 100%; flex-direction: row; align-items: center; justify-content: flex-start; gap: 1.25rem; margin-left: 0; }
  .wordmark { font-size: clamp(2rem, 8vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
