/* ============================================================
   home-layout.css — Home Page Frame & Shared Parts
   ─────────────────────────────────────────
   PURPOSE : Page width, section rhythm, headings, buttons and
             utilities shared by every home section
             (html-templates/home/).
   ============================================================ */

/* The decorative hero art is wider than a phone screen; clip it at the
   viewport edge so it never scrolls the page sideways (the search popup
   only overflows vertically, so it is unaffected). */
#tabContentHome {
  overflow-x: clip;
}

.home {
  --home-max-width: 1120px;
  --home-gutter: clamp(16px, 4vw, 32px);

  width: 100%;
  max-width: calc(var(--home-max-width) + 2 * var(--home-gutter));
  margin: 0 auto;
  padding: 0 var(--home-gutter) 48px;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] .home {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', 'Inter', system-ui, sans-serif;
}

/* In-page scroll targets land below the sticky header. */
.home [id] {
  scroll-margin-top: calc(var(--shell-header-h, 64px) + 20px);
}

/* ── Sections ─────────────────────────────────────────────────── */
.home-section {
  padding-top: clamp(48px, 7vw, 88px);
}

.home-section__title {
  margin: 0 0 32px;
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}

.home-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Arabic has no capitals and must not be letter-spaced. */
html[dir="rtl"] .home-section__title {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: normal;
}

html[dir="rtl"] .home-eyebrow {
  font-size: 0.9rem;
  letter-spacing: normal;
  text-transform: none;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.home-btn:active {
  transform: scale(0.98);
}

.home-btn--primary {
  background: var(--accent);
  color: #FFFFFF !important;
  box-shadow:
    0 1px 2px hsl(var(--shadow-color) / 0.12),
    0 8px 20px -8px hsl(var(--shadow-color) / 0.45);
}

.home-btn--primary:hover {
  background: var(--accent-strong);
}

.home-btn--quiet {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.home-btn--quiet:hover {
  background: var(--surface);
  border-color: var(--text-faint);
}

.home-btn__arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}

.home-btn:hover .home-btn__arrow {
  transform: translateX(3px);
}

html[dir="rtl"] .home-btn__arrow {
  transform: scaleX(-1);
}

html[dir="rtl"] .home-btn:hover .home-btn__arrow {
  transform: scaleX(-1) translateX(3px);
}

/* ── Focus ────────────────────────────────────────────────────── */
.home a:focus-visible,
.home button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── Footer note & utilities ──────────────────────────────────── */
.home-disclaimer {
  margin-top: 64px;
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-faint);
}

.home-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.home a,
.home button {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 640px) {
  .home {
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  }

  .home-section {
    padding-top: 56px;
  }

  .home-section__title {
    margin-bottom: 24px;
    font-size: 1.55rem;
  }

  .home-disclaimer {
    margin-top: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-btn,
  .home-btn__arrow {
    transition: none;
  }
}
