/*
Theme Name: Museum of the Scroll
Theme URI: https://themuseumofthescroll.org
Author: The Museum of the Scroll
Author URI: https://themuseumofthescroll.org
Description: A custom WordPress theme for The Museum of the Scroll, a 501(c)(3) nonprofit dedicated to Tanakh, Sifrei Torah, and Jewish sacred texts. Hebrew-aware, archival design with exhibits and donation support.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: museum-of-the-scroll
*/

/* ---------- Design Tokens ---------- */
:root {
  --ink: #1b1813;
  --ink-soft: #4a4238;
  --parchment: #f3ead6;
  --parchment-deep: #e6d7b6;
  --vellum: #fbf6ec;
  --gold: #8f6f2c;
  --gold-bright: #bd9638;
  --tekhelet: #1f3a6e;      /* Biblical blue / tekhelet */
  --tekhelet-soft: #2f4f8a;
  --crimson: #6c2622;
  --rule: #d6c6a3;
  --shadow: rgba(27, 24, 19, 0.18);
  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "EB Garamond", Georgia, serif;
  --sans: "Spectral", Georgia, serif;
  --hebrew: "Frank Ruhl Libre", "Cormorant Garamond", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--vellum);
  font-size: 1.18rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(143,111,44,0.05), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(31,58,110,0.04), transparent 50%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--tekhelet); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--gold); }

.wrap { width: min(1140px, 92vw); margin: 0 auto; }

/* Hebrew text helper */
.hebrew, [lang="he"] { font-family: var(--hebrew); direction: rtl; unicode-bidi: isolate; }
:root[dir="rtl"] body, body.rtl { direction: rtl; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--parchment);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px var(--shadow);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 0;
}
.brand { display: flex; flex-direction: column; gap: .15rem; }
.brand .mark {
  font-family: var(--serif); font-weight: 700; font-size: 1.85rem;
  letter-spacing: .01em; color: var(--ink); line-height: 1;
}
.brand .mark span { color: var(--gold); font-style: italic; }
.brand .mark-he { font-family: var(--hebrew); direction: rtl; font-size: 1.15rem; color: var(--tekhelet); font-weight: 500; }
.main-nav > ul,
.main-nav ul.nav-menu { list-style: none; display: flex; gap: 1.7rem; align-items: center; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a {
  font-family: var(--sans); font-size: .82rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink); font-weight: 500;
  display: inline-flex; align-items: center; gap: .35rem;
}
.main-nav a:hover { color: var(--gold); }
.main-nav .caret { font-size: .6rem; opacity: .6; transition: transform .2s ease; }
.main-nav .has-sub:hover .caret { transform: rotate(180deg); }

/* Submenus */
.main-nav .sub-menu {
  list-style: none; margin: 0; padding: .5rem 0;
  position: absolute; top: 100%; left: -1rem; min-width: 230px;
  background: var(--parchment); border: 1px solid var(--rule);
  box-shadow: 0 10px 28px var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 60; flex-direction: column; display: block; gap: 0;
}
.main-nav .has-sub:hover > .sub-menu,
.main-nav .has-sub:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.main-nav .sub-menu li { display: block; }
.main-nav .sub-menu a {
  display: block; padding: .55rem 1.4rem; letter-spacing: .1em;
  text-transform: none; font-size: .92rem; white-space: nowrap;
}
.main-nav .sub-menu a:hover { background: var(--parchment-deep); color: var(--ink); }

.btn-donate {
  background: var(--tekhelet); color: var(--vellum) !important;
  padding: .55rem 1.2rem; border-radius: 2px; letter-spacing: .12em;
}
.btn-donate:hover { background: var(--gold); color: var(--ink) !important; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  padding: 6rem 0 5rem; text-align: center; position: relative;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(243,234,214,0.0), rgba(230,215,182,0.55));
}
.hero .eyebrow {
  font-family: var(--hebrew); direction: rtl; font-size: 1.5rem;
  color: var(--tekhelet); margin-bottom: 1rem; letter-spacing: 0;
}
.hero h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.04; color: var(--ink); margin-bottom: 1.4rem;
}
.hero h1 em { font-style: italic; color: var(--tekhelet); }
.hero p.lede {
  max-width: 660px; margin: 0 auto 2.2rem; font-size: 1.32rem; color: var(--ink-soft);
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: var(--sans); letter-spacing: .14em; text-transform: uppercase;
  font-size: .82rem; padding: .85rem 1.8rem; border-radius: 2px;
  border: 1px solid var(--ink); display: inline-block;
}
.btn-primary { background: var(--ink); color: var(--vellum); }
.btn-primary:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--vellum); }

/* ---------- Sections ---------- */
.section { padding: 5rem 0; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head .kicker {
  font-family: var(--hebrew); direction: rtl; font-size: 1.25rem;
  color: var(--gold); display: block; margin-bottom: .6rem;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 4vw, 3rem);
  color: var(--ink);
}
.divider {
  width: 70px; height: 1px; background: var(--gold); margin: 1.2rem auto 0;
  position: relative;
}
.divider::before, .divider::after {
  content: "✡"; position: absolute; top: -.75rem; color: var(--gold); font-size: .85rem;
}
.divider::before { left: -1.5rem; } .divider::after { right: -1.5rem; }

/* ---------- Collection Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card {
  background: var(--vellum); border: 1px solid var(--rule);
  box-shadow: 0 4px 18px var(--shadow); overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px var(--shadow); }
.card .thumb { aspect-ratio: 4/3; background: var(--parchment-deep); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 1.6rem; }
.card h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin-bottom: .3rem; }
.card .he { font-family: var(--hebrew); direction: rtl; color: var(--tekhelet); font-size: 1.15rem; margin-bottom: .5rem; }
.card .meta { font-family: var(--sans); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: .7rem; }
.card p { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Featured ---------- */
.feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3.5rem; align-items: center; }
.feature .media { aspect-ratio: 5/6; background: var(--parchment-deep); border: 1px solid var(--rule); box-shadow: 0 8px 30px var(--shadow); overflow: hidden; }
.feature .media img { width: 100%; height: 100%; object-fit: cover; }
.feature h2 { font-family: var(--serif); font-size: clamp(1.8rem,3.5vw,2.8rem); font-weight: 600; margin-bottom: 1rem; }
.feature .kicker { font-family: var(--hebrew); direction: rtl; color: var(--gold); font-size: 1.2rem; display:block; margin-bottom:.5rem; }
.feature p { color: var(--ink-soft); margin-bottom: 1.2rem; }

/* ---------- Donate band ---------- */
.donate-band {
  background: var(--tekhelet); color: var(--parchment); text-align: center; padding: 5rem 0;
  background-image: radial-gradient(circle at 50% 0%, rgba(189,150,56,0.22), transparent 60%);
}
.donate-band .he { font-family: var(--hebrew); direction: rtl; font-size: 1.6rem; color: var(--gold-bright); margin-bottom: .8rem; }
.donate-band h2 { font-family: var(--serif); font-size: clamp(2rem,4vw,3.2rem); color: var(--vellum); margin-bottom: 1rem; }
.donate-band p { color: var(--parchment); max-width: 620px; margin: 0 auto 2rem; opacity: .92; }
.donate-band .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.donate-band .btn-primary:hover { background: var(--gold-bright); }
.donate-band .ein { font-family: var(--sans); font-size: .76rem; letter-spacing: .14em; color: var(--gold-bright); margin-top: 1.8rem; text-transform: uppercase; }

/* ---------- Content ---------- */
.entry { padding: 4rem 0; }
.entry-narrow { width: min(720px, 92vw); margin: 0 auto; }
.entry h1.entry-title { font-family: var(--serif); font-size: clamp(2.2rem,5vw,3.4rem); font-weight: 600; margin-bottom: 1rem; line-height: 1.08; }
.entry .entry-meta { font-family: var(--sans); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 2rem; }
.entry-content > * + * { margin-top: 1.4rem; }
.entry-content h2 { font-family: var(--serif); font-size: 2rem; font-weight: 600; margin-top: 2.4rem; }
.entry-content h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin-top: 1.8rem; }
.entry-content blockquote { border-left: 3px solid var(--gold); padding-left: 1.4rem; font-style: italic; color: var(--ink-soft); font-size: 1.3rem; }
.entry-content blockquote.hebrew { border-left: 0; border-right: 3px solid var(--gold); padding-left: 0; padding-right: 1.4rem; font-style: normal; font-family: var(--hebrew); }
.entry-content img { margin: 1.6rem auto; box-shadow: 0 6px 22px var(--shadow); }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--parchment); border-top: 1px solid var(--rule); padding: 4rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.2rem; margin-bottom: 3rem; }
.footer-grid h4 { font-family: var(--sans); font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.1rem; }
.footer-grid .mark { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; margin-bottom: .3rem; }
.footer-grid .mark span { color: var(--gold); font-style: italic; }
.footer-grid .mark-he { font-family: var(--hebrew); direction: rtl; color: var(--tekhelet); font-size: 1.1rem; margin-bottom:.6rem; }
.footer-grid p { color: var(--ink-soft); font-size: 1rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid a { color: var(--ink); font-size: 1rem; }
.footer-bottom { border-top: 1px solid var(--rule); padding-top: 1.6rem; text-align: center; font-family: var(--sans); font-size: .76rem; letter-spacing: .08em; color: var(--ink-soft); }

/* ---------- misc ---------- */
.screen-reader-text { position: absolute; left: -9999px; }
.aligncenter { margin-left: auto; margin-right: auto; }
.alignright { float: right; margin-left: 1.5rem; }
.alignleft { float: left; margin-right: 1.5rem; }
.wp-caption-text { font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); text-align: center; margin-top: .5rem; }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--parchment); border-bottom: 1px solid var(--rule); max-height: 80vh; overflow-y: auto; }
  .main-nav.open { display: block; }
  .main-nav ul.nav-menu { flex-direction: column; gap: 0; padding: .5rem 0; align-items: stretch; }
  .main-nav .nav-menu > li { border-bottom: 1px solid var(--rule); }
  .main-nav .nav-menu > li:last-child { border-bottom: 0; }
  .main-nav a { padding: .9rem 6vw; }
  /* On mobile, show submenus inline (no hover) */
  .main-nav .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; background: var(--vellum);
    min-width: 0; padding: 0;
  }
  .main-nav .sub-menu a { padding: .7rem 10vw; font-size: .85rem; }
  .main-nav .caret { display: none; }
  .nav-toggle { display: block; }
}
