/*
 Theme Name:   ABTdomain Field Station
 Theme URI:    https://abtdomain.com
 Description:  Field Station redesign of the ABTdomain theme. Newspaper-style masthead, live ticker, observatory readouts, editorial typography. Self-hosted JetBrains Mono + Source Serif 4 + Inter. Independent standalone theme; v2 (domain_story_v2) is the previous version and is left untouched.
 Author:       ABTdomain
 Author URI:   https://abtdomain.com
 Version:      3.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  abtdomain
 Requires at least: 6.0
 Tested up to: 6.5
 Requires PHP: 7.4
*/

/* ==========================================================================
   Self-hosted fonts
   See assets/fonts/README.md for the download checklist. Using OFL/Apache
   licensed faces (Inter / Source Serif 4 / JetBrains Mono) — self-host is
   explicitly permitted by their licenses and avoids GDPR concerns about
   Google Fonts CDN under Schrems II.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/Inter-Bold.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/SourceSerif4-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/SourceSerif4-Italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/SourceSerif4-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/SourceSerif4-BoldItalic.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('assets/fonts/SourceSerif4-Black.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/JetBrainsMono-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/JetBrainsMono-Bold.woff2') format('woff2');
}

/* ==========================================================================
   Design tokens
   v2 base palette (signal red #c23a22, paper #fafafa) merged with v3 layout
   tokens (rhythm, type stack, status colors). Keeping v2 colours so that any
   pages or assets that still reference --signal etc. by name keep working
   when previewed against v3 markup.
   ========================================================================== */

:root {
  /* Color palette — v2 brand, lifted into v3 */
  --paper:        #fafafa;
  --paper-2:      #f3efe7;
  --paper-3:      #e8e4de;
  --ink:          #1a1612;
  --ink-2:        #2a2621;
  --ink-3:        #3d3630;
  --muted:        #9e948a;
  --rule:         #e8e4de;
  --rule-strong:  #1a1a1a;
  --white:        #ffffff;

  /* Signal & accents */
  --signal:       #c23a22;
  --signal-2:     #f4d4cb;
  --data:         #2a6496;
  --data-2:       #cfdbee;
  --live:         #c89b3c;
  --live-2:       #f4e4c1;
  --ok:           #2d6a4f;
  --warn:         #d97706;
  --danger:       #dc2626;

  /* Status colors retained for compatibility with v2 component snippets */
  --status-info-bg:      #e0f2fe;
  --status-info-fg:      #0369a1;
  --status-warning-bg:   #fef3c7;
  --status-warning-fg:   #d97706;
  --status-danger-bg:    #fee2e2;
  --status-danger-fg:    #dc2626;
  --status-indigo-bg:    #e0e7ff;
  --status-indigo-fg:    #4338ca;
  --status-purple-bg:    #ddd6fe;
  --status-purple-fg:    #6d28d9;
  --status-success-fg:   #059669;
  --status-gold-bg:      #fbbf24;
  --status-gold-fg:      #78350f;

  /* Chart palette — Chart.js + sparkline shared */
  --chart-1: #c23a22;
  --chart-2: #2a6496;
  --chart-3: #1a1612;
  --chart-4: #c89b3c;
  --chart-5: #2d6a4f;
  --chart-6: #9e948a;
  --chart-line-primary:   #c23a22;
  --chart-line-secondary: #2a6496;
  --chart-grid:           rgba(0, 0, 0, 0.05);
  --chart-tooltip-bg:     rgba(26, 22, 18, 0.92);

  /* Typography */
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', Times, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Rhythm */
  --max:    1320px;
  --max-r:  1180px;
  --pad-x:  clamp(20px, 4vw, 40px);

  /* Type scale */
  --fs-9:  9px;
  --fs-11: 11px;
  --fs-13: 13px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;
  --fs-34: 34px;

  /* Spacing scale (8px base) */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  40px;
  --space-6:  48px;
  --space-7:  56px;
  --space-8:  64px;
  --space-9:  72px;
  --space-10: 80px;

  /* Radius — minimal, this is a print-feeling theme */
  --radius-0:    0;
  --radius-sm:   2px;
  --radius-md:   4px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
}

a { color: inherit; text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--signal); }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Tabular numbers everywhere we render counts */
.tnum, .num, .mono, table td, table th { font-variant-numeric: tabular-nums; }

/* WP screen reader text (kept compatible with v2) */
.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;
}
.screen-reader-text:focus {
  background-color: var(--paper-2);
  border-radius: var(--radius-sm);
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
  clip: auto;
  clip-path: none;
  color: var(--ink);
  display: block;
  font-size: var(--fs-13);
  font-weight: 600;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* Reveal on scroll — used by JS micro-observer */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }
