/* Ferienhäuser Portiragnes — warm, mediterranean, relaxed. */

@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-latin-italic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --sand: #faf6ee;
  --sand-deep: #f1e9da;
  --ink: #33302a;
  --ink-soft: #5f594e;
  --terracotta: #b4531f;
  --terracotta-dark: #933f12;
  --sea: #2f5d8a;
  --sea-dark: #234867;
  --olive: #6b7f3e;
  --lavender: #7c6f9b;
  --free-bg: #e8f0dd;
  --free-ink: #3d5622;
  --busy-bg: #f4e3dd;
  --busy-ink: #8c3b22;
  /* Flaechen und Linien getrennt von den Markenfarben benannt: nur so laesst
     sich der Dunkelmodus unten als Variablentausch schreiben, statt jede
     Regel zu verdoppeln. */
  --surface: #fff;
  --border: #d8cfc0;
  --busy-surface: #faf3f0;
  --free-dot: #86a655;
  --busy-dot: #c4633f;
  /* --sea-dark traegt Flaechen (Hero, Fusszeile) *und* Text (Preise,
     Monatstitel). Im Dunkelmodus muessen die auseinanderlaufen, deshalb hier
     schon zwei Namen. */
  --sea-text: #234867;
  /* Die klebende Kopfzeile liegt ueber dem Inhalt und ist deshalb leicht
     durchscheinend — eine eigene Variable, weil ein rgba() hier nicht aus
     --sand ableitbar ist. Genau dieser Wert blieb beim Dunkelmodus zuerst
     hell stehen, waehrend die Schrift darauf hell wurde. */
  --header-bg: rgba(250, 246, 238, .96);
  /* Text auf den dunklen Flaechen (Fusszeile, Verwaltungskopf). Beide bleiben
     im Dunkelmodus, wie sie sind — diese Werte deshalb auch. */
  --on-dark: #cfd9e4;
  --on-dark-hover: #ffd9a0;
  /* Zustaende im Verwaltungsbereich — hier und nicht in admin.css, damit der
     Dunkelmodus unten alle Werte an einer Stelle umstellt. */
  --blocked-bg: #e7e3f1;
  --progress-bg: #e8a13c;
  --progress-ink: #3a2a12;
  --done-bg: #cfd8cd;
  --done-ink: #33402f;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(90, 70, 40, .10);
  color-scheme: light dark;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* E9: Dunkelmodus als Variablentausch. Keine Regel darunter wird verdoppelt —
   genau dafuer tragen Flaechen, Linien und Zustaende oben eigene Namen.

   Was *nicht* mitwechselt: die Markenflaechen. Der Knopf bleibt terracotta mit
   weisser Schrift, Hero und Fusszeile bleiben dunkelblau — sie waren schon
   dunkel, und ein Umfaerben haette die Seite nur unkenntlich gemacht.
   --sea-dark traegt deshalb weiter Flaechen, --sea-text den Text. */
@media (prefers-color-scheme: dark) {
  :root {
    --sand: #1b1917;
    --sand-deep: #272320;
    --surface: #221f1c;
    --ink: #ece6dc;
    --ink-soft: #b2a99b;
    --border: #3b352d;
    --busy-surface: #2b201d;
    --header-bg: rgba(27, 25, 23, .96);
    /* Links und Preise muessen auf dunklem Grund heller werden; die Flaeche
       --sea-dark bleibt, wie sie ist. */
    --sea: #8fb6dc;
    --sea-text: #8fb6dc;
    --terracotta: #c75f26;
    --terracotta-dark: #a94d1b;
    --free-bg: #22311d;
    --free-ink: #b4cf8c;
    --busy-bg: #38231d;
    --busy-ink: #e8a88f;
    --blocked-bg: #2e2a3a;
    --progress-bg: #8a5a16;
    --progress-ink: #f6e3c4;
    --done-bg: #2b352a;
    --done-ink: #cfe0cb;
    --shadow: 0 2px 14px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand);
}

h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.25; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
a { color: var(--sea); }
a:hover { color: var(--terracotta); }
img { max-width: 100%; height: auto; display: block; }

/* Für Screenreader sichtbar, visuell nicht — statt aria-label auf einem
   Element, dessen Inhalt sonst leer bliebe. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
/* Sprungmarke: erst beim Tabben sichtbar. */
.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--terracotta); color: #fff; padding: .6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius); text-decoration: none;
  transition: top .15s ease-in;
}
.skip-link:focus { top: 0; color: #fff; }
table { border-collapse: collapse; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 46rem; }
.prose ul { padding-left: 1.3rem; }
.lead { font-size: 1.2rem; color: var(--ink-soft); }

/* ---------------------------------------------------------------- header */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--sand-deep);
  position: sticky;
  top: 0;
  z-index: 500;
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--serif); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
.brand-mark { width: 30px; height: 30px; }
.site-nav { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .97rem; padding: .3rem 0; }
.site-nav a:hover { color: var(--terracotta); }
.nav-cta {
  background: var(--terracotta); color: #fff !important;
  padding: .45rem 1rem !important; border-radius: 999px;
}
.nav-cta:hover { background: var(--terracotta-dark); }
.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 860px) {
  /* Fokussierbar, aber unsichtbar: die Checkbox ist das Bedienelement.
     display:none würde sie aus dem Tab-Fluss nehmen und das Menü für
     Tastaturnutzer unerreichbar machen. */
  .nav-toggle {
    display: block; position: absolute; width: 1px; height: 1px;
    margin: 0; overflow: hidden; clip-path: inset(50%);
  }
  .nav-toggle-label {
    display: flex; flex-direction: column; gap: 5px; cursor: pointer; padding: .6rem;
  }
  .nav-toggle-label .bar { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }
  /* Tastaturfokus sichtbar machen — der Fokus sitzt auf der verborgenen
     Checkbox, zu sehen ist das Label daneben. */
  .nav-toggle:focus-visible + .nav-toggle-label {
    outline: 2px solid var(--terracotta); outline-offset: 2px; border-radius: 4px;
  }
  .site-nav {
    display: none; width: 100%; flex-direction: column; align-items: flex-start;
    gap: .2rem; padding: .5rem 0 1rem;
  }
  .site-nav a { padding: .5rem 0; font-size: 1.05rem; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; color: #fff;
  background: var(--sea-dark);
  min-height: min(72vh, 620px);
  display: flex; align-items: flex-end;
  overflow: hidden;
}
/* Das Hero-Bild liegt als <img> hinter dem Text, damit der Browser es früh
   findet (LCP) und responsive Varianten wählen kann. */
.hero-media { position: absolute; inset: 0; }
.hero-media picture, .hero-media img { width: 100%; height: 100%; }
.hero-media img { object-fit: cover; }
.hero-credit {
  position: absolute; right: .6rem; bottom: .4rem; z-index: 2;
  font-size: .7rem; color: rgba(255,255,255,.75); text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.hero-credit a { color: inherit; text-decoration: underline; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 30, 40, .05) 30%, rgba(25, 30, 35, .65));
}
.hero .wrap { position: relative; z-index: 1; padding-bottom: 3rem; width: 100%; }
.hero h1 { color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.4); max-width: 21ch; }
.hero p { color: #f4efe6; font-size: 1.2rem; max-width: 44ch; text-shadow: 0 1px 10px rgba(0,0,0,.45); }

.btn {
  display: inline-block; background: var(--terracotta); color: #fff;
  padding: .7rem 1.5rem; border-radius: 999px; border: 0;
  font-size: 1.02rem; font-family: var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--terracotta-dark); color: #fff; }
.btn-ghost { background: transparent; border: 1.5px solid currentColor; color: var(--sea); }
.btn-ghost:hover { background: var(--sea); border-color: var(--sea); }

/* -------------------------------------------------------------- sections */
.section { padding: 3.2rem 0 1rem; }
.section-tight { padding: 2rem 0 0; }
/* Erste Sektion unter der Brotkrumennavigation: weniger Luft nach oben. Stand
   als style="padding-top:1.2rem" in jeder Seitenvorlage — und war damit der
   Grund, warum die CSP style-src 'unsafe-inline' erlauben musste (C4). */
.section-top { padding-top: 1.2rem; }
/* Überschrift direkt unter der Kante ihres Kastens. */
.h-flush { margin-top: 0; }
.kicker {
  text-transform: uppercase; letter-spacing: .12em; font-size: .8rem;
  color: var(--terracotta); font-weight: 600; margin-bottom: .3rem;
}

/* ----------------------------------------------------------------- cards */
.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); padding: 0; margin: 1.5rem 0; list-style: none; }
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card-body { padding: 1.1rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.card h3 { margin: 0; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--terracotta); }
.card .facts { color: var(--ink-soft); font-size: .92rem; }
.card .from-price { margin-top: auto; font-weight: 600; color: var(--sea-text); }

.tile-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); padding: 0; list-style: none; }
.tile {
  background: var(--sand-deep); border-radius: var(--radius); padding: 1.2rem 1.3rem;
}
.tile h3 { margin: 0 0 .3rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.tile a { text-decoration: none; font-weight: 600; }

/* --------------------------------------------------------------- gallery */
.gallery { display: grid; gap: .8rem; grid-template-columns: 2fr 1fr; margin: 1.2rem 0 2rem; }
.gallery img { border-radius: var(--radius); object-fit: cover; width: 100%; height: 100%; }
.gallery .g-side { display: grid; gap: .8rem; }
@media (max-width: 640px) { .gallery { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; list-style: none; margin: .8rem 0 1.5rem; }
.chips li {
  background: var(--surface); border: 1px solid var(--sand-deep); border-radius: 999px;
  padding: .3rem .9rem; font-size: .92rem; color: var(--ink-soft);
}

/* ---------------------------------------------------------------- tables */
.info-table { width: 100%; max-width: 46rem; margin: 1rem 0 2rem; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.info-table th, .info-table td { text-align: left; padding: .65rem 1rem; border-bottom: 1px solid var(--sand-deep); font-size: .97rem; }
.info-table th { background: var(--sand-deep); font-family: var(--serif); }
.info-table tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }

/* -------------------------------------------------------------- calendar */
.calendar { margin: 1rem 0 2rem; }
.cal-legend { display: flex; gap: 1.2rem; font-size: .92rem; margin-bottom: 1rem; color: var(--ink-soft); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-free { background: var(--free-dot); }
.dot-busy { background: var(--busy-dot); }
/* E6: Monatsuebersicht. Ein Feld je Woche, Farbe und Beschriftung = Status,
   jedes Feld ist ein Anker in die Zeile darunter. Ersetzt das Scrollen durch
   57 Zeilen fuer die Frage "ist im August noch was frei?". */
.cal-overview {
  display: grid; gap: .9rem 1.4rem; margin: 0 0 1.8rem;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem 1.2rem;
}
.cal-overview-label {
  display: block; font-family: var(--serif); font-size: .95rem;
  color: var(--sea-text); text-decoration: none; margin-bottom: .35rem;
}
.cal-overview-label:hover { color: var(--terracotta); }
.cal-cells { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.cal-cell {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.3rem; padding: .25rem .35rem; border-radius: 6px;
  font-size: .82rem; font-variant-numeric: tabular-nums;
  text-decoration: none; border: 1px solid transparent;
}
/* Nicht nur Farbe: die Zahl bleibt lesbar, und das aria-label nennt den
   Status im Klartext — sonst traegt die Uebersicht ihre Aussage allein
   ueber Rot und Gruen. */
.cal-cell.frei { background: var(--free-bg); color: var(--free-ink); border-color: var(--free-dot); }
.cal-cell.belegt { background: var(--busy-bg); color: var(--busy-ink); border-color: var(--busy-dot); }
.cal-cell:hover, .cal-cell:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 1px; }
/* Der Sprung soll unter der klebenden Kopfzeile nicht verschwinden. */
.cal-week, .cal-month { scroll-margin-top: 5rem; }

.cal-month { margin-bottom: 1.4rem; }
.cal-month h3 { margin: 0 0 .5rem; font-size: 1.05rem; color: var(--sea-text); }
.cal-weeks { display: grid; gap: .45rem; padding: 0; list-style: none; margin: 0; }
.cal-week {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: var(--surface); border-radius: 9px; padding: .5rem .9rem;
  border-left: 5px solid transparent; font-size: .97rem;
}
.cal-week.frei { border-left-color: var(--free-dot); }
.cal-week.belegt { border-left-color: var(--busy-dot); background: var(--busy-surface); color: var(--ink-soft); }
.cal-week .range { min-width: 12.5rem; }
.cal-week .status { font-weight: 600; min-width: 4.5rem; }
.cal-week.frei .status { color: var(--free-ink); }
.cal-week.belegt .status { color: var(--busy-ink); }
.cal-week .price { color: var(--sea-text); min-width: 5.5rem; }
.cal-week .ask { margin-left: auto; font-size: .9rem; text-decoration: none; font-weight: 600; }
@media (max-width: 560px) {
  .cal-week { gap: .3rem .8rem; }
  .cal-week .range { min-width: 0; }
  .cal-week .ask { margin-left: 0; flex-basis: 100%; }
}

/* --------------------------------------------------------------- figures */
.area-figure { margin: 1.5rem 0 2rem; max-width: 46rem; }
.area-figure img { border-radius: var(--radius); box-shadow: var(--shadow); max-height: 30rem; }
/* Hochformate (z. B. die Dorfkirche, 1600×2593) würden sonst die Seite
   sprengen; max-height begrenzt sie, ohne etwas wegzuschneiden. */
.area-figure figcaption { margin-top: .4rem; }

/* ------------------------------------------------------------------ maps */
.map { height: 380px; border-radius: var(--radius); box-shadow: var(--shadow); margin: 1.2rem 0 2rem; z-index: 1; }

/* ----------------------------------------------------------------- forms */
.form { max-width: 40rem; background: var(--surface); padding: 1.6rem; border-radius: var(--radius); box-shadow: var(--shadow); margin: 1.5rem 0 2.5rem; }
.form label { display: block; font-weight: 600; margin: 1rem 0 .3rem; font-size: .97rem; }
.form input[type=text], .form input[type=email], .form input[type=tel],
.form select, .form textarea {
  width: 100%; padding: .6rem .8rem; font: inherit; color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; background: var(--sand);
}
.form textarea { min-height: 9rem; resize: vertical; }
.form .consent { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: 1.2rem 0; }
.form .consent input { margin-top: .3rem; }
.form button { margin-top: .4rem; }
.field-hp { position: absolute; left: -9999px; }

.flash { border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.2rem 0; }
.flash-ok { background: var(--free-bg); color: var(--free-ink); }
.flash-err { background: var(--busy-bg); color: var(--busy-ink); }
.flash ul { margin: 0; padding-left: 1.2rem; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--sea-dark); color: var(--on-dark); margin-top: 4rem; padding: 2.5rem 0; font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr; }
.footer-brand { font-family: var(--serif); font-size: 1.15rem; color: #fff; margin-bottom: .4rem; }
.site-footer nav { display: flex; flex-direction: column; gap: .35rem; }
.site-footer a { color: var(--on-dark); text-decoration: none; }
.site-footer a:hover { color: #fff; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- various */
.breadcrumbs { font-size: .88rem; color: var(--ink-soft); margin: 1.4rem 0 0; }
.breadcrumbs a { color: var(--ink-soft); }
.figure-caption, .credit { font-size: .82rem; color: var(--ink-soft); }
.trip { border-bottom: 1px solid var(--sand-deep); padding: 1.2rem 0; max-width: 46rem; }
.trip:last-child { border-bottom: 0; }
.trip h3 { margin-top: 0; }
.trip .meta-line { color: var(--terracotta); font-size: .9rem; font-weight: 600; }
.price-note { font-size: .9rem; color: var(--ink-soft); }
.property-header { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: baseline; color: var(--ink-soft); }
.sticky-cta { display: none; }
@media (max-width: 700px) {
  .sticky-cta {
    display: block; position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
    z-index: 400; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  }
  main { padding-bottom: 4.5rem; }
}
