/* Society of the Veiled Archive — style.css
   Baseline snapshot synced to index.html (2025-08-28)
   Palette & typography aim for parchment + oxidized gold aesthetic.
*/

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

html, body { height: 100%; }

:root{
  /* Colors */
  --paper: #fff7eb;
  --ink: #2b2520;
  --muted: #6d665c;
  --line: #e6ddcc;
  --accent: #7a5a33;         /* button + highlights */
  --accent-veil: #b89a67;     /* secondary gold */
  --accent-ink: #ffffff;

  /* Effects */
  --shadow: 0 12px 30px rgba(0,0,0,.08);

  /* Texture */
  --paper-texture: url('/img/bg-parchment.jpg');  /* <- add this image */
}

body{
  margin: 0;
  color: var(--ink);

  /* Non-gradient parchment background (site-wide) */
  background-color: var(--paper);             /* fallback color */
  background-image: var(--paper-texture);     /* seamless parchment */
  background-repeat: repeat;
  background-position: top center;
  background-size: 700px auto;                /* adjust for finer/coarser grain */
  background-attachment: fixed;               /* subtle parallax; remove if undesired */

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Body & headings fonts (loaded in index.html) */
  font-family: "Libre Baskerville", Georgia, serif;
  line-height: 1.55;
  font-size: 16px;
}

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

a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; }

/* ---------- Typography ---------- */
h1,h2,h3,h4{
  font-family: "IM Fell English", "Libre Baskerville", Georgia, serif;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
}

h1{ font-size: clamp(32px, 4vw, 44px); }
h2{ font-size: clamp(22px, 2.6vw, 28px); }
h3{ font-size: clamp(18px, 2.1vw, 22px); }
p{ margin: 0 0 1em; color: var(--ink); }
.small{ font-size: .875rem; color: var(--muted); }

/* Whisper line (CTA subhead) */
.whisper{
  font-size: clamp(18px, 1.6vw, 20px);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .25rem;
}

/* ---------- Layout ---------- */
.container{
  max-width: 1080px;
  padding: 20px;
  margin: 0 auto;
}

/* ---------- Header (via /includes/header.html) ---------- */
.header{
  position: relative;
  z-index: 10;
  background: rgba(255, 247, 235, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(2px);
}

.header .container{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .emblem{
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #952f2f; /* wax-seal red if image missing */
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.brand .emblem img{
  width: 100%; height: 100%; object-fit: cover;
}

.brand .tag{
  font-size: .9rem;
  letter-spacing: .08em;
  color: var(--muted);
}

.nav{
  display: flex; gap: 10px; flex-wrap: wrap;
}
.nav a{
  padding: 6px 10px;
  border-radius: 8px;
  text-underline-offset: .2em;
  color: var(--ink);
}
.nav a[aria-current="page"]{
  background: #f4ead7;
  border: 1px solid var(--line);
}

/* ---------- Hero ---------- */
.hero{
  padding: clamp(24px, 4vw, 48px) 0 10px;
}

.hero-grid{
  display: grid;
  grid-template-columns: 1fr;  /* single-column as per current index */
  gap: 20px;
  align-items: center;
}

.hero h1{
  text-align: center;
  margin-bottom: .35em;
}

.hero p{
  max-width: 70ch;
  margin: 0 auto;
  text-align: center;
  color: var(--ink);
}

/* ---------- CTA: Ledger Notice ---------- */
.cta-notice{
  margin: 24px 0;
  padding: 18px clamp(14px, 2vw, 22px);
  background: #fbf4e6;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 14px;
}

.cta-notice h2{
  margin-bottom: 6px;
}

.cta-notice ul{
  list-style: none;
  margin: 10px 0 0;
  padding-left: 0; /* reinforced by inline overrides in index.html */
}

.cta-notice ul li{
  position: relative;
  margin: 8px 0 0 1.25rem; /* left indent for bullets */
  color: var(--ink);
}
.cta-notice ul li::before{
  content: "•";
  position: absolute;
  left: -1.25rem;
  color: var(--accent);
}

.cta-actions{
  display: grid;
  place-items: center;
  margin-top: 14px;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transform: translateZ(0);
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  font-weight: 700;
  letter-spacing: .02em;
}
.btn:hover{
  text-decoration: none;
  background: #6e4f2d;
  box-shadow: 0 10px 26px rgba(0,0,0,.12);
}
.btn:active{ transform: translateY(1px); }
.btn:focus-visible{
  outline: 2px solid #0000;
  box-shadow: 0 0 0 3px rgba(123, 93, 55, .35), var(--shadow);
}

/* ---------- Featured Relics ---------- */
.grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card{
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 16px;
  box-shadow: var(--shadow);
}

.card h3{ margin-bottom: 6px; }
.card p{ margin-bottom: .65em; color: var(--muted); }
.card a{ color: var(--accent); font-weight: 700; }
.card a:hover{ text-decoration: none; }

/* ---------- Archive CTA (simple) ---------- */
main section + section h2{ margin-top: 0; }

/* ---------- Footer ---------- */
footer{
  margin-top: 28px;
  border-top: 1px solid var(--line);
  background: rgba(255, 247, 235, 0.85);
  backdrop-filter: blur(2px);
}

footer .small{
  padding: 14px 20px;
}

footer{
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
}

/* Footer sigil button (right-aligned) */
#footerSigil.sigil{
  margin-left: auto;            /* push to right edge */
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fffdf7;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}
#footerSigil.sigil img{
  width: 28px; height: 28px; object-fit: cover;
}
#footerSigil.sigil:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
  background: #fbf4e6;
}
#footerSigil.sigil:active{ transform: translateY(0); }
#footerSigil.sigil:focus-visible{
  outline: 2px solid #0000;
  box-shadow: 0 0 0 3px rgba(184,154,103, .35), var(--shadow);
}

/* Ensure NO tooltip/label is introduced via CSS:
   (index.js already removes any ::before content if present)
*/
#footerSigil.sigil::before{ content: none !important; }

/* ---------- Utilities ---------- */
hr{
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.center{ text-align: center; }
.muted{ color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 920px){
  .grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px){
  .grid{ grid-template-columns: 1fr; }
  .header .container{ flex-wrap: wrap; }
  .brand .tag{ display: none; }
  footer{ flex-wrap: wrap; }
}

/* === HOTFIX (0828) — restore red invite, keep header logo as-is, un-style footer sigil === */

/* 1) Ledger invitation line: centered + red (wax-seal) */
.cta-notice ul > h3:first-child{
  color: #952f2f !important;
  text-align: center !important;
}

/* 2) Header logo: do not restyle; let the include control it */
.header .brand .emblem{
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  display: inline-block !important;
}
.header .brand .emblem img{
  height: 36px !important;      /* keeps header height tidy; adjust if you prefer */
  width: auto !important;
  display: inline-block !important;
}

/* 3) Footer sigil: original look, no tooltip/hover effects, right-aligned */
#footerSigil.sigil{
  margin-left: auto;            /* stays on the right */
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  transform: none !important;
}
#footerSigil.sigil:hover,
#footerSigil.sigil:active,
#footerSigil.sigil:focus-visible{
  transform: none !important;
  box-shadow: none !important;
  outline: none !important;
}
#footerSigil.sigil::before{ content: none !important; } /* ensure no hover label */

/* HOTFIX 0828-B — Correct CTA colors/alignment */
.cta-notice > .whisper{
  /* This line: “SCARE AND HAUNT VICTIMS…” */
  color: #952f2f !important;   /* wax-seal red */
  text-align: center !important;
}
.cta-notice ul > h3:first-child{
  /* This invitation paragraph should be black */
  color: var(--ink) !important; /* black */
}

/* HOTFIX 0828-C — Header logo + brand label larger */
.header .brand .emblem img{
  height: 120px !important;   /* was ~36px */
  width: auto !important;
}
.header .brand .emblem{
  min-height: 120px !important;
}
.header .brand .tag{
  font-size: clamp(36px, 2.2vw, 36px) !important;
  line-height: 1.1 !important;
}

/* HOTFIX — Make the whisper line render as H2 size */
.cta-notice > .whisper{
  font-size: clamp(32px, 2.6vw, 28px) !important; /* match h2 */
}

/* HOTFIX — Center header content */
.header .container{
  justify-content: center !important;  /* center the brand + nav group */
}
.header .nav{
  justify-content: center !important;  /* center the links within the nav */
}

/* HOTFIX 0828-D — Whisper line scales like H2 (22–28px) */
.cta-notice > .whisper{ font-size: clamp(22px, 2.6vw, 28px) !important; }

/* ---- Mobile header fixes (no desktop changes) ---- */
@media (max-width: 640px){
  /* Keep header content visible and not overlapping the hero */
  .header{ position: sticky; top: 0; z-index: 100; background: var(--paper,#fff7eb); }

  /* Brand row: logo + title side-by-side */
  .brand{ display:flex; align-items:center; gap:12px; }

  /* If your emblem is an <img> inside .emblem */
  .emblem img{
    display:block;
    width:56px;          /* was likely taller + cropped */
    height:56px;
    object-fit: contain; /* prevents cropping */
  }

  /* Ensure the brand title shows on mobile */
  .brand .tag{
    display:block;                   /* was likely hidden */
    font-family: "IM Fell English", serif;
    font-size: 14px;
    line-height: 1.1;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: normal;             /* allow wrapping */
    max-width: 60vw;                 /* avoid pushing nav off-screen */
  }

  /* Nav wraps nicely on two lines if needed */
  .nav{
    display:flex; flex-wrap: wrap;
    gap: 10px 20px;
  }

  /* Make the hero H1 scale on phones so it doesn’t look “missing” */
  h1{ font-size: clamp(28px, 6vw, 56px); line-height:1.1; }
}

/* ---------- Mobile fixes (≤640px) ---------- */
@media (max-width: 640px){
  /* Stack header content and center it */
  .header .container{
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:12px 16px;
    gap:10px;
  }

  /* Logo + wordmark side-by-side, uncropped logo */
  .header .brand{
    display:flex;
    align-items:center;
    gap:12px;
  }
  .header .emblem img{
    display:block;
    width:64px;          /* was visually cramped/cropped */
    height:auto;         /* prevents crop */
    object-fit:contain;  /* belt-and-suspenders */
  }
  .header .tag{
    text-align:center;
    line-height:1.05;
    font-size:clamp(20px, 6vw, 28px);
    word-break:normal;
  }

  /* Nav wraps neatly and stays centered */
  .header nav,
  .header .nav{
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:8px 22px;
    margin-top:4px;
  }
  .header nav a,
  .header .nav a{
    font-size:16px;
    padding:6px 2px;
    line-height:1.2;
  }

  /* Hero typography scales & centers on mobile */
  .hero h1,
  .lede h1,
  main h1.hero-title{
    text-align:center;
    font-size:clamp(26px, 6.8vw, 34px);
    line-height:1.15;
    margin:12px auto 8px;
  }
  .hero p,
  .lede p,
  .intro p{
    max-width:38ch;
    margin-left:auto;
    margin-right:auto;
    font-size:16px;
  }
}

/* ---------- Mobile title font shrink (≤640px) ---------- */
@media (max-width: 640px){
  .header .tag {
    font-family: "Libre Baskerville", Georgia, serif;
    font-weight: 700;
    font-size: clamp(14px, 4vw, 18px); /* much smaller range */
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-align: center;
    max-width: 90%;        /* prevent edge-to-edge crowding */
    margin: 0 auto;        /* center within container */
  }
}

/* --- Mobile brand title hard cap (≤640px) --- */
@media (max-width: 640px){
  /* catch-all for the wordmark text in the header */
  .header .brand .tag,
  .header .brand .wordmark,
  .header .brand .brand-title,
  .header .brand .site-title,
  .header .brand h1,
  .header .brand .title {
    font-family: "Libre Baskerville", Georgia, serif !important;
    font-weight: 700 !important;
    font-size: 16px !important;     /* hard cap */
    line-height: 1.08 !important;
    letter-spacing: .3px !important;
    text-align: center !important;
    margin: 0 auto !important;
    max-width: 92% !important;
    display: block !important;
  }

  /* keep emblem sane */
  .header .emblem img{
    width: 56px !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* center and wrap nav neatly */
  .header nav, .header .nav{
    justify-content: center !important;
    gap: 8px 20px !important;
  }
}

/* ---------- Archive Fancy Ledger (CSS remains even if the table is removed) ---------- */
.fancy-ledger .ledger-frame{
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 12px;
  overflow: hidden;
}

/* corner notches */
.fancy-ledger .ledger-frame::before,
.fancy-ledger .ledger-frame::after{
  content:"";
  position:absolute;
  width:22px;height:22px;
  border:1px solid var(--line);
  border-radius:4px;
  transform: rotate(45deg);
  opacity:.35;
}
.fancy-ledger .ledger-frame::before{ top:-12px; left:18px; }
.fancy-ledger .ledger-frame::after{ bottom:-12px; right:18px; }

/* header band */
.fancy-ledger .ledger-head{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,0));
  border-radius:12px;
  margin: 4px 4px 10px;
}
.fancy-ledger .ledger-sigil{
  display:block; filter: grayscale(100%) contrast(1.1);
  opacity:.9
}
.fancy-ledger .ledger-title{
  line-height:1.1
}
.fancy-ledger .ledger-title .small{
  display:block; color: var(--muted); font-size:12px; letter-spacing:.08em;
  text-transform: uppercase;
}
.fancy-ledger .ledger-title strong{
  font-family: "IM Fell English", serif;
  font-size: 22px;
}

/* table container with scroll shadows on mobile */
.fancy-ledger .table-wrap{
  position: relative;
  border:1px solid var(--line);
  border-radius: 12px;
  overflow:auto;
  background:
    radial-gradient(80px 40px at 0% 50%, rgba(0,0,0,.08), transparent 60%) left/16px 100% no-repeat,
    radial-gradient(80px 40px at 100% 50%, rgba(0,0,0,.08), transparent 60%) right/16px 100% no-repeat,
    var(--paper);
}

/* base table */
.ledger-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:15px;
}

/* sticky header */
.ledger-table thead th{
  position: sticky; top:0; z-index: 1;
  background: linear-gradient(180deg, var(--accent-veil), #a4844d);
  color: var(--accent-ink);
  font-family: "IM Fell English", serif;
  font-size:15px;
  letter-spacing:.02em;
  text-align:left;
  border-bottom: 1px solid rgba(0,0,0,.12);
  padding:12px 14px;
}

/* cells */
.ledger-table td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.015));
}

/* ---- Archive relic images (side-by-side on desktop, stacked on mobile) ---- */
.relic-img {
  float: left;
  width: 40%;
  max-width: 420px;          /* standard desktop cap */
  height: auto;
  margin: 0 24px 12px 0;     /* space between image and text */
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #f8f1e3;       /* subtle parchment behind transparent PNGs */
}

/* Mobile: stack and slightly smaller cap */
@media (max-width: 820px) {
  .relic-img {
    float: none;
    width: 100%;
    max-width: 260px;        /* standard mobile cap */
    margin: 0 0 16px 0;
  }
}
/* ---------- Primary Nav (horizontal buttons) ---------- */
.primary-nav {
  display: flex;
  gap: 1.5rem;              /* spacing between buttons */
  align-items: flex-end;    /* keeps them aligned along bottom */
  justify-content: flex-end;/* push to right side if desired */
  flex-wrap: wrap;          /* allows wrapping on small screens */
  margin-top: auto;         /* positions at bottom of header block */
}

.primary-nav a {
  text-decoration: none;
  color: var(--ink);
  font-family: 'IM Fell English', serif;
  font-size: 1.1rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--accent);
}
/* Keep nav aligned at the bottom of the header */
.header {
  display: flex;
  align-items: flex-end;   /* pushes contents to bottom */
  justify-content: space-between;
}

.header .container {
  display: flex;
  align-items: flex-end;   /* bottom-align brand + nav */
  justify-content: space-between;
  width: 100%;
}

.nav, .primary-nav {
  display: flex;
  gap: 2rem;               /* spacing between links */
}
/* ==== Header/Nav override: lock links to bottom, single row ==== */
.header { position: relative; }

/* Add a little bottom space in the header block for the nav baseline */
.header .container { position: relative; padding-bottom: 1px; }

/* Handle either class name your header might use */
.primary-nav,
.nav{
  position:absolute;
  left:215px;       /* adjust until the first link sits neatly under the title, past the emblem */
  right:auto;
  bottom:0;
  display:flex;
  gap:2rem;
  white-space:nowrap;
  align-items:flex-end;
  flex-wrap:nowrap;
}


/* Keep link styling consistent; you likely have this already */
.primary-nav a,
.nav a {
  display: inline-block;
  text-decoration: none;
}

/* On smaller screens, fall back to normal flow and allow wrapping */
@media (max-width: 860px) {
  .header .container { padding-bottom: 0; }
  .primary-nav,
  .nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
    justify-content: left;
    white-space: normal;
    margin-top: 8px;
  }
}
.ledger-cta h2 {
  text-align: center;
}

/* Center the Ledger CTA heading */
.ledger-cta h2 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
