/* ==========================================================================
   Aphorisms page — Greg T Meyers
   Parchment cards on a dark wood/leather background.
   NOTE: the ornate wood/filmstrip frame in the mockup is approximated here with
   CSS gradients. Drop in real texture images (e.g. assets/images/wood-frame.png)
   as background-image where noted if you want a pixel match.
   ========================================================================== */

:root{
  --wood-dark:   #2a1a0e;
  --wood-mid:    #4a2f17;
  --wood-light:  #6b4523;
  --gold:        #c9a24b;
  --gold-soft:   #d8b968;
  --parchment:   #efe2c0;
  --parchment-2: #e7d7af;
  --ink:         #3a2410;
  --ink-soft:    #7a5a30;
}

*{ box-sizing:border-box; }

html,body{ margin:0; padding:0; }

body{
  font-family:'EB Garamond', Georgia, 'Times New Roman', serif;
  color:var(--parchment);
  background-color:var(--wood-dark);
  background-image:url("../images/body-wood.jpg");
  background-repeat:repeat;        /* 1024x1024 seamless tile */
  min-height:100vh;
}

/* ============ HEADER / NAV ============ */
.site-header{
  position:relative; height:120px;      /* ~1.25in on screen */
  background:url("../images/header-wood.png") repeat-x center top;
  background-size:auto 100%;            /* uniform scale: squares stay square, tiles across */
  box-shadow:0 6px 18px rgba(0,0,0,.5);
}
.header-inner{
  max-width:1180px; margin:0 auto; height:100%;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 30px 26px;                  /* sit the logo/nav in the wood band above the filmstrip */
}
@media (max-width:640px){
  .site-header{ height:92px; }
  .header-inner{ padding-bottom:20px; }
  .brand{ font-size:1.5rem; }
}
.brand{
  font-size:2rem; letter-spacing:.06em; color:var(--parchment);
  text-decoration:none; text-shadow:0 1px 2px rgba(0,0,0,.6);
}
.main-nav a{
  color:#d9c6a3; text-decoration:none; margin-left:28px;
  font-size:1.15rem; letter-spacing:.03em; padding-bottom:4px;
  transition:color .2s;
}
.main-nav a:hover{ color:#fff; }
.main-nav a.active{
  color:var(--gold-soft);
  border-bottom:2px solid var(--gold);
}

/* ============ PAGE TITLE ============ */
.page-title{ text-align:center; padding:14px 20px 22px; }

/* gold plaque image with the title set inside it */
.title-plate{
  width:536px; max-width:92%; aspect-ratio:2626 / 289;
  margin:0 auto;
  background:url("../images/title-plate.png") no-repeat center center;
  background-size:contain;
  display:flex; align-items:center; justify-content:center;
}
.title-plate span{
  font-size:1.35rem; letter-spacing:.4em; text-transform:uppercase;
  color:var(--gold-soft); padding-left:.4em;
}
.subtitle{
  margin:6px 0 0; font-size:1.3rem; font-style:italic;
  color:#cdb98f;
}

/* ============ PARCHMENT PANEL ============ */
.parchment-panel{
  max-width:1180px; margin:10px auto 60px; padding:34px 34px 48px;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(255,255,255,.35), transparent 55%),
    linear-gradient(160deg, var(--parchment) 0%, var(--parchment-2) 100%);
  border-radius:4px;
  box-shadow:0 12px 40px rgba(0,0,0,.55);
  color:var(--ink);
}

/* ============ FILTER ROW ============ */
.filter-row{ display:flex; align-items:center; gap:14px; margin-bottom:28px; }
.filter-row label{
  font-size:1.2rem; letter-spacing:.02em; color:var(--ink);
}
#topic-select{
  font-family:inherit; font-size:1rem; color:var(--ink);
  padding:8px 40px 8px 14px; min-width:260px;
  background-color:#f1e4c2;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233a2410' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; background-size:11px 7px;
  border:1px solid var(--ink-soft); border-radius:3px;
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  cursor:pointer;
}
#topic-select:focus{ outline:none; border-color:var(--ink); }

/* ============ GRID ============ */
.aphorism-grid{
  display:grid; gap:22px;
  grid-template-columns:repeat(4, 1fr);
}
@media (max-width:1024px){ .aphorism-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:560px){  .aphorism-grid{ grid-template-columns:1fr; } }

/* ============ CARD ============ */
.aphorism-card{
  position:relative;
  display:flex; flex-direction:column; align-items:center;
  text-align:center;
  padding:14px 18px 10px;
  background:transparent;  /* parchment fill is baked into the frame image (fill) */
  /* ornamented gold frame: flat parchment inside, transparent outside the corners */
  border:20px solid transparent;
  border-image:url("../images/card-frame.png") 80 fill stretch;
  min-height:260px;
}

.card-topic{
  font-size:.82rem; letter-spacing:.22em; text-transform:uppercase;
  color:var(--ink-soft); font-weight:600;
}
.card-divider{ width:34px; height:1px; background:var(--ink-soft); opacity:.6; margin:8px 0 14px; }

.card-verse{
  flex:1 1 auto; display:flex; align-items:center; justify-content:center;
  margin:0 0 16px; color:var(--ink);
  font-size:1.168rem; line-height:1.38;   /* auto-fit shrinks toward 0.78rem floor */
}

/* ============ SHARE ROW ============ */
.card-share{ display:flex; gap:18px; align-items:center; justify-content:center; }
.share-btn{
  color:#b8912f; font-size:1.15rem; text-decoration:none; line-height:1;  /* match gold frame */
  opacity:.9; transition:transform .15s, color .15s, opacity .15s;
}
.share-btn:hover{ color:#8a6a1f; transform:translateY(-2px); opacity:1; }
.share-btn.x-btn{ font-size:1.25rem; font-weight:700; }

/* ============ MISC ============ */
.no-results{ text-align:center; font-size:1.2rem; color:var(--ink-soft); padding:30px 0; }

.toast{
  position:fixed; left:50%; bottom:30px; transform:translateX(-50%) translateY(20px);
  background:rgba(42,26,14,.95); color:var(--parchment);
  padding:12px 22px; border:1px solid var(--gold); border-radius:4px;
  font-size:1rem; opacity:0; pointer-events:none;
  transition:opacity .25s, transform .25s; z-index:1000;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
/* Footer styles now live inside footer.php (self-contained include). */
