/* Sanna Commons styles. The brand palette and fonts are defined once, here.
   Brand: Sri's Sanna Commons identity (Brand/README.txt), in the Sanna Studio
   family. Contrast (WCAG): charcoal on cream ~12:1 for text and buttons;
   brand terracotta on cream is only ~3.4:1, so it's for the logo, rings and
   decoration, never small text; links use the darker terracotta (~4.8:1). */

/* ── fonts (self-hosted: no third-party font requests; SIL OFL, see fonts/) ─ */
@font-face { font-family: "Lora"; font-weight: 600; font-style: normal; font-display: swap;
             src: url("/static/fonts/lora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
             src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
             src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); }

/* ── palette ──────────────────────────────────────────────────────────────── */
:root {
  --cream: #F2EDE3;            /* page background */
  --charcoal: #2B2B28;         /* text, buttons */
  --terracotta: #C0673A;       /* brand accent: decoration only */
  --terracotta-dark: #A0522D;  /* links and focus: 4.8:1 on cream */
  --paper: #FBF8F2;            /* raised surfaces: menu, cards, inputs */
  --line: #DDD5C7;             /* borders */
  --muted: #6B675F;            /* secondary text: 4.8:1 on cream */
  --error: #A4262C;
  --ok: #1E6B3A;
  --heading: "Lora", Georgia, "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ── base ─────────────────────────────────────────────────────────────────── */
body { font-family: var(--body); background: var(--cream); color: var(--charcoal);
       max-width: 40rem; margin: 0 auto 2rem; padding: 0 1rem; line-height: 1.55; }
h1, h2 { font-family: var(--heading); font-weight: 600; }
h1 { margin-bottom: 0.25rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 0.25rem; }
a { color: var(--terracotta-dark); }
:focus-visible { outline: 2px solid var(--terracotta-dark); outline-offset: 2px; }
ul { padding-left: 1.1rem; }
code { font-size: 0.85em; }
.muted { color: var(--muted); font-size: 0.9rem; }
.small { font-size: 0.8rem; word-break: break-all; }
.error { color: var(--error); }
.saved { color: var(--ok); }

/* ── header and menu ──────────────────────────────────────────────────────── */
nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: center;
      padding: 0.9rem 0; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
nav .brand { margin-right: auto; line-height: 0; }
nav .brand img { height: 2rem; width: auto; }
nav form { margin: 0; }
.menu { position: relative; }
.menu summary { cursor: pointer; color: var(--terracotta-dark); list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; }
.menu-items { position: absolute; right: 0; top: 1.75rem; z-index: 10; min-width: 11rem;
              background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
              padding: 0.5rem 0.9rem; box-shadow: 0 4px 14px rgba(43, 43, 40, 0.10);
              display: flex; flex-direction: column; gap: 0.45rem; }
.menu-heading { color: var(--muted); font-size: 0.8rem; text-transform: uppercase;
                letter-spacing: 0.04em; margin-top: 0.25rem; }
.menu-items .sub { padding-left: 0.6rem; }
.menu-items button.link { text-align: left; }

/* ── footer ───────────────────────────────────────────────────────────────── */
footer.site { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line);
              display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* ── buttons and forms ────────────────────────────────────────────────────── */
button, a.button { font: inherit; display: inline-block; padding: 0.5rem 1rem; border: 0;
                   border-radius: 6px; background: var(--charcoal); color: var(--cream);
                   cursor: pointer; text-decoration: none; }
button.link { background: none; color: var(--terracotta-dark); padding: 0;
              text-decoration: underline; font-size: inherit; }
form { margin: 1.25rem 0; }
label { font-weight: 600; }
input, textarea, select { font: inherit; padding: 0.5rem; margin: 0.35rem 0 0.75rem;
        width: 100%; max-width: 22rem; box-sizing: border-box; border: 1px solid var(--line);
        border-radius: 6px; background: var(--paper); color: var(--charcoal); }
textarea { max-width: 100%; }
input[type="radio"] { width: auto; margin: 0 0.4rem 0 0; accent-color: var(--charcoal); }
[aria-invalid="true"] { border-color: var(--error); }
.field { margin-bottom: 0.5rem; }
.field > label { display: block; }
.field .error { margin: -0.4rem 0 0.75rem; font-size: 0.9rem; }
.label { font-weight: 600; display: block; margin-bottom: 0.35rem; }
.choice { font-weight: normal; display: block; margin: 0.25rem 0; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.1rem 0 0; }
.cancel { margin-left: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.actions form { margin: 0; }

/* ── profile ──────────────────────────────────────────────────────────────── */
.headline { font-size: 1.15rem; font-weight: 600; margin: 0.75rem 0; }
.prose { white-space: pre-line; }
.quote { border-left: 3px solid var(--terracotta); padding-left: 1rem; margin: 1.25rem 0;
         font-style: italic; white-space: pre-line; }
.attr { color: var(--muted); font-size: 0.85rem; font-style: normal; margin-top: 0.5rem; }
.notice { background: var(--paper); border: 1px solid var(--line);
          border-left: 4px solid var(--terracotta); border-radius: 8px;
          padding: 0.75rem 1rem; margin: 1.25rem 0; }
.notice p { margin: 0.25rem 0; }
.notice form { margin: 0.5rem 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
        padding: 0.25rem 1rem 1rem; }

/* ── admin ────────────────────────────────────────────────────────────────── */
.summary { font-size: 0.95rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.75rem 0 1rem;
           padding: 0; border: 0; font-size: 0.9rem; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem 0.4rem 0; border-bottom: 1px solid var(--line);
         white-space: nowrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem;
         font-size: 0.9rem; margin: 0.75rem 0 1.25rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }  /* long links wrap on phones */
/* Queue: one card per item; "Seen before" stands out so repeat visitors are noticed */
ul.queue { list-style: none; padding: 0; }
.queue-row { margin-bottom: 0.75rem; padding: 0.6rem 1rem; overflow-wrap: anywhere; }
.queue-row p { margin: 0.2rem 0; }
.queue-kind { font-weight: 600; }
.seen-before { color: var(--terracotta-dark); font-size: 0.85rem; font-weight: 600; }
.history { font-size: 0.9rem; }
.history li { margin-bottom: 0.5rem; }

/* ── profile edit: provider / seeker sections (no JavaScript) ─────────────── */
/* The form is a column so sections can be reordered: About you, then the
   "I offer services" checkbox; unticked, the provider sections hide and "What you
   look for" moves up under it. The server ignores provider answers when unticked. */
.profile-form { display: flex; flex-direction: column; }
.profile-form > .about { order: -3; }
.profile-form > .offers { order: -2; }
.profile-form:has(#offers:not(:checked)) .provider-only { display: none; }
.profile-form:has(#offers:not(:checked)) .seeker-box { order: -1; }
.profile-form .form-actions { order: 1; margin-top: 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 0.75rem; min-width: 0; }
legend { padding: 0; }
input[type="checkbox"] { width: auto; margin: 0 0.4rem 0 0; accent-color: var(--charcoal); }
.options.columns { columns: 2 12rem; column-gap: 1.5rem; }
.choices .choice { break-inside: avoid; }
details.fold { border-top: 1px solid var(--line); padding-top: 0.75rem; margin: 1rem 0; }
details > summary { cursor: pointer; font-family: var(--heading); font-weight: 600;
                    font-size: 1.05rem; margin-bottom: 0.5rem; }
/* "Where do you need help?": its own shaded box, so providers don't read it as
   criteria for their clients. */
/* The shading extends 1rem beyond the column on each side (negative margin =
   padding), so the text inside lines up with the rest of the page. */
.seeker-box { background: #E9E2D4; border-radius: 10px; padding: 0.9rem 1rem 0.5rem;
              margin: 1rem -1rem; }
.seeker-box input, .seeker-box textarea { background: var(--paper); }
/* Queue: choose an action, and its fields appear under it (no JavaScript) */
.choose-action .option { margin: 0 0 0.6rem; }
.choose-action .option .hint { margin-left: 1.6rem; }
.choose-action .option-fields { display: none; margin: 0.35rem 0 0.25rem 1.6rem; }
.choose-action .option:has(input[type="radio"]:checked) .option-fields { display: block; }
/* Admin search */
.search-results { padding-left: 1.4rem; }
.search-results li { margin-bottom: 0.75rem; padding: 0.6rem 1rem; }
.search-results p { margin: 0.25rem 0; }
.result-name { font-weight: 600; }
.rating { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; margin: 0.4rem 0 0; }
button.chosen { padding: 0.15rem 0.6rem; font-size: 0.9rem; }
.result-reason { font-weight: 600; }
.admin-reveal { font-size: 0.85rem; margin-top: 0.3rem; }
.admin-reveal summary { font-family: var(--body); font-size: 0.85rem; font-weight: 400; color: var(--muted); }
/* Invite links: easy to select and copy */
input.copy-link { max-width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.inline-form { display: inline; margin: 0 0 0 0.5rem; }
.copy-row { display: flex; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }
.copy-row input.copy-link { margin: 0; }
.copy-button { white-space: nowrap; }
/* Admin › System: one line per section, open for the detail */
.system-sections { border-top: 1px solid var(--line); }
details.system { border-bottom: 1px solid var(--line); padding: 0.55rem 0; }
details.system > summary { font-family: var(--body); font-size: 1rem; font-weight: 400;
                           margin: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; }
.sys-name { font-weight: 600; min-width: 7.5rem; }
.sys-line { color: var(--muted); }
details.system[open] > summary { margin-bottom: 0.4rem; }
/* Admin › Settings */
fieldset.setting { border-top: 1px solid var(--line); padding-top: 0.5rem; margin-bottom: 1.25rem; }
fieldset.setting legend h2 { margin: 0.5rem 0 0.25rem; }
/* System sections: an arrow that turns when a line opens, so it's clear they open */
details.system > summary { cursor: pointer; list-style: none; align-items: baseline;
                           padding: 0.15rem 0.25rem; border-radius: 6px; }
details.system > summary::-webkit-details-marker { display: none; }
details.system > summary::before { content: "▸"; color: var(--terracotta-dark);
                                   display: inline-block; width: 1rem;
                                   transition: transform 0.15s ease; }
details.system[open] > summary::before { transform: rotate(90deg); }
details.system > summary:hover { background: var(--paper); }
details.system > summary:focus-visible { outline: 2px solid var(--terracotta-dark); }
details.system > :not(summary) { margin-left: 1.25rem; }
