/* St. Lawrence Men's Group, mobile-first, light and dark themes */
:root {
  --bg: #f7f3ec;
  --surface: #fffdf9;
  --surface-2: #f1ebe0;
  --text: #231d18;
  --muted: #6b6259;
  --border: #e2d9cb;
  --accent: #8c1d18;        /* martyr red */
  --accent-hover: #731611;
  --accent-ink: #ffffff;
  --gold: #a87a26;
  --gold-soft: #f4e8cf;
  --success-bg: #e8f2e6; --success-ink: #24521f;
  --error-bg: #f9e5e3;   --error-ink: #8a1f16;
  --info-bg: #eef0f4;    --info-ink: #33415c;
  --lit-violet: #5b3a8c; --lit-rose: #c46a8a; --lit-white: #c9a74a; --lit-green: #3f7a3a; --lit-red: #a3241c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 16px rgba(60, 40, 20, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f; --surface: #211b16; --surface-2: #2a231c; --text: #efe7dc; --muted: #a99d8f;
    --border: #3a3028; --accent: #d0574c; --accent-hover: #e06a5f; --accent-ink: #1a0f0d;
    --gold: #d6aa55; --gold-soft: #3a2f1c;
    --success-bg: #1f3320; --success-ink: #b5dcae; --error-bg: #3d1f1b; --error-ink: #f2b8b0;
    --info-bg: #232a38; --info-ink: #c3cde0;
    --lit-violet: #9a7ad0; --lit-rose: #e092ad; --lit-white: #e0c57a; --lit-green: #79b872; --lit-red: #e0665b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.55 var(--sans);
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.break { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 1.5rem; padding-bottom: 3rem; }

/* liturgical color strip */
.lit-strip { height: 5px; background: var(--lit-green); }
.season-violet .lit-strip { background: var(--lit-violet); }
.season-rose .lit-strip { background: var(--lit-rose); }
.season-white .lit-strip { background: var(--lit-white); }
.season-red .lit-strip { background: var(--lit-red); }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand-mark { width: 34px; height: 34px; color: var(--accent); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.brand-sub { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: .25rem; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: .4rem .65rem; border-radius: 8px; text-decoration: none; color: var(--text); white-space: nowrap; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--gold-soft); color: var(--text); font-weight: 600; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.user-name { color: var(--muted); text-decoration: none; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 820px) {
  .nav { order: 0; width: auto; margin: 0; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; min-height: 44px;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-danger { color: var(--error-ink); border-color: color-mix(in srgb, var(--error-ink) 35%, var(--border)); }
.btn-danger:hover { background: var(--error-bg); color: var(--error-ink); }
.btn-small { padding: .35rem .7rem; min-height: 36px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn.danger, .danger { color: var(--error-ink); }

/* layout pieces */
.hero { margin-bottom: 1.5rem; }
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: .35rem; display: block; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; color: var(--muted); font-size: .95rem; }
.note { background: var(--gold-soft); border-left: 3px solid var(--gold); padding: .5rem .75rem; border-radius: 6px; font-size: .95rem; margin-top: .5rem; }
.note-patronal { border-left-color: var(--lit-red); font-weight: 600; }
.section { margin-top: 2rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.section-head a { font-size: .95rem; white-space: nowrap; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.stack { display: grid; gap: .75rem; }
.stack-sm { display: grid; gap: .35rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.stack > .card + .card, .grid-2 > .card + .card { margin-top: 0; }
.card-feature { border-top: 4px solid var(--accent); }
.card-link { display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--text); }
.card-link:hover { border-color: var(--gold); color: var(--text); }
.card-link.current { border-left: 4px solid var(--gold); }
.empty { color: var(--muted); padding: 1.25rem; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.tag-private { background: var(--info-bg); color: var(--info-ink); }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }

/* liturgical color badge */
.lit-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--text); }
.lit-badge .dot { width: .8rem; height: .8rem; border-radius: 50%; background: var(--lit-green); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.lit-violet .dot { background: var(--lit-violet); } .lit-rose .dot { background: var(--lit-rose); }
.lit-white .dot { background: #fff; } .lit-red .dot { background: var(--lit-red); }

/* flashes */
.flashes { display: grid; gap: .5rem; margin-bottom: 1rem; }
.flash { padding: .7rem .9rem; border-radius: 10px; background: var(--info-bg); color: var(--info-ink); }
.flash-success { background: var(--success-bg); color: var(--success-ink); }
.flash-error { background: var(--error-bg); color: var(--error-ink); margin-bottom: 1rem; }

/* tabs and search */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.search input { flex: 1 1 220px; }

/* intentions */
.intention-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.intention-title { margin: 0; font-size: 1.12rem; }
.intention-details { margin: .25rem 0 .5rem; }
.intention-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .5rem; }
.intention-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.intention.answered { border-left: 4px solid var(--lit-white); }
.intention.expired { opacity: .75; }
.answered-note { background: var(--success-bg); color: var(--success-ink); padding: .5rem .75rem; border-radius: 8px; margin: .5rem 0; }
.pray-btn {
  display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: .35rem .85rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.pray-btn svg { width: 16px; height: 16px; color: var(--accent); }
.pray-btn:hover { border-color: var(--gold); }
.pray-btn.on { background: var(--gold-soft); border-color: var(--gold); }
.more { position: relative; }
.more summary { list-style: none; font-size: .9rem; }
.more summary::-webkit-details-marker { display: none; }
.more-panel { display: grid; gap: .6rem; margin-top: .6rem; padding: .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: min(300px, 80vw); }

/* evening prayer */
.day-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: .75rem; font-size: .95rem; }
.link-grid { display: grid; gap: .6rem; margin-top: .75rem; }
@media (min-width: 640px) { .link-grid { grid-template-columns: 1fr 1fr; } }
.link-tile { display: flex; flex-direction: column; gap: .2rem; padding: .8rem .9rem; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: var(--text); background: var(--surface-2); }
.link-tile:hover { border-color: var(--gold); color: var(--text); }
.link-tile strong { color: var(--accent); }
.hours-outline { padding-left: 1.3rem; display: grid; gap: .45rem; }
.prayer-text p { font-family: var(--serif); font-size: 1.08rem; line-height: 1.65; }
.prayer-text h2 .small { font-family: var(--sans); font-weight: 400; }
.vr { margin-bottom: .35rem; }
.vr-mark { color: var(--accent); font-weight: 700; }
.intercessions { padding-left: 1.2rem; display: grid; gap: .5rem; font-family: var(--serif); font-size: 1.05rem; }
.toc { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.25rem; }
.toc a { font-size: .875rem; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; background: var(--surface); color: var(--text); }
.toc a:hover { border-color: var(--gold); }
.patron { border-top: 4px solid var(--lit-red); }
.patron-response { font-family: var(--serif); color: var(--accent); }

/* forms */
.form .field { margin-bottom: 1rem; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
legend, label { font-weight: 600; display: block; margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: 2px solid color-mix(in srgb, var(--gold) 35%, transparent); outline-offset: 0; }
input[type=file] { font: inherit; max-width: 100%; }
.choice { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin-bottom: .5rem; cursor: pointer; }
.choice input { margin-top: .3rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.field-row { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; }
.field-row .field { flex: 1 1 140px; }
.field-row .grow { flex: 3 1 220px; }
.field-end { flex: 0 0 auto !important; }
.copy-row { display: flex; gap: .5rem; margin: .5rem 0 .75rem; }
.copy-row input { flex: 1; min-width: 0; }

.auth { display: grid; place-items: start center; padding-top: 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.error-card { max-width: 560px; margin: 2rem auto; text-align: center; }

/* tables / lists */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { color: var(--muted); }
.table select { min-height: 36px; padding: .3rem .5rem; width: auto; }
.table .actions { display: flex; gap: .9rem; flex-wrap: wrap; }
.inline-form { display: inline; }
.plain-list, .file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.file-list li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.file-list li:last-child { border-bottom: 0; }
.file-list a:first-child { font-weight: 600; overflow-wrap: anywhere; }
.prose { overflow-wrap: anywhere; }

.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; text-align: center; background: var(--surface); }
.site-footer p:first-child { font-family: var(--serif); font-style: italic; color: var(--accent); margin-bottom: .25rem; }
