/* ==========================================================================
   CFX NETWORK — TYPOGRAPHY, EDITORIAL RULES & GLOBAL PRIMITIVES (typography.css)
   Depends on variables.css
   ========================================================================== */

/* ── 1. Reset & Normalize GeneratePress Containers ──────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  background-color: var(--cfx-paper);
  color: var(--cfx-ink);
  font-family: var(--cfx-font-sans);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Override GeneratePress wrapper limits when our custom templates render */
body .site.grid-container,
body .inside-article {
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--cfx-transition-fast), border-color var(--cfx-transition-fast), background-color var(--cfx-transition-fast), opacity var(--cfx-transition-fast);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ── 2. Editorial Heading Hierarchy ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--cfx-font-sans);
  font-weight: 600;
  color: var(--cfx-ink);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

/* Display / Hero Headlines */
.cfx-display-xl,
h1 {
  font-size: clamp(2.65rem, 4.8vw, 4.5rem); /* 42px -> 72px */
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.cfx-display-lg,
h2 {
  font-size: clamp(2rem, 3.2vw, 3.25rem); /* 32px -> 52px */
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.cfx-heading-md,
h3 {
  font-size: clamp(1.35rem, 1.9vw, 1.85rem); /* 21px -> 30px */
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cfx-heading-sm,
h4 {
  font-size: clamp(1.125rem, 1.3vw, 1.35rem); /* 18px -> 21px */
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

/* Optional Editorial Serif Italic Accent inside Headlines */
.cfx-serif-em,
h1 em,
h2 em {
  font-family: var(--cfx-font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Body & Lead Copy */
.cfx-lead {
  font-size: clamp(1.125rem, 1.4vw, 1.3125rem); /* 18px -> 21px */
  line-height: 1.55;
  color: var(--cfx-ink-secondary);
  font-weight: 400;
}

.cfx-body {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--cfx-ink-secondary);
}

.cfx-body-sm {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--cfx-ink-muted);
}

/* ── 3. Eyebrows, Index Numbers & Wireframe Labels ──────────────────────── */
.cfx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--cfx-font-sans);
  font-size: 0.75rem; /* 12px */
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cfx-ink-muted);
  line-height: 1.2;
}

.cfx-eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--cfx-accent);
  border-radius: 50%;
}

.cfx-section-dark .cfx-eyebrow {
  color: var(--cfx-on-dark-muted);
}

.cfx-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cfx-ink-muted);
  margin-bottom: var(--cfx-space-md);
}

.cfx-breadcrumb a:hover {
  color: var(--cfx-ink);
}

.cfx-breadcrumb .sep {
  opacity: 0.45;
}

.cfx-index-num {
  font-family: var(--cfx-font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--cfx-accent);
  display: inline-block;
}

.cfx-wireframe-note {
  display: none !important;
}

/* Hide default WordPress/GeneratePress page title bar ("Home") when custom page templates or front page render */
.home .entry-header,
.page .entry-header,
.home .page-header,
.page .page-header {
  display: none !important;
}

/* ── 4. Containers, Sections & Grids ────────────────────────────────────── */
.cfx-container {
  width: 100%;
  max-width: var(--cfx-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--cfx-gutter);
  padding-right: var(--cfx-gutter);
}

.cfx-section {
  padding-top: var(--cfx-space-2xl);
  padding-bottom: var(--cfx-space-2xl);
  position: relative;
  border-bottom: 1px solid var(--cfx-rule);
}

.cfx-section-lg {
  padding-top: var(--cfx-space-3xl);
  padding-bottom: var(--cfx-space-3xl);
}

.cfx-section-surface {
  background-color: var(--cfx-surface);
}

.cfx-section-warm {
  background-color: var(--cfx-paper-warm);
}

.cfx-section-dark {
  background-color: var(--cfx-obsidian);
  color: var(--cfx-on-dark);
  border-bottom-color: var(--cfx-rule-dark);
}

.cfx-section-dark h1,
.cfx-section-dark h2,
.cfx-section-dark h3,
.cfx-section-dark h4,
.cfx-section-dark .cfx-ink-text {
  color: var(--cfx-on-dark);
}

.cfx-section-dark .cfx-lead,
.cfx-section-dark .cfx-body,
.cfx-section-dark p {
  color: var(--cfx-on-dark-muted);
}

/* Editorial Section Header Layout */
.cfx-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--cfx-space-lg);
  margin-bottom: var(--cfx-space-xl);
}

.cfx-section-header-left {
  max-width: 760px;
}

.cfx-section-header-left .cfx-eyebrow {
  margin-bottom: 14px;
}

.cfx-section-header-right {
  max-width: 480px;
}

/* Reusable Grid Layouts */
.cfx-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--cfx-grid-gap);
}

.cfx-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--cfx-grid-gap);
}

.cfx-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--cfx-grid-gap);
}

/* ── 5. Buttons & Interactive Links ─────────────────────────────────────── */
.cfx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 26px;
  font-family: var(--cfx-font-sans);
  font-size: 0.9375rem; /* 15px */
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  border-radius: var(--cfx-radius-xs);
  border: 1px solid var(--cfx-ink);
  background-color: var(--cfx-ink);
  color: var(--cfx-paper);
  cursor: pointer;
  transition: all var(--cfx-transition-fast);
  white-space: nowrap;
}

.cfx-btn:hover,
.cfx-btn:focus-visible {
  background-color: var(--cfx-accent);
  border-color: var(--cfx-accent);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.cfx-btn-outline {
  background-color: transparent;
  color: var(--cfx-ink);
  border: 1px solid var(--cfx-rule-strong);
}

.cfx-btn-outline:hover,
.cfx-btn-outline:focus-visible {
  border-color: var(--cfx-ink);
  background-color: var(--cfx-ink);
  color: var(--cfx-paper);
}

/* Buttons on Dark Backgrounds */
.cfx-section-dark .cfx-btn-primary,
.cfx-btn-light {
  background-color: var(--cfx-paper);
  border-color: var(--cfx-paper);
  color: var(--cfx-obsidian);
}

.cfx-section-dark .cfx-btn-primary:hover,
.cfx-btn-light:hover {
  background-color: var(--cfx-accent);
  border-color: var(--cfx-accent);
  color: #FFFFFF;
}

.cfx-section-dark .cfx-btn-outline,
.cfx-btn-outline-light {
  background-color: transparent;
  border-color: var(--cfx-rule-dark-strong);
  color: var(--cfx-on-dark);
}

.cfx-section-dark .cfx-btn-outline:hover,
.cfx-btn-outline-light:hover {
  border-color: var(--cfx-on-dark);
  background-color: var(--cfx-on-dark);
  color: var(--cfx-obsidian);
}

/* Inline Editorial Arrow Link ("Read case study ↗" / "Watch film →") */
.cfx-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cfx-ink);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--cfx-rule-strong);
  transition: all var(--cfx-transition-fast);
}

.cfx-link-arrow .arrow {
  display: inline-block;
  transition: transform var(--cfx-transition-fast);
}

.cfx-link-arrow:hover {
  color: var(--cfx-accent);
  border-bottom-color: var(--cfx-accent);
}

.cfx-link-arrow:hover .arrow {
  transform: translate(3px, -2px);
}

.cfx-section-dark .cfx-link-arrow {
  color: var(--cfx-on-dark);
  border-bottom-color: var(--cfx-rule-dark-strong);
}

.cfx-section-dark .cfx-link-arrow:hover {
  color: var(--cfx-accent);
  border-bottom-color: var(--cfx-accent);
}

/* ── 6. Architectural Media Placeholders (16:9 Stills, Portraits, Visuals) ─ */
.cfx-media-placeholder {
  position: relative;
  width: 100%;
  background: linear-gradient(135deg, #17181B 0%, #23252A 100%);
  color: var(--cfx-on-dark);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border: 1px solid var(--cfx-rule);
}

.cfx-media-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.cfx-media-16x9 {
  aspect-ratio: 16 / 9;
}

.cfx-media-4x3 {
  aspect-ratio: 4 / 3;
}

.cfx-media-portrait {
  aspect-ratio: 4 / 3.2;
}

.cfx-media-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform var(--cfx-transition-slow);
}

.cfx-media-placeholder:hover img {
  transform: scale(1.03);
}

.cfx-placeholder-meta-top,
.cfx-placeholder-meta-bottom,
.cfx-placeholder-center {
  position: relative;
  z-index: 2;
}

.cfx-placeholder-tag {
  font-family: var(--cfx-font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245, 243, 238, 0.65);
}

.cfx-placeholder-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 243, 238, 0.85);
}

/* Play Button Circle inside Film Cards & Showreel */
.cfx-play-trigger {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(11, 11, 12, 0.78);
  border: 1px solid rgba(245, 243, 238, 0.4);
  color: var(--cfx-on-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--cfx-transition);
  backdrop-filter: blur(6px);
}

.cfx-play-trigger:hover,
.cfx-card-film:hover .cfx-play-trigger {
  background: var(--cfx-accent);
  border-color: var(--cfx-accent);
  color: #FFFFFF;
  transform: scale(1.08);
}

/* ── 7. Scroll Reveal Utility ───────────────────────────────────────────── */
.cfx-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s var(--cfx-ease-editorial), transform 0.6s var(--cfx-ease-editorial);
}

.js-enabled .cfx-reveal.is-hidden {
  opacity: 0;
  transform: translateY(20px);
}

/* Screen Reader Utility */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
