/* Torah Apps by BD TECH — page-specific components.
   The design system itself lives in style.css (synced from the repo root). */

/* language menu — current code highlighted like selected text (a tight
   light-gray rectangle behind it, in the site's neutral palette); click
   stacks the other codes below, text starts aligned. Pure <details>, no JS. */
.lang-menu { position: relative; display: inline-block; }
.lang-chip {
  display: inline-block;
  background: var(--line); color: var(--ink);
  font-family: var(--font-mono); font-size: 0.82rem;
  padding: 2px 6px; border-radius: 3px;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.lang-menu summary {
  list-style: none; cursor: pointer; padding-block: 8px;
  display: inline-block;   /* shrink-wrap so the chip starts on the menu's edge */
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover .lang-chip { background: var(--ink); color: var(--accent-ink); }
/* open list: stacked, each chip's text start aligned with the summary's */
.lang-menu ul {
  position: absolute; inset-inline-start: 0; inset-block-start: 100%;
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; z-index: 60;
}
.lang-menu ul a.lang-chip { text-decoration: none; color: var(--ink); }
.lang-menu ul a.lang-chip:hover { background: var(--ink); color: var(--accent-ink); }

/* five nav items (four anchors + the language menu) do not fit a phone
   header — drop the two secondary anchors there. Same degradation as the
   orsyncui wordmark: the page is one scroll, so no destination is lost. */
@media (max-width: 599px) {
  .site-nav a[href="#screenshots"], .site-nav a[href="#more"] { display: none; }
  .wordmark .tld { display: none; }   /* "by BDTech" — the footer still says it */
}

/* the flagship app block: large icon above the overline, product title
   carrying the same weight as a hero h1 without stealing the page's h1 */
.product-hero-icon {
  inline-size: clamp(72px, 10vw, 96px); block-size: auto;
  border-radius: 22.5%; margin-block-end: 24px;
  outline: 1px solid rgba(29, 29, 31, 0.1); outline-offset: -1px;
}
.product-title { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); max-inline-size: 22ch; }
#siddur .lede { margin-block-start: 20px; }

/* official App Store badge with a coming-soon chip (the app is not live yet,
   so the badge is deliberately unlinked — never a dead store link) */
.store-badge { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.store-badge img { block-size: 52px; inline-size: auto; display: block; }

/* the scope caveat under the badge — what version 1.0 does and does not cover */
.scope-note {
  margin-block-start: 24px; max-inline-size: 60ch;
  font-size: 0.9rem; color: var(--ink-soft);
  padding-inline-start: 14px; border-inline-start: 2px solid var(--line);
}

/* features: six caps sit better on three columns */
@media (min-width: 1080px) {
  .cap-grid--three { grid-template-columns: repeat(3, 1fr); }
}

/* screenshots: a scrolling strip of phone shots, each one a button that
   opens the lightbox. Portrait 1320x2868 sources, so the strip is sized by
   width and the aspect ratio holds the height. */
.shot-strip {
  list-style: none; margin: 0; padding: 0 0 6px;
  display: flex; gap: clamp(14px, 2.5vw, 22px);
  overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.shot-strip > li {
  flex: 0 0 auto; inline-size: clamp(184px, 42vw, 250px);
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 12px;
}
.shot {
  inline-size: 100%; block-size: auto; aspect-ratio: 1320 / 2868;
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--surface); display: block;
  transition: border-color 0.15s ease-out, transform 0.18s ease-out;
}
.shot-btn:hover .shot { border-color: var(--line-strong); transform: translateY(-2px); }
.shot-label {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-soft);
}
:lang(he) .shot-label { letter-spacing: 0.04em; }

/* each screenshot is a button that opens the lightbox (see the inline script
   in _template.html). Reset button chrome WITHOUT touching opacity/transform,
   so the .reveal animation on the same element survives. */
.shot-btn {
  display: block; inline-size: 100%; padding: 0; border: 0;
  background: none; font: inherit; color: inherit; cursor: zoom-in;
  -webkit-appearance: none; appearance: none;
}
.shot-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-card); }

/* lightbox overlay (one per page, built by the inline script) */
.shot-modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: rgba(15, 15, 17, 0.82);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.shot-modal.is-open { display: flex; }
.shot-modal-img {
  max-inline-size: min(660px, 92vw); max-block-size: 90vh;
  inline-size: auto; block-size: auto;
  border-radius: var(--radius-card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  background: var(--surface);
}
.shot-modal-close {
  position: absolute;
  inset-block-start: clamp(10px, 2vw, 20px); inset-inline-end: clamp(10px, 2vw, 20px);
  inline-size: 44px; block-size: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; line-height: 1; color: #fff;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%; cursor: pointer;
  transition: background 0.15s ease-out;
}
.shot-modal-close:hover { background: rgba(255, 255, 255, 0.24); }
.shot-modal-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .shot-modal.is-open { animation: shot-modal-in 0.18s ease-out; }
  @keyframes shot-modal-in { from { opacity: 0; } to { opacity: 1; } }
}

/* footer: source attribution under the nav */
.credits { font-size: 0.85rem; color: var(--ink-soft); margin-block-start: 12px; }
