/* ==========================================================================
   Family Photo Archive — Static pages stylesheet
   photoarchive.family

   Styles the public shell (includes/public-header.php / public-footer.php) and
   the three static pages: Privacy, Terms, Contact.

   Design system (spec §2):
     Display  Playfair Display   Body  Roboto
     Palette  sage / olive / gold / cream / taupe
   Signature: the project's matted photo-frame card becomes a "mounted archival
   sheet" here — cream mat, hairline taupe border, a thin gold rule under the
   title, warm soft shadow. Legal prose reads like a document mounted in an album.
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */
:root {
    --sage:        #5C7A5C;  /* primary   */
    --olive:       #7A8C6E;  /* secondary */
    --gold:        #B5956A;  /* accent    */
    --cream:       #F2EDE4;  /* background */
    --surface:     #FAFAF8;  /* cards / sheets */
    --ink:         #333330;  /* text primary   */
    --ink-soft:    #6B6B63;  /* text secondary */
    --taupe:       #D9D2C5;  /* border / divider */

    --gold-deep:   #9c7f57;  /* gold, darkened for text/links on light */
    --sage-deep:   #4a6349;  /* sage, darkened for hover */
    --shadow:      0 1px 2px rgba(51,51,48,.05), 0 8px 24px rgba(51,51,48,.07);
    --radius:      6px;

    --measure:     68ch;     /* comfortable reading width for legal prose */
    --space:       clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
}

/* --- Reset-ish base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body.static-body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--gold-deep); }

img { max-width: 100%; height: auto; }

/* Visible keyboard focus everywhere (quality floor). */
:focus-visible {
    outline: 2px solid var(--gold-deep);
    outline-offset: 2px;
    border-radius: 3px;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    background: var(--surface);
    color: var(--ink);
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--taupe);
    border-radius: var(--radius);
    transition: top .15s ease;
    z-index: 20;
}
.skip-link:focus { top: 0.5rem; }

/* --- Top bar -------------------------------------------------------------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--taupe);
}
.topbar__inner {
    max-width: 76rem;
    margin: 0 auto;
    padding: 0.85rem var(--space);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}
.brand__mark {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid var(--gold);
    border-radius: 2px;
    position: relative;
    flex: none;
}
.brand__mark::after {          /* a little "mounted photo" tick */
    content: "";
    position: absolute;
    inset: 3px;
    border-top: 2px solid var(--sage);
}
.brand__name {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font: inherit;
    font-weight: 500;
    line-height: 1;
    padding: 0.6rem 1.05rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn--solid {
    background: var(--sage);
    color: #fff;
}
.btn--solid:hover { background: var(--sage-deep); color: #fff; }
.btn--ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--taupe);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn[disabled] { opacity: .6; cursor: default; }

/* --- Page column ---------------------------------------------------------- */
.page {
    flex: 1 0 auto;
    width: 100%;
    max-width: 52rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 1rem + 3vw, 3.5rem) var(--space);
}

/* --- The mounted archival sheet (signature) ------------------------------- */
.sheet {
    background: var(--surface);
    border: 1px solid var(--taupe);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* Cream "mat" framing the content, tighter on small screens. */
    padding: clamp(1.5rem, 1rem + 4vw, 3.25rem);
    position: relative;
}
.sheet::before {              /* hairline inner rule, echoing the matted-frame cards */
    content: "";
    position: absolute;
    inset: 0.6rem;
    border: 1px solid var(--taupe);
    border-radius: 3px;
    pointer-events: none;
    opacity: .55;
}
.sheet > * { position: relative; }  /* keep content above the inner rule */

/* --- Document header ------------------------------------------------------ */
.doc-head { margin-bottom: 2rem; }
.doc-eyebrow {
    font-family: "Roboto", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin: 0 0 0.5rem;
}
.doc-title {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.9rem, 1.4rem + 2.4vw, 2.75rem);
    line-height: 1.1;
    margin: 0;
    color: var(--ink);
}
.doc-rule {                    /* the thin gold accent under the title */
    width: 3.5rem;
    height: 3px;
    background: var(--gold);
    border: 0;
    margin: 1rem 0 0.9rem;
    border-radius: 2px;
}
.doc-updated {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin: 0;
}
.doc-intro {
    margin: 1.25rem 0 0;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

/* --- Legal prose ---------------------------------------------------------- */
.prose { max-width: var(--measure); }

.prose__section { margin-top: 2.25rem; }
.prose__section:first-of-type { margin-top: 1.5rem; }

.prose__section h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    font-size: 1.3rem;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 0.75rem;
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
}
/* §-marker: honest here — the document really is a numbered sequence. */
.prose__num {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-deep);
    flex: none;
    font-variant-numeric: tabular-nums;
}
.prose p { margin: 0 0 1rem; }
.prose ul {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
}
.prose li { margin: 0.35rem 0; }
.prose strong { color: var(--ink); }

/* A quiet callout for the sensitive bits (e.g. face tagging, children). */
.note {
    margin: 1.25rem 0;
    padding: 1rem 1.15rem;
    background: rgba(181, 149, 106, 0.09);
    border-left: 3px solid var(--gold);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.note p { margin: 0; }
.note p + p { margin-top: 0.6rem; }

/* --- Contact page --------------------------------------------------------- */
.contact-lead { margin-bottom: 2rem; }
.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-weight: 500;
}

.contact-gate {                /* shown to signed-out visitors */
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--cream);
    border: 1px dashed var(--taupe);
    border-radius: var(--radius);
    text-align: center;
}
.contact-gate p { margin: 0 0 1rem; color: var(--ink-soft); }
.contact-gate .btn + .btn { margin-left: 0.5rem; }

/* Form */
.form { margin-top: 1.75rem; }
.form__identity {
    font-size: 0.9rem;
    color: var(--ink-soft);
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--taupe);
}
.form__identity strong { color: var(--ink); }

.field { margin-bottom: 1.25rem; }
.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 0.4rem;
}
.field .req { color: var(--gold-deep); }

.input,
.select,
.textarea {
    width: 100%;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--taupe);
    border-radius: var(--radius);
    padding: 0.65rem 0.8rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(92, 122, 92, 0.15);
}
.textarea { min-height: 9rem; resize: vertical; line-height: 1.55; }
.select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
        linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
    background-position: right 1rem top 55%, right 0.75rem top 55%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2.25rem;
}
.field__hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--ink-soft);
}
.field__hint .count { font-variant-numeric: tabular-nums; }

/* Honeypot — visually and semantically hidden from real users. */
.hp {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.form__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* --- Flash / status messages --------------------------------------------- */
.flash {
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.flash--ok  { background: rgba(92, 122, 92, 0.12); border-color: var(--sage); color: var(--sage-deep); }
.flash--err { background: rgba(160, 82, 66, 0.10); border-color: #a85b4a; color: #8a4636; }

.form__status { margin: 0; font-size: 0.95rem; }
.form__status[data-state="ok"]  { color: var(--sage-deep); }
.form__status[data-state="err"] { color: #8a4636; }
.is-hidden { display: none !important; }

/* --- Footer --------------------------------------------------------------- */
.sitefoot {
    flex: none;
    background: var(--surface);
    border-top: 1px solid var(--taupe);
    margin-top: 3rem;
}
.sitefoot__inner {
    max-width: 76rem;
    margin: 0 auto;
    padding: 1.75rem var(--space);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
}
.sitefoot__brand {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    margin: 0;
    color: var(--ink);
}
.sitefoot__links {
    display: flex;
    gap: 1.25rem;
    margin-left: auto;
}
.sitefoot__links a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.sitefoot__links a:hover,
.sitefoot__links a[aria-current="page"] { color: var(--gold-deep); }
.sitefoot__note {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

/* --- Small screens -------------------------------------------------------- */
@media (max-width: 40rem) {
    .brand__name { font-size: 1rem; }
    .btn { padding: 0.55rem 0.85rem; }
    .form__actions { flex-direction: column; align-items: stretch; }
    .form__actions .btn { width: 100%; }
    .sitefoot__links { margin-left: 0; }
}

/* --- Respect reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}
