/* ─── Template Base — Shared Foundation ────────────────── */
/* Loaded by all project pages (template-a, b, c).          */
/* Must come after site.css and before the specific         */
/* template CSS in the <head>.                              */

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { -webkit-tap-highlight-color: transparent; }

/* ── ROOT OVERRIDES ─────────────────────────────────────── */
/* Override only the values all three templates share.      */
:root {
  --radius: 10px;    /* tighter than site default (12px) for case-study layouts */
  --max-w:  1200px;  /* match site default for consistent page widths */
  --ease:   0.22s ease; /* local transition alias */
}

/* ── HTML ────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── BODY ────────────────────────────────────────────────── */
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── BASE ELEMENTS ──────────────────────────────────────── */
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); line-height: 1.25; font-weight: var(--fw-bold); }

/* ── FOCUS RING ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── PAGE LOAD FADE-IN ──────────────────────────────────── */
body { opacity: 0; transition: opacity 0.4s ease; }
body.ta-loaded,
body.tb-loaded,
body.tc-loaded { opacity: 1; }

/* ── CONTAINER ──────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 5vw;
}

/* ══════════════════════════════════════════════════════════
   CTA BUTTON SYSTEM
   Usage:
     Primary   → <a class="ta-btn ta-btn--primary">Label</a>
                 <a class="tb-btn tb-btn--primary">Label</a>
                 <a class="tc-btn tc-btn--primary">Label</a>
     Secondary → same pattern with --secondary
     Tertiary  → same pattern with --tertiary
   ══════════════════════════════════════════════════════════ */

/* ── Base ── */
.ta-btn,
.tb-btn,
.tc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition:
    background var(--ease),
    color var(--ease),
    border-color var(--ease),
    box-shadow var(--ease),
    transform 0.12s ease;
}
.ta-btn:active,
.tb-btn:active,
.tc-btn:active { transform: scale(0.97); }

/* ── Primary: filled accent ── */
.ta-btn--primary,
.tb-btn--primary,
.tc-btn--primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.ta-btn--primary:hover,
.tb-btn--primary:hover,
.tc-btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(0,87,217,0.28);
}
.ta-btn--primary:active,
.tb-btn--primary:active,
.tc-btn--primary:active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: none;
}

/* ── Secondary: outlined ── */
.ta-btn--secondary,
.tb-btn--secondary,
.tc-btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.ta-btn--secondary:hover,
.tb-btn--secondary:hover,
.tc-btn--secondary:hover {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,87,217,0.2);
}
.ta-btn--secondary:active,
.tb-btn--secondary:active,
.tc-btn--secondary:active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--white);
  box-shadow: none;
}

/* ── Tertiary: text + arrow ── */
.ta-btn--tertiary,
.tb-btn--tertiary,
.tc-btn--tertiary {
  background: none;
  border-color: transparent;
  color: var(--accent);
  padding: 0;
  font-size: 13px;
  gap: 4px;
}
.ta-btn--tertiary::after,
.tb-btn--tertiary::after,
.tc-btn--tertiary::after {
  content: '→';
  display: inline-block;
  transition: transform var(--ease);
}
.ta-btn--tertiary:hover,
.tb-btn--tertiary:hover,
.tc-btn--tertiary:hover { color: var(--accent-dark); }
.ta-btn--tertiary:hover::after,
.tb-btn--tertiary:hover::after,
.tc-btn--tertiary:hover::after { transform: translateX(4px); }
.ta-btn--tertiary:active,
.tb-btn--tertiary:active,
.tc-btn--tertiary:active { color: var(--accent-dark); transform: scale(0.98); }

/* ── NAV ───────────────────────────────────────────────── */
.ta-nav,
.tb-nav,
.tc-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.ta-nav--scrolled,
.tb-nav--scrolled,
.tc-nav--scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
  border-bottom-color: transparent;
}

.ta-nav .container,
.tb-nav .container,
.tc-nav .container {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ta-nav-home,
.tb-nav-home,
.tc-nav-home {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--text);
  transition: color var(--ease);
}
.ta-nav-home:hover,
.tb-nav-home:hover,
.tc-nav-home:hover { color: var(--accent); }

.ta-nav-links,
.tb-nav-links,
.tc-nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.ta-nav-links a,
.tb-nav-links a,
.tc-nav-links a {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  color: var(--text);
  transition: color var(--ease);
}
.ta-nav-links a:hover,
.tb-nav-links a:hover,
.tc-nav-links a:hover { color: var(--accent); }

/* ── DIVIDER ───────────────────────────────────────────── */
.ta-divider,
.tc-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── CALLOUT BLOCK ─────────────────────────────────────── */
.ta-callout,
.tb-callout,
.tc-callout {
  background: var(--light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 28px 32px;
}
.ta-callout-label,
.tb-callout-label,
.tc-callout-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}
.ta-callout p,
.tb-callout p,
.tc-callout p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}
.ta-callout p + p { margin-top: 12px; }

/* ── IMG PLACEHOLDER BASE ───────────────────────────────── */
.ta-img-placeholder,
.tb-img-placeholder,
.tc-img-placeholder {
  width: 100%;
  min-height: 160px;
  background: var(--light);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── READING PROGRESS BAR ──────────────────────────────── */
.ta-progress,
.tb-progress,
.tc-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── BACK TO TOP ────────────────────────────────────────── */
.ta-back-top,
.tb-back-top,
.tc-back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
  z-index: 90;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.ta-back-top.visible,
.tb-back-top.visible,
.tc-back-top.visible { opacity: 1; transform: none; }
.ta-back-top:hover,
.tb-back-top:hover,
.tc-back-top:hover { background: var(--accent); }

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.ta-reveal,
.tb-reveal,
.tc-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.ta-reveal.ta-reveal--visible,
.tb-reveal.tb-reveal--visible,
.tc-reveal.tc-reveal--visible {
  opacity: 1;
  transform: none;
}

/* ── FOOTER ────────────────────────────────────────────── */
.ta-footer,
.tb-footer,
.tc-footer {
  background: var(--navy);
  padding: 32px 0;
}
.ta-footer .container,
.tb-footer .container,
.tc-footer .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.ta-footer-contact,
.tb-footer-contact,
.tc-footer-contact {
  font-size: 14px;
  color: var(--nav-item-text);
  line-height: 1.7;
  text-align: right;
}
.ta-footer-contact a,
.tb-footer-contact a,
.tc-footer-contact a { color: var(--nav-item-text); }
.ta-footer-contact a:hover,
.tb-footer-contact a:hover,
.tc-footer-contact a:hover { color: white; }

/* ── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1 !important; transition: none !important; }
  .ta-reveal,
  .tb-reveal,
  .tc-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .ta-progress,
  .tb-progress,
  .tc-progress,
  .ta-back-top,
  .tb-back-top,
  .tc-back-top { transition: none !important; }
}

/* ── RESPONSIVE: CONTAINER ──────────────────────────────── */
@media (max-width: 1280px) {
  .container { padding: 0 48px; }
}

@media (max-width: 1023px) {
  .container { padding: 0 32px; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .container { padding: 0 24px; }
  html { overflow-x: clip; }
}

/* ── CASE STUDY NAV ─────────────────────────────────────── */
.proj-case-nav {
  border-top: 1px solid var(--border);
  padding: 36px 48px 120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}
.proj-case-nav a {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  color: var(--accent);
  text-decoration: none;
}
.proj-case-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.proj-case-nav__all {
  color: var(--muted) !important;
  font-weight: var(--fw-medium) !important;
}
@media (max-width: 600px) {
  .proj-case-nav {
    flex-direction: column;
    gap: 10px;
    padding: 28px 20px;
    text-align: center;
  }
}

/* ── FLOATING NAV CLEARANCE (mobile) ────────────────────── */
/* Body padding-bottom is set in floating-nav.css; 36px here is aesthetic spacing only */
@media (max-width: 1023px) {
  .proj-case-nav { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}
