/* Public site – Hausarztpraxis Franusch & Milke
   One file, no frameworks, system fonts. Mobile first; wider layouts are added further down. */

:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --ink: #16243a;
    --muted: #57657b;
    --line: #dbe1ea;

    --brand: #1f5fa6;
    --brand-strong: #153f72;
    --brand-soft: #e4edf9;

    --notice-bg: #fff5d6;
    --notice-line: #e6b23a;
    --notice-ink: #4a3200;

    --open: #17794a;
    --closed: #a5412f;

    --radius: 14px;
    --radius-small: 9px;
    --shadow: 0 1px 2px rgb(23 41 44 / 6%), 0 8px 24px rgb(23 41 44 / 7%);
    --wrap: 1120px;
    --gutter: 1.125rem;
    --quickbar-height: 4rem;

    color-scheme: light;
}

/* Alternative colour schemes. Blue (above) is the default; the others are only selected
   by a query parameter: ?farbe=petrol or ?farbe=beere */
:root[data-theme="petrol"] {
    --bg: #f6f4ee;
    --ink: #17292c;
    --muted: #586a6d;
    --line: #e2ded3;
    --brand: #0e6a6c;
    --brand-strong: #0b4a4d;
    --brand-soft: #e3f0ee;
}
:root[data-theme="beere"] {
    --bg: #f8f5f3;
    --ink: #2b1c24;
    --muted: #6c5a63;
    --line: #e6dcd8;
    --brand: #8c3a5e;
    --brand-strong: #632640;
    --brand-soft: #f5e6ed;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.55;
    /* room for the fixed quick bar on phones */
    padding-bottom: calc(var(--quickbar-height) + env(safe-area-inset-bottom));
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { color: var(--brand-strong); }
address { font-style: normal; }
button, input, textarea { font: inherit; color: inherit; }

:focus-visible {
    outline: 3px solid #f0a81c;
    outline-offset: 2px;
    border-radius: 4px;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-small);
}
.skip-link:focus { top: 0.5rem; }

.icon {
    width: 1.2em;
    height: 1.2em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.875rem;
    padding: 0.55rem 1.15rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms, border-color 120ms, color 120ms;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-strong); color: #fff; }
.btn--light { background: #fff; color: var(--brand-strong); }
.btn--light:hover { background: var(--brand-soft); color: var(--brand-strong); }
.btn--ghost { background: transparent; border-color: rgb(255 255 255 / 55%); color: #fff; }
.btn--ghost:hover { background: rgb(255 255 255 / 12%); border-color: #fff; color: #fff; }
.btn--outline { background: transparent; border-color: var(--brand); color: var(--brand-strong); }
.btn--outline:hover { background: var(--brand-soft); }
.btn--small { min-height: 2.25rem; padding: 0.3rem 0.85rem; font-size: 0.9375rem; }
.btn:disabled { opacity: 0.6; cursor: progress; }

.badge {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--notice-line);
    color: #2e1f00;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: 0.1em;
}
.badge--quiet { background: var(--brand); color: #fff; }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 4rem;
}
.brand {
    display: flex;
    flex-direction: column;
    margin-right: auto;
    color: var(--ink);
    text-decoration: none;
    line-height: 1.15;
}
.brand__name { font-size: 1.125rem; font-weight: 750; letter-spacing: -0.01em; }
.brand__sub { font-size: 0.8125rem; color: var(--muted); }

.site-nav { display: none; gap: 0.25rem; }
.site-nav a {
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 550;
    text-decoration: none;
}
.site-nav a:hover { background: var(--brand-soft); color: var(--brand-strong); }
.site-nav .site-nav__extra { background: var(--notice-bg); color: var(--notice-ink); }

.site-header__call { min-height: 2.5rem; padding-block: 0.35rem; white-space: nowrap; }

/* ---------- Hero ---------- */

.hero {
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgb(255 255 255 / 14%), transparent 60%),
        linear-gradient(160deg, var(--brand) 0%, var(--brand-strong) 70%);
    color: #fff;
    padding-block: 1.5rem 1.75rem;
}
.hero__inner { display: grid; gap: 1.25rem; }
.hero__eyebrow {
    font-size: 0.875rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(255 255 255 / 80%);
}
.hero h1 {
    margin-top: 0.4rem;
    font-size: clamp(1.75rem, 1.1rem + 3.2vw, 3rem);
    font-weight: 780;
    letter-spacing: -0.02em;
}
.hero__lead { margin-top: 0.75rem; max-width: 34rem; color: rgb(255 255 255 / 88%); }
/* On phones the fixed quick bar already offers these actions; leaving them out here
   brings the notices right under the opening status. */
.hero__actions { display: none; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

.status {
    display: inline-flex;
    align-items: baseline;
    gap: 0.55rem;
    margin-top: 1.25rem;
    padding: 0.45rem 0.9rem;
    border-radius: 1.25rem;
    background: rgb(255 255 255 / 14%);
    color: #fff;
    text-decoration: none;
    font-size: 0.9875rem;
}
.status:hover { background: rgb(255 255 255 / 22%); color: #fff; }
.status__dot {
    flex: none;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: #ff9d8a;
}
.status--open .status__dot { background: #6ee7a8; box-shadow: 0 0 0 4px rgb(110 231 168 / 25%); }

/* ---------- Notices (Aktuelle Mitteilungen) ---------- */

.notices {
    align-self: start;
    background: var(--notice-bg);
    color: var(--notice-ink);
    border: 1px solid var(--notice-line);
    border-radius: var(--radius);
    padding: 1rem 1.125rem 0.375rem;
}
.notices__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.1875rem;
    font-weight: 750;
}
.notices__title .icon { width: 1.4em; height: 1.4em; color: #9a6400; }
.notices__empty { margin-top: 0.75rem; padding-bottom: 0.75rem; font-size: 0.9375rem; }
.notices__list { margin-top: 0.5rem; }
/* flat list: the notices are separated by a fine line, no cards inside the box */
.notice { padding: 0.75rem 0; border-top: 1px solid #ecd590; }
.notice__text { font-size: 1.0625rem; font-weight: 550; overflow-wrap: anywhere; }
.notice:first-child .notice__text { font-size: 1.125rem; font-weight: 650; }
.notice__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
    font-size: 0.8125rem;
    color: #7a6230;
}

/* ---------- Sections & cards ---------- */

.section { padding-block: 2rem; }
.section--tinted { background: var(--brand-soft); }
.section__title { font-size: 1.5rem; font-weight: 750; letter-spacing: -0.01em; margin-bottom: 1.25rem; }

.info-grid { display: grid; gap: 1.25rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    min-width: 0;
}
.card__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.375rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}
.card__title > .icon { color: var(--brand); width: 1.3em; height: 1.3em; }
.card__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.125rem; }

/* ---------- Opening hours ---------- */

.hours-changes {
    background: var(--notice-bg);
    border: 1px solid var(--notice-line);
    border-radius: var(--radius-small);
    color: var(--notice-ink);
    padding: 0.75rem 0.875rem;
    margin-bottom: 1rem;
}
.hours-changes h3 { font-size: 1rem; font-weight: 750; margin-bottom: 0.35rem; }
.hours-changes dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.2rem;
}
.hours-changes dt { font-weight: 600; white-space: nowrap; }
.hours-changes dd { text-align: right; }

.hours { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hours th, .hours td {
    padding: 0.6rem 0.5rem;
    border-top: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}
.hours tr:first-child th, .hours tr:first-child td { border-top: 0; }
.hours th { font-weight: 600; white-space: nowrap; }
.hours td { text-align: right; }
.hours__span { display: block; white-space: nowrap; }
.hours__note { display: block; font-size: 0.8125rem; color: #8a5a00; }
.hours .is-closed td { color: var(--muted); }
.hours .is-today th, .hours .is-today td { background: var(--brand-soft); }
/* no separator lines touching the highlighted row, so it reads as one clean block */
.hours .is-today th, .hours .is-today td,
.hours .is-today + tr th, .hours .is-today + tr td { border-top-color: transparent; }
.hours .is-today th { border-radius: var(--radius-small) 0 0 var(--radius-small); }
.hours .is-today td { border-radius: 0 var(--radius-small) var(--radius-small) 0; font-weight: 650; }

/* ---------- Contact & map ---------- */

.contact { display: grid; gap: 0.75rem; }
.contact__address { font-size: 1.0625rem; }
.contact__phone a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.375rem;
    font-weight: 750;
    text-decoration: none;
}
.facts { display: grid; gap: 0.4rem; color: var(--muted); }
.facts li { display: flex; align-items: center; gap: 0.6rem; }
.line {
    display: inline-block;
    min-width: 2.4em;
    padding: 0 0.4em;
    border-radius: 5px;
    background: #a5027d; /* BVG bus colour */
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
}

.map {
    position: relative;
    display: block;
    margin-top: 1.125rem;
    border-radius: var(--radius-small);
    overflow: hidden;
    border: 1px solid var(--line);
}
.map img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.map__hint {
    position: absolute;
    right: 0.6rem;
    top: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow);
    color: var(--brand-strong);
    font-size: 0.875rem;
    font-weight: 650;
}

/* ---------- Team ---------- */

.team { display: grid; gap: 1rem; }
.person {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
}
.person img {
    width: 6.5rem;
    height: 6.5rem;
    flex: none;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--brand-soft);
}
.person h3 { font-size: 1.25rem; font-weight: 750; }
.person__role { margin-top: 0.25rem; color: var(--muted); }

/* ---------- Footer ---------- */

.site-footer {
    background: var(--brand-strong);
    color: rgb(255 255 255 / 88%);
    font-size: 0.9375rem;
    padding-block: 1.75rem;
}
.site-footer a { color: #fff; }
.site-footer__inner { display: grid; gap: 1.25rem; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* ---------- Quick bar (phones) ---------- */

.quickbar {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgb(23 41 44 / 10%);
    padding-bottom: env(safe-area-inset-bottom);
}
.quickbar a, .quickbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: var(--quickbar-height);
    border: 0;
    background: none;
    color: var(--brand-strong);
    font-size: 0.8125rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.quickbar .icon { width: 1.5rem; height: 1.5rem; }
.quickbar a:active, .quickbar button:active { background: var(--brand-soft); }

/* ---------- Contact dialog ---------- */

.dialog {
    width: min(34rem, 100%);
    max-width: 100%;
    max-height: 100dvh;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgb(0 0 0 / 35%);
    color: var(--ink);
}
.dialog::backdrop { background: rgb(15 25 40 / 60%); }
.contact-form { display: flex; flex-direction: column; max-height: 100dvh; }
.dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--line);
}
.dialog__header h2 { font-size: 1.25rem; font-weight: 750; }
.dialog__close {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-right: -0.5rem;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
}
.dialog__close:hover { background: var(--brand-soft); }
.dialog__body { display: grid; gap: 0.875rem; padding: 1.125rem; overflow-y: auto; }
.dialog__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-top: 1px solid var(--line);
}
.contact-form__hint, .contact-form__legal { font-size: 0.9375rem; color: var(--muted); }

.field { display: grid; gap: 0.3rem; }
.field > span { font-weight: 600; font-size: 0.9375rem; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input, .field textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1.5px solid #b9c4c2;
    border-radius: var(--radius-small);
    background: #fff;
    font-size: 1rem; /* 16px keeps iOS from zooming into the field */
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus, .field textarea:focus { border-color: var(--brand); outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent); }

.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-small);
    font-weight: 600;
}
.alert--success { background: #e2f4e8; color: #125c38; }
.alert--error { background: #fde7e2; color: #8c2c1c; }

/* ---------- Legal pages ---------- */

.legal { padding-block: 2rem 3rem; }
.legal .wrap { max-width: 46rem; }
.legal h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); font-weight: 780; letter-spacing: -0.02em; margin-bottom: 1.25rem; }
.legal h2 { font-size: 1.25rem; font-weight: 750; margin: 2rem 0 0.5rem; }
.legal h3 { font-size: 1.0625rem; font-weight: 700; margin: 1.25rem 0 0.35rem; }
.legal p, .legal ul { margin-bottom: 0.75rem; }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal li { margin-bottom: 0.25rem; }
.legal__updated { color: var(--muted); font-size: 0.9375rem; }

/* ---------- Inline editing ---------- */

.edit-link {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    margin-left: 0.4rem;
    border-radius: 50%;
    background: var(--notice-line);
    color: #2e1f00;
    font-size: 0.8125rem;
    vertical-align: middle;
}
.edit-link:hover { background: #f0a81c; color: #2e1f00; }
.inline-edit { display: grid; gap: 0.5rem; font-size: 1rem; font-weight: 400; }
.inline-edit__area {
    padding: 0.6rem 0.75rem;
    border: 2px dashed var(--notice-line);
    border-radius: var(--radius-small);
    background: #fffdf5;
    color: var(--ink);
}
.inline-edit__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Wider screens ---------- */

@media (max-width: 479px) {
    .site-header__call span { display: none; }
    .site-header__call { width: 2.75rem; padding: 0; }
    .dialog { height: 100dvh; border-radius: 0; }
    .contact-form { height: 100%; }
    .dialog__body { flex: 1; align-content: start; }
}

@media (min-width: 640px) {
    :root { --gutter: 1.5rem; }
    .team { grid-template-columns: 1fr 1fr; }
    .site-footer__inner { grid-template-columns: 1fr auto; align-items: end; }
}

@media (min-width: 900px) {
    body { padding-bottom: 0; }
    .quickbar { display: none; }
    .site-nav { display: flex; }
    .hero { padding-block: 3.5rem 4rem; }
    .hero__actions { display: flex; }
    .hero__inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; align-items: center; }
    .notices { padding: 1.25rem 1.375rem 0.5rem; }
    .section { padding-block: 3rem; }
    .info-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
    .card { padding: 1.75rem; }
    .person { padding: 1.5rem; gap: 1.5rem; }
    .person img { width: 8.5rem; height: 8.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn { transition: none; }
}

@media print {
    .site-header, .quickbar, .hero__actions, .card__actions, .map, .site-footer__links, .edit-link { display: none; }
    body { background: #fff; padding: 0; }
    .hero { background: none; color: #000; }
    .card { box-shadow: none; }
}
