/* ==========================================================================
   Frie & Lars — 1 mei 2027 — Kinderboerderij Wilrijk
   Huisstijl afgeleid van de save-the-date: aquarel, crème papier,
   terracotta handschrift en olijfkleurige kapitalen.
   ========================================================================== */

/* ---------- Lettertypen (lokaal, OFL) ---------- */

@font-face {
    font-family: "Cormorant Garamond";
    src: url("fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Cormorant Garamond";
    src: url("fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "EB Garamond";
    src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "EB Garamond";
    src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "EB Garamond";
    src: url("fonts/eb-garamond-latin-600-normal.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "EB Garamond";
    src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Mrs Saint Delafield";
    src: url("fonts/mrs-saint-delafield-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ---------- Ontwerp-tokens ---------- */

:root {
    /* Kleuren, gemeten op de save-the-date */
    --terracotta: #a85d34;
    --terracotta-deep: #8a4724;
    --terracotta-soft: #d99a72;
    --terracotta-wash: #f3dfcc;
    --ink: #4a4733;
    --ink-soft: #6e6a52;
    --ink-faint: #9a957c;
    --sage: #8e9a66;
    --sage-deep: #5f6b3c;
    --sage-wash: #e5e8d3;
    --straw: #e9c77a;
    --straw-wash: #f7ead0;
    --wood: #93693d;
    --sky: #e7ebe8;
    --cream: #f8f1e2;
    --paper: #fbf7ee;
    --line: #dccfb4;
    --line-soft: #e9dfca;
    --danger: #a4402c;

    /* Lettertypen */
    --font-script: "Mrs Saint Delafield", "Brush Script MT", cursive;
    --font-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
    --font-body: "EB Garamond", Georgia, "Times New Roman", serif;

    /* Maten */
    --sheet-max: 1024px;
    --content-max: 44rem;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-soft: 0 1px 2px rgb(74 71 51 / .06), 0 8px 28px -12px rgb(74 71 51 / .22);
    --shadow-lift: 0 2px 4px rgb(74 71 51 / .08), 0 18px 40px -16px rgb(74 71 51 / .32);
    --ease-out: cubic-bezier(.22, .8, .24, 1);

    /* Papierstructuur */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42  0 0 0 0 .36  0 0 0 0 .24  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

    color-scheme: light;
    accent-color: var(--terracotta);
}

/* ---------- Basis ---------- */

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

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: clamp(1.08rem, 1rem + .3vw, 1.2rem);
    line-height: 1.6;
    color: var(--ink);
    background: var(--cream);
    font-variant-numeric: lining-nums;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--terracotta);
    text-decoration-thickness: 1px;
    text-underline-offset: .2em;
    transition: color .2s;
}

a:hover {
    color: var(--terracotta-deep);
}

:focus-visible {
    outline: 2px solid var(--terracotta);
    outline-offset: 3px;
    border-radius: 6px;
}

::selection {
    background: var(--terracotta-wash);
    color: var(--terracotta-deep);
}

/* FocusOnNavigate zet de focus op de h1; geen zichtbare rand daarvoor */
h1:focus {
    outline: none;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 500;
    line-height: 1.15;
    text-wrap: balance;
}

p {
    margin: 0 0 1em;
    text-wrap: pretty;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 1em;
    height: 1em;
    flex: none;
}

/* ---------- Typografie ---------- */

/* Olijfkleurige, gespatieerde kapitalen, zoals "SAVE THE DATE" op de kaart */
.caps {
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .24em;
    color: var(--ink);
}

.kicker {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .3em;
    color: var(--ink-soft);
}

.script {
    font-family: var(--font-script);
    font-weight: 400;
    color: var(--terracotta);
    letter-spacing: 0;
    line-height: 1;
}

.section-title {
    display: grid;
    justify-items: center;
    gap: .15em;
    text-align: center;
    margin-bottom: 2rem;
}

.section-title .script {
    font-size: clamp(3.2rem, 2.4rem + 3.5vw, 4.6rem);
    padding: .1em .2em 0;
}

.lead {
    font-size: 1.15em;
    color: var(--ink-soft);
    text-align: center;
    max-width: 34rem;
    margin-inline: auto;
}

.muted {
    color: var(--ink-soft);
}

.center {
    text-align: center;
}

/* ---------- Hartje met lijntjes, zoals onder de namen op de kaart ---------- */

.heart-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(.8rem, 2vw, 1.2rem);
    color: var(--terracotta);
    margin: 1.2rem auto;
    width: min(100%, 22rem);
}

.heart-divider::before,
.heart-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: .75;
}

.heart-divider .icon {
    width: 1.35rem;
    height: 1.35rem;
}

/* ---------- Knoppen ---------- */

.btn {
    --btn-bg: var(--terracotta);
    --btn-fg: var(--paper);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65em;
    min-height: 3.25rem;
    padding: .8rem 1.9rem;
    border: 0;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), 0 10px 22px -12px rgb(138 71 36 / .75);
    transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background-color .2s;
    -webkit-tap-highlight-color: transparent;
}

/* dun binnenrandje, als een gedrukte kaart */
.btn::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: inherit;
    border: 1px solid rgb(251 247 238 / .45);
    pointer-events: none;
}

.btn:hover {
    --btn-bg: var(--terracotta-deep);
    color: var(--btn-fg);
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12), 0 16px 28px -14px rgb(138 71 36 / .85);
}

.btn:active {
    transform: translateY(0);
}

.btn .icon {
    width: 1.25em;
    height: 1.25em;
    transition: transform .3s var(--ease-out);
}

.btn:hover .icon-arrow {
    transform: translateX(4px);
}

.btn-ghost {
    --btn-bg: transparent;
    --btn-fg: var(--terracotta);
    box-shadow: inset 0 0 0 1px var(--terracotta);
}

.btn-ghost::before {
    display: none;
}

.btn-ghost:hover {
    --btn-bg: rgb(168 93 52 / .07);
    --btn-fg: var(--terracotta-deep);
    box-shadow: inset 0 0 0 1px var(--terracotta-deep);
}

.btn-small {
    min-height: 2.6rem;
    padding: .55rem 1.3rem;
    font-size: .85rem;
}

.btn[disabled],
.btn[aria-disabled=true] {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .9rem;
}

/* ---------- Kaarten ---------- */

.card {
    position: relative;
    background: linear-gradient(180deg, rgb(255 252 244 / .86), rgb(253 248 237 / .74));
    border: 1px solid rgb(233 223 202 / .9);
    border-radius: var(--radius);
    padding: clamp(1.4rem, 1rem + 2vw, 2.2rem);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ---------- Formulieren ---------- */

.field {
    display: grid;
    align-content: start;
    gap: .45rem;
    margin-bottom: 1.4rem;
}

.field-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--ink);
}

.field-hint {
    font-size: .92em;
    font-style: italic;
    color: var(--ink-soft);
    margin-top: -.2rem;
}

.input,
.field input:not([type=radio]):not([type=checkbox]),
.field textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: rgb(255 253 248 / .85);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: .8rem 1rem;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
    appearance: none;
}

.field textarea {
    min-height: 7.5rem;
    resize: vertical;
    line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--ink-faint);
    font-style: italic;
}

.field input:hover,
.field textarea:hover {
    border-color: var(--terracotta-soft);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    background: #fffdf9;
    border-color: var(--terracotta);
    box-shadow: 0 0 0 4px rgb(168 93 52 / .14);
}

.field input.invalid,
.field textarea.invalid {
    border-color: var(--danger);
}

.validation-message,
.validation-errors {
    color: var(--danger);
    font-size: .95em;
    font-style: italic;
}

.validation-errors {
    list-style: none;
    padding: 1rem 1.2rem;
    margin: 0 0 1.5rem;
    border-radius: var(--radius-sm);
    background: rgb(164 64 44 / .07);
    border: 1px solid rgb(164 64 44 / .25);
}

.validation-errors:empty {
    display: none;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

legend {
    padding: 0;
}

/* honeypot tegen spambots */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- RSVP-formulier (het <form> zelf wordt door EditForm gerenderd) ---------- */

.rsvp-form {
    display: grid;
    gap: 1.2rem;
    max-width: var(--content-max);
    margin-inline: auto;
}

/* Stappen die alleen nodig zijn als er iemand komt (werkt zonder JavaScript) */
.rsvp-form:not(:has(.attend-yes:checked)) .needs-attendance {
    display: none;
}

/* ---------- Meldingen ---------- */

.notice {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--straw-wash);
    border: 1px solid #ecd9ad;
    color: var(--ink);
}

.notice .icon {
    width: 1.6rem;
    height: 1.6rem;
    color: var(--terracotta);
    margin-top: .1rem;
}

.notice p:last-child {
    margin-bottom: 0;
}

/* ---------- Bewegingen ---------- */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rise {
    animation: rise 1s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 120ms + 150ms);
}

@supports (animation-timeline: view()) {
    .reveal {
        animation: rise linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 22%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Blazor ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 1rem 1rem;
    z-index: 1000;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lift);
    color: var(--ink);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
    margin-left: 1rem;
}

.blazor-error-boundary {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    background: rgb(164 64 44 / .08);
    color: var(--danger);
}

.blazor-error-boundary::after {
    content: "Er is iets misgegaan.";
}
