/* ==========================================================================
   HAZORGS MARKETING — components.css
   Reusable patterns shared across all pages. Depends on base.css tokens.
   ========================================================================== */

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.9375rem var(--s-5);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }

/* Primary — white on --red (5.53:1, passes AA). Never --brand-red: 4.00:1 fails. */
.btn--primary {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); }

.btn--outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--outline:hover { background: var(--ink); color: var(--white); }

.btn--ghost {
  background: transparent;
  border-color: rgba(255,255,255,.35);
  color: var(--white);
}
.btn--ghost:hover { border-color: var(--white); background: rgba(255,255,255,.08); }

.btn--lg { padding: 1.0625rem var(--s-6); font-size: var(--t-base); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* WhatsApp glyph sits inside .btn */
.btn svg { width: 1.125em; height: 1.125em; fill: currentColor; }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 4.5rem;
}

.header__logo { display: block; flex: none; }
.header__logo img, .header__logo svg { height: 30px; width: auto; }

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav__link {
  display: block;
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--dur) var(--ease);
}
.nav__link:hover { color: var(--red); }
.nav__link[aria-current="page"] { color: var(--red); font-weight: 600; }

/* Dropdown for the seven services */
.nav__item--has-menu { position: relative; }

.nav__toggle {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--ink);
  border-radius: var(--radius);
}
.nav__toggle:hover { color: var(--red); }
.nav__toggle.is-active { color: var(--red); font-weight: 600; }
.nav__toggle::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur) var(--ease);
}
.nav__toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }

.nav__menu {
  position: absolute;
  top: calc(100% + var(--s-3));
  left: 50%;
  translate: -50% 0;
  min-width: 17rem;
  padding: var(--s-2);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              visibility var(--dur);
}
.nav__toggle[aria-expanded="true"] + .nav__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav__menu a {
  display: block;
  padding: var(--s-3);
  font-size: var(--t-sm);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
}
.nav__menu a:hover { background: var(--surface); color: var(--red); }
.nav__menu a[aria-current="page"] { color: var(--red); font-weight: 600; }

/* Hamburger */
.nav__burger {
  display: none;
  width: 2.75rem; height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.nav__burger span {
  display: block;
  position: relative;
  width: 20px; height: 2px;
  background: var(--ink);
  transition: background var(--dur) var(--ease);
}
.nav__burger span::before,
.nav__burger span::after {
  content: "";
  position: absolute; left: 0;
  width: 20px; height: 2px;
  background: var(--ink);
  transition: transform var(--dur) var(--ease), top var(--dur) var(--ease);
}
.nav__burger span::before { top: -6px; }
.nav__burger span::after  { top: 6px; }
.nav__burger[aria-expanded="true"] span { background: transparent; }
.nav__burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 1024px) {
  .nav__burger { display: flex; }
  .header__cta { display: none; }

  .nav {
    position: fixed;
    top: 4.5rem;
    left: 0;
    right: 0;
    bottom: 0;
    /* width + min-height are required because .nav is a flex child of
       .header__inner. Even when position:fixed removes it from flow,
       Chromium still applies flex sizing — so the element collapses to its
       content height (≈88px) instead of stretching via top+bottom.
       min-height: calc(100vh - 4.5rem) forces the correct height. */
    width: 100%;
    min-height: calc(100vh - 4.5rem);
    padding: var(--s-5) var(--gutter) var(--s-8);
    background: var(--white);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* smooth momentum scroll on iOS */
    overscroll-behavior: contain;      /* prevent drawer scroll leaking to page */
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 260ms var(--ease), visibility 260ms;
  }
  .nav[data-open="true"] { visibility: visible; transform: translateX(0); }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__link, .nav__toggle {
    width: 100%;
    padding: var(--s-4) 0;
    font-size: var(--t-h4);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav__toggle { justify-content: space-between; }

  .nav__menu {
    position: static;
    translate: none;
    min-width: 0;
    padding: 0 0 var(--s-3) var(--s-4);
    border: 0;
    box-shadow: none;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav__toggle[aria-expanded="true"] + .nav__menu { display: block; }

}

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 2rem + 8vw, 7.5rem);
  overflow: hidden;
}

.hero__inner { position: relative; z-index: 2; max-width: 56rem; }
.hero h1 { margin-bottom: var(--s-5); }
.hero .lead { max-width: 44rem; }
.hero .btn-row { margin-top: var(--s-6); }

/* The slash, blown up to architectural scale as a background element.
   Sits behind the copy, clipped by the section, never competing for focus. */
.hero__slash {
  position: absolute;
  top: -20%;
  right: -4%;
  width: clamp(180px, 26vw, 420px);
  height: 140%;
  background: var(--brand-red);
  transform: skewX(-18deg);
  opacity: .07;
  z-index: 1;
  pointer-events: none;
}
.hero--ink .hero__slash { opacity: .16; }

@media (max-width: 700px) { .hero__slash { right: -30%; opacity: .05; } }

/* ==========================================================================
   SECTION HEADING
   ========================================================================== */

.sec-head { max-width: 46rem; margin-bottom: var(--s-7); }
.sec-head .eyebrow { margin-bottom: var(--s-4); }
.sec-head h2 { margin-bottom: var(--s-4); }
.sec-head--center { margin-inline: auto; text-align: center; }
.sec-head--center .eyebrow { justify-content: center; }

/* ==========================================================================
   GRID
   ========================================================================== */

.grid { display: grid; gap: var(--s-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

/* ==========================================================================
   SERVICE CARD
   ========================================================================== */

.card {
  display: flex;
  flex-direction: column;
  padding: var(--s-6);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.card:hover {
  border-color: var(--ink);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.card h3 { margin-bottom: var(--s-3); }
.card p  { color: var(--ink-soft); margin-bottom: var(--s-5); }

.card__link {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--red);
  text-decoration: none;
}
.card__link::after {
  content: "";
  width: 5px; height: 5px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  transition: translate var(--dur) var(--ease);
}
.card__link:hover::after { translate: 3px 0; }

/* Slash rule at the top of each card — ties cards to the identity */
.card__mark {
  width: 4px; height: 1.75rem;
  margin-bottom: var(--s-4);
  background: var(--red);
  transform: skewX(-18deg);
}

.card--feature {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}
.card--feature h3 { color: var(--white); }
.card--feature p  { color: rgba(255,255,255,.72); }
.card--feature .card__mark { background: var(--brand-red); }
.card--feature .card__link { color: var(--brand-red); }

/* ==========================================================================
   PROCESS STEPS
   Numbered here because the framework genuinely is an ordered sequence —
   Discover must precede Strategise. Order carries meaning, so it's shown.
   ========================================================================== */

.steps { counter-reset: step; display: grid; gap: 0; }

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: var(--s-5);
  padding-block: var(--s-6);
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }

.step__num {
  font-family: var(--font-display);
  font-size: var(--t-h3);
  font-weight: 800;
  font-stretch: var(--wide);
  line-height: 1;
  color: var(--red);
}
.step__num::before { content: counter(step, decimal-leading-zero); }

.step h3 { margin-bottom: var(--s-3); }
.step p  { color: var(--ink-soft); max-width: 46rem; }

.step__outcome {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s-2);
  margin-top: var(--s-4);
  font-size: var(--t-sm);
}
.step__outcome b {
  font-family: var(--font-display);
  font-size: var(--t-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.section--ink .step { border-color: rgba(255,255,255,.14); }
.section--ink .step p { color: rgba(255,255,255,.72); }
.section--ink .step__num { color: var(--brand-red); }

@media (max-width: 640px) {
  .step { grid-template-columns: 1fr; gap: var(--s-3); }
}

/* ==========================================================================
   PILLARS — compact value props (Why Choose Hazorgs)
   ========================================================================== */

.pillar { padding-top: var(--s-5); border-top: 3px solid var(--ink); }
.pillar h4 { margin-bottom: var(--s-2); }
.pillar p { font-size: var(--t-sm); color: var(--ink-soft); }
.section--ink .pillar { border-color: var(--brand-red); }
.section--ink .pillar p { color: rgba(255,255,255,.7); }

/* ==========================================================================
   FAQ ACCORDION
   ========================================================================== */

.faq { max-width: 48rem; }

.faq__item { border-bottom: 1px solid var(--line); }

.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  width: 100%;
  padding: var(--s-5) 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: var(--t-h4);
  font-weight: 600;
  color: var(--ink);
}
.faq__q:hover { color: var(--red); }

/* Plus → minus. Both bars are drawn as gradients on a single pseudo-element;
   the vertical bar is switched to transparent via a custom property, so the
   whole thing animates without a second element or absolute positioning. */
.faq__q::after {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  background:
    linear-gradient(var(--red), var(--red)) center / 14px 2px no-repeat,
    linear-gradient(var(--bar-v, var(--red)), var(--bar-v, var(--red))) center / 2px 14px no-repeat;
  transition: rotate var(--dur) var(--ease);
}
.faq__q[aria-expanded="true"]::after { --bar-v: transparent; rotate: 180deg; }

.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms var(--ease);
}
.faq__a > div { overflow: hidden; }
.faq__a p { padding-bottom: var(--s-5); color: var(--ink-soft); max-width: 42rem; }
.faq__q[aria-expanded="true"] + .faq__a { grid-template-rows: 1fr; }

/* ==========================================================================
   CTA BAND
   ========================================================================== */

.cta {
  position: relative;
  padding-block: var(--section-y);
  background: var(--ink);
  color: var(--white);
  overflow: hidden;
}
.cta__inner { position: relative; z-index: 2; max-width: 44rem; }
.cta h2 { color: var(--white); margin-bottom: var(--s-4); }
.cta p  { color: rgba(255,255,255,.72); font-size: var(--t-lead); }
.cta .btn-row { margin-top: var(--s-6); }
.cta__slash {
  position: absolute;
  top: -30%; right: 6%;
  width: clamp(120px, 18vw, 260px); height: 160%;
  background: var(--brand-red);
  transform: skewX(-18deg);
  opacity: .18;
  z-index: 1;
}
@media (max-width: 800px) { .cta__slash { right: -20%; opacity: .1; } }

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  padding-block: var(--s-8) var(--s-5);
  background: var(--black);
  color: rgba(255,255,255,.62);
  font-size: var(--t-sm);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: var(--s-6);
  padding-bottom: var(--s-7);
}
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }

.footer__logo img, .footer__logo svg { height: 28px; width: auto; margin-bottom: var(--s-4); }
.footer__blurb { max-width: 24rem; line-height: 1.6; }

.footer h5 {
  margin-bottom: var(--s-4);
  font-family: var(--font-display);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
}

.footer li { margin-bottom: var(--s-2); }
.footer a { color: rgba(255,255,255,.62); text-decoration: none; }
.footer a:hover { color: var(--brand-red); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-5);
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--t-xs);
}

.social { display: flex; gap: var(--s-3); }
.social a {
  display: grid;
  place-items: center;
  width: 2.25rem; height: 2.25rem;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.social a:hover { border-color: var(--brand-red); background: rgba(255,0,0,.15); }
.social svg { width: 16px; height: 16px; fill: currentColor; }

/* ==========================================================================
   FLOATING WHATSAPP
   ========================================================================== */

.wa-float {
  position: fixed;
  right: var(--s-5); bottom: var(--s-5);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 3.25rem; height: 3.25rem;
  background: #25D366;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur) var(--ease);
}
.wa-float:hover { transform: scale(1.06); }
.wa-float svg { width: 26px; height: 26px; fill: var(--white); }

/* ==========================================================================
   FORM
   ========================================================================== */

.field { margin-bottom: var(--s-5); }
.field label {
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--t-sm);
  font-weight: 600;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.8125rem var(--s-4);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); }
.field textarea { min-height: 8rem; resize: vertical; }
.field__hint { margin-top: var(--s-2); font-size: var(--t-xs); color: var(--ink-mute); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-5); }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   SCROLL REVEAL — applied by main.js only when motion is allowed
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}

/* Social icons on a light background (contact page). The footer set is
   tuned for black; this variant inverts the borders and hover. */
.social--light a {
  border-color: var(--line);
  color: var(--ink-soft);
}
.social--light a:hover {
  border-color: var(--red);
  background: var(--red-tint);
  color: var(--red);
}

/* ==========================================================================
   DEVELOPER CREDIT
   Sits below the client's copyright line and stays quieter than it — the
   footer belongs to Hazorgs. Legible, not loud: the muted grey still clears
   WCAG AA against black, and the link picks up the brand red on hover.
   ========================================================================== */

.footer__credit {
  padding-top: var(--s-4);
  font-size: var(--t-xs);
  /* .50 not .42 — at 13px this needs 4.5:1 against the black footer.
     .42 measures 3.94:1 and fails AA; .50 gives 5.32:1. */
  color: rgba(255,255,255,.5);
}
.footer__credit p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
}
.footer__credit a {
  color: rgba(255,255,255,.72);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.25);
  padding-bottom: 1px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer__credit a:hover {
  color: var(--brand-red);
  border-color: var(--brand-red);
}

/* The slash again — the same mark that separates the wordmark's "o",
   here separating the developer from the studio. */
.footer__credit-sep {
  width: 2px;
  height: 0.85em;
  background: rgba(255,255,255,.3);
  transform: skewX(-18deg);
  flex: none;
}

.footer__credit-org { color: rgba(255,255,255,.5); }

@media (max-width: 560px) {
  .footer__credit-sep { display: none; }
  .footer__credit p { gap: var(--s-1) var(--s-2); }
}

/* ==========================================================================
   NAV OVERLAY
   Dims the page content behind the open mobile drawer. Tapping it closes
   the nav — which is what users expect when they tap outside a drawer.
   ========================================================================== */

.nav-overlay {
  display: none;
}

@media (max-width: 1024px) {
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 99;                /* just below the header (100) and drawer */
    background: rgba(0,0,0,.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 260ms var(--ease), visibility 260ms;
    pointer-events: none;
  }
  .nav-overlay[data-open="true"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}
