/* ============================================================
   imprexi template — style.css
   Structural CSS only. All design tokens (--* vars) live in
   content/theme/client-vars.css, which header.php inlines for
   zero-latency first paint. No :root or @import here.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary); }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--color-primary);
  font-weight: 500;
}
h1 { font-size: clamp(var(--fs-xl), 6vw, var(--fs-3xl)); }
h2 { font-size: clamp(var(--fs-lg), 4vw, var(--fs-2xl)); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p, li { max-width: 60ch; }
small, .small { font-size: var(--fs-sm); color: var(--color-ink-muted); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-px);
}
.section { padding-block: clamp(var(--space-16), 10vw, var(--space-32)); }
.stack > * + * { margin-top: var(--space-6); }
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.5rem; position: relative;
}
.site-logo {
  font-family: var(--font-display); font-size: var(--fs-lg);
  display: flex; align-items: center;
}
.site-logo img { height: 2.5rem; width: auto; object-fit: contain; }

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  background: none; border: none; cursor: pointer;
  color: var(--color-ink); border-radius: var(--radius);
  transition: background var(--t-fast); flex-shrink: 0;
  font-size: 1.4rem; line-height: 1;
}
/* Prevent the icon span from intercepting clicks meant for the button */
.nav-toggle .nav-icon { pointer-events: none; display: block; line-height: 1; }
.nav-toggle:hover { background: var(--color-surface-2); }

/* Desktop only — mutually exclusive with the mobile ≤768px block below */
@media (min-width: 769px) {
  .site-nav { display: flex; gap: var(--space-6); }
}
.site-nav a {
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.4rem; height: 1px;
  background: var(--color-primary); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- Mobile nav (≤ 768 px) ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 4.5rem;
    left: -1rem; right: -1rem;       /* bleed past container padding */
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-line);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 9;
    padding: var(--space-3) var(--space-4) var(--space-4);
  }
  .site-nav.is-open { display: flex; }

  /* Generous tap targets */
  .site-nav a {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    font-size: var(--fs-md);
    text-transform: none;
    letter-spacing: 0;
    display: block;
  }
  .site-nav a:hover { background: var(--color-surface-2); }
  .site-nav a[aria-current="page"] {
    background: var(--color-surface-2);
    font-weight: 600; color: var(--color-primary);
  }
  .site-nav a::after { display: none; }
}

/* ---------- Hero (ATO-inspired centered CTA) ---------- */
.hero {
  min-height: 80vh;
  display: grid; place-items: center;
  text-align: center;
  padding-inline: var(--container-px);
  /* background-image injected inline by PHP when hero_bg_image is configured */
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero h1 { max-width: 18ch; margin-inline: auto; }
.hero p  { max-width: 44ch; margin-inline: auto; color: var(--color-ink-muted); }
/* Dark scrim over background photos — keeps text readable without touching colour tokens */
.hero.has-bg::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
/* Lift the content stack above the scrim */
.hero.has-bg > .stack { position: relative; z-index: 1; color: #fff; }
.hero.has-bg h1,
.hero.has-bg p { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-primary { background: var(--color-primary); color: var(--color-surface); }
.btn-primary:hover { background: var(--color-accent); color: var(--color-primary); }
.btn-ghost { border: 1px solid var(--color-primary); color: var(--color-primary); }
.btn-ghost:hover { background: var(--color-primary); color: var(--color-surface); }

/* ---------- Portfolio grid (Building-Practice-inspired) ---------- */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: var(--space-4); }
.portfolio-card { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--color-surface-2); }
.portfolio-card img, .portfolio-card picture { width: 100%; height: 100%; }
.portfolio-card img { object-fit: cover; transition: transform var(--t-med) var(--ease); }
.portfolio-card:hover img { transform: scale(1.03); }
.portfolio-card .caption {
  position: absolute; inset: auto 0 0 0;
  padding: var(--space-6);
  color: var(--color-surface);
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
}

/* ---------- Footer (Studio-Contra-inspired) ---------- */
.site-footer {
  background: var(--color-primary);
  color: var(--color-surface);
  padding-block: var(--space-16) var(--space-8);
}
.site-footer .container { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.site-footer h4 { color: var(--color-surface); font-family: var(--font-sans); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: var(--space-2); }
.site-footer a { color: color-mix(in srgb, var(--color-surface) 75%, transparent); }
.site-footer a:hover { color: var(--color-surface); }
.site-footer .copyright { grid-column: 1 / -1; border-top: 1px solid color-mix(in srgb, var(--color-surface) 12%, transparent); padding-top: var(--space-6); font-size: var(--fs-xs); color: color-mix(in srgb, var(--color-surface) 55%, transparent); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; align-items: center; }
/* Agency attribution — hardcoded in core/partials/footer.php, not editable by clients. */
.ejitech-credit { color: inherit; opacity: .45; font-size: var(--fs-xs); text-decoration: none; white-space: nowrap; }
.ejitech-credit:hover { opacity: .75; }

/* ---------- Homepage custom HTML sections ---------- */
/* Wrapper for admin-authored HTML blocks on the public homepage. */
.hp-section { padding-block: clamp(var(--space-16), 10vw, var(--space-32)); }
/* Reset the 60ch paragraph limit inside custom blocks — admins control their own layout. */
.hp-content p, .hp-content li { max-width: none; }
/* Sensible image defaults to prevent layout breaks. */
.hp-content img { max-width: 100%; height: auto; border-radius: var(--radius); }
/* Heading rhythm inside custom blocks. */
.hp-content h2 { margin-bottom: var(--space-4); }
.hp-content h3 { margin-bottom: var(--space-3); }
.hp-content h4 { margin-bottom: var(--space-2); }
/* Spacing between block-level children. */
.hp-content > * + * { margin-top: var(--space-6); }

/* ---------- Utilities ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

