:root {
    --sea: #0e5a7a;
    --sea-dark: #0a4059;
    --sand: #f5efe3;
    --ink: #1c2b33;
    --muted: #5f6f78;
    --line: #dfe6ea;
    --accent: #e08a2e;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: #fff;
}

a { color: var(--sea); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.6rem; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 760px; }
.section { padding: 3rem 1.25rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .8rem; padding-bottom: .8rem; flex-wrap: wrap; }
.brand { font-size: 1.5rem; font-weight: 700; color: var(--sea-dark); text-decoration: none; letter-spacing: .02em; }
nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--ink); }
nav a[aria-current="page"] { color: var(--sea); font-weight: 600; }

/* Buttons */
.btn {
    display: inline-block; border: 0; cursor: pointer;
    background: var(--accent); color: #fff; font: inherit; font-weight: 600;
    padding: .7rem 1.4rem; border-radius: var(--radius); text-decoration: none;
}
.btn:hover { filter: brightness(.95); }
.btn-small { padding: .4rem .9rem; font-size: .95rem; }
nav .btn-small { color: #fff; }
.btn-secondary { background: var(--sea); }
.btn-danger { background: #b3382c; }

/* Hero */
.hero {
    color: #fff; padding: 5rem 0 4rem;
    background: linear-gradient(135deg, var(--sea) 0%, #2a8fb0 60%, #7cc5d8 100%) center/cover no-repeat;
}
.hero h1 { max-width: 16em; }
.hero p { font-size: 1.15rem; margin-bottom: 1.5rem; }
.search {
    display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
    background: #fff; color: var(--ink); padding: 1rem; border-radius: var(--radius); max-width: 760px;
}
.search label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); gap: .2rem; flex: 1 1 140px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #cfe6ee, #e9dcc0) center/cover no-repeat; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.card-body h3 { font-size: 1.1rem; margin-bottom: 0; }
.card-body p { margin: 0; }
.card-body .btn { margin-top: auto; align-self: flex-start; }
.card-body .price { margin: .4rem 0 .8rem; }

/* Band */
.band { background: var(--sand); padding: 2.5rem 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.facts strong { display: block; font-size: 1.1rem; margin-bottom: .2rem; color: var(--sea-dark); }
.facts span { color: var(--muted); }

/* Tabellen */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--sand); }
table.prices td:nth-child(n+3) { text-align: right; }
table.prices th:nth-child(n+3) { text-align: right; }

/* Formulare */
form label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: 1rem; font-size: .95rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], select, textarea {
    font: inherit; padding: .6rem .7rem; border: 1px solid #b9c5cb; border-radius: 8px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(14, 90, 122, .35); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem .4rem; margin: 0 0 1.5rem; }
legend { padding: 0 .4rem; font-weight: 600; color: var(--sea-dark); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.check { flex-direction: row; align-items: flex-start; gap: .6rem; }
.check input { width: auto; margin-top: .3rem; }
.field-website { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.quote { background: var(--sand); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1rem; }
.quote-line { display: flex; justify-content: space-between; padding: .15rem 0; }
.quote-total { border-top: 1px solid #cfc6b0; margin-top: .4rem; padding-top: .5rem; font-weight: 700; font-size: 1.1rem; }
.quote-nights { margin: 0 0 .4rem; font-weight: 600; color: var(--sea-dark); }
.quote-error { margin: 0; color: #9a2c20; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-error { background: #fbe9e7; color: #8a2a1f; border: 1px solid #f0c3bd; }
.alert-ok { background: #e6f4ea; color: #1e5b34; border: 1px solid #b9dfc5; }

/* Footer */
.site-footer { background: var(--sea-dark); color: #dbe9ef; padding: 2rem 0; margin-top: 3rem; }
.site-footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.site-footer a { color: #fff; }

/* Admin */
.admin-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: .5rem; }
.status { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; background: #eee; }
.status-pending { background: #fff3cd; }
.status-confirmed { background: #d4edda; }
.status-declined, .status-cancelled { background: #f0d4d1; }
.inline-form { display: inline; }
.inline-form button { margin: 0 .15rem .15rem 0; }
td.wrap-cell { white-space: normal; min-width: 180px; }

/* Belegungskalender */
table.cal { font-size: .85rem; }
table.cal th, table.cal td { padding: .25rem .3rem; text-align: center; white-space: nowrap; }
table.cal th.rowhead { text-align: left; padding-right: .8rem; position: sticky; left: 0; background: var(--sand); }
table.cal th.we { background: #ebe3d0; }
table.cal td a { display: block; text-decoration: none; color: inherit; min-width: 1.6rem; padding: .2rem 0; font-weight: 600; }
table.cal td.free { background: #d9efdf; }
table.cal td.part { background: #fff0c2; }
table.cal td.full { background: #f2c4bf; }
table.cal td a:hover { outline: 2px solid var(--sea); }
.quote-info { margin: .5rem 0 0; font-size: .9rem; color: var(--muted); }
.alt-contact { margin-top: 1.5rem; padding: 1rem; background: var(--sand); border-radius: var(--radius); }
.overdue { color: #b3382c; font-weight: 600; }

/* Kurznamen auf kleinen Bildschirmen */
.n-short { display: none; }
@media (max-width: 600px) {
    .n-long { display: none; }
    .n-short { display: inline; }
}

/* Gäste-Kalender */
.cal { margin: .5rem 0 1rem; max-width: 420px; }
.cal[hidden] { display: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.cal-nav { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 2.4rem; height: 2.4rem; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.cal-nav:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-weekdays span { text-align: center; font-size: .8rem; color: var(--muted); padding: .2rem 0; }
.cal-day {
    border: 1px solid transparent; border-radius: 6px; padding: .25rem 0; min-height: 2.9rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
    font: inherit; font-size: .9rem; line-height: 1.2; background: #e7f3ea; color: var(--ink); cursor: pointer;
}
.cal-day small { font-size: .7rem; color: var(--muted); }
.cal-day.high small { color: #a35a00; font-weight: 700; }
.cal-day.busy { background: #f2c4bf; color: #7d2b22; text-decoration: line-through; cursor: default; }
.cal-day.busy small { visibility: hidden; }
.cal-day.off { background: #f1f3f4; color: #a3adb2; cursor: default; }
.cal-day.off small { visibility: hidden; }
.cal-day.range { background: #cfe6f2; }
.cal-day.sel { background: var(--sea); color: #fff; border-color: var(--sea-dark); }
.cal-day.sel small { color: #e0f0f7; }
.cal-blank { min-height: 2.9rem; }
.cal-legend { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }
.lg { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; }
.lg-free { background: #e7f3ea; border: 1px solid #b9dfc5; }
.lg-busy { background: #f2c4bf; }
.lg-high { background: #fff; border: 2px solid #a35a00; }
@media (max-width: 600px) { .cal { max-width: none; } .cal-day { min-height: 2.6rem; font-size: .85rem; } }

/* Feinschliff Mobil */
.quote-line span:last-child { white-space: nowrap; margin-left: .75rem; }
.cal-day.sel { text-decoration: none; }
@media (max-width: 900px) {
    table.prices { font-size: .85rem; }
    table.prices th, table.prices td { padding: .5rem .4rem; white-space: normal; }
    table.prices th { line-height: 1.2; vertical-align: bottom; }
    table.prices td:nth-child(n+3) { white-space: nowrap; }
}
@media (max-width: 600px) {
    table.prices { font-size: .8rem; }
    table.prices th, table.prices td { padding: .5rem .3rem; }
    table.prices .col-pers { display: none; }
}

/* Karten mit Foto und Detail-Link */
a.card-img { display: block; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { text-decoration: underline; }
.card-actions { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.card-body .card-actions .btn { margin-top: 0; }
.btn-secondary { background: var(--sea); }

/* Detailseite */
.crumb { margin: 0 0 .5rem; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; margin-top: 1rem; }
.detail-text { max-width: 60ch; }
.sub { font-size: 1.2rem; margin: 1.8rem 0 .6rem; }
.price-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; background: var(--sand); position: sticky; top: 5rem; }
.price-box h2 { font-size: 1.15rem; }
.price-box dl { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; margin: 0 0 .8rem; }
.price-box dt { color: var(--muted); }
.price-box dd { margin: 0; font-weight: 700; text-align: right; }
.price-box .btn { display: block; text-align: center; }
@media (max-width: 800px) {
    .detail-layout { grid-template-columns: 1fr; }
    .price-box { position: static; order: -1; }
}

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.g-item { padding: 0; border: 0; background: #e9edf0; border-radius: 8px; overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.g-item:hover img { transform: scale(1.03); }
.gallery.plans .g-item { background: #fff; border: 1px solid var(--line); }
.gallery.plans .g-item img { object-fit: contain; }
.gallery.plans { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery.plans .g-item { aspect-ratio: 1 / 1; }

/* Lightbox */
#lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
#lightbox::backdrop { background: rgba(8, 20, 28, .9); }
#lightbox[open] { display: flex; align-items: center; justify-content: center; }
#lb-img { max-width: 94vw; max-height: 84vh; object-fit: contain; border-radius: 6px; background: #fff; }
.lb-btn { position: absolute; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 2rem; line-height: 1; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; }
.lb-btn:hover { background: rgba(255, 255, 255, .3); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .75rem; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #dbe9ef; margin: 0; font-size: .9rem; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; } .lb-count { display: none; } }

/* Umgebung (Startseite) */
.env-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin-top: 1.2rem; }
.env-grid img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); display: block; }

.card-actions .btn { padding: .55rem .95rem; font-size: .95rem; }
.gallery-wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Beschriftung auf Galerie-Kacheln */
.g-item { position: relative; }
.g-label { position: absolute; left: 6px; bottom: 6px; background: rgba(8, 40, 56, .78); color: #fff; font-size: .72rem; line-height: 1.2; padding: .15rem .45rem; border-radius: 4px; pointer-events: none; }
.lb-label { position: absolute; top: 1.2rem; left: 0; right: 0; text-align: center; color: #fff; margin: 0; font-size: .95rem; }

/* Admin: Fotoverwaltung */
.media-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.media-tabs a { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: #fff; }
.media-tabs a[aria-current="page"] { background: var(--accent, #1b5e7a); color: #fff; border-color: transparent; }
.media-section { margin: 1.5rem 0 2.5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin: 1rem 0; }
.media-grid figure { margin: 0; padding: .5rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.media-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f4f4f4; display: block; margin-bottom: .4rem; }
.media-grid input[type="text"] { width: 100%; font-size: .85rem; margin-bottom: .4rem; box-sizing: border-box; }
.media-grid figcaption { font-size: .85rem; color: #555; min-height: 1.2em; }
.media-actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.upload-form { margin-top: 1rem; display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.inline-form { margin: .5rem 0; }

/* Admin: Preise und Saison */
.price-edit td, .price-edit th { vertical-align: middle; }
.price-edit input { width: 6.5rem; text-align: right; }
.price-edit small { display: block; }
.season-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; max-width: 60rem; }
.season-grid input { width: 7rem; }
.holiday-grid { display: grid; grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr); gap: 1.5rem; max-width: 60rem; margin-bottom: 1rem; }
.holiday-grid textarea { width: 100%; box-sizing: border-box; font: inherit; }
.holiday-grid fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; }
.price-edit input[type="number"] { width: 5rem; }
.price-edit tfoot td { border-top: 2px solid var(--line); }

/* Admin-Kalender mit direkter Bearbeitung der Verfügbarkeit */
.cal-nav2 { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.cal-month { min-width: 9rem; text-align: center; }
.cal2-wrap { max-height: 78vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table.cal2 { border-collapse: separate; border-spacing: 0; font-size: .82rem; table-layout: fixed; width: 100%; min-width: 1150px; }
table.cal2 th, table.cal2 td { padding: 0; text-align: center; border-bottom: 1px solid var(--line); border-right: 1px solid #ece6d8; white-space: nowrap; }
table.cal2 .mon { border-left: 2px solid #b9ad92; }
table.cal2 thead th { position: sticky; top: 0; background: var(--sand); z-index: 3; }
table.cal2 thead tr.cal2-month th { top: 0; font-weight: 700; padding: .35rem .5rem; text-align: left; }
table.cal2 thead tr:nth-child(2) th { top: 2rem; padding: .2rem 0; }
table.cal2 thead .wd { display: block; font-size: .7rem; color: var(--muted); font-weight: 400; }
table.cal2 thead .dn { display: block; font-weight: 700; }
table.cal2 thead th.we { background: #ebe3d0; }
table.cal2 thead th.today { background: var(--sea); color: #fff; }
table.cal2 thead th.today .wd { color: #fff; }
table.cal2 th.rowhead { position: sticky; left: 0; z-index: 2; background: var(--sand); text-align: left; padding: .25rem .7rem .25rem .5rem; width: 7rem; font-weight: 600; }
table.cal2 thead th.rowhead { z-index: 4; }
table.cal2 tr.cal2-type th.rowhead { position: sticky; background: #e6efee; font-size: .95rem; padding: .5rem; white-space: normal; }
table.cal2 tr.r-booked th.rowhead, table.cal2 tr.r-blocked th.rowhead { font-weight: 400; color: var(--muted); }
table.cal2 tr.r-free td.free { background: #d9efdf; }
table.cal2 tr.r-free td.part { background: #fff0c2; }
table.cal2 tr.r-free td.full { background: #f2c4bf; }
table.cal2 tr.r-free td.today { box-shadow: inset 0 0 0 2px var(--sea); }
table.cal2 tr.r-free td.saved { outline: 2px solid #2e8b57; outline-offset: -2px; }
table.cal2 tr.r-free td.saving { opacity: .55; }
table.cal2 .free-input { width: 100%; box-sizing: border-box; border: 0; background: transparent; text-align: center; font: inherit; font-weight: 700; padding: .4rem 0; min-width: 0; -moz-appearance: textfield; }
table.cal2 .free-input:focus { outline: 2px solid var(--sea); background: #fff; }
table.cal2 .free-input:disabled { color: #999; font-weight: 400; }
table.cal2 tr.r-booked td, table.cal2 tr.r-blocked td { color: #555; padding: .15rem 0; height: 1.4rem; }
table.cal2 tr.r-booked td.has { background: #e1ecf7; font-weight: 700; cursor: help; }
table.cal2 tr.r-blocked td.has { background: #ececec; }
table.cal2 details.mass { display: inline-block; margin-left: 1rem; font-weight: 400; font-size: .85rem; }
table.cal2 details.mass summary { cursor: pointer; color: var(--sea); }
.mass-form { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; padding: .5rem 0; }
.mass-form input[type="number"] { width: 4rem; }

/* Datumsfelder im deutschen Format (date-de.js): Knopf und Auswahlfeld werden per Inline-Stil im Skript platziert */
.date-de-wrap { display: block; position: relative; }
.date-de-btn:hover { filter: brightness(.92); }
.season-rows { display: grid; gap: .6rem; margin-bottom: 1rem; max-width: 60rem; }
.season-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; }
.season-row strong { min-width: 8.5rem; }
.season-row label { display: flex; flex-direction: row; align-items: center; gap: .4rem; }
.season-row input { width: 6.5rem; }
.holiday-events { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; max-width: 36rem; margin-bottom: 1rem; }
.small { font-size: .9rem; }
.bulk-form .row { margin-bottom: .5rem; }
.bulk-table td:nth-child(2) { text-align: right; }
.bulk-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
