/* ==========================================================================
   Base: typography, links, buttons, forms, focus, utilities
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--fcs-header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--fcs-bg);
  color: var(--fcs-text);
  font-family: var(--fcs-font-sans);
  font-size: var(--fcs-text-base);
  line-height: var(--fcs-leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--fcs-dur) var(--fcs-ease), color var(--fcs-dur) var(--fcs-ease);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--fcs-text);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 0.6em;
  overflow-wrap: anywhere;
}
h1 { font-size: var(--fcs-text-4xl); letter-spacing: -0.025em; }
h2 { font-size: var(--fcs-text-2xl); }
h3 { font-size: var(--fcs-text-xl); }
h4 { font-size: var(--fcs-text-lg); }
h5, h6 { font-size: var(--fcs-text-base); }

p { margin: 0 0 1.25em; }

a {
  color: var(--fcs-accent);
  text-decoration: none;
  text-underline-offset: 0.15em;
  transition: color var(--fcs-dur) var(--fcs-ease);
}
a:hover { color: var(--fcs-accent-strong); }

/* GP sets underline on all links when underline_links=always; we opt in per context */
.entry-content a:not(.wp-block-button__link):not(.fcs-btn):not(.fcs-card__link) {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--fcs-accent) 40%, transparent);
}
.entry-content a:not(.wp-block-button__link):not(.fcs-btn):hover {
  text-decoration-color: currentColor;
}

[hidden] { display: none !important; }

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }

/* Visible, consistent focus for keyboard users only */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--fcs-accent);
  outline-offset: 2px;
  border-radius: var(--fcs-radius-sm);
}

::selection { background: var(--fcs-accent-soft); color: var(--fcs-text); }

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  overflow: hidden; position: absolute !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  clip: auto; clip-path: none;
  height: auto; width: auto;
  left: 1rem; top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--fcs-surface);
  color: var(--fcs-text);
  border-radius: var(--fcs-radius);
  box-shadow: var(--fcs-shadow-lg);
  z-index: 100000;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.fcs-btn,
.wp-block-button__link,
button.button, input[type="submit"], .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--fcs-radius-sm);
  background: var(--fcs-accent);
  color: var(--fcs-on-accent);
  font: inherit;
  font-size: var(--fcs-text-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--fcs-dur) var(--fcs-ease), color var(--fcs-dur) var(--fcs-ease), transform var(--fcs-dur) var(--fcs-ease), box-shadow var(--fcs-dur) var(--fcs-ease);
}
.fcs-btn:hover, .wp-block-button__link:hover,
button.button:hover, input[type="submit"]:hover, .button:hover {
  background: var(--fcs-accent-strong);
  color: var(--fcs-on-accent);
}
.fcs-btn:active { transform: translateY(1px); }
.fcs-btn svg { width: 1em; height: 1em; }

.fcs-btn--secondary {
  background: var(--fcs-surface);
  color: var(--fcs-text);
  border-color: var(--fcs-border-strong);
}
.fcs-btn--secondary:hover { background: var(--fcs-surface-2); color: var(--fcs-text); }

.fcs-btn--ghost {
  background: transparent;
  color: var(--fcs-accent);
  padding-inline: 0.5rem;
  min-height: 36px;
}
.fcs-btn--ghost:hover { background: var(--fcs-accent-soft); color: var(--fcs-accent-text); }

.fcs-btn--sm { min-height: 36px; padding: 0.35rem 0.8rem; font-size: var(--fcs-text-xs); }

.fcs-btn--light {
  background: var(--fcs-on-accent);
  color: var(--fcs-accent-text);
}
:root[data-theme="dark"] .fcs-btn--light { background: #ffffff; color: #1e40af; }
.fcs-btn--light:hover { background: #ffffff; color: #1d4ed8; }

/* Inline link with arrow, e.g. "View all →" */
.fcs-link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fcs-text-sm);
  font-weight: 600;
  color: var(--fcs-accent);
  white-space: nowrap;
}
.fcs-link-more svg { width: 0.9em; height: 0.9em; transition: transform var(--fcs-dur) var(--fcs-ease); }
.fcs-link-more:hover svg { transform: translateX(2px); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--fcs-border-strong);
  border-radius: var(--fcs-radius-sm);
  background: var(--fcs-surface);
  color: var(--fcs-text);
  font: inherit;
  font-size: var(--fcs-text-sm);
  transition: border-color var(--fcs-dur) var(--fcs-ease), box-shadow var(--fcs-dur) var(--fcs-ease);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--fcs-accent);
  box-shadow: 0 0 0 3px var(--fcs-accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--fcs-text-3); }
textarea { min-height: 8rem; resize: vertical; }

/* --------------------------------------------------------------------------
   Chips, badges, labels
   -------------------------------------------------------------------------- */
.fcs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: var(--fcs-radius-pill);
  background: var(--fcs-accent-soft);
  color: var(--fcs-accent-text);
  font-size: var(--fcs-text-xs);
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--fcs-dur) var(--fcs-ease), color var(--fcs-dur) var(--fcs-ease);
}
a.fcs-chip:hover { background: var(--fcs-accent); color: var(--fcs-on-accent); }

.fcs-eyebrow {
  display: inline-block;
  font-size: var(--fcs-text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fcs-accent);
}

.fcs-kicker {
  color: var(--fcs-text-2);
  font-size: var(--fcs-text-sm);
  margin: 0;
}

/* Meta row: author · read time · date */
.fcs-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  color: var(--fcs-text-3);
  font-size: var(--fcs-text-xs);
  margin: 0;
}
.fcs-meta > * { display: inline-flex; align-items: center; gap: 0.35rem; }
.fcs-meta > * + *::before { content: "•"; color: var(--fcs-border-strong); margin-right: 0.6rem; }
.fcs-meta a { color: inherit; }
.fcs-meta a:hover { color: var(--fcs-accent); }
.fcs-meta strong { color: var(--fcs-text-2); font-weight: 600; }
.fcs-meta img { width: 24px; height: 24px; border-radius: 50%; }

/* --------------------------------------------------------------------------
   Cards and surfaces
   -------------------------------------------------------------------------- */
.fcs-surface {
  background: var(--fcs-surface);
  border: 1px solid var(--fcs-border);
  border-radius: var(--fcs-radius-lg);
  box-shadow: var(--fcs-shadow-sm);
}

/* Section header: title + subtitle on the left, "view all" on the right */
.fcs-section { margin-block: var(--fcs-space-7); }
.fcs-section:first-child { margin-top: 0; }
.fcs-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--fcs-space-4);
  margin-bottom: var(--fcs-space-5);
}
.fcs-section__title { font-size: var(--fcs-text-2xl); margin: 0 0 0.2em; }
.fcs-section__sub { margin: 0; color: var(--fcs-text-2); font-size: var(--fcs-text-sm); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.fcs-grid { display: grid; gap: var(--fcs-space-5); }
.fcs-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fcs-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fcs-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) {
  .fcs-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fcs-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fcs-grid--4, .fcs-grid--3, .fcs-grid--2 { grid-template-columns: 1fr; }
}

.fcs-ratio-16x9 { aspect-ratio: 16 / 9; object-fit: cover; }
.fcs-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fcs-truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.fcs-icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Pagination (GP markup) */
.paging-navigation, .fcs-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: var(--fcs-space-7) 0 0;
}
.paging-navigation .page-numbers, .fcs-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.85rem;
  border: 1px solid var(--fcs-border);
  border-radius: var(--fcs-radius-sm);
  background: var(--fcs-surface);
  color: var(--fcs-text-2);
  font-size: var(--fcs-text-sm);
  font-weight: 600;
}
.paging-navigation .page-numbers:hover, .fcs-pagination .page-numbers:hover { border-color: var(--fcs-accent); color: var(--fcs-accent); }
.paging-navigation .page-numbers.current, .fcs-pagination .page-numbers.current { background: var(--fcs-accent); border-color: var(--fcs-accent); color: var(--fcs-on-accent); }
.paging-navigation .page-numbers.dots { border: 0; background: none; }
