/* Kaffeehaus de Châtillon motif: the venue's own red, parchment, ink and
   gilt, set in its own typefaces (Vollkorn for display, Libre Baskerville
   for text), with a copperplate script for the two engraved lines.
   One memorable element: the invitation as a gilt baroque cartouche. */

:root {
    --red: #8e0505;
    --red-deep: #6d0303;
    --parchment: #e6e0db;
    --paper: #fbf8f4;
    --paper-deep: #f5efe7;
    --ink: #000c10;
    --ink-soft: #3d3a38;
    --gilt: #b8924e;
    --gilt-pale: #d9c69a;
    --gilt-faint: #ede3cc;
    --leaf: #2f5d2a;
    --display: "Vollkorn", "Times New Roman", serif;
    --text: "Libre Baskerville", Georgia, serif;
    --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
    --frame: 44px; /* how far the corner scrolls reach in */
    --frame-inset: 5px; /* gap between the paper edge and the frame */
}

* {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    background: var(--parchment) url("/static/damask.svg") center top / 96px
        96px;
    color: var(--ink);
    font-family: var(--text);
    font-size: 17px;
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
@media (max-width: 380px) {
    body {
        font-size: 16px;
    }
}
a {
    color: var(--red);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
a:hover {
    color: var(--red-deep);
}
:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

.page {
    flex: 1;
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    padding: clamp(20px, 5vw, 56px) clamp(10px, 3vw, 24px) 24px;
}

/* The card ----------------------------------------------------------------
   Paper, a gilt double fillet with acanthus corners drawn by a border-image
   overlay, and a soft shadow so it sits on the salon wallpaper. */
.card {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--gilt);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.7) inset,
        0 22px 50px -28px rgba(0, 12, 16, 0.55),
        0 2px 6px -2px rgba(0, 12, 16, 0.2);
    margin: 0 0 clamp(28px, 5vw, 48px);
}
.card::before {
    content: "";
    position: absolute;
    inset: var(--frame-inset);
    border: var(--frame) solid transparent;
    border-image: url("/static/frame.svg") 40 / var(--frame) stretch;
    pointer-events: none;
    z-index: 1;
}
@media (max-width: 480px) {
    :root {
        --frame: 32px;
        --frame-inset: 4px;
    }
}

.card-head {
    background: var(--red) url("/static/damask-red.svg") center top / 96px 96px;
    color: var(--paper);
    text-align: center;
    padding: clamp(32px, 6vw, 44px) 24px 18px;
    border-bottom: 1px solid var(--gilt);
    position: relative;
}
.card-head::after {
    /* the second, inner fillet under the band */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3px;
    border-top: 1px solid rgba(184, 146, 78, 0.6);
}
.card-head .crest {
    display: block;
    margin: 0 auto 10px;
    height: auto;
    filter: drop-shadow(0 0 14px rgba(217, 198, 154, 0.55))
        drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.venue-line {
    margin: 0;
    font-family: var(--display);
    font-size: 1.1rem;
    letter-spacing: 0.06em;
    font-variant: small-caps;
    color: var(--gilt-pale);
}

.card-body {
    padding: clamp(24px, 6vw, 40px) clamp(22px, 7vw, 60px)
        clamp(28px, 6vw, 44px);
}
.card > .card-body:last-child {
    padding-bottom: calc(var(--frame) + 16px);
}

.rule {
    border: 0;
    height: 22px;
    margin: 0 clamp(36px, 10vw, 70px);
    background:
        url("/static/fleuron.svg") center / 154px 22px no-repeat,
        linear-gradient(var(--gilt-pale), var(--gilt-pale)) center / 100% 1px
            no-repeat;
}
.rule::after {
    content: none;
}

/* The invitation text: centred, as stationery is --------------------- */
.invite-text {
    text-align: center;
}
.invite-text p {
    margin: 0;
}
.hosts {
    font-family: var(--display);
    font-size: clamp(1.45rem, 4.5vw, 1.7rem);
    line-height: 1.25;
    letter-spacing: 0.01em;
}
.request {
    font-family: var(--script);
    font-size: clamp(1.55rem, 5vw, 1.9rem);
    line-height: 1.3;
    color: var(--ink-soft);
    margin-top: 6px !important;
}
.invite-text h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.05rem, 7vw, 2.9rem);
    line-height: 1.12;
    color: var(--red);
    margin: 12px auto 22px;
    max-width: 14em;
    text-wrap: balance;
}
.when {
    font-family: var(--display);
    font-size: clamp(1.2rem, 3.6vw, 1.35rem);
    line-height: 1.4;
}
.where {
    margin-top: 18px !important;
    color: var(--ink-soft);
}

/* Particulars: a definition list, not cards -------------------------- */
.particulars dl {
    margin: 0;
}
.particulars dl > div {
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: 0 22px;
    padding: 11px 0;
    border-top: 1px dotted var(--gilt-pale);
}
.particulars dl > div:first-child {
    border-top: 0;
    padding-top: 0;
}
.particulars dt {
    font-family: var(--display);
    font-size: 1.15rem;
    color: var(--red);
}
.particulars dd {
    margin: 0;
}
@media (max-width: 480px) {
    .particulars dl > div {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Headings and forms --------------------------------------------------- */
h2,
.page-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.75rem;
    line-height: 1.2;
    margin: 0 0 8px;
}
.page-title {
    font-size: clamp(1.9rem, 6vw, 2.2rem);
    margin-bottom: 4px;
}
h2.script {
    font-family: var(--script);
    font-weight: 400;
    font-size: clamp(2.2rem, 7vw, 2.7rem);
    line-height: 1.15;
    color: var(--red);
    margin-bottom: 10px;
    text-align: center;
}
.lede {
    margin: 0 0 22px;
    color: var(--ink-soft);
}

.form {
    display: grid;
    gap: 20px;
}
.field {
    display: grid;
    gap: 6px;
    align-content: start;
}
.field > span,
.field legend {
    font-family: var(--display);
    font-size: 1.1rem;
}
.field small {
    font-family: var(--text);
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin-left: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--gilt);
    box-shadow: inset 0 1px 2px rgba(0, 12, 16, 0.08);
    border-radius: 0;
    padding: 11px 13px;
    width: 100%;
}
input:focus,
textarea:focus {
    border-color: var(--red);
    outline: 2px solid var(--red);
    outline-offset: 0;
}
textarea {
    resize: vertical;
}

fieldset.party {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
fieldset.party legend {
    padding: 0;
    margin-bottom: 6px;
}
.choice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--gilt);
    background: #fff;
    cursor: pointer;
}
.choice + .choice {
    margin-top: -1px;
}
.choice input {
    accent-color: var(--red);
    width: 18px;
    height: 18px;
    margin: 0;
    flex: none;
}
.choice span {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.choice em {
    font-style: normal;
    font-family: var(--display);
    color: var(--red);
}
.choice:has(input:checked) {
    border-color: var(--red);
    box-shadow: inset 0 0 0 1px var(--red);
    background: var(--paper);
    position: relative;
}
.field-stack {
    display: grid;
    gap: 20px;
    align-content: start;
}
.guest-field {
    display: none;
}
.form:has(input[name="party"][value="2"]:checked) .guest-field {
    display: grid;
}

/* A red seal with a gilt fillet inside its edge */
.button {
    font-family: var(--display);
    font-size: 1.2rem;
    background: var(--red);
    color: #fff;
    border: 1px solid var(--red-deep);
    box-shadow:
        inset 0 0 0 2px var(--red),
        inset 0 0 0 3px var(--gilt),
        0 4px 10px -6px rgba(109, 3, 3, 0.8);
    padding: 13px 26px;
    cursor: pointer;
    justify-self: start;
    border-radius: 0;
}
.button:hover {
    background: var(--red-deep);
    box-shadow:
        inset 0 0 0 2px var(--red-deep),
        inset 0 0 0 3px var(--gilt-pale);
}
@media (max-width: 480px) {
    .form > .button {
        justify-self: stretch;
    }
}

.trap {
    position: absolute;
    left: -9999px;
    top: -9999px;
}
.fine {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin: 0;
}
.keep {
    margin-top: 26px;
}

.error,
.flash,
.notice {
    margin: 0 0 20px;
    padding: 12px 16px;
    border: 1px solid var(--red);
    border-left-width: 4px;
    background: #f6e9e9;
}
.flash,
.notice {
    border-color: var(--gilt);
    background: var(--gilt-faint);
}

/* Registration page ---------------------------------------------------- */
.status {
    font-family: var(--display);
    font-size: 1.25rem;
    color: var(--red);
    margin: 0 0 24px;
}
.status.paid {
    color: var(--leaf);
}
.details {
    margin: 0 0 26px;
}
.details > div {
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: 0 22px;
    padding: 9px 0;
    border-top: 1px dotted var(--gilt-pale);
}
.details > div:last-child {
    border-bottom: 1px dotted var(--gilt-pale);
}
.details dt {
    font-family: var(--display);
    font-size: 1.1rem;
    color: var(--ink-soft);
}
.details dd {
    margin: 0;
}
@media (max-width: 480px) {
    .details > div {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Riddle ----------------------------------------------------------------- */
.riddle {
    padding: clamp(28px, 6vw, 36px) clamp(30px, 8vw, 56px);
    text-align: center;
    background: var(--paper-deep);
}
.riddle h2 {
    font-size: 1.35rem;
}
.verse {
    font-family: var(--display);
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.5;
    margin: 8px 0 14px;
}

/* Tables ------------------------------------------------------------------ */
.guests {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    line-height: 1.5;
}
.guests th,
.guests td {
    text-align: left;
    padding: 10px 10px;
    border-bottom: 1px solid var(--gilt-pale);
    vertical-align: top;
}
.guests th {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.05rem;
    color: var(--red);
    border-bottom-color: var(--gilt);
    white-space: nowrap;
}
.guests tr.paid td:nth-child(3) {
    color: var(--leaf);
}

/* Colophon --------------------------------------------------------------- */
.colophon {
    text-align: center;
    padding: 28px 16px 44px;
    color: #5c5652;
    font-size: 0.88rem;
    background: rgba(251, 248, 244, 0.55);
    border-top: 1px solid var(--gilt-pale);
}
.colophon p {
    margin: 0 0 8px;
}
.colophon .motto {
    font-family: var(--display);
    font-variant: small-caps;
    letter-spacing: 0.14em;
    color: var(--gilt);
    font-size: 1.05rem;
}
.colophon a {
    color: #5c5652;
}

@media (prefers-reduced-motion: no-preference) {
    .button {
        transition: background-color 0.15s ease;
    }
}
@media print {
    body {
        background: #fff;
    }
    .card {
        box-shadow: none;
    }
    .rsvp,
    .riddle,
    .colophon {
        display: none;
    }
}

/* Public guest list -------------------------------------------------------- */
.names {
    list-style: none;
    padding: 0;
    margin: 18px 0 20px;
    columns: 2;
    column-gap: 32px;
    font-family: var(--display);
    font-size: 1.2rem;
    line-height: 1.7;
}
.names li {
    break-inside: avoid;
}
@media (max-width: 480px) {
    .names {
        columns: 1;
    }
}

/* Admin ----------------------------------------------------------------------
   Desktops get the full grid; below that each reservation becomes a
   labelled block, two columns wide on an iPad and one on a phone. */
.page:has(.admin) {
    max-width: 1180px;
}
.admin .card-body {
    padding-left: clamp(18px, 4vw, 44px);
    padding-right: clamp(18px, 4vw, 44px);
}
.admin .guests {
    font-size: 0.9rem;
}
.admin .guests td {
    padding: 12px 10px;
}
.admin .guests td.actions {
    min-width: 250px;
}
.admin .guests td[data-label="Reserved"],
.admin .guests td[data-label="Sent"] {
    white-space: nowrap;
}
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -8px;
    padding: 0 8px;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.actions form {
    display: contents;
}
button.link {
    font: inherit;
    color: var(--red);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
button.link.danger {
    color: #5c5652;
}
.actions button.link {
    font-size: 0.85rem;
    line-height: 1.2;
    padding: 6px 10px;
    border: 1px solid var(--gilt-pale);
    background: var(--paper);
    color: var(--red);
    text-decoration: none;
    white-space: nowrap;
}
.actions button.link:hover {
    border-color: var(--red);
}
.actions button.link.danger {
    color: #5c5652;
}
.actions button.link.danger:hover {
    border-color: #5c5652;
}

.form.two-col {
    grid-template-columns: 1fr 1fr;
    max-width: 860px;
}
.form.two-col .span {
    grid-column: 1 / -1;
}
@media (max-width: 640px) {
    .form.two-col {
        grid-template-columns: 1fr;
    }
}
h2.sub {
    margin-top: 32px;
    font-size: 1.35rem;
}
code {
    font-size: 0.9em;
    background: var(--gilt-faint);
    padding: 1px 5px;
}

.signout {
    margin: -14px 0 22px;
}

@media (max-width: 1000px) {
    .admin .guests,
    .admin .guests tbody,
    .admin .guests tr,
    .admin .guests td {
        display: block;
    }
    .admin .guests thead {
        display: none;
    }
    .admin .guests tr {
        border: 1px solid var(--gilt-pale);
        background: #fff;
        padding: 6px 14px 12px;
        margin-bottom: 12px;
    }
    .admin .guests td {
        display: grid;
        grid-template-columns: 6.5em 1fr;
        gap: 0 12px;
        padding: 7px 0;
        border-bottom: 1px dotted var(--gilt-pale);
    }
    .admin .guests td:empty {
        display: none;
    }
    .admin .guests td::before {
        content: attr(data-label);
        font-family: var(--display);
        color: var(--ink-soft);
    }
    .admin .guests td[colspan] {
        grid-template-columns: 1fr;
    }
    .admin .guests td[colspan]::before {
        content: none;
    }
    .admin .guests td.actions {
        display: flex;
        border-bottom: 0;
        padding-top: 12px;
    }
    .admin .guests td.actions::before {
        content: none;
    }
    .admin .guests td.actions button.link {
        padding: 9px 12px;
        font-size: 0.9rem;
    }
}
@media (min-width: 600px) and (max-width: 1000px) {
    .admin .guests tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 28px;
        padding: 6px 18px 14px;
    }
    .admin .guests td.actions,
    .admin .guests td[data-label="Note"],
    .admin .guests td[colspan] {
        grid-column: 1 / -1;
    }
    .admin .guests td {
        grid-template-columns: 5.5em 1fr;
    }
}
