/* =========================================================================
   BiblePro — Download section (all 7 platform options)
   Uses the design tokens defined in styles.css (:root). Loaded after
   styles.css so it can rely on those variables.
   ========================================================================= */

/* Hero "available for…" becomes a jump link to the download grid */
.hero-avail-link {
  color: var(--snow-2);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.hero-avail-link:hover { color: var(--snow); border-bottom-color: var(--snow-3); }
.hero-avail-link b { color: var(--snow); }

/* Grid of platform cards */
.download-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 36px;
}
@media (max-width: 1000px) { .download-grid { grid-template-columns: repeat(2, 1fr); } }
/* Phones: keep TWO cards per row (compact) instead of one giant card per row.
   minmax(0,1fr) lets the tracks shrink below the button's min-content width
   (otherwise the long "Microsoft Store" label would blow out the grid).
   NB: the per-card / per-button tightening lives at the END of this file so it
   sits AFTER the base .dl-btn rule and actually wins the cascade. */
@media (max-width: 560px) {
  .download-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: none; margin-top: 28px; }
}

.dl-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.dl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-2); }

.dl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.dl-head h3 { margin: 0; font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.dl-ico {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 13px;
  background: var(--peach);
  color: var(--orange);
  display: grid; place-items: center;
}
.dl-ico svg { width: 24px; height: 24px; }

/* Download buttons inside a card */
.dl-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 13px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.dl-btn-ico { display: inline-flex; }
.dl-btn-ico svg { width: 20px; height: 20px; display: block; }

.dl-btn.primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.dl-btn.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #0a1322; }

.dl-btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-2); }
.dl-btn.ghost:hover { transform: translateY(-2px); border-color: var(--orange); color: var(--orange-deep); }
.dl-btn.ghost .dl-btn-ico svg { stroke: currentColor; }

/* Keyboard focus gets the same emphasis as hover */
.dl-btn.primary:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #0a1322; }
.dl-btn.ghost:focus-visible { transform: translateY(-2px); border-color: var(--orange); color: var(--orange-deep); }

.dl-note { margin: 2px 0 0; font-size: .82rem; color: var(--ink-3); text-align: center; }

/* Footer of the download section */
.dl-foot { text-align: center; margin-top: 34px; }
.dl-foot .btn { display: inline-flex; }
.dl-disclaimer {
  max-width: 620px;
  margin: 16px auto 0;
  font-size: .84rem;
  line-height: 1.6;
  color: var(--ink-3);
}

/* Complex-script locales: give Thai/Burmese a touch more line-height for legibility */
.locale-th .dl-card, .locale-my .dl-card,
.locale-th .dl-disclaimer, .locale-my .dl-disclaimer { line-height: 1.7; }

/* =========================================================================
   Social / community section
   ========================================================================= */
.community-video {
  /* Chinese-only promo (the video is in Chinese). Hidden by default so
     non-Chinese locales never flash it; revealed for zh / tw below. */
  display: none;
  max-width: 780px;
  margin: 0 auto clamp(34px, 5vw, 54px);
}
html.locale-zh .community-video,
html.locale-tw .community-video { display: block; }
.community-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0A1120;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(16,23,38,.06);
}
.community-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
@media (max-width: 560px) {
  .community-video {
    /* full-bleed edge-to-edge on phones for a bigger, cleaner player
       (negative margins cancel the container's side padding) */
    max-width: none;
    margin-left: calc(-1 * max(24px, var(--safe-l)));
    margin-right: calc(-1 * max(24px, var(--safe-r)));
    margin-bottom: 30px;
  }
  .community-video-frame { border-radius: 16px; }
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 36px;
}
@media (max-width: 900px) { .social-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .social-grid { grid-template-columns: repeat(2, 1fr); } }

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 26px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.social-card-ico {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: var(--paper-3);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.social-card-ico svg { width: 27px; height: 27px; display: block; }
.social-card-name { font-weight: 800; font-size: 1rem; letter-spacing: -.01em; }
.social-card-handle { font-size: .82rem; color: var(--ink-3); transition: color .3s var(--ease); }

/* Brand-colored icons at rest */
.social-card.fb .social-card-ico { color: #1877F2; }
.social-card.ig .social-card-ico { color: #DD2A7B; }
.social-card.yt .social-card-ico { color: #FF0000; }
.social-card.tt .social-card-ico { color: #111418; }
.social-card.x  .social-card-ico { color: #111418; }

/* Lift + flood with the brand colour on hover/focus */
.social-card:hover, .social-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  color: #fff;
  border-color: transparent;
}
.social-card:hover .social-card-handle, .social-card:focus-visible .social-card-handle { color: rgba(255, 255, 255, .85); }
.social-card:hover .social-card-ico, .social-card:focus-visible .social-card-ico { background: rgba(255, 255, 255, .18); color: #fff; }

.social-card.fb:hover, .social-card.fb:focus-visible { background: #1877F2; }
.social-card.ig:hover, .social-card.ig:focus-visible { background: linear-gradient(45deg, #F58529, #DD2A7B 45%, #8134AF 75%, #515BD4); }
.social-card.yt:hover, .social-card.yt:focus-visible { background: #FF0000; }
.social-card.tt:hover, .social-card.tt:focus-visible { background: #111418; }
.social-card.x:hover,  .social-card.x:focus-visible  { background: #111418; }

@media (prefers-reduced-motion: reduce) {
  .dl-card, .dl-btn, .social-card, .social-card-ico { transition: background .2s, color .2s, border-color .2s; }
  .dl-card:hover, .dl-btn:hover, .dl-btn:focus-visible,
  .social-card:hover, .social-card:focus-visible { transform: none; }
}

/* =========================================================================
   PHONE download-card tightening — placed at the very end so it overrides the
   base .dl-card / .dl-btn rules above (two-per-row needs smaller everything).
   ========================================================================= */
@media (max-width: 560px) {
  .dl-card { padding: 18px 12px; gap: 9px; border-radius: 16px; }
  .dl-head { gap: 9px; margin-bottom: 2px; }
  .dl-ico { width: 42px; height: 42px; border-radius: 12px; }
  .dl-ico svg { width: 22px; height: 22px; }
  .dl-head h3 { font-size: 1rem; }
  /* The card's big platform icon + title already name the platform, so drop the
     in-button icon and shrink the label. Single line for en/zh store names;
     wraps gracefully (min-height keeps the pair even) for longer th/my labels. */
  .dl-btn {
    padding: 9px 6px; font-size: .76rem; gap: 0; border-radius: 11px;
    white-space: normal; line-height: 1.2; min-height: 44px; text-align: center;
  }
  .dl-btn .dl-btn-ico { display: none; }
  .dl-note { font-size: .74rem; line-height: 1.45; }
}
@media (max-width: 360px) {
  .dl-card { padding: 16px 8px; }
  .dl-btn { font-size: .72rem; }
}

/* =========================================================================
   PHONE community/social cards — they were very tall with oversized icons.
   Compact them (kept 2-up) so the section reads tight, not huge.
   ========================================================================= */
@media (max-width: 560px) {
  .social-grid { gap: 12px; margin-top: 24px; }
  .social-card { padding: 16px 10px; gap: 7px; border-radius: 16px; }
  .social-card-ico { width: 44px; height: 44px; border-radius: 13px; }
  .social-card-ico svg { width: 22px; height: 22px; }
  .social-card-name { font-size: .92rem; }
  .social-card-handle { font-size: .74rem; }
}

/* =========================================================================
   Visitor share block — lets anyone pass the page on (homepage community)
   ========================================================================= */
.share-block { margin-top: clamp(34px, 5vw, 52px); text-align: center; }
.share-title { font-size: clamp(1.15rem, 2.6vw, 1.45rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin: 0 0 6px; }
.share-sub { color: var(--ink-2); font-size: .95rem; line-height: 1.6; margin: 0 auto 20px; max-width: 480px; }
.share-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.share-btn svg { width: 18px; height: 18px; flex: none; }
.share-btn:hover, .share-btn:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: transparent; color: #fff; }
.share-btn.native:hover, .share-btn.native:focus-visible { background: linear-gradient(180deg, var(--orange-2), var(--orange)); }
.share-btn.wa:hover, .share-btn.wa:focus-visible { background: #25D366; }
.share-btn.tg:hover, .share-btn.tg:focus-visible { background: #229ED9; }
.share-btn.fb:hover, .share-btn.fb:focus-visible { background: #1877F2; }
.share-btn.xx:hover, .share-btn.xx:focus-visible { background: #111418; }
.share-btn.copy:hover, .share-btn.copy:focus-visible { background: var(--ink); }
.share-btn.copy.ok { background: #1E7A6F; border-color: transparent; color: #fff; }

/* Toast (shared by homepage copy action) */
.share-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; box-shadow: 0 14px 36px -10px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); z-index: 80;
}
.share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .share-btn:hover, .share-btn:focus-visible { transform: none; }
  .share-toast { transition: opacity .2s; }
}
@media (max-width: 480px) {
  .share-btn { padding: 10px 15px; font-size: .85rem; }
}
