/* ═══════════════════════════════════════════════════════════
   BusinessWelder — Core Styles
   Based on UI-DESIGN-DIRECTION.md (Concept 02 — Build Studio)
   ═══════════════════════════════════════════════════════════ */

@import url('variables.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography (§4) ── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.05;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.045em;
}
h1 { font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.06em; }
h2 { font-size: clamp(26px, 3vw, 40px); }
h3 { font-size: 18px; letter-spacing: -.02em; }
h4 { font-size: 16px; }
p { margin-bottom: var(--space-4); }
a { color: var(--blue); text-decoration: none; transition: color .2s; }
a:hover { color: var(--orange); }

/* ── Eyebrow (§4) ── */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--orange);
  border-radius: 2px;
}

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--space-5); }
.section { padding: var(--space-8) 0; }
.section-alt { background: var(--white); }

/* ── Header (§3.1) ── */
.site-header {
  background: var(--ink);
  height: 76px;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  border-bottom: 1px solid var(--line-dark);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--space-5);
}
.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo-mark {
  height: 28px;
  width: 28px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}
.logo-brand { color: var(--white); }
.logo-accent { color: var(--orange); }

/* Nav pills (§3.1) */
.site-nav { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  color: rgba(255,255,255,.65);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: color .2s, background .2s;
}
.site-nav a:hover { color: var(--white); background: rgba(255,255,255,.08); }
.site-nav a.active { color: var(--ink); background: var(--white); font-weight: 600; }

/* ── Buttons (§5.1) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 24px;
  border-radius: 13px;
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: var(--white); box-shadow: 0 4px 14px rgba(6,53,121,.25); }
.btn-primary:hover { background: var(--blue-dark); color: var(--white); }
.btn-orange { background: var(--orange); color: var(--ink); box-shadow: 0 4px 14px rgba(255,122,26,.25); }
.btn-orange:hover { background: var(--orange-dark); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-2); color: var(--white); }
.btn-ghost { background: var(--white); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.site-header .btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.2); color: var(--white); }
.site-header .btn-ghost:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

/* ── Cards (§5.2) ── */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.card-lg { border-radius: var(--radius-lg); }

/* ── Status pills (§5.3) ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill-orange { background: var(--orange); color: var(--ink); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }

/* ── Icon container ── */
.icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange-soft);
  border-radius: var(--radius-sm);
  color: var(--orange);
  margin-bottom: var(--space-4);
}
.icon-box svg { width: 24px; height: 24px; }

/* ── Grid ── */
.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Footer ── */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,.7);
  padding: var(--space-7) 0 var(--space-5);
  margin-top: var(--space-8);
  border-top: 1px solid var(--line-dark);
}
.site-footer .container { display: grid; grid-template-columns: 2fr 3fr; gap: var(--space-7); }
@media (max-width: 768px) { .site-footer .container { grid-template-columns: 1fr; } }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: var(--orange); }
.footer-brand .logo { margin-bottom: var(--space-3); }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); }
.footer-links h4 { color: var(--white); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: var(--space-3); }
.footer-links a { display: block; padding: 4px 0; font-size: 14px; }

/* ═══════════════════════════════════════════════════════════
   Mobile Responsive Breakpoints
   Targets: 320px (small), 375px (iPhone), 414px (iPhone Plus),
            768px (iPad portrait), 1024px (iPad landscape)
   ═══════════════════════════════════════════════════════════ */

/* ── Tablet (≤1024px) — collapse 4-col grids ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 0 var(--space-4); }
}

/* ── Tablet portrait (≤768px) — single column layouts ── */
@media (max-width: 768px) {
  /* Typography scaling */
  h1 { font-size: clamp(28px, 7vw, 42px); }
  h2 { font-size: clamp(22px, 5vw, 32px); }
  h3 { font-size: clamp(18px, 4vw, 24px); }

  /* Layout */
  .container { padding: 0 var(--space-3); max-width: 100%; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: var(--space-4); }

  /* Navigation: hide horizontal nav, show hamburger */
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }

  /* Cards: reduce padding */
  .card, [class*="card"] { padding: var(--space-3); }

  /* Sections: reduce vertical spacing */
  section { padding: var(--space-5) 0; }

  /* Footer: stack columns */
  .site-footer .container { grid-template-columns: 1fr; gap: var(--space-4); }
  .footer-links { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}

/* ── Mobile (≤414px) — compact mobile layout ── */
@media (max-width: 414px) {
  /* Typography */
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }
  body { font-size: 15px; }

  /* Layout */
  .container { padding: 0 var(--space-2); }
  .grid { gap: var(--space-3); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Cards */
  .card, [class*="card"] { padding: var(--space-2); border-radius: var(--radius-md); }

  /* Sections */
  section { padding: var(--space-4) 0; }

  /* Footer */
  .footer-links { grid-template-columns: 1fr; }

  /* Buttons: full width on mobile */
  .btn, [class*="btn-"] { width: 100%; text-align: center; }

  /* Forms */
  input, textarea, select { font-size: 16px; } /* prevents iOS zoom */
}

/* ── Small mobile (≤375px) ── */
@media (max-width: 375px) {
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  .container { padding: 0 var(--space-1); }
}

/* ── Mobile navigation toggle (hidden on desktop) ── */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  flex-direction: column;
  gap: 4px;
}
.nav-mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.3s;
}

/* ── Mobile nav open state ── */
@media (max-width: 768px) {
  .nav-links.nav-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--paper);
    padding: var(--space-3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    gap: var(--space-2);
  }
  .nav-links.nav-open a {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--line);
  }
}

/* ── Touch targets: minimum 44px for accessibility ── */
@media (max-width: 768px) {
  a, button, .btn, [class*="btn-"] {
    min-height: 44px;
    min-width: 44px;
  }
  .nav-links a { padding: var(--space-2) var(--space-1); }
}

/* ── Prevent horizontal scroll on mobile ── */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  img, video, iframe { max-width: 100%; height: auto; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ═══════════════════════════════════════════════════════════
   CMS Loading / Error / Empty States
   Shown while CMS content loads, on load failure, or when no
   CMS content exists for a data-cms-key element.
   ═══════════════════════════════════════════════════════════ */

/* ── Loading skeleton ── */
.cms-loading {
  position: relative;
  overflow: hidden;
  background: var(--line);
  border-radius: var(--radius-sm);
  animation: cms-shimmer 1.5s infinite linear;
}
.cms-loading-text {
  display: inline-block;
  min-width: 80px;
  color: transparent;
}
@keyframes cms-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.cms-loading {
  background: linear-gradient(90deg, var(--line) 25%, var(--paper) 50%, var(--line) 75%);
  background-size: 200% 100%;
}

/* ── Full-page loading state ── */
.cms-page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: var(--space-5);
  text-align: center;
}
.cms-page-loading .cms-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: cms-spin 0.8s infinite linear;
  margin-bottom: var(--space-2);
}
@keyframes cms-spin {
  to { transform: rotate(360deg); }
}
.cms-page-loading p {
  color: var(--muted);
  font-size: 14px;
}

/* ── Error state ── */
.cms-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: var(--space-5);
  text-align: center;
}
.cms-error-state .cms-error-icon {
  font-size: 36px;
  color: var(--red);
  margin-bottom: var(--space-2);
}
.cms-error-state p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: var(--space-3);
}
.cms-error-state .cms-retry-btn {
  padding: var(--space-1) var(--space-3);
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.cms-error-state .cms-retry-btn:hover {
  background: var(--orange-dark);
}

/* ── Empty state (no CMS content) ── */
.cms-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: var(--space-4);
  text-align: center;
}
.cms-empty-state .cms-empty-icon {
  font-size: 32px;
  color: var(--muted);
  margin-bottom: var(--space-2);
  opacity: 0.5;
}
.cms-empty-state p {
  color: var(--muted);
  font-size: 13px;
}

/* ── CMS content fade-in (when loaded) ── */
.cms-content-loaded {
  animation: cms-fade-in 0.3s ease-out;
}
@keyframes cms-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Hide elements until CMS loads (optional) ── */
.cms-awaiting-load {
  visibility: hidden;
}
.cms-awaiting-load.cms-content-loaded {
  visibility: visible;
}
.footer-bottom { border-top: 1px solid var(--line-dark); margin-top: var(--space-6); padding-top: var(--space-4); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); font-size: 13px; }
.footer-bottom a { margin-right: var(--space-3); }

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none; }

/* ── Page enter animation (§3.2) ── */
@keyframes pageEnter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.page-enter { animation: pageEnter .35s ease; }
