/* Same layout as the Wainwrights gate (wainwrights/App.css), in island colours: sea navy, sand and white */
:root {
    --kw-accent: #2F6E8A;
    --kw-accent-dark: #1F5068;  /* hover state */
    --kw-accent-tint: rgba(47, 110, 138, 0.08);
    --kw-sand: #F4EEE1;
    --kw-ink: #1B3A4B;
    --kw-muted: rgba(27, 58, 75, 0.68);
    --kw-line: rgba(27, 58, 75, 0.15);
    --kw-shadow: rgba(27, 58, 75, 0.12);
    --kw-error: #A9502F;
    --kw-bg: var(--kw-sand);  /* the same ivory as the portal - cards stay white on top of it */
    --kw-card: #ffffff;
    --kw-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --kw-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--kw-bg);
    color: var(--kw-ink);
    font-family: var(--kw-sans);
    font-size: 16px;
    line-height: 1.55;
}

a { color: var(--kw-accent); }
a:hover { color: var(--kw-accent-dark); }

.kw-eyebrow { display: block; margin: 0; letter-spacing: 0.3em; font-size: 0.8rem; color: var(--kw-accent); text-transform: uppercase; }
.kw-title { display: block; margin: 0.1rem 0 0; font-family: var(--kw-serif); font-weight: 500; font-size: 2.4rem; line-height: 1.1; }
.kw-subtitle { margin: 0.4rem 0 1.5rem; color: var(--kw-muted); }
.kw-heading { margin: 0 0 1rem; font-family: var(--kw-serif); font-weight: 500; font-size: 2.2rem; line-height: 1.15; }
.kw-section-title { margin: 0 0 0.6rem; font-family: var(--kw-serif); font-weight: 600; font-size: 1.6rem; line-height: 1.2; }
.kw-subheading { margin: 1.2rem 0 0.3rem; font-size: 1rem; }
.kw-lede { margin: 0 0 1.5rem; color: var(--kw-muted); font-size: 1.1rem; }
.kw-lede.kw-prose p { margin: 0 0 0.6rem; }
.kw-note { color: var(--kw-muted); font-style: italic; }
.kw-centre { text-align: center; }
.kw-error { color: var(--kw-error); font-weight: 600; font-size: 0.9rem; margin: 0.4rem 0 0; }

.kw-card {
    background: var(--kw-card);
    border: 1px solid var(--kw-line);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px var(--kw-shadow);
}

/* gate - the couple's photo alongside the card on wide screens, as a banner above it on phones */
.kw-gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kw-gate-photo { position: relative; background: var(--kw-ink); }
.kw-gate-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.kw-gate-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.kw-gate-card { width: 100%; max-width: 420px; text-align: center; border-top: 4px solid var(--kw-accent); }
.kw-gate-card .kw-label { text-align: left; }
.kw-gate-card .kw-button { width: 100%; margin-top: 1rem; }

.kw-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.kw-input {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--kw-line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: inherit;
}
.kw-input:focus { outline: 2px solid var(--kw-accent); outline-offset: -1px; border-color: transparent; }

.kw-button {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 999px;
    background: var(--kw-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.kw-button:hover { background: var(--kw-accent-dark); }

.kw-link { background: none; border: none; color: var(--kw-muted); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* content pages */
.kw-page { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.kw-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.kw-wordmark { color: inherit; text-decoration: none; }
.kw-wordmark:hover { color: inherit; }

.kw-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.2rem 0 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--kw-line); }
.kw-nav a { padding: 0.4rem 0.9rem; border-radius: 999px; color: var(--kw-ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.kw-nav a:hover { background: var(--kw-accent-tint); }
.kw-nav a[aria-current="page"] { background: var(--kw-accent); color: #fff; }

.kw-intro { max-width: 680px; margin-bottom: 2rem; }
.kw-section { margin-bottom: 1.25rem; }
.kw-section p:last-child { margin-bottom: 0; }

/* Markdown from the portal - see templatetags/katie_and_will.py. A "> " quote is shown as a highlighted callout box */
.kw-prose > :first-child { margin-top: 0; }
.kw-prose > :last-child { margin-bottom: 0; }
.kw-prose h3 { margin: 1.2rem 0 0.3rem; font-size: 1rem; }
.kw-prose h4 { margin: 1rem 0 0.3rem; font-size: 0.95rem; color: var(--kw-muted); }
.kw-prose ul, .kw-prose ol { padding-left: 1.2rem; }
.kw-prose li { margin-bottom: 0.4rem; }
.kw-prose a { overflow-wrap: anywhere; }
/* photos added in the portal (models.Photo) - never more than 90% of the screen's width or height, so a portrait phone
   photo narrows rather than filling several screens */
.kw-prose img { display: block; max-width: min(100%, 90vw); max-height: 90vh; width: auto; height: auto; margin: 1rem auto; border-radius: 10px; }
/* a photo on a line of its own, at the display size set on the portal's Photos page (see templatetags/katie_and_will.py) */
.kw-prose .kw-photo { margin: 1.25rem auto; }
.kw-prose .kw-photo img { margin: 0 auto; }
.kw-photo--cropped img { object-fit: cover; }
/* photos on lines next to each other in the Markdown, side by side - wrapping onto another row if they don't fit */
.kw-prose .kw-photo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 1rem; margin: 1.25rem 0; }
.kw-prose .kw-photo-row .kw-photo { min-width: 0; margin: 0; }
.kw-photo figcaption { margin-top: 0.5rem; text-align: center; font-size: 0.9rem; font-style: italic; color: var(--kw-muted); }
/* one in the middle of some text */
.kw-prose img.kw-photo-inline { display: inline-block; max-height: 10rem; margin: 0.25rem; vertical-align: middle; }
.kw-prose blockquote { margin: 1rem 0; padding: 0.9rem 1rem; border-left: 4px solid var(--kw-accent); border-radius: 0 8px 8px 0; background: var(--kw-sand); }
.kw-prose blockquote p { margin: 0; }
.kw-prose blockquote p + p { margin-top: 0.5rem; }
.kw-prose em { color: var(--kw-muted); }

.kw-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kw-tile { display: block; color: inherit; text-decoration: none; border-top: 4px solid var(--kw-accent); }
.kw-tile p { margin: 0; color: var(--kw-muted); }
a.kw-tile { transition: transform 0.15s, box-shadow 0.15s; }
a.kw-tile:hover { color: inherit; transform: translateY(-2px); box-shadow: 0 6px 16px var(--kw-shadow); }

.kw-signoff { margin: 2.5rem 0 0; text-align: center; font-family: var(--kw-serif); font-size: 1.8rem; }

.kw-footer { margin-top: 3rem; text-align: center; font-size: 0.85rem; color: var(--kw-muted); }
.kw-footer a { color: inherit; }
.kw-gate-form .kw-footer { margin-top: 1.5rem; }

/* "Choose our music!" - see music.js */
.kw-optional { font-weight: 400; color: var(--kw-muted); }
.kw-hint { margin: -0.2rem 0 1rem; color: var(--kw-muted); font-size: 0.9rem; }
.kw-button--small { padding: 0.45rem 1rem; font-size: 0.9rem; }
.kw-button:disabled { opacity: 0.5; cursor: default; }
.kw-music-search-label { margin-top: 1rem; }
.kw-music-status { margin: 0.5rem 0 0; min-height: 1.2em; color: var(--kw-muted); font-size: 0.9rem; }
.kw-music-status:empty { min-height: 0; }
.kw-music-status--error { color: var(--kw-error); font-weight: 600; }
.kw-music-manual { margin-top: 1rem; }
.kw-music-manual summary { cursor: pointer; color: var(--kw-accent); font-weight: 600; }
.kw-music-manual form { margin-top: 0.8rem; display: grid; gap: 0.35rem; }
.kw-music-manual .kw-label:not(:first-child) { margin-top: 0.5rem; }
.kw-music-manual .kw-button { justify-self: start; margin-top: 0.75rem; }

.kw-songs { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.kw-song { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-top: 1px solid var(--kw-line); }
.kw-song:first-child { border-top: none; }
.kw-songs--results .kw-song { padding: 0.5rem 0; }

.kw-artwork { flex: none; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--kw-sand); }
.kw-artwork--none { display: grid; place-items: center; color: var(--kw-accent); font-size: 1.4rem; }
.kw-song-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.kw-song-title { font-weight: 600; overflow-wrap: anywhere; }
.kw-song-artist, .kw-song-extra { color: var(--kw-muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.kw-song-extra { font-size: 0.8rem; }
.kw-song-actions { flex: none; display: flex; align-items: center; gap: 0.6rem; }

.kw-sort { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0 0 0.5rem; }
.kw-sort-label { margin-right: 0.2rem; color: var(--kw-muted); font-size: 0.9rem; }
.kw-sort-button {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--kw-line); border-radius: 999px; background: #fff;
    color: var(--kw-ink); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.kw-sort-button:hover { border-color: var(--kw-accent); }
.kw-sort-button[aria-pressed="true"] { background: var(--kw-accent); border-color: var(--kw-accent); color: #fff; }

.kw-votes { flex: none; display: flex; align-items: center; gap: 0.35rem; }
.kw-vote-button {
    display: inline-flex; align-items: center; gap: 0.3rem;
    min-width: 3.6rem; height: 2.3rem; padding: 0 0.6rem;
    border: 1px solid var(--kw-line); border-radius: 999px; background: #fff;
    color: var(--kw-ink); font: inherit; font-weight: 700; cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.kw-vote-emoji { font-size: 1.1rem; line-height: 1; }
.kw-vote-count { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.kw-vote-button:hover { transform: scale(1.05); }
.kw-vote-button:active { transform: scale(0.95); }
.kw-vote-button--up:hover { border-color: #3E8A5A; }
.kw-vote-button--down:hover { border-color: var(--kw-error); }
.kw-vote-button--up.kw-vote-button--chosen { background: #E3F2E8; border-color: #3E8A5A; color: #2B6B42; }
.kw-vote-button--down.kw-vote-button--chosen { background: #F7E4DC; border-color: var(--kw-error); color: #8A3E22; }
.kw-net {
    min-width: 2.6rem; padding: 0.2rem 0.4rem; border-radius: 6px;
    text-align: center; font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums;
}
.kw-net--up { color: #2B6B42; }
.kw-net--down { color: #8A3E22; }
.kw-net--zero { color: var(--kw-muted); }

.kw-play {
    width: 2.4rem; height: 2.4rem; padding: 0;
    border: 1px solid var(--kw-accent); border-radius: 50%; background: #fff;
    color: var(--kw-accent); font-size: 0.85rem; cursor: pointer;
}
.kw-play:hover, .kw-play--playing { background: var(--kw-accent); color: #fff; }
.kw-apple { font-size: 0.75rem; color: var(--kw-muted); }

/* RSVP - see rsvp.js */
.kw-banner { margin: 0 0 1.25rem; padding: 0.9rem 1rem; border-radius: 10px; background: #E3F2E8; color: #2B6B42; font-weight: 600; }
.kw-banner--error { background: #F7E4DC; color: #8A3E22; }
.kw-banner--muted { background: var(--kw-sand); color: var(--kw-ink); }
.kw-notice { margin: 0 0 1rem; padding: 0.7rem 0.9rem; border-radius: 8px; background: var(--kw-sand); text-align: left; font-size: 0.9rem; }
.kw-rsvp-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin: 0 0 1.25rem; }
.kw-inline-form { display: inline; }
.kw-field { margin-bottom: 1.3rem; }
.kw-field:last-child { margin-bottom: 0; }
.kw-field [aria-invalid="true"] { border-color: var(--kw-error); }
.kw-fieldset { margin: 0 0 1.3rem; padding: 0; border: none; min-width: 0; }
.kw-field > .kw-fieldset { margin: 0; }
.kw-fieldset legend { padding: 0; }
.kw-help { margin: -0.15rem 0 0.45rem; color: var(--kw-muted); font-size: 0.88rem; }
.kw-choice { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.35rem 0; cursor: pointer; }
.kw-choice input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.18rem 0 0; accent-color: var(--kw-accent); }
.kw-input--short { max-width: 14rem; }
.kw-input--count { width: 6.5rem; }
textarea.kw-input { resize: vertical; }
.kw-privacy { margin-bottom: 1rem; font-size: 0.9rem; }
.kw-privacy summary { cursor: pointer; font-weight: 700; margin-bottom: 0.4rem; }
.kw-privacy p { margin: 0 0 0.6rem; color: var(--kw-muted); }
.kw-privacy strong { color: var(--kw-ink); }
.kw-consent { margin-top: 0.5rem; padding: 0.8rem; border-radius: 8px; background: var(--kw-sand); }
.kw-rsvp-submit { margin-top: 1rem; }
.kw-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 0.5rem 1rem; margin: 0; }
.kw-summary dt { color: var(--kw-muted); }
.kw-summary dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
    .kw-summary { grid-template-columns: 1fr; gap: 0.15rem; }
    .kw-summary dd { margin-bottom: 0.5rem; }
}
details.kw-card > summary { cursor: pointer; color: var(--kw-accent); font-weight: 600; }
details.kw-card[open] > summary { margin-bottom: 0.8rem; }
.kw-rsvp-resend .kw-button { margin-top: 0.75rem; }
.kw-rsvp-delete summary { color: var(--kw-error); }
.kw-button--danger { background: var(--kw-error); }
.kw-button--danger:hover { background: #832d17; }

@media (max-width: 760px) {
    .kw-gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .kw-gate-photo { height: 45vh; min-height: 260px; }
    .kw-gate-form { justify-content: flex-start; padding: 1.5rem 1rem 2.5rem; }
    .kw-title { font-size: 2rem; }
    .kw-heading { font-size: 1.9rem; }
    .kw-card { padding: 1.2rem; }
    .kw-artwork { width: 44px; height: 44px; }
    .kw-song { gap: 0.55rem; }
    .kw-song-actions { flex-direction: column; gap: 0.25rem; }  /* play button above the Apple Music link */
    /* the votes go on their own line under the song, lined up with its name */
    .kw-song--playlist { flex-wrap: wrap; }
    .kw-song--playlist .kw-votes { width: 100%; padding-left: calc(44px + 0.55rem); }
}
