/* Home page, third version: the parts shared by the Arabic page (Views/Home/IndexAr.cshtml) and the
   English page (Views/Home/Index.cshtml). Both pages use the same markup for these blocks:
   - the note under the main button
   - "Try before you sign up" cards
   - "What you find inside" feature groups
   - questions and answers
   - the trial-lecture bar fixed to the bottom on phones
   - the Arabic page's phone menu
   Each page keeps its own older styles (home-ar.css / home-v2.css) for everything else. */

:root {
  --hv-red: var(--primary, #a30b00);
  --hv-red-dark: #6f0700;
  --hv-olive: var(--secondary, #2e321b);
  --hv-ink: #16181d;
  --hv-muted: #5b606c;
  --hv-soft: #f7f3ee;
  --hv-line: rgba(46, 50, 27, 0.22);
  --hv-radius: 20px;
}

/* ---------- Hero: one main button, a short note, one quiet link ---------- */

.hv-hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.hv-note {
  margin: 0;
  color: var(--hv-muted);
  font-size: 0.95rem;
}

.hv-more {
  color: var(--hv-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hv-more:hover {
  color: var(--hv-red);
}

/* ---------- "Try before you sign up": three free tools ---------- */

.hv-try {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.hv-try__card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 2px solid var(--hv-line);
  border-radius: var(--hv-radius);
  background: #fff;
  color: var(--hv-ink);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.hv-try__card:hover,
.hv-try__card:focus-visible {
  border-color: var(--hv-red);
  color: var(--hv-ink);
  transform: translateY(-3px);
}

.hv-try__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--hv-red);
  color: #fff;
  font-size: 1.3rem;
}

.hv-try__card h3 {
  margin: 0.25rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.hv-try__card p {
  margin: 0;
  color: var(--hv-muted);
  line-height: 1.8;
}

/* Pushed to the bottom so the three "start" lines sit on one line whatever the text length. */
.hv-try__go {
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--hv-red);
  font-weight: 700;
}

/* ---------- "What you find inside": every feature in three groups ---------- */

.hv-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.hv-group {
  padding: 1.5rem;
  border-radius: var(--hv-radius);
  background: #fff;
  border: 2px solid var(--hv-line);
}

.hv-group__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--hv-line);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--hv-red);
}

.hv-group ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hv-group li {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.25rem 0.75rem;
}

.hv-group li i {
  grid-row: span 2;
  margin-top: 0.3rem;
  color: var(--hv-olive);
  font-size: 1.1rem;
  text-align: center;
}

.hv-group li strong {
  font-size: 1.05rem;
  color: var(--hv-ink);
}

.hv-group li span {
  color: var(--hv-muted);
  line-height: 1.7;
}

/* ---------- Questions and answers ---------- */

.hv-faq {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 820px;
}

.hv-faq details {
  border: 2px solid var(--hv-line);
  border-radius: 16px;
  background: #fff;
}

.hv-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--hv-ink);
  cursor: pointer;
  list-style: none;
}

.hv-faq summary::-webkit-details-marker {
  display: none;
}

/* A plus that turns into a minus when the answer is open. */
.hv-faq summary::after {
  content: "+";
  flex: none;
  color: var(--hv-red);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}

.hv-faq details[open] summary::after {
  content: "\2212";
}

.hv-faq summary:focus-visible {
  outline: 3px solid var(--hv-red);
  outline-offset: 2px;
  border-radius: 14px;
}

.hv-faq p {
  margin: 0;
  padding: 0 1.25rem 1.1rem;
  color: var(--hv-muted);
  line-height: 1.9;
}

/* ---------- Trial-lecture bar, fixed to the bottom on phones ---------- */

.hv-sticky {
  display: none;
}

/* ---------- Arabic page: menu button (the menu was not reachable on phones) ---------- */

.ar-menu-btn {
  display: none;
}

@media (max-width: 991.98px) {
  .hv-try,
  .hv-groups {
    grid-template-columns: 1fr;
  }

  .ar-menu-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--hv-ink);
    font-size: 1.3rem;
    cursor: pointer;
  }

  .ar-menu-btn:focus-visible {
    outline: 3px solid var(--hv-red);
  }

  /* The menu opens as a panel under the sticky header. */
  .ar-nav.is-open {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0.5rem 20px 1rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  }

  .ar-nav.is-open a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid #f0ece6;
  }
}

@media (max-width: 767.98px) {
  .hv-hero-cta {
    align-items: stretch;
    text-align: center;
  }

  .hv-sticky {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 70;
    display: block;
    padding: 0.6rem 16px calc(0.6rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--hv-line);
    box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.08);
  }

  .hv-sticky a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    border-radius: 14px;
    background: var(--hv-red);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
  }

  .hv-sticky a:hover {
    background: var(--hv-red-dark);
    color: #fff;
  }

  /* Room for the bar at the end of the page. */
  body.hv-has-sticky {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  /* The bar already opens WhatsApp, so the round WhatsApp button is not shown with it:
     on a phone it sat on top of the text. Wider screens keep the round button. */
  body.hv-has-sticky .ar-wa-float,
  body.hv-has-sticky .eh-wa-float {
    display: none;
  }
}

/* Sections reached from the menu links stop below the sticky header instead of under it. */
.hv-anchor {
  scroll-margin-top: 90px;
}

/* ---------- Phones: a shorter page ---------- */
/* The page was about ten screens long on a phone. Cards put their icon beside the text instead of
   above it, and the four weekly steps sit two by two, so the same content takes far less scrolling. */
@media (max-width: 575.98px) {
  /* Header: the menu button joined the row, so the log-in button stays on one line and gets tighter. */
  .ar-header-actions {
    gap: 0.4rem;
  }

  .ar-header-actions .ar-btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* "Who it's for" cards (both pages) and the free-tool cards: icon on the side. */
  .ar-card,
  .eh-card,
  .hv-try__card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.9rem;
    row-gap: 0.25rem;
    align-items: start;
    padding: 1.1rem;
  }

  .ar-card > .ar-icon,
  .eh-card > .eh-icon,
  .hv-try__icon {
    grid-row: 1 / span 3;
    width: 46px;
    height: 46px;
    margin: 0;
    font-size: 1.15rem;
  }

  .ar-card h3,
  .eh-card h3,
  .hv-try__card h3 {
    margin: 0;
    font-size: 1.05rem;
  }

  .hv-try__go {
    margin-top: 0;
    padding-top: 0.15rem;
  }

  /* Bootstrap's row gap between the stacked "who it's for" cards is larger than the cards need. */
  .ar-section .row.g-4,
  .eh-section .row.g-4 {
    --bs-gutter-y: 0.75rem;
  }

  .hv-try,
  .hv-groups {
    gap: 0.75rem;
  }

  .hv-group {
    padding: 1.1rem;
  }

  .hv-group ul {
    gap: 0.7rem;
  }

  /* Weekly steps: two by two, with tighter boxes. */
  .ar-steps,
  .eh-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .ar-steps li,
  .eh-step {
    padding: 1rem 0.9rem;
  }

  .ar-steps h3,
  .eh-step h3 {
    font-size: 1.05rem;
  }

  /* Less empty space between sections and under section titles. */
  .ar-section,
  .eh-section {
    padding: 40px 0;
  }

  .ar-head,
  .eh-section-head {
    margin-bottom: 1.5rem;
  }
}

/* English page, phones: the founder block had no phone layout (a 180px picture column squeezed the text
   into a narrow strip). Same stacked layout as the Arabic page. */
@media (max-width: 575.98px) {
  .eh-founder {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.5rem;
    text-align: center;
  }

  .eh-founder-badge {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    font-size: 2.6rem;
  }
}
