﻿/* =========================
   Global Theme & Resets
   ========================= */
:root{
  --bg: #FFFE91;            /* light yellow */
  --ink: #1a1a1a;
  --card: rgba(255,255,255,.75);
  --radius: 16px;
  --pad: clamp(16px, 3vw, 28px);
  --maxw: 760px;
  --accent: #111827;
}

/* Optional webfont if you add files to /assets/fonts/
@font-face{
  font-family: "Naudex";
  src: url("../fonts/naudex.woff2") format("woff2"),
       url("../fonts/naudex.woff")  format("woff");
  font-display: swap;
}
*/

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Naudex", Georgia, "Times New Roman", Times, serif; /* falls back if Naudex not installed */
  display:grid;
  place-items:center;
  padding: 16px;              /* tighter for mobile */
  overflow-x:hidden;          /* prevent sideways scroll */
}

/* =========================
   Headings
   ========================= */
.site-title{
  font-family: "Snell Roundhand", "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
  font-size: clamp(24px, 7vw, 42px);
  font-weight: 500;
  margin: 0 0 .3em 0;
  color: var(--accent);
  text-align:center;
}

.chapter-title{
  text-align: center;
  font-family: "Naudex", Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 5vw, 26px);
  color: #2b2b2b;
  margin-top: .25em;          /* slight space below main title */
  margin-bottom: .75em;       /* gap above the card */
  letter-spacing: .5px;
}

/* Title row with flanking images */
.title-row{
  width: min(100%, var(--maxw));
  margin: 0 auto .75em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 3vw, 24px);
  position: relative;
  z-index: 3; /* above stickers */
}

.title-row .titles{
  flex: 1;
  text-align: center;
}

/* Match side-sticker scaling */
.crest{
  width: clamp(36px, 8vw, 72px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}

/* Tighten on small phones */
@media (max-width: 480px){
  .crest{ width: clamp(28px, 10vw, 44px); }
}


/* =========================
   Card & Content
   ========================= */
.card{
  width:min(100%, var(--maxw));
  background: var(--card);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  padding: var(--pad);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  position:relative;
  z-index: 2; /* above edge stickers */
}

.content{
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.6;
  min-height: 30vh;
  white-space: pre-wrap;       /* preserves your line breaks */
  text-align: center;          /* center the message text in the box */
}

/* =========================
   Nav & Buttons
   ========================= */
.nav{
  margin-top: 16px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content: center;
}

.btn{
  appearance:none; border:0; cursor:pointer;
  padding:.6em 1em; border-radius:999px;
  font-weight:600; text-decoration:none;
  background:#111827; color:#fff;
}

.btn.ghost{ background:transparent; outline:2px solid #111827; color:#111827; }

footer{
  margin-top:12px;
  font-size:.9em;
  opacity:.8;
  text-align:center;
}

/* =========================
   Edge “Sticker” Images
   (placed by page.js)
   ========================= */
.edge-sticker{
  position: fixed;
  width: clamp(36px, 8vw, 72px);   /* scales for phone/desktop */
  opacity: .9;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
  z-index: 1;
  transform: rotate(0deg);         /* keep upright */
}

/* =========================
   Links in Content
   ========================= */
a{ color:#0b4; text-decoration-thickness: 2px; }
a:hover{ text-decoration: underline; }

/* =========================
   Mobile Polish
   ========================= */
@media (max-width: 600px){
  .card{
    padding: 16px;
    border-radius: 12px;
  }
  .nav{
    flex-direction: column;
    align-items: center;
  }
  .btn{
    width: 100%;
    text-align: center;
  }
}

/* On very narrow phones, reduce decorative clutter */
@media (max-width: 480px){
  .edge-sticker:nth-of-type(n+5){
    display: none;
  }
}
