/* Events: Visibility Ecosystem brand, every text pairing WCAG AAA (Context/design.md), same palette as the Toolkit Guides */

@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/vendor/montserrat-700.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("/vendor/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("/vendor/lato-700.woff2") format("woff2"); }
@font-face { font-family: "Lilita One"; font-weight: 400; font-display: swap; src: url("/vendor/lilita-one-400.woff2") format("woff2"); }

:root {
  --bg: #FFFFFF;
  --text: #0D1B2A;          /* brand black, 17.39 on white */
  --heading: #22466D;       /* indigo, 9.70 on white */
  --muted-bg: #F4F4F6;      /* gray pale; brand black 15.83 */
  --tint: #FFFEE1;          /* yellow super pale, brand black 16.99 */
  --teal-tint: #CCF5F2;     /* teal super pale, brand black 14.84 */
  --primary-bg: #44DAD0;    /* teal light, brand black text 10.09 */
  --primary-text: #0D1B2A;
  --primary-edge: #22466D;  /* teal light is 1.72 on white, so it needs an edge */
  --secondary-bg: #FFFFFF;
  --secondary-text: #22466D;
  --danger-bg: #912728;     /* carmine; white 8.32 */
  --danger-text: #FFFFFF;
  --link: #22466D;
  --error: #912728;         /* carmine, 8.32 on white */
  --focus: #22466D;
  --border: #22466D;
  --line: #5B6B7D;          /* non-text dividers, 3:1 is enough */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1B2A;
    --text: #F4F4F6;          /* 15.83 on brand black */
    --heading: #E2DC1A;       /* yellow, 12.00 */
    --muted-bg: #16283D;
    --tint: #16283D;
    --teal-tint: #16283D;
    --primary-bg: #44DAD0;
    --primary-text: #0D1B2A;
    --primary-edge: #44DAD0;
    --secondary-bg: #0D1B2A;
    --secondary-text: #B1CBE7;  /* indigo super pale, 10.41 */
    --danger-bg: #FF993F;       /* orange light; brand black 8.18 */
    --danger-text: #0D1B2A;
    --link: #44DAD0;            /* teal light, 10.09 */
    --error: #FF993F;
    --focus: #E2DC1A;
    --border: #B1CBE7;
    --line: #8A9BB0;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 400 1.0625rem/1.6 "Lato", system-ui, sans-serif; }
body.embed { background: transparent; }
h1, h2, h3 { font-family: "Montserrat", system-ui, sans-serif; font-weight: 700; color: var(--heading); line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: 1.3rem; margin-top: 1.75rem; }
h3 { font-size: 1.05rem; margin-top: 1.25rem; }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--bg); padding: .5rem 1rem; z-index: 10; }

.wrap { max-width: 860px; margin: 0 auto; padding: 1rem 16px 3rem; }
.embed .wrap { padding: .5rem 4px 1rem; }
header.site, footer.site { max-width: 860px; margin: 0 auto; padding: 1rem 16px; }
header.site img { display: block; height: 64px; width: auto; }
footer.site { border-top: 1px solid var(--line); font-size: .95rem; }

.card { background: var(--bg); border: 2px solid var(--border); border-radius: 20px; padding: 1.5rem; margin: 1.5rem 0; }
.card h2:first-child { margin-top: 0; }
.card.narrow { max-width: 560px; margin: 2rem auto; }
.lead p { margin: .5rem 0 1rem; }
.small, .hint { font-size: .95rem; }
.hint { margin: 0 0 .35rem; }
.optional { font-weight: 400; font-size: .95rem; }
.eyebrow { margin: 0 0 .25rem; font-weight: 700; }
.when { font-size: 1.15rem; font-weight: 700; }

/* A stripe in the calendar's own color (decorative) */
.cal-head { border-left: 8px solid var(--cal, #22466D); padding-left: 1rem; margin: 1rem 0; }
.swatch { display: inline-block; width: .9em; height: .9em; border-radius: 50%; background: var(--cal); border: 1px solid var(--line); margin-right: .4em; vertical-align: -.05em; }

/* Forms */
label { display: block; font-weight: 700; margin: 1rem 0 .35rem; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 2px solid var(--border); border-radius: 10px; padding: .6rem .75rem; min-height: 44px;
}
input[type="color"] { width: 5rem; padding: .2rem; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; min-height: 0; margin: 0; accent-color: var(--heading); flex: none; }
.check { display: flex; gap: .6rem; align-items: center; margin: 1rem 0 .25rem; }
.check label { margin: 0; }
fieldset { border: 0; padding: 0; margin: 1.25rem 0 0; min-width: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: .35rem; }
.choices label, label.radio { display: flex; gap: .6rem; align-items: center; font-weight: 400; margin: .5rem 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; }
.inline-form > div { flex: 1 1 200px; }
.inline-form .button { margin-top: 1rem; }
.hp { position: absolute; left: -9999px; }
.stack .button[type="submit"] { margin-top: 1.5rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px;
  padding: .6rem 1.2rem; border-radius: 999px; font: 700 1rem "Montserrat", system-ui, sans-serif; text-decoration: none; cursor: pointer;
  background: var(--primary-bg); color: var(--primary-text); border: 2px solid var(--primary-edge);
}
.button.secondary { background: var(--secondary-bg); color: var(--secondary-text); border-color: var(--border); }
.button.danger { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-bg); }
.button.small { min-height: 36px; padding: .3rem .8rem; font-size: .9rem; }
.button:hover { text-decoration: underline; }
.link-button { background: none; border: 0; color: var(--link); font: inherit; text-decoration: underline; cursor: pointer; padding: .5rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1rem 0; }
.actions form { margin: 0; }
.add-cal { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }

.flash { background: var(--teal-tint); border-left: 6px solid var(--heading); padding: .75rem 1rem; border-radius: 8px; }
.error { background: var(--tint); border-left: 6px solid var(--error); color: var(--error); font-weight: 700; padding: .75rem 1rem; border-radius: 8px; }
.error-text { color: var(--error); font-weight: 700; }

/* Lists and tables */
.event-list, .plain { list-style: none; padding: 0; margin: 0; }
.event-list li { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.event-list a { font-weight: 700; font-size: 1.1rem; }
.plain li { padding: .4rem 0; border-bottom: 1px solid var(--line); }
.table-scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: "Montserrat", system-ui, sans-serif; font-size: .9rem; }
tr.top th, tr.top td { background: var(--teal-tint); }
.poll .vote { margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.poll .vote label { display: flex; gap: .4rem; align-items: center; font-weight: 400; margin: 0; }
.tally { white-space: nowrap; }

/* Month view */
.month { margin: 1.5rem 0; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.month-nav h2 { margin: 0; font-size: 1.15rem; }
.month-grid { table-layout: fixed; margin-top: .75rem; }
.month-grid th { text-align: center; }
.month-grid td { height: 4.5rem; border: 1px solid var(--line); padding: .25rem; font-size: .85rem; overflow-wrap: anywhere; }
.month-grid td.has { background: var(--tint); }
.month-grid .d { display: block; font-weight: 700; }
.month-grid a { display: block; margin-top: .2rem; }
@media (max-width: 600px) {
  .month-grid td { height: 3rem; font-size: .75rem; }
  .month-grid a { font-size: 0; width: .7rem; height: .7rem; border-radius: 50%; background: var(--heading); margin: .2rem auto 0; }
}

/* Admin */
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .75rem 16px; border-bottom: 2px solid var(--border); background: var(--muted-bg); }
.admin-name { font: 400 1.4rem "Lilita One", system-ui, sans-serif; color: var(--heading); }
.admin-bar nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; flex: 1; }
.admin-bar nav a { padding: .4rem 0; font-weight: 700; }
.admin-bar nav a[aria-current="page"] { text-decoration-thickness: 3px; }
.admin-bar form { margin: 0; }
.crumb { margin: .5rem 0; }
.copy-box { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin: .75rem 0; padding: .6rem .75rem; background: var(--muted-bg); border-radius: 10px; }
.copy-label { font-weight: 700; flex: 0 0 100%; }
.copy-text { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; overflow-wrap: anywhere; flex: 1 1 260px; }
pre.code { background: var(--muted-bg); padding: .75rem; border-radius: 10px; overflow-x: auto; font-size: .85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.fields-editor { border-top: 2px solid var(--line); padding-top: .5rem; margin-top: 1.5rem; }
.field-row { border: 1px solid var(--line); border-radius: 12px; padding: .25rem 1rem 1rem; margin: 1rem 0; display: grid; grid-template-columns: 1fr; }
@media (min-width: 700px) { .field-row { grid-template-columns: 2fr 1fr; gap: 0 1rem; } .field-row > div:nth-child(4) { grid-column: 1 / -1; } }
.template-pick { margin-bottom: 1rem; }
