/* Source Sheets (/source-sheets/) — layered cleanly on /styles.css */
.ss-hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin: 8px 0 16px;
}
.page-hero .ss-hero-title h1 {
  margin: 0;
}
.ss-hero-he {
  font-family: "Frank Ruhl Libre", "David Libre", "Times New Roman", Georgia, serif;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 500;
  color: var(--gold-l);
  letter-spacing: 0.01em;
  line-height: 1.15;
}
.topic-page .bar nav a[aria-current="page"] {
  color: var(--teal);
  font-weight: 600;
}
@media (max-width: 640px) {
  .topic-page .bar nav a[href="/parsha-pearls/"],
  .topic-page .bar nav a[href="/about/"] {
    display: none;
  }
}

/* Main ivory gallery section */
.ss-gallery-sec {
  background: var(--cream);
  padding: 52px 0 68px;
  border-bottom: 1px solid var(--line);
}
.ss-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.ss-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.ss-heading {
  font-size: clamp(30px, 4.8vw, 40px);
  color: var(--ink);
  margin: 0;
}
.ss-heading::after,
.ss-companion-text h2::after {
  display: none;
}
.ss-count {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Filter pills */
.ss-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ss-filter-btn {
  appearance: none;
  font: 500 13.5px/1 Inter, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.ss-filter-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}
.ss-filter-btn[aria-pressed="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.ss-filter-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Responsive booklet grid — Featured newest booklet + balanced 3x2 grid */
.ss-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  align-items: stretch;
}
@media (max-width: 980px) {
  .ss-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
}
@media (max-width: 620px) {
  .ss-gallery-sec {
    padding: 36px 0 48px;
  }
  .ss-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* Booklet card */
.sheet-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(9, 37, 42, 0.045);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.sheet-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(9, 37, 42, 0.09);
  border-color: #d6cdb9;
}
.sheet-card[hidden] {
  display: none;
}

/* Featured newest booklet spans full row cleanly on desktop & tablet when showing All */
@media (min-width: 780px) {
  .ss-grid:not(.is-filtered) .sheet-featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
    border-color: #d9cfb8;
    box-shadow: 0 6px 24px rgba(9, 37, 42, 0.065);
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-cover-link {
    flex: 0 0 340px;
    display: flex;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-cover-stage {
    width: 100%;
    padding: 26px 36px;
    border-bottom: none;
    border-right: 1px solid var(--line);
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-cover {
    max-width: 240px;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-body {
    padding: 28px 34px 28px;
    justify-content: center;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-he {
    font-size: 25px;
    margin-bottom: 6px;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-title {
    font-size: 34px;
    margin-bottom: 6px;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-sub {
    font-size: 19px;
    margin-bottom: 14px;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-desc {
    font-size: 15.5px;
    max-width: 56ch;
    flex: 0 0 auto;
    margin-bottom: 22px;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-actions {
    padding-top: 18px;
    justify-content: flex-start;
  }
  .ss-grid:not(.is-filtered) .sheet-featured .sheet-btn-pri {
    flex: 0 0 auto;
    padding: 12px 24px;
  }
}

/* Cover display — exact 17:22 (8.5x11) letter aspect ratio, zero clipping */
.sheet-cover-link {
  display: block;
  text-decoration: none;
}
.sheet-cover-stage {
  background: linear-gradient(180deg, #f3eee4 0%, #ebe4d6 100%);
  padding: 20px 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.sheet-cover {
  width: 100%;
  max-width: 244px;
  height: auto;
  aspect-ratio: 17 / 22;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 10px 24px rgba(9, 37, 42, 0.22), 0 1px 4px rgba(9, 37, 42, 0.12);
  transition: transform 0.28s ease;
}
.sheet-cover-link:hover .sheet-cover {
  transform: scale(1.018);
}

/* Card body */
.sheet-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}
.sheet-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sheet-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-pages {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sheet-he {
  margin: 0 0 4px;
  font-family: "Frank Ruhl Libre", "David Libre", "Times New Roman", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.28;
  color: var(--teal-d);
  text-align: left;
}
.sheet-title {
  font-family: Cormorant, "Cormorant Garamond", Georgia, serif;
  font-size: 23.5px;
  font-weight: 600;
  line-height: 1.16;
  color: var(--ink);
  margin: 0 0 4px;
}
.sheet-sub {
  margin: 0 0 10px;
  font-family: Cormorant, "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 16.5px;
  line-height: 1.3;
  color: var(--teal);
}
.sheet-desc {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  flex: 1;
}

/* Action buttons */
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #efebe2;
}
.sheet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: 500 13.5px/1 Inter, system-ui, sans-serif;
  text-decoration: none;
  border-radius: 6px;
  padding: 10px 14px;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.sheet-btn-pri {
  background: var(--teal);
  border: 1px solid var(--teal);
  color: #fff;
  flex: 1 1 auto;
}
.sheet-btn-pri:hover {
  background: var(--teal-d);
  border-color: var(--teal-d);
  color: #fff;
}
.sheet-btn-sec {
  background: #fff;
  border: 1px solid var(--gold);
  color: var(--teal-d);
  flex: 1 1 auto;
}
.sheet-btn-sec:hover {
  background: var(--cream);
  border-color: var(--teal);
  color: var(--teal-d);
}

/* Companion Parsha Pearls essays callout */
.ss-companion {
  background: #fff;
  padding: 52px 0;
}
.ss-companion-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px 32px;
  background: linear-gradient(135deg, #0b4a4a 0%, #073335 100%);
  color: #fff;
  border-radius: 12px;
  padding: 32px 36px;
  border: 1px solid rgba(212, 181, 106, 0.35);
}
.ss-companion-text {
  max-width: 620px;
}
.ss-companion-text .ss-eyebrow {
  color: var(--gold-l);
}
.ss-companion-text h2 {
  font-size: clamp(26px, 4vw, 34px);
  color: #fff;
  margin: 0 0 8px;
}
.ss-companion-text p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}
.ss-companion-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-l);
  color: #06302f;
  font: 600 14.5px/1 Inter, system-ui, sans-serif;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 999px;
  transition: background-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.ss-companion-cta:hover {
  background: #e3c985;
  transform: translateY(-1px);
}
@media (max-width: 620px) {
  .ss-companion {
    padding: 36px 0;
  }
  .ss-companion-box {
    padding: 24px 22px;
  }
}
