/* allsoulsday.com — candlelight design system. Self-hosted, no webfonts, no build. */

:root {
  --paper:      #f7f1e6;   /* warm off-white ground */
  --paper-2:    #f1e8d7;   /* slightly deeper panel */
  --ink:        #2b2621;   /* warm near-black (not pure) */
  --ink-soft:   #4a4239;
  --muted:      #7a6e60;   /* muted brown */
  --line:       #e3d9c5;   /* hairlines */
  --gold:       #b8842b;   /* amber-gold accent (AA on paper) */
  --gold-deep:  #92671d;
  --flame:      #f0a83c;
  --flame-hot:  #ffe6b0;
  --danger:     #a3391f;
  --focus:      #2f6db0;
  --maxw:       68rem;
  --narrow:     40rem;
  --radius:     10px;
  --shadow:     0 1px 2px rgba(60,45,20,.06), 0 6px 20px rgba(60,45,20,.05);
  --serif:      "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:       system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #1c1a17;   /* deep charcoal ground */
    --paper-2:  #24211c;
    --ink:      #efe7d8;
    --ink-soft: #d9cfbe;
    --muted:    #a99b86;
    --line:     #35302a;
    --gold:     #e0a944;
    --gold-deep:#f0be62;
    --flame:    #f6b24a;
    --flame-hot:#ffe9bd;
    --danger:   #e0805f;
    --focus:    #7db2e8;
    --shadow:   0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.075rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .brand-name, .single-name, .tribute-name {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); letter-spacing: .2px; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

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

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 1.25rem; }
.narrow { max-width: var(--narrow); }
.section { margin-block: clamp(2.5rem, 6vw, 4.5rem); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Accessibility ---------------------------------------------------------- */
.visually-hidden, .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;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 100;
}
.skip-link:focus { left: 0; color: var(--paper); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }

/* Header ----------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.brand-name { font-size: 1.25rem; }
.brand-flame {
  width: 12px; height: 18px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 65%, var(--flame-hot), var(--flame) 55%, var(--gold-deep));
  display: inline-block; box-shadow: 0 0 10px rgba(240,168,60,.55);
}
.site-nav { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-size: .98rem; }
.site-nav a:hover { color: var(--gold-deep); text-decoration: underline; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-block; font: inherit; font-size: .98rem; cursor: pointer;
  padding: .6rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink); text-decoration: none; transition: transform .06s ease, background .15s ease;
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn--gold { background: var(--gold); border-color: var(--gold-deep); color: #241a06; font-weight: 600; }
.btn--gold:hover { background: var(--gold-deep); color: #fff; }
.btn--ghost { background: transparent; }
.btn--danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--lg { padding: .8rem 1.5rem; font-size: 1.05rem; }
.btn--sm { padding: .35rem .7rem; font-size: .85rem; }

/* Hero ------------------------------------------------------------------- */
.hero { text-align: center; padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3rem); }
.hero-eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; color: var(--muted); margin-bottom: .8rem; }
.hero-title { margin: 0 0 1rem; }
.hero-lede { max-width: 34rem; margin: 0 auto 1.8rem; color: var(--ink-soft); font-size: 1.15rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.hero-proof { margin-top: 2rem; color: var(--muted); font-size: 1rem; }

/* Sections & grids ------------------------------------------------------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.section-more { white-space: nowrap; }
.tribute-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

.tribute-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.tribute-card-link { text-decoration: none; color: inherit; display: block; flex: 1; }
.tribute-card-link:hover .tribute-name { color: var(--gold-deep); }
.tribute-name { margin: 0 0 .15rem; font-size: 1.2rem; }
.tribute-years { margin: 0 0 .5rem; color: var(--muted); font-size: .92rem; }
.tribute-rel { margin: 0 0 .5rem; color: var(--ink-soft); font-style: italic; }
.tribute-msg { margin: 0; color: var(--ink-soft); font-size: .97rem; }
.tribute-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .9rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.tribute-loc { text-align: right; }

.candle-count { display: inline-flex; align-items: center; gap: .35rem; }
.candle-dot {
  width: 8px; height: 11px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 65%, var(--flame-hot), var(--flame) 60%, var(--gold-deep));
  display: inline-block; box-shadow: 0 0 6px rgba(240,168,60,.5);
}
.candle-dot--lg { width: 11px; height: 15px; }

/* Bands / call-outs ------------------------------------------------------ */
.band { }
.band-inner {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem); text-align: center; box-shadow: var(--shadow);
}
.band-inner h2 { margin-top: 0; }
.band-inner p { max-width: 34rem; margin-inline: auto; color: var(--ink-soft); }

.tri-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.tri-links a { display: block; text-decoration: none; color: inherit; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.tri-links a:hover { border-color: var(--gold); }
.tri-links h3 { margin: 0 0 .4rem; color: var(--gold-deep); }
.tri-links p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* Page heads ------------------------------------------------------------- */
.page-head { padding-block: clamp(2rem, 5vw, 3rem) 1rem; }
.page-head.narrow { }
.page-lede { color: var(--ink-soft); font-size: 1.1rem; max-width: 36rem; }

/* Wall filter ------------------------------------------------------------ */
.wall-filter { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wall-filter input[type=search] { flex: 1; min-width: 12rem; }
.wall-clear { align-self: center; }
.wall-years { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.wall-years a { text-decoration: none; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--ink-soft); }
.wall-years a.is-active, .wall-years a:hover { background: var(--gold); color: #241a06; border-color: var(--gold-deep); }
.wall-count { color: var(--muted); margin-bottom: 1rem; }
.empty-note { text-align: center; color: var(--muted); padding: 3rem 1rem; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 2.5rem; }
.page-of { color: var(--muted); font-size: .95rem; }

/* Forms ------------------------------------------------------------------ */
input[type=text], input[type=email], input[type=search], input[type=password], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .75rem;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; }
::placeholder { color: var(--muted); opacity: .8; }

.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field .hint, .field .req { font-weight: 400; color: var(--muted); font-size: .88rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-foot { display: flex; justify-content: space-between; gap: 1rem; margin: .3rem 0 0; font-size: .85rem; color: var(--muted); }
.field-note { text-align: right; }
.char-count { font-variant-numeric: tabular-nums; }
.char-count.over { color: var(--danger); font-weight: 600; }
.field-error { color: var(--danger); font-size: .9rem; margin: .35rem 0 0; }
.form-actions { display: flex; gap: .8rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.form-fine { margin-top: 1rem; color: var(--muted); font-size: .9rem; }

/* Opt-in ----------------------------------------------------------------- */
.optin { max-width: 30rem; margin-inline: auto; text-align: left; }
.optin-row { display: flex; gap: .5rem; }
.optin-email { flex: 1; }
.optin-consent { display: flex; gap: .5rem; align-items: flex-start; margin-top: .7rem; font-size: .88rem; color: var(--muted); }
.optin-consent input { margin-top: .35rem; }

/* Flash / messages ------------------------------------------------------- */
.flash { border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.5rem; border: 1px solid var(--line); }
.flash--ok { background: rgba(184,132,43,.1); border-color: var(--gold); }
.flash--error { background: rgba(163,57,31,.08); border-color: var(--danger); color: var(--danger); }
.flash p { margin: 0; }

.page-message { padding-block: clamp(3rem, 8vw, 5rem); }
.message-card { text-align: center; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(2rem, 5vw, 3rem); box-shadow: var(--shadow); }
.message-flame { display: inline-block; width: 16px; height: 24px; margin-bottom: 1rem; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 50% 65%, var(--flame-hot), var(--flame) 55%, var(--gold-deep)); box-shadow: 0 0 16px rgba(240,168,60,.6); }
.message-body { max-width: 34rem; margin-inline: auto; color: var(--ink-soft); }
.error-code { font-family: var(--serif); font-size: 3rem; color: var(--gold); margin: 0; }

/* Single tribute --------------------------------------------------------- */
.tribute-single { padding-block: clamp(2rem, 6vw, 4rem); }
.single-head { text-align: center; margin-bottom: 2rem; }
.single-eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; color: var(--muted); margin: 0 0 .5rem; }
.single-name { font-size: clamp(2.2rem, 6vw, 3.2rem); margin: 0; }
.single-years { color: var(--muted); font-size: 1.15rem; margin: .4rem 0 0; }
.single-rel { font-style: italic; color: var(--ink-soft); margin: .5rem 0 0; }
.single-flame {
  display: inline-block; width: 20px; height: 30px; margin-bottom: 1rem;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 65%, var(--flame-hot), var(--flame) 55%, var(--gold-deep));
  box-shadow: 0 0 22px rgba(240,168,60,.65); animation: flicker 3.5s infinite ease-in-out;
}
.single-message {
  font-family: var(--serif); font-size: 1.3rem; line-height: 1.75; color: var(--ink);
  max-width: 34rem; margin: 0 auto 1.5rem; text-align: center; white-space: pre-line;
}
.single-loc { text-align: center; color: var(--muted); margin-bottom: 2rem; }
.single-back { text-align: center; margin-top: 2.5rem; }

/* Candle block ----------------------------------------------------------- */
.candle-block { text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2rem 1rem; margin: 2rem 0; }
.candle-visual { height: 90px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: .5rem; }
.candle-stick { position: relative; width: 26px; height: 64px; border-radius: 6px 6px 3px 3px; background: linear-gradient(90deg, #efe6d2, #cdbfa2); }
.candle-flame {
  position: absolute; left: 50%; top: -22px; transform: translateX(-50%);
  width: 16px; height: 26px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, var(--flame-hot), var(--flame) 55%, var(--gold-deep));
  box-shadow: 0 0 20px rgba(240,168,60,.7); transform-origin: bottom center;
  animation: flicker 3s infinite ease-in-out;
}
.candle-total { font-size: 1.1rem; }
.candle-count-big { font-family: var(--serif); font-size: 1.6rem; color: var(--gold-deep); font-variant-numeric: tabular-nums; }
.candle-thanks { color: var(--gold-deep); font-weight: 600; }
.candle-form { margin-top: 1rem; }
.candle-btn[disabled] { opacity: .55; cursor: default; }

@keyframes flicker {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-1deg); opacity: 1; }
  25%      { transform: translateX(-50%) scale(1.06, .96) rotate(1deg); opacity: .92; }
  50%      { transform: translateX(-50%) scale(.97, 1.04) rotate(-1deg); opacity: 1; }
  75%      { transform: translateX(-50%) scale(1.03, .98) rotate(.5deg); opacity: .95; }
}
.single-flame { animation-name: flicker-soft; }
@keyframes flicker-soft { 0%,100% { opacity: 1; } 50% { opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  .candle-flame, .single-flame { animation: none !important; }
}

/* Share ------------------------------------------------------------------ */
.share-block { text-align: center; margin: 2rem 0; }
.share-links { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.share-link {
  font: inherit; font-size: .92rem; cursor: pointer; text-decoration: none;
  padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-2); color: var(--ink-soft);
}
.share-link:hover { border-color: var(--gold); color: var(--gold-deep); }
.single-optin { margin-top: 2.5rem; }

/* Content pages ---------------------------------------------------------- */
.page-content main, .content { }
.article { max-width: 42rem; margin-inline: auto; padding-block: clamp(2rem, 5vw, 3.5rem); }
.article h1 { margin-bottom: .5rem; }
.article .lede { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 2rem; }
.article h2 { margin-top: 2.2rem; }
.article h3 { margin-top: 1.6rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-bottom: .5rem; }
.article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .97rem; }
.article th, .article td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); }
.article th { font-family: var(--sans); font-weight: 600; }
.article blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--gold); color: var(--ink-soft); font-style: italic; }
.article .callout { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.5rem 0; }
.country-nav { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 2rem; }
.country-nav a { text-decoration: none; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--ink-soft); }
.country-nav a.is-active, .country-nav a:hover { background: var(--gold); color: #241a06; border-color: var(--gold-deep); }
.verify-note { display: none; } /* editorial <!-- VERIFY --> markers are HTML comments */

/* Ad slots (disabled by default) ---------------------------------------- */
.ad-slot { margin: 2rem auto; max-width: 42rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); padding: .5rem; }
.ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: .3rem; }

/* Footer ----------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 2.5rem 3rem; background: var(--paper-2); }
.footer-optin { text-align: center; max-width: 34rem; margin: 0 auto 2rem; }
.footer-optin h2 { margin: 0 0 .5rem; }
.footer-optin p { color: var(--ink-soft); }
.optin--compact .optin-consent { font-size: .82rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin: 1.5rem 0 1rem; }
.footer-nav a { color: var(--ink-soft); text-decoration: none; font-size: .92rem; }
.footer-nav a:hover { color: var(--gold-deep); text-decoration: underline; }
.footer-fine { text-align: center; color: var(--muted); font-size: .85rem; line-height: 1.6; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .header-inner { justify-content: center; text-align: center; }
  .optin-row { flex-direction: column; }
}
