/* Reusable components - see skills/ui/components.md. Markup patterns are listed in spec.md. */

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: var(--space-md); top: -100px; z-index: 100;
  background: var(--color-text); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: var(--space-sm); color: #fff; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--sky);
  box-shadow: 0 2px 0 rgba(255, 255, 255, 0.08), 0 8px 24px -16px rgba(20, 40, 80, 0.5);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: var(--space-md);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: 700; font-size: 1.65rem; line-height: 1;
  color: var(--color-text); text-decoration: none; display: inline-flex; align-items: baseline; gap: 0.3rem;
  padding: 0.4rem 0;
}
.nav-brand:hover { color: var(--color-text); }
.nav-brand .brand-accent {
  color: var(--pink); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.nav-brand .brand-star {
  width: 0.7em; height: 0.7em; background: var(--sun); align-self: flex-start;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.nav-toggle {
  width: 48px; height: 48px; border: 0; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14); color: var(--color-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.nav-toggle:active { transform: scale(0.94); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 22px; height: 2.5px; border-radius: 2px; background: currentColor;
  transition: transform 220ms var(--ease-out), opacity 160ms var(--ease-out);
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

.nav-links {
  position: absolute; left: 0; right: 0; top: 100%;
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: var(--space-sm) var(--space-md) var(--space-md);
  background: var(--sky);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 18px 30px -18px rgba(20, 40, 80, 0.6);
  opacity: 0; transform: translateY(-8px); visibility: hidden;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
}
.nav-links.open {
  opacity: 1; transform: translateY(0); visibility: visible;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s;
}
.nav-links a {
  color: var(--color-text); text-decoration: none; font-family: var(--font-heading); font-weight: 600;
  font-size: 1.25rem; padding: 0.7rem 1rem; border-radius: var(--radius-pill);
  min-height: 48px; display: flex; align-items: center;
  transition: background-color 160ms var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(255, 255, 255, 0.16); color: var(--color-text); }
.nav-links a[aria-current="page"] { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-links {
    position: static; flex-direction: row; padding: 0; background: none; box-shadow: none;
    opacity: 1; transform: none; visibility: visible; gap: 0.35rem;
  }
  .nav-links a { font-size: 1.1rem; padding: 0.5rem 1.1rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.75rem 1.6rem;
  border: 0; border-radius: var(--radius-pill); cursor: pointer;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; line-height: 1.1;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--pink-deep); color: var(--color-text); box-shadow: 0 6px 0 var(--pink-deeper); }
.btn-primary:hover { background: var(--pink-deeper); color: var(--color-text); }
.btn-primary:active { box-shadow: 0 2px 0 var(--pink-deeper); transform: translateY(4px) scale(0.99); }
.btn-ghost { background: #fff; color: var(--color-text); box-shadow: inset 0 0 0 2px var(--color-border); }
.btn-ghost:hover { color: var(--color-text); box-shadow: inset 0 0 0 2px var(--sky-light); }
.btn-icon {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, 0.22);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.btn-icon svg { width: 14px; height: 14px; }

/* ---------- Placeholder tag (only while MD.site.showPlaceholders is true) ---------- */
.placeholder-tag {
  display: inline-block; font-family: var(--font-body); font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--color-text); background: var(--sun); border: 2px dashed rgba(53, 52, 58, 0.55);
  border-radius: var(--radius-pill); padding: 0.15rem 0.6rem; vertical-align: middle;
}
body:not(.show-placeholders) .placeholder-tag { display: none; }

/* ---------- Hero ---------- */
.hero {
  background: var(--sky); color: var(--color-text); overflow: hidden;
  padding: var(--space-lg) 0 calc(var(--space-xl) + 40px);
}
.hero-inner { display: grid; gap: var(--space-lg); align-items: center; position: relative; z-index: 1; }
.hero h1 { color: var(--color-text); margin-bottom: var(--space-sm); }
.hero-sub { font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 700; line-height: 1.45; margin-bottom: var(--space-lg); }
.hero-text { text-align: center; }
.hero-text p { margin-left: auto; margin-right: auto; }
.hero .placeholder-tag { margin-bottom: var(--space-sm); }
.hero-photo { position: relative; width: min(78vw, 400px); margin: 0 auto; }
.blob-frame {
  aspect-ratio: 1 / 1.05; background: #fff; padding: 12px;
  border-radius: 58% 42% 55% 45% / 48% 52% 48% 52%;
  box-shadow: 0 24px 50px -20px rgba(10, 30, 70, 0.55);
  transform: rotate(-3deg);
}
.blob-frame > * { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.photo-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  background: repeating-linear-gradient(45deg, var(--blush), var(--blush) 14px, #fff4f9 14px, #fff4f9 28px);
  color: var(--color-text); text-align: center; padding: 1.5rem;
  font-family: var(--font-heading); font-weight: 600; font-size: 1.2rem;
}
.photo-placeholder small { font-family: var(--font-body); font-weight: 600; font-size: 0.85rem; color: var(--color-text-muted); max-width: 20ch; }
.hero-heart {
  position: absolute; width: 64px; height: 64px; top: 4%; left: -6%;
  background: var(--pink); transform: rotate(-12deg);
  clip-path: path("M32 58 C 10 42, 0 28, 6 16 C 12 4, 26 4, 32 16 C 38 4, 52 4, 58 16 C 64 28, 54 42, 32 58 Z");
}
@media (min-width: 768px) {
  .hero { padding-top: var(--space-xl); }
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; }
  .hero-text { text-align: left; order: 0; }
  .hero-text p { margin-left: 0; }
  .hero-photo { order: 1; }
}

/* Floating doodles: decorative, aria-hidden */
.doodle { position: absolute; pointer-events: none; opacity: 0.9; animation: bob 7s var(--ease-in-out) infinite alternate; }
.doodle-star { width: 34px; height: 34px; background: var(--sun);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.doodle-dot { width: 16px; height: 16px; border-radius: 50%; background: #ffe0c2; }
.doodle-ring { width: 46px; height: 46px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, 0.35); }
.doodle-note { width: 30px; height: 36px; border-right: 5px solid var(--pink); border-bottom: 0; position: absolute; }
@keyframes bob { from { transform: translateY(0) rotate(0deg); } to { transform: translateY(-14px) rotate(8deg); } }

/* ---------- Wavy section dividers ---------- */
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 48px; display: block; }
.wave-top { top: -1px; bottom: auto; transform: scaleY(-1); }

/* ---------- Section heading ---------- */
.section-head { text-align: center; margin: 0 auto var(--space-lg); max-width: 720px; }
.section-head p { margin-left: auto; margin-right: auto; color: var(--color-text-muted); font-size: 1.1rem; }
.eyebrow {
  display: inline-block; font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
  color: var(--color-text); background: var(--mint); border-radius: var(--radius-pill);
  padding: 0.3rem 0.9rem; margin-bottom: var(--space-sm);
}
.hebrew-name { font-family: var(--font-heading); font-weight: 500; }

/* ---------- This week's parsha ---------- */
.this-week-card {
  display: grid; gap: var(--space-lg); align-items: center;
  background: var(--color-surface); border-radius: calc(var(--radius) + 8px);
  padding: var(--space-md); box-shadow: var(--shadow);
  border: 3px solid var(--pale-blue);
}
.this-week-info h3 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 0.25rem; }
.this-week-info .hebrew-name { font-size: 1.6rem; color: var(--color-text); display: block; margin-bottom: var(--space-sm); }
.this-week-meta { color: var(--color-text-muted); font-weight: 700; margin-bottom: var(--space-sm); }
.this-week-note {
  background: var(--blush); border-radius: var(--radius-sm); padding: 0.75rem 1rem;
  font-weight: 700; margin-bottom: var(--space-md);
}
.this-week-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
@media (min-width: 768px) {
  .this-week-card { grid-template-columns: 1.35fr 1fr; padding: var(--space-lg); }
}

/* ---------- Video player (lite YouTube embed) ---------- */
.video {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: var(--sky); border: 6px solid var(--book-color, var(--pink));
  box-shadow: var(--shadow-soft);
}
.video iframe, .video img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video-play {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer;
  background: transparent; display: flex; align-items: center; justify-content: center;
}
.video-play-icon {
  width: 84px; height: 84px; border-radius: 50%; background: var(--pink-deep); color: var(--color-text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.4), inset 0 0 0 5px rgba(255, 255, 255, 0.35);
  transition: transform 180ms var(--ease-out);
}
.video-play-icon svg { width: 34px; height: 34px; margin-left: 5px; }
.video-play:hover .video-play-icon { transform: scale(1.06); }
.video-play:active .video-play-icon { transform: scale(0.96); }
.video-soon {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; text-align: center; color: var(--color-text); padding: 1rem;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.22) 0 38px, transparent 39px),
    radial-gradient(circle at 84% 78%, rgba(255, 255, 255, 0.16) 0 60px, transparent 61px),
    var(--book-bg, var(--sky));
}
.video-soon .hebrew-name { font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1.1; }
.video-soon-label {
  font-family: var(--font-heading); font-weight: 600; font-size: 1rem;
  background: rgba(255, 255, 255, 0.22); border-radius: var(--radius-pill); padding: 0.25rem 0.9rem;
}
.video-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }

/* Book colors: set --book-color (borders) and --book-bg (fills with charcoal text) */
.book-bereshit { --book-color: var(--teal); --book-bg: var(--teal-deep); --book-soft: var(--mint); }
.book-shemot   { --book-color: var(--sky-light); --book-bg: var(--sky); --book-soft: var(--pale-blue); }
.book-vayikra  { --book-color: var(--pink); --book-bg: var(--purple); --book-soft: var(--blush); }
.book-bamidbar { --book-color: var(--orange); --book-bg: var(--purple); --book-soft: var(--blush); }
.book-devarim  { --book-color: var(--pink); --book-bg: var(--pink-deep); --book-soft: var(--blush); }

/* ---------- Book tiles (home) ---------- */
.book-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.book-tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  min-height: 190px; padding: 1.4rem; border-radius: var(--radius);
  background: var(--book-bg); color: var(--color-text); text-decoration: none; overflow: hidden;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.12);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.book-tile:hover { color: var(--color-text); transform: translateY(-4px); box-shadow: 0 12px 0 rgba(0, 0, 0, 0.12); }
.book-tile:active { transform: scale(0.98); }
.book-tile::after {
  content: ""; position: absolute; width: 140px; height: 140px; right: -40px; top: -40px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.14);
}
.book-tile .hebrew-name { font-size: 2.6rem; line-height: 1; position: relative; z-index: 1; }
.book-tile-name { font-family: var(--font-heading); font-weight: 600; font-size: 1.4rem; line-height: 1.2; }
.book-tile-meta { font-weight: 700; opacity: 0.92; font-size: 0.95rem; }
/* Asymmetric on desktop: first book is a wide feature tile (taste-skill: avoid identical card rows) */
@media (min-width: 1024px) {
  .book-grid { grid-template-columns: repeat(6, 1fr); }
  .book-grid .book-tile:nth-child(1), .book-grid .book-tile:nth-child(2) { grid-column: span 3; min-height: 220px; }
  .book-grid .book-tile:nth-child(n + 3) { grid-column: span 2; }
}

/* ---------- About teaser ---------- */
.about-teaser { display: grid; gap: var(--space-lg); align-items: center; }
.about-teaser-art {
  aspect-ratio: 4 / 3; border-radius: 42% 58% 38% 62% / 55% 45% 55% 45%;
  background: var(--sky); position: relative; overflow: hidden; max-width: 460px; width: 100%; margin: 0 auto;
}
.about-teaser-art .photo-placeholder { position: absolute; inset: 14px; border-radius: inherit; }
@media (min-width: 768px) { .about-teaser { grid-template-columns: 0.9fr 1.1fr; } }

/* ---------- Parshas page ---------- */
.page-hero { background: var(--sky); color: var(--color-text); padding: var(--space-lg) 0 calc(var(--space-lg) + 40px); text-align: center; overflow: hidden; }
.page-hero h1 { color: var(--color-text); }
.page-hero p { margin: 0 auto; font-size: 1.15rem; font-weight: 700; }
.book-chips {
  display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.35rem var(--space-md) 0.6rem;
  margin: var(--space-md) calc(var(--space-md) * -1) 0; scroll-snap-type: x mandatory;
  scrollbar-width: none; justify-content: flex-start;
}
.book-chips::-webkit-scrollbar { display: none; }
.book-chip {
  flex: none; scroll-snap-align: start; min-height: 46px; display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.45rem 1.1rem; border-radius: var(--radius-pill); background: #fff; color: var(--color-text);
  font-family: var(--font-heading); font-weight: 600; text-decoration: none; box-shadow: var(--shadow-soft);
  transition: transform 160ms var(--ease-out);
}
.book-chip:hover { color: var(--color-text); transform: translateY(-2px); }
.book-chip::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--book-color); }
@media (min-width: 768px) { .book-chips { justify-content: center; margin-left: 0; margin-right: 0; } }

.book-section { padding: var(--space-lg) 0; scroll-margin-top: 80px; }
.book-section + .book-section { border-top: 2px dashed var(--color-border); }
.book-section-head { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); flex-wrap: wrap; }
.book-badge {
  width: 64px; height: 64px; border-radius: 22px; background: var(--book-bg); color: var(--color-text);
  display: flex; align-items: center; justify-content: center; font-size: 1.9rem; flex: none;
  transform: rotate(-6deg); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.12);
}
.book-section-head h2 { margin: 0; }
.book-section-head p { margin: 0; color: var(--color-text-muted); font-weight: 700; }

.parsha-grid { display: grid; gap: var(--space-md); grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.parsha-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--color-text);
  background: #fff; border-radius: var(--radius); overflow: hidden;
  border: 4px solid var(--book-color); box-shadow: var(--shadow-soft);
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.parsha-card:hover { color: var(--color-text); transform: translateY(-4px); box-shadow: var(--shadow); }
.parsha-card:active { transform: scale(0.98); }
.parsha-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--book-bg); color: var(--color-text); display: flex; align-items: center; justify-content: center; }
.parsha-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.parsha-thumb .hebrew-name { font-size: 2.2rem; }
.parsha-thumb-play {
  position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--pink-deep); color: var(--color-text); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}
.parsha-thumb-play svg { width: 16px; height: 16px; margin-left: 2px; }
.parsha-badge {
  position: absolute; left: 10px; top: 10px; font-size: 0.78rem; font-weight: 800;
  background: rgba(255, 255, 255, 0.9); color: var(--color-text); border-radius: var(--radius-pill); padding: 0.15rem 0.6rem;
}
.parsha-card-body { padding: 0.9rem 1rem 1.1rem; }
.parsha-card-body h3 { margin: 0 0 0.15rem; font-size: 1.25rem; }
.parsha-card-body p { margin: 0; color: var(--color-text-muted); font-size: 0.92rem; font-weight: 600; }

/* ---------- Single parsha page ---------- */
.parsha-page { padding-top: var(--space-lg); }
.breadcrumb { font-weight: 700; margin-bottom: var(--space-md); display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; }
.parsha-head { margin-bottom: var(--space-md); }
.parsha-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 0.2rem; }
.parsha-head .hebrew-name { font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--book-bg); }
.parsha-head-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--space-sm); }
.pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0.3rem 0.9rem; border-radius: var(--radius-pill); background: var(--book-soft, var(--pale-blue)); font-weight: 700; font-size: 0.95rem; }
.parsha-video-wrap { max-width: 900px; }
.parsha-below { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; margin: var(--space-md) 0 var(--space-lg); }
.parsha-pager { display: grid; gap: var(--space-sm); grid-template-columns: 1fr 1fr; max-width: 900px; }
.pager-link {
  display: flex; flex-direction: column; gap: 0.1rem; padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--color-surface); border: 2px solid var(--color-border); text-decoration: none; color: var(--color-text);
  min-height: 64px; transition: border-color 160ms var(--ease-out);
}
.pager-link:hover { color: var(--color-text); border-color: var(--sky-light); }
.pager-link small { color: var(--color-text-muted); font-weight: 700; }
.pager-link strong { font-family: var(--font-heading); font-weight: 600; font-size: 1.15rem; }
.pager-next { text-align: right; grid-column: 2; }
.not-found { text-align: center; padding: var(--space-xl) 0; }
.not-found p { margin-left: auto; margin-right: auto; }

/* ---------- Aleph Bet ---------- */
.letter-grid { display: grid; gap: var(--space-sm); grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); direction: rtl; }
.letter-tile {
  aspect-ratio: 1; border-radius: 22px; border: 0; cursor: pointer; direction: ltr;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  background: var(--tile-bg); color: var(--color-text); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.14);
  transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.letter-tile:hover { transform: translateY(-3px) rotate(-2deg); }
.letter-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.14); }
.letter-tile .hebrew-name { font-size: 2.8rem; line-height: 1; }
.letter-tile small { font-weight: 800; font-size: 0.85rem; }
.letter-tile[aria-pressed="true"] { outline: 4px solid var(--sun); outline-offset: 3px; }
.letter-stage { margin-top: var(--space-lg); max-width: 760px; margin-left: auto; margin-right: auto; }

/* ---------- About page ---------- */
.prose { max-width: 680px; }
.prose h2 { margin-top: var(--space-lg); }

/* ---------- Footer ---------- */
.site-footer { background: var(--sky); color: var(--color-text); padding: calc(var(--space-lg) + 40px) 0 var(--space-lg); position: relative; margin-top: 48px; }
.site-footer .wave { top: -47px; bottom: auto; }
.site-footer .wave path { fill: var(--sky); }
.footer-inner { display: flex; flex-direction: column; gap: var(--space-md); align-items: center; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 0.5rem; padding: 0; list-style: none; }
.footer-links a { color: var(--color-text); font-weight: 700; padding: 0.6rem 0.8rem; display: inline-block; min-height: 44px; }
.footer-links a:hover { color: var(--color-text); }
.footer-dedication { font-family: var(--font-display, inherit); font-weight: 800; font-size: 1.05rem; margin: 0; }
.footer-small { font-size: 0.9rem; opacity: 0.92; margin: 0; }
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* ---------- Scroll reveal (js/components/reveal.js adds .is-visible once) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* ---------- Fixes after visual review ---------- */
/* Hebrew names under English headings stay left-aligned, not pushed to the right edge */
.this-week-info .hebrew-name, .parsha-head .hebrew-name { text-align: left; unicode-bidi: isolate; }
/* Mobile: book tiles in two columns so the section isn't a long scroll */
@media (max-width: 1023px) {
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
  .book-tile { min-height: 150px; padding: 1.1rem; }
  .book-tile .hebrew-name { font-size: 2.1rem; }
  .book-tile-name { font-size: 1.2rem; }
  .book-grid .book-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .book-grid .book-tile:last-child:nth-child(odd) { grid-column: auto; }
  .book-grid .book-tile:nth-child(4) { grid-column: span 1; }
}
/* Mobile: two parsha cards per row (54 cards in one column is too much scrolling) */
@media (max-width: 767px) {
  .parsha-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .parsha-card { border-width: 3px; border-radius: 18px; }
  .parsha-thumb .hebrew-name { font-size: 1.6rem; }
  .parsha-badge { font-size: 0.68rem; left: 6px; top: 6px; }
  .parsha-thumb-play { width: 32px; height: 32px; right: 6px; bottom: 6px; }
  .parsha-card-body { padding: 0.6rem 0.7rem 0.8rem; }
  .parsha-card-body h3 { font-size: 1.05rem; }
  .parsha-card-body p { font-size: 0.8rem; }
  .book-chips { padding-left: var(--space-md); }
}


/* October 2026: Deena's village-window direction, gentle sage/lavender. */
.hero { background: var(--sage-soft); color: var(--color-text); padding-bottom: var(--space-xl); }
.hero h1 { color: var(--color-text); }
.hero-sub { font-weight: 600; }
.nav-brand .brand-accent { color: var(--color-text); text-shadow: none; }
.nav-brand .brand-star { display: none; }
.hero-photo { width: min(90%, 420px); padding: var(--space-lg) 0; }
.village-window { position: relative; width: 76%; margin: 0 auto; padding: 14px 14px 0; background: var(--stone); border: 3px solid var(--stone-light); border-radius: 48% 48% 4px 4px / 30% 30% 4px 4px; box-shadow: var(--shadow); }
.window-opening { position: relative; aspect-ratio: 3 / 4; background: var(--window-dark); border-radius: 48% 48% 0 0 / 28% 28% 0 0; overflow: hidden; }
.window-opening [data-hero-photo] { width: 100%; height: 100%; border-radius: inherit; padding: 0; }
.window-opening img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.window-opening .photo-placeholder { background: var(--lavender-soft); padding: var(--space-md); }
.window-shutter { position: absolute; top: 27%; bottom: 0; width: 29%; background: repeating-linear-gradient(to bottom,var(--shutter) 0,var(--shutter) 14px,var(--shutter-line) 15px,var(--shutter-line) 17px); border: 6px solid var(--shutter); box-shadow: var(--shadow-soft); }
.window-shutter-left { right: calc(100% - 5px); transform: perspective(500px) rotateY(-22deg); transform-origin: right; border-radius: 7px 0 0 3px; }
.window-shutter-right { left: calc(100% - 5px); transform: perspective(500px) rotateY(22deg); transform-origin: left; border-radius: 0 7px 3px 0; }
.window-sill { position: absolute; height: 22px; bottom: -18px; left: -9%; width: 118%; background: var(--stone-light); border-bottom: 7px solid var(--stone); border-radius: 4px; box-shadow: var(--shadow-soft); z-index: 3; }
/* Shutters open once on arrival; no continuous motion or mouse following. */
.window-shutter { animation: window-open 700ms var(--ease-out) both; }
@keyframes window-open { from { opacity: 0; } to { opacity: 1; } }
.doodle { display: none; }
.torah-scroll { position: absolute; width: 58px; height: 65px; opacity: .68; pointer-events: none; background: url('../assets/icons/torah-scroll.svg') center / contain no-repeat; }

.torah-scroll-books { top: 6%; right: 5%; transform: rotate(12deg); }
@media (min-width: 768px) { .hero-photo { width: 100%; } .hero-inner { gap: var(--space-xl); } }
@media (hover: hover) and (pointer: fine) {
  html, body, a, button, [role="button"], .btn, .nav-toggle, .video-play, .letter-tile { cursor: url('../assets/icons/yad-cursor.svg') 3 2, auto; }
  input, textarea, [contenteditable="true"] { cursor: text; }
}

.window-opening .has-photo { padding: 0; display: block; }
/* The opening-page Torah sits above the greeting in normal flow, not over it. */
.torah-scroll-hero {
  display: block; position: relative; top: auto; left: auto;
  width: var(--torah-hero-width); height: auto; aspect-ratio: 12 / 11;
  margin: 0 auto var(--space-md); opacity: 1;
  transform: rotate(var(--torah-hero-tilt));
}
@media (min-width: 768px) {
  .torah-scroll-hero { width: var(--torah-hero-width-desktop); }
}

/* Transparent portrait overlaps the arch and inner frame, behind the sill. */
.window-opening { overflow: visible; background: var(--lavender-soft); }
.window-opening .has-photo { position: absolute; inset: -25px -20px 0; width: auto; height: auto; border-radius: 0; background: transparent; overflow: hidden; }
.window-opening .has-photo img { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; }

.about-teaser-art { aspect-ratio: auto; border-radius: var(--radius); background: var(--mint); }
.about-teaser-art > img { width: 100%; height: auto; }
.about-teaser p { font-size: clamp(1.15rem, 2.4vw, 1.45rem); }

/* Vibrant Harmony preview: bright fills with readable purple ink. */
.book-vayikra { --book-bg: var(--pink); }
.book-bamidbar { --book-bg: var(--sun); }
.book-devarim { --book-bg: #0ead6a; }
.nav-brand .brand-accent { color: var(--color-text); }

.letter-tile:nth-child(5n+1) { background: var(--teal); }
.letter-tile:nth-child(5n+2), .letter-tile:nth-child(5n+5) { background: var(--sun); }
.letter-tile:nth-child(5n+3) { background: var(--pink); }
.letter-tile:nth-child(5n+4) { background: #0ead6a; }

/* Teal-dominant Aleph Bet page preview. Other pages retain yellow navigation. */
.aleph-page { --sky: #3ccdac; --sky-light: #3ccdac; }
.aleph-page .letter-tile:nth-child(5n+1), .aleph-page .letter-tile:nth-child(5n+2) { background: #3ccdac; }
.aleph-page .letter-tile:nth-child(5n+5) { background: #fdd341; }
