/*
Theme Name: A Freak Pulse Enhanced
Theme URI: https://freakpulse.com
Description: Child theme for A Freak Pulse news briefing. Based on Twenty Twenty-Five.
Author: A Freak Pulse
Author URI: https://freakpulse.com
Template: twentytwentyfive
Version: 1.3.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: a-freak-pulse-enhanced
*/

/* ===================================================================
   CSS VARIABLES
   =================================================================== */
:root {
  /* --- Base palette --- */
  --afp-bg:           #0B0D10;
  --afp-panel:        #11161C;
  --afp-border:       #1F2933;
  --afp-border-deep:  #2A3441;
  --afp-text:         #E6E8EB;
  --afp-text-muted:   #A8B0B8;
  --afp-text-dim:     #7A848E;
  --afp-link:         #8AB4F8;
  --afp-content-max:  42rem;
  --afp-font-serif:   "Charter", "Georgia", serif;
  --afp-font-sans:    "Helvetica Neue", "Arial", sans-serif;
  --afp-font-mono:    "IBM Plex Mono", monospace;

  /* --- Legacy accent aliases (UI chrome only — not section colors) --- */
  --afp-accent-01:    #00E5FF;   /* cyan — primary interactive */
  --afp-accent-02:    #00B8D4;   /* teal — secondary interactive */
  --afp-accent-03:    #0091EA;   /* blue */
  --afp-accent-indigo:#3D5AFE;   /* indigo */

  /* --- Section accent color matrix (25-color Wired editorial system) ---
     Assigned per section, consistent across issues. Colors from spec rows 1–5.
     Row 1 (cyan→blue):  #00E5FF  #00B8D4  #0091EA  #2979FF  #3D5AFE
     Row 2 (purple):     #7C4DFF  #651FFF  #6200EA  #AA00FF  #D500F9
     Row 3 (red/pink):   #FF4081  #F50057  #C51162  #FF1744  #D50000
     Row 4 (warm):       #FF6D00  #FF9100  #FFC400  #FFD600  #AEEA00
     Row 5 (green/teal): #00C853  #00BFA5  #00ACC1  #00838F  #006064
  --- */
  --afp-s01: #00E5FF;   /* section_01 — Technology & AI */
  --afp-s02: #00B8D4;   /* section_02 — Business & Economics */
  --afp-s03: #0091EA;   /* section_03 — Politics & Policy */
  --afp-s04: #2979FF;   /* section_04 — Science & Research */
  --afp-s05: #3D5AFE;   /* section_05 — Health & Medicine */
  --afp-s06: #7C4DFF;   /* section_06 — Culture & Media */
  --afp-s07: #AA00FF;   /* section_07 — Design & Architecture */
  --afp-s08: #00C853;   /* section_08 — Environment & Climate */
  --afp-s09: #FF4081;   /* section_09 — Global Affairs */
  --afp-s10: #FF6D00;   /* section_10 — Labor & Future of Work */
  --afp-s11: #FFC400;   /* section_11 — Education */
  --afp-s12: #FF1744;   /* section_12 — Legal & Regulatory */
  --afp-s13: #D500F9;   /* section_13 — Cybersecurity */
  --afp-s14: #AEEA00;   /* section_14 — Finance & Markets */
  --afp-s15: #00BFA5;   /* section_15 — Entrepreneurship */
  --afp-s16: #651FFF;   /* section_16 — Neurodiversity & Mental Health */
  --afp-s17: #FF9100;   /* section_17 — Creative Industries */
  --afp-s18: #00ACC1;   /* section_18 — Long Reads & Essays */
  --afp-s19: #F50057;   /* section_19 — Strategic Implications */
}

/* ===================================================================
   BASE
   =================================================================== */
html {
  background: var(--afp-bg);
  color: var(--afp-text);
  font-family: var(--afp-font-serif);
  font-size: 16px;
  line-height: 1.65;
}

body {
  background: var(--afp-bg);
  color: var(--afp-text);
  margin: 0;
  padding: 0;
}

/* ===================================================================
   TYPOGRAPHY
   =================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--afp-font-sans);
  color: #fff;
  line-height: 1.15;
}
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.75rem 0 0.5rem; letter-spacing: -0.01em; }
h4, h5, h6 { font-size: 0.9375rem; font-weight: 600; }

/* ===================================================================
   LINKS
   =================================================================== */
a { color: var(--afp-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===================================================================
   CONTENT LAYOUT
   =================================================================== */
.entry-content {
  max-width: var(--afp-content-max);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.entry-header {
  max-width: var(--afp-content-max);
  margin: 0 auto;
  padding: 3rem 1.5rem 0;
}

.entry-title {
  font-family: var(--afp-font-sans);
  font-size: 1.875rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 8px solid var(--afp-accent-01);
}

/* Category accent colors on entry title */
.category-technology-ai      .entry-title { border-left-color: var(--afp-s01); }
.category-business           .entry-title { border-left-color: var(--afp-s02); }
.category-politics-policy    .entry-title { border-left-color: var(--afp-s03); }
.category-science-research   .entry-title { border-left-color: var(--afp-s04); }
.category-culture-media      .entry-title { border-left-color: var(--afp-s06); }
.category-design             .entry-title { border-left-color: var(--afp-s07); }
.category-environment        .entry-title { border-left-color: var(--afp-s08); }
.category-global-affairs     .entry-title { border-left-color: var(--afp-s09); }
.category-creative-industries .entry-title { border-left-color: var(--afp-s17); }
/* Legacy category slugs */
.category-world-travel       .entry-title { border-left-color: var(--afp-s01); }
.category-local-radar        .entry-title { border-left-color: var(--afp-s02); }
.category-industry-watch     .entry-title { border-left-color: var(--afp-s03); }
.category-special-interests  .entry-title { border-left-color: var(--afp-s06); }

/* ===================================================================
   BRIEFING ITEMS
   Geometric left-border style (Wired editorial system).
   =================================================================== */
.briefing-item {
  border-top: none;
  border-left: 2px solid var(--afp-border);
  padding-top: 0;
  padding-left: 1rem;
  margin-top: 2rem;
  position: relative;
}

.briefing-item:first-of-type {
  border-left: none;
  padding-left: 0;
  margin-top: 0;
}

.field-label {
  font-family: var(--afp-font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--afp-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 1rem 0 0.2rem;
}

/* Item metadata block (code-style) */
pre.item-meta {
  background: var(--afp-panel);
  border-left: 3px solid var(--afp-text-dim);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-family: var(--afp-font-mono);
  font-size: 0.8125rem;
  color: var(--afp-text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  border-radius: 0;
}

pre.item-meta .meta-source { color: var(--afp-text); font-weight: 500; }
pre.item-meta .meta-date   { color: var(--afp-text-dim); }
pre.item-meta .meta-url {
  color: var(--afp-link);
  display: block;
  margin-top: 0.5rem;
  word-break: break-all;
}

/* Legacy metadata block */
.metadata-block {
  font-family: var(--afp-font-sans);
  font-size: 0.875rem;
  color: var(--afp-text-dim);
  margin: 0.5rem 0 1rem;
}

.url-display {
  font-family: var(--afp-font-mono);
  font-size: 0.8125rem;
  color: var(--afp-link);
  word-break: break-all;
  display: block;
  margin: 0.5rem 0 1rem;
}

/* ===================================================================
   SECTION HEADERS
   Wired v1/v2 style: thick left bar + accent underline, no rounded shapes.
   Each H2 in post content gets a sequential section color via nth-of-type.
   =================================================================== */

/* ---- In-content section H2 (briefing sections) ---- */
.entry-content h2 {
  --section-accent: var(--afp-accent-01); /* default; overridden by nth-of-type below */
  position: relative;
  font-family: var(--afp-font-sans);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin: 3rem 0 1.25rem;
  padding: 0.5rem 0 0.625rem 1.125rem;
  border-left: 8px solid var(--section-accent);
  border-bottom: 2px solid var(--section-accent);
}

/* Dim left border slightly on non-first sections to avoid visual noise at top */
.entry-content h2:first-of-type { margin-top: 1.5rem; }

/* ---- Sequential section accent colors (nth-of-type = briefing section order) ---- */
.entry-content h2:nth-of-type(1)  { --section-accent: var(--afp-s01); }
.entry-content h2:nth-of-type(2)  { --section-accent: var(--afp-s02); }
.entry-content h2:nth-of-type(3)  { --section-accent: var(--afp-s03); }
.entry-content h2:nth-of-type(4)  { --section-accent: var(--afp-s04); }
.entry-content h2:nth-of-type(5)  { --section-accent: var(--afp-s05); }
.entry-content h2:nth-of-type(6)  { --section-accent: var(--afp-s06); }
.entry-content h2:nth-of-type(7)  { --section-accent: var(--afp-s07); }
.entry-content h2:nth-of-type(8)  { --section-accent: var(--afp-s08); }
.entry-content h2:nth-of-type(9)  { --section-accent: var(--afp-s09); }
.entry-content h2:nth-of-type(10) { --section-accent: var(--afp-s10); }
.entry-content h2:nth-of-type(11) { --section-accent: var(--afp-s11); }
.entry-content h2:nth-of-type(12) { --section-accent: var(--afp-s12); }
.entry-content h2:nth-of-type(13) { --section-accent: var(--afp-s13); }
.entry-content h2:nth-of-type(14) { --section-accent: var(--afp-s14); }
.entry-content h2:nth-of-type(15) { --section-accent: var(--afp-s15); }
.entry-content h2:nth-of-type(16) { --section-accent: var(--afp-s16); }
.entry-content h2:nth-of-type(17) { --section-accent: var(--afp-s17); }
.entry-content h2:nth-of-type(18) { --section-accent: var(--afp-s18); }
.entry-content h2:nth-of-type(19) { --section-accent: var(--afp-s19); }

/* ---- Article headline H3s ---- */
.entry-content h3 {
  font-family: var(--afp-font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin: 1.75rem 0 0.4rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Subtle left marker on H3 — thin 2px bar, accent-01 color (section-neutral chrome) */
.entry-content h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--afp-accent-01);
  margin-right: 0.5rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ---- .section-header component (used by PHP-rendered feature blocks) ---- */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 2.5rem 0 1.5rem;
  padding: 0.5rem 0 0.625rem 1.125rem;
  border-left: 8px solid var(--afp-accent-01);
  border-bottom: 2px solid var(--afp-accent-01);
}

.section-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===================================================================
   CODE AND BLOCKQUOTES
   =================================================================== */
pre {
  background: #1A1F27;
  padding: 1rem;
  border-left: 3px solid var(--afp-border-deep);
  overflow-x: auto;
  font-family: var(--afp-font-mono);
  font-size: 0.8125rem;
}

blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.25rem 1rem 1.25rem;
  border-left: 4px solid var(--afp-accent-01);
  color: var(--afp-text);
  font-family: var(--afp-font-serif);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.6;
  background: var(--afp-panel);
  border-top: 1px solid var(--afp-border);
  border-bottom: 1px solid var(--afp-border);
  border-right: none;
}

blockquote p { margin: 0; }

blockquote p + p { margin-top: 0.75rem; }

/* ===================================================================
   EXECUTIVE SUMMARY BLOCK
   =================================================================== */
.executive-summary {
  background: var(--afp-panel);
  border-left: 6px solid var(--afp-accent-01);
  border-top: 1px solid var(--afp-border);
  border-bottom: 1px solid var(--afp-border);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  font-family: var(--afp-font-serif);
  font-size: 1.0625rem;
  color: var(--afp-text);
  line-height: 1.7;
  border-radius: 0;
}

.executive-summary p { margin: 0 0 1rem 0; }
.executive-summary p:last-child { margin-bottom: 0; }

/* ===================================================================
   READING TIME (TASK.019)
   =================================================================== */
.reading-time-wrapper {
  margin: 0.75rem 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--afp-border);
}

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--afp-font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--afp-text-dim);
  padding: 0.5rem 0;
}

.reading-time-icon { flex-shrink: 0; color: var(--afp-accent-02); }
.reading-time-text { color: var(--afp-text-muted); }

@media (max-width: 768px) {
  .reading-time-wrapper { margin: 0.5rem 0 1rem; padding-bottom: 0.75rem; }
  .reading-time { font-size: 0.8125rem; }
}

/* ===================================================================
   READING PROGRESS BAR (TASK.018)
   =================================================================== */
#afp-reading-progress-container {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--afp-border);
  z-index: 1000;
  transform: translateZ(0);
}

#afp-reading-progress-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--afp-s01) 0%,
    var(--afp-s06) 35%,
    var(--afp-s09) 60%,
    var(--afp-s11) 80%,
    var(--afp-s14) 100%
  );
  transition: width 0.1s ease;
  transform: translateZ(0);
}

@media (max-width: 480px) {
  #afp-reading-progress-container { height: 2px; }
}

/* ===================================================================
   TEXT SIZE CONTROLS (TASK.021)
   =================================================================== */
.afp-text-size-controls {
  display: inline-flex;
  gap: 4px;
  margin: 0.5rem 0;
}

.afp-text-size-btn {
  background: var(--afp-panel);
  border: 1px solid var(--afp-border-deep);
  color: var(--afp-text-muted);
  padding: 4px 10px;
  font-size: 0.8125rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.afp-text-size-btn:hover {
  background: var(--afp-accent-02);
  color: #fff;
  border-color: var(--afp-accent-02);
}

/* ===================================================================
   HIGHLIGHT & NOTE-TAKING (TASK.020)
   =================================================================== */
.afp-highlight {
  padding: 2px 0;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.afp-highlight:hover { opacity: 0.8; }
.afp-highlight.has-note { border-bottom: 2px dashed #666; }

/* Highlight palette popup */
.afp-highlight-palette {
  position: absolute;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: #1A1F27;
  border: 1px solid var(--afp-border-deep);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1001;
}

.afp-highlight-color {
  width: 24px; height: 24px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.afp-highlight-color:hover {
  transform: scale(1.1);
  border-color: #fff;
}

/* Notes sidebar */
.afp-notes-sidebar {
  position: fixed;
  top: 0; right: 0;
  width: 320px; height: 100vh;
  background: var(--afp-panel);
  border-left: 1px solid var(--afp-border);
  display: flex;
  flex-direction: column;
  z-index: 1002;
  box-shadow: -4px 0 12px rgba(0,0,0,0.3);
}

.afp-notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--afp-border);
}

.afp-notes-header h3 { margin: 0; font-size: 1rem; color: var(--afp-text); }

.afp-notes-close {
  background: none;
  border: none;
  color: var(--afp-text-dim);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}

.afp-notes-close:hover { color: var(--afp-text); }

.afp-notes-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.afp-no-notes { color: var(--afp-text-dim); text-align: center; font-style: italic; }

.afp-note-item {
  margin-bottom: 16px;
  padding: 12px;
  background: #1A1F27;
  border-radius: 6px;
}

.afp-note-text {
  font-size: 0.875rem;
  color: var(--afp-text-muted);
  margin-bottom: 8px;
  line-height: 1.5;
}

.afp-note-content {
  font-size: 0.8125rem;
  color: var(--afp-text);
  margin-bottom: 8px;
  padding: 8px;
  background: var(--afp-panel);
  border-radius: 4px;
}

.afp-note-actions { display: flex; gap: 8px; }

.afp-note-actions button {
  padding: 6px 12px;
  font-size: 0.75rem;
  background: var(--afp-border-deep);
  color: var(--afp-text-muted);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.afp-note-actions button:hover {
  background: var(--afp-accent-indigo);
  color: #fff;
}

.afp-notes-footer {
  padding: 16px;
  border-top: 1px solid var(--afp-border);
}

.afp-notes-button {
  width: 100%;
  padding: 12px;
  background: var(--afp-accent-02);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.afp-notes-button:hover { background: var(--afp-accent-01); }

/* Notes toggle FAB */
.afp-notes-toggle {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 48px; height: 48px;
  background: var(--afp-accent-02);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 1003;
  transition: transform 0.2s, background 0.2s;
}

.afp-notes-toggle:hover {
  transform: scale(1.1);
  background: var(--afp-accent-01);
}

/* Notes export modal */
.afp-notes-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1004;
}

.afp-notes-modal-content {
  width: 90%;
  max-width: 500px;
  background: var(--afp-panel);
  border-radius: 8px;
  overflow: hidden;
}

.afp-notes-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--afp-border);
}

.afp-notes-modal-header h3 { margin: 0; color: var(--afp-text); font-size: 1rem; }

.afp-notes-modal-body {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

.afp-notes-modal-footer {
  padding: 16px;
  border-top: 1px solid var(--afp-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.afp-btn-secondary {
  padding: 8px 16px;
  background: var(--afp-border-deep);
  color: var(--afp-text-muted);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.afp-btn-secondary:hover { background: #3D4A5C; color: var(--afp-text); }

.afp-btn-primary {
  padding: 8px 16px;
  background: var(--afp-accent-02);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.afp-btn-primary:hover { background: var(--afp-accent-01); }

/* ===================================================================
   BOOKMARKS (TASK.024)
   =================================================================== */
.afp-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--afp-panel);
  border: 1px solid var(--afp-border-deep);
  color: var(--afp-text-muted);
  border-radius: 6px;
  font-family: var(--afp-font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.afp-bookmark-btn:hover {
  background: var(--afp-accent-indigo);
  border-color: var(--afp-accent-indigo);
  color: #fff;
}

.afp-bookmark-btn.bookmarked {
  background: var(--afp-accent-indigo);
  border-color: var(--afp-accent-indigo);
  color: #fff;
}

/* ===================================================================
   RELATED POSTS (TASK.022)
   =================================================================== */
.afp-related-posts {
  margin: 2.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--afp-border);
}

.afp-related-posts h3 {
  font-family: var(--afp-font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--afp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1.25rem;
}

.afp-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.afp-related-item {
  background: var(--afp-panel);
  border: 1px solid var(--afp-border);
  border-radius: 6px;
  padding: 1rem;
  transition: border-color 0.2s;
}

.afp-related-item:hover { border-color: var(--afp-accent-02); }

.afp-related-item a {
  color: var(--afp-text);
  font-family: var(--afp-font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.afp-related-item a:hover { color: var(--afp-accent-01); }

.afp-related-date {
  display: block;
  font-size: 0.75rem;
  color: var(--afp-text-dim);
  margin-top: 6px;
}

/* ===================================================================
   SOURCE CREDIBILITY BADGES (TASK.015)
   =================================================================== */
.afp-credibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--afp-font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.afp-credibility-tier-1 { background: rgba(40,167,69,0.15);  color: #28a745; }
.afp-credibility-tier-2 { background: rgba(108,154,40,0.15); color: #6c9a28; }
.afp-credibility-tier-3 { background: rgba(212,160,23,0.15); color: #d4a017; }
.afp-credibility-tier-4 { background: rgba(230,126,34,0.15); color: #e67e22; }
.afp-credibility-unverified { background: rgba(149,165,166,0.15); color: #95a5a6; }

/* ===================================================================
   TONE INDICATORS (TASK.010)
   =================================================================== */
.afp-tone-positive {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  background: rgba(0,229,255,0.12);
  color: var(--afp-accent-01);
}

.afp-tone-negative {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  background: rgba(230,126,34,0.12);
  color: #e67e22;
}

.afp-tone-neutral {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.75rem;
  background: rgba(168,176,184,0.12);
  color: var(--afp-text-muted);
}

/* ===================================================================
   ARCHIVE / CATEGORY COLOR CODING (TASK.023)
   =================================================================== */
.afp-archive-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.afp-cat-world-travel       .afp-archive-dot { background: var(--afp-s01); }
.afp-cat-local-radar        .afp-archive-dot { background: var(--afp-s02); }
.afp-cat-industry-watch     .afp-archive-dot { background: var(--afp-s03); }
.afp-cat-special-interests  .afp-archive-dot { background: var(--afp-s06); }
.afp-cat-technology-ai      .afp-archive-dot { background: var(--afp-s01); }
.afp-cat-business           .afp-archive-dot { background: var(--afp-s02); }
.afp-cat-science            .afp-archive-dot { background: var(--afp-s04); }
.afp-cat-culture-media      .afp-archive-dot { background: var(--afp-s06); }
.afp-cat-environment        .afp-archive-dot { background: var(--afp-s08); }
.afp-cat-global             .afp-archive-dot { background: var(--afp-s09); }
.afp-cat-labor              .afp-archive-dot { background: var(--afp-s10); }
.afp-cat-legal              .afp-archive-dot { background: var(--afp-s12); }
.afp-cat-cybersecurity      .afp-archive-dot { background: var(--afp-s13); }
.afp-cat-finance            .afp-archive-dot { background: var(--afp-s14); }
.afp-cat-creative           .afp-archive-dot { background: var(--afp-s17); }

/* ===================================================================
   TOPSHEET SECTION ACCENTS (section color dots and rank numbers)
   =================================================================== */
.afp-topsheet-item { border-left: 3px solid var(--afp-border-deep); padding-left: 0.75rem; }
.afp-topsheet-rank {
  font-family: var(--afp-font-sans);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--afp-text-dim);
  display: inline-block;
  width: 1.5rem;
  text-align: right;
  margin-right: 0.5rem;
}

/* Rank 1–3 get accent colors */
.afp-topsheet-item:nth-child(1) { border-left-color: var(--afp-s11); } /* gold */
.afp-topsheet-item:nth-child(1) .afp-topsheet-rank { color: var(--afp-s11); }
.afp-topsheet-item:nth-child(2) { border-left-color: var(--afp-s01); } /* cyan */
.afp-topsheet-item:nth-child(2) .afp-topsheet-rank { color: var(--afp-s01); }
.afp-topsheet-item:nth-child(3) { border-left-color: var(--afp-s09); } /* pink */
.afp-topsheet-item:nth-child(3) .afp-topsheet-rank { color: var(--afp-s09); }

/* ===================================================================
   POST-LEVEL SECTION CLASS ACCENTS
   Applied via body.single-post .entry-title or post wrapper.
   The publisher should add class afp-section-NN to the post container.
   =================================================================== */
.afp-section-01 .entry-title { border-left-color: var(--afp-s01); }
.afp-section-02 .entry-title { border-left-color: var(--afp-s02); }
.afp-section-03 .entry-title { border-left-color: var(--afp-s03); }
.afp-section-04 .entry-title { border-left-color: var(--afp-s04); }
.afp-section-05 .entry-title { border-left-color: var(--afp-s05); }
.afp-section-06 .entry-title { border-left-color: var(--afp-s06); }
.afp-section-07 .entry-title { border-left-color: var(--afp-s07); }
.afp-section-08 .entry-title { border-left-color: var(--afp-s08); }
.afp-section-09 .entry-title { border-left-color: var(--afp-s09); }
.afp-section-10 .entry-title { border-left-color: var(--afp-s10); }
.afp-section-11 .entry-title { border-left-color: var(--afp-s11); }
.afp-section-12 .entry-title { border-left-color: var(--afp-s12); }
.afp-section-13 .entry-title { border-left-color: var(--afp-s13); }
.afp-section-14 .entry-title { border-left-color: var(--afp-s14); }
.afp-section-15 .entry-title { border-left-color: var(--afp-s15); }
.afp-section-16 .entry-title { border-left-color: var(--afp-s16); }
.afp-section-17 .entry-title { border-left-color: var(--afp-s17); }
.afp-section-18 .entry-title { border-left-color: var(--afp-s18); }
.afp-section-19 .entry-title { border-left-color: var(--afp-s19); }

/* ===================================================================
   SOURCE LINK FAVICONS (TASK.027)
   =================================================================== */
.afp-source-favicon {
  width: 14px; height: 14px;
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 2px;
}

/* ===================================================================
   AI SUMMARIES (TASK.017)
   =================================================================== */
.afp-ai-summary {
  background: var(--afp-panel);
  border-left: 4px solid var(--afp-s06);   /* purple — AI/editorial signal */
  border-top: 1px solid var(--afp-border);
  border-bottom: 1px solid var(--afp-border);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--afp-text);
  line-height: 1.65;
  border-radius: 0;
}

.afp-ai-summary-label {
  font-family: var(--afp-font-sans);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--afp-s06);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.5rem;
}

/* ===================================================================
   KEY QUOTES (TASK.013)
   Pull-quote treatment: Wired-style large italic with accent bar.
   =================================================================== */
.afp-key-quote {
  margin: 2.5rem 0;
  padding: 1.5rem 1.75rem 1.5rem 1.75rem;
  background: var(--afp-panel);
  border-left: 6px solid var(--afp-accent-01);
  border-top: 1px solid var(--afp-border);
  border-bottom: 1px solid var(--afp-border);
  border-right: none;
  border-radius: 0;
  position: relative;
}

/* Large opening quote mark in accent color */
.afp-key-quote::before {
  content: "\201C";
  position: absolute;
  top: -0.25rem;
  left: 1.5rem;
  font-size: 4rem;
  line-height: 1;
  font-family: var(--afp-font-serif);
  color: var(--afp-accent-01);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
}

.afp-key-quote blockquote {
  margin: 0;
  padding: 0.75rem 0 0 0;
  border: none;
  background: transparent;
  font-family: var(--afp-font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--afp-text);
}

.afp-key-quote cite {
  display: block;
  margin-top: 1rem;
  font-family: var(--afp-font-sans);
  font-size: 0.8125rem;
  font-style: normal;
  color: var(--afp-accent-01);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===================================================================
   DATA VISUALIZATION (TASK.014)
   =================================================================== */
.afp-data-viz-block {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--afp-panel);
  border: 1px solid var(--afp-border);
  border-radius: 8px;
}

.afp-data-viz-title {
  font-family: var(--afp-font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--afp-text);
  margin-bottom: 1rem;
}

/* ===================================================================
   SUBSCRIPTION FORM (TASK.026)
   =================================================================== */
.afp-subscribe-block {
  margin: 2.5rem 0;
  padding: 1.5rem 2rem;
  background: var(--afp-panel);
  border: 1px solid var(--afp-border);
  border-radius: 8px;
}

.afp-subscribe-block h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: #fff;
}

.afp-subscribe-block p {
  font-size: 0.9375rem;
  color: var(--afp-text-muted);
  margin: 0 0 1rem;
}

.afp-subscribe-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.afp-subscribe-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--afp-bg);
  border: 1px solid var(--afp-border-deep);
  color: var(--afp-text);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: var(--afp-font-sans);
}

.afp-subscribe-input:focus {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 1px;
  border-color: var(--afp-accent-02);
}

.afp-subscribe-submit {
  padding: 10px 20px;
  background: var(--afp-s01);   /* bright cyan — high-contrast CTA */
  color: #000;                  /* black on cyan passes WCAG AA */
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.afp-subscribe-submit:hover { background: var(--afp-s15); color: #000; }

/* ===================================================================
   A/B TESTING HEADLINES (TASK.016)
   =================================================================== */
.afp-variant-hidden { display: none; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 768px) {
  .entry-content, .entry-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .entry-title { font-size: 1.25rem; }

  .afp-notes-sidebar { width: 100%; }

  .afp-related-list {
    grid-template-columns: 1fr;
  }

  .afp-subscribe-form { flex-direction: column; }
  .afp-subscribe-input { min-width: 0; }
}

@media (max-width: 480px) {
  .afp-notes-toggle { bottom: 16px; right: 16px; }
}

/* ===================================================================
   LIGHT MODE OVERRIDES (TASK.NEW-C)
   Applied when [data-theme="light"] is set on <html>
   =================================================================== */
[data-theme="light"] {
  --afp-bg:          #FFFFFF;
  --afp-panel:       #F4F6F8;
  --afp-border:      #DDE1E7;
  --afp-border-deep: #C8CDD5;
  --afp-text:        #1A1F27;
  --afp-text-muted:  #3D4A5C; /* #3D4A5C on #fff ≈ 7.8:1 — passes WCAG AA+AAA */
  --afp-text-dim:    #4F5B6B; /* #4F5B6B on #fff ≈ 6.0:1 — passes WCAG AA (#718096 only 3.7:1) */
  --afp-link:        #1A56DB;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6 { color: #0F172A; }

[data-theme="light"] .entry-title { color: #0F172A; }

[data-theme="light"] pre.item-meta,
[data-theme="light"] pre,
[data-theme="light"] .executive-summary,
[data-theme="light"] .afp-ai-summary,
[data-theme="light"] .afp-note-item { background: #EEF1F5; }

[data-theme="light"] .afp-highlight-palette,
[data-theme="light"] .afp-notes-sidebar,
[data-theme="light"] .afp-notes-modal-content { background: #F4F6F8; }

[data-theme="light"] blockquote {
  background: #EEF1F5;
  color: #1A1F27;
}

[data-theme="light"] .afp-key-quote blockquote {
  color: #1A1F27;
}

/* Section headers on light mode: keep bold borders, darken the H2 text */
[data-theme="light"] .entry-content h2 { color: #0F172A; }
[data-theme="light"] .section-header h2 { color: #0F172A; }

/* Light mode section accent colors stay the same (they're bright enough on white) */

/* Theme toggle button */
.afp-theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--afp-panel);
  border: 1px solid var(--afp-border-deep);
  border-radius: 50%;
  color: var(--afp-text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 999;
}

.afp-theme-toggle-btn:hover {
  background: var(--afp-accent-02);
  border-color: var(--afp-accent-02);
  color: #fff;
}

@media (max-width: 480px) {
  .afp-theme-toggle-btn { top: 0.5rem; right: 0.5rem; }
}

/* ===================================================================
   TABLE OF CONTENTS (TASK.NEW-A)
   =================================================================== */
.afp-toc {
  position: fixed;
  top: 4rem;
  right: 1.5rem;
  width: 220px;
  max-height: calc(100vh - 6rem);
  background: var(--afp-panel);
  border: 1px solid var(--afp-border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 900;
  font-family: var(--afp-font-sans);
  font-size: 0.8125rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.afp-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--afp-border);
  background: var(--afp-panel);
}

.afp-toc-title {
  font-weight: 600;
  color: var(--afp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

.afp-toc-toggle {
  background: none;
  border: none;
  color: var(--afp-text-dim);
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1;
  transition: transform 0.2s;
}

.afp-toc.collapsed .afp-toc-toggle { transform: rotate(-90deg); }

.afp-toc-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  max-height: calc(100vh - 10rem);
}

.afp-toc.collapsed .afp-toc-list { display: none; }

.afp-toc-item { margin: 0; }

.afp-toc-link {
  display: block;
  padding: 5px 14px;
  color: var(--afp-text-dim);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.afp-toc-link:hover {
  color: var(--afp-text);
  background: rgba(255,255,255,0.04);
  text-decoration: none;
}

.afp-toc-link.active {
  color: var(--afp-accent-01);
  border-left-color: var(--afp-accent-01);
  background: rgba(0,229,255,0.06);
}

/* Per-section active color in ToC (mirrors nth-of-type assignment on H2s) */
.afp-toc-item:nth-child(1)  .afp-toc-link.active { color: var(--afp-s01); border-left-color: var(--afp-s01); background: rgba(0,229,255,0.06); }
.afp-toc-item:nth-child(2)  .afp-toc-link.active { color: var(--afp-s02); border-left-color: var(--afp-s02); background: rgba(0,184,212,0.06); }
.afp-toc-item:nth-child(3)  .afp-toc-link.active { color: var(--afp-s03); border-left-color: var(--afp-s03); background: rgba(0,145,234,0.06); }
.afp-toc-item:nth-child(4)  .afp-toc-link.active { color: var(--afp-s04); border-left-color: var(--afp-s04); background: rgba(41,121,255,0.06); }
.afp-toc-item:nth-child(5)  .afp-toc-link.active { color: var(--afp-s05); border-left-color: var(--afp-s05); background: rgba(61,90,254,0.06); }
.afp-toc-item:nth-child(6)  .afp-toc-link.active { color: var(--afp-s06); border-left-color: var(--afp-s06); background: rgba(124,77,255,0.06); }
.afp-toc-item:nth-child(7)  .afp-toc-link.active { color: var(--afp-s07); border-left-color: var(--afp-s07); background: rgba(170,0,255,0.06); }
.afp-toc-item:nth-child(8)  .afp-toc-link.active { color: var(--afp-s08); border-left-color: var(--afp-s08); background: rgba(0,200,83,0.06); }
.afp-toc-item:nth-child(9)  .afp-toc-link.active { color: var(--afp-s09); border-left-color: var(--afp-s09); background: rgba(255,64,129,0.06); }
.afp-toc-item:nth-child(10) .afp-toc-link.active { color: var(--afp-s10); border-left-color: var(--afp-s10); background: rgba(255,109,0,0.06); }
.afp-toc-item:nth-child(11) .afp-toc-link.active { color: var(--afp-s11); border-left-color: var(--afp-s11); background: rgba(255,196,0,0.06); }
.afp-toc-item:nth-child(12) .afp-toc-link.active { color: var(--afp-s12); border-left-color: var(--afp-s12); background: rgba(255,23,68,0.06); }
.afp-toc-item:nth-child(13) .afp-toc-link.active { color: var(--afp-s13); border-left-color: var(--afp-s13); background: rgba(213,0,249,0.06); }
.afp-toc-item:nth-child(14) .afp-toc-link.active { color: var(--afp-s14); border-left-color: var(--afp-s14); background: rgba(174,234,0,0.06); }
.afp-toc-item:nth-child(15) .afp-toc-link.active { color: var(--afp-s15); border-left-color: var(--afp-s15); background: rgba(0,191,165,0.06); }
.afp-toc-item:nth-child(16) .afp-toc-link.active { color: var(--afp-s16); border-left-color: var(--afp-s16); background: rgba(101,31,255,0.06); }
.afp-toc-item:nth-child(17) .afp-toc-link.active { color: var(--afp-s17); border-left-color: var(--afp-s17); background: rgba(255,145,0,0.06); }
.afp-toc-item:nth-child(18) .afp-toc-link.active { color: var(--afp-s18); border-left-color: var(--afp-s18); background: rgba(0,172,193,0.06); }
.afp-toc-item:nth-child(19) .afp-toc-link.active { color: var(--afp-s19); border-left-color: var(--afp-s19); background: rgba(245,0,87,0.06); }

.afp-toc-level-3 .afp-toc-link { padding-left: 26px; font-size: 0.75rem; }

/* Hide ToC on narrow viewports */
@media (max-width: 1200px) {
  .afp-toc { display: none; }
}

/* ===================================================================
   SOCIAL SHARING (TASK.NEW-D)
   =================================================================== */
.afp-social-share {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0.75rem 0 1.5rem;
  flex-wrap: wrap;
}

.afp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--afp-panel);
  border: 1px solid var(--afp-border-deep);
  border-radius: 20px;
  color: var(--afp-text-muted);
  font-family: var(--afp-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.afp-share-btn:hover { text-decoration: none; }

.afp-share-twitter:hover  { background: #1da1f2; border-color: #1da1f2; color: #fff; }
.afp-share-linkedin:hover { background: #0a66c2; border-color: #0a66c2; color: #fff; }
.afp-share-copy:hover     { background: var(--afp-accent-indigo); border-color: var(--afp-accent-indigo); color: #fff; }
.afp-share-native:hover   { background: var(--afp-accent-02); border-color: var(--afp-accent-02); color: #fff; }

/* ===================================================================
   READ ALOUD BAR (TASK.032)
   =================================================================== */
.afp-read-aloud-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1rem 0 2rem;
  padding: 10px 16px;
  background: var(--afp-panel);
  border: 1px solid var(--afp-border);
  border-radius: 8px;
}

.afp-read-aloud-btn,
.afp-read-aloud-stop {
  padding: 6px 16px;
  border-radius: 20px;
  font-family: var(--afp-font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.afp-read-aloud-btn {
  background: var(--afp-accent-02);
  color: #fff;
  border-color: var(--afp-accent-02);
}

.afp-read-aloud-btn:hover  { background: var(--afp-accent-01); border-color: var(--afp-accent-01); }

.afp-read-aloud-stop {
  background: var(--afp-panel);
  color: var(--afp-text-muted);
  border-color: var(--afp-border-deep);
}

.afp-read-aloud-stop:hover { background: #dc3545; border-color: #dc3545; color: #fff; }

.afp-read-aloud-status {
  font-family: var(--afp-font-sans);
  font-size: 0.8125rem;
  color: var(--afp-text-dim);
  flex: 1;
}

/* ===================================================================
   PREVIOUSLY COVERED (TASK.NEW-E)
   =================================================================== */
.afp-related-coverage {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--afp-border);
}

.afp-related-coverage-title {
  font-family: var(--afp-font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--afp-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 0 0 1rem;
}

.afp-related-coverage-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.afp-related-coverage-link {
  color: var(--afp-link);
  font-size: 0.9375rem;
  text-decoration: none;
  line-height: 1.4;
}

.afp-related-coverage-link:hover { text-decoration: underline; }

.afp-related-coverage-date {
  font-family: var(--afp-font-sans);
  font-size: 0.75rem;
  color: var(--afp-text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===================================================================
   PRINT STYLES (TASK.NEW-F)
   =================================================================== */
@media print {
  /* Base */
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Reset dark panel backgrounds */
  :root {
    --afp-bg:    #fff;
    --afp-panel: #f8f8f8;
    --afp-text:  #000;
    --afp-link:  #000;
  }

  /* Hide interactive / navigation elements */
  #afp-reading-progress-container,
  .afp-notes-toggle,
  .afp-notes-sidebar,
  .afp-highlight-palette,
  .afp-text-size-controls,
  .afp-theme-toggle-btn,
  .afp-toc,
  .afp-social-share,
  .afp-read-aloud-bar,
  .afp-subscribe-block,
  .afp-related-posts,
  nav, .site-header, .site-footer, .site-nav,
  .wp-block-navigation, .admin-bar { display: none !important; }

  /* Content */
  .entry-content, .entry-header {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  /* Show full URLs after links */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #444;
    word-break: break-all;
  }

  /* Don't print URLs for navigation or UI links */
  .afp-related-coverage a::after,
  .afp-related-posts a::after { content: none; }

  /* Page breaks */
  h2, h3 { page-break-after: avoid; }
  .briefing-item { page-break-inside: avoid; }

  /* Blockquotes */
  blockquote {
    background: #f8f8f8 !important;
    border-left: 3px solid #ccc;
    color: #333;
  }

  pre.item-meta, pre {
    background: #f4f4f4 !important;
    border-left: 2px solid #ccc;
    font-size: 0.8em;
  }
}

/* ===================================================================
   ACCESSIBILITY — FOCUS VISIBLE (WCAG 2.1 SC 2.4.7 / 2.4.11)
   All interactive elements must expose a visible focus indicator.
   We use :focus-visible so mouse users aren't affected.
   =================================================================== */

/* Global default for anything not specifically overridden */
:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* Table of Contents links */
.afp-toc-link:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ToC collapse toggle */
.afp-toc-toggle:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Social share buttons */
.afp-share-btn:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* Read-aloud play / stop buttons */
.afp-read-aloud-btn:focus-visible,
.afp-read-aloud-stop:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* Highlight color swatches (small targets — larger offset) */
.afp-highlight-color:focus-visible {
  outline: 3px solid var(--afp-accent-01);
  outline-offset: 3px;
  border-radius: 50%;
}

/* Notes sidebar action buttons */
.afp-note-actions button:focus-visible,
.afp-notes-close:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Highlight-notes floating toggle */
.afp-notes-button:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 3px;
}

/* Text-size control buttons */
.afp-text-size-btn:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* Theme toggle */
.afp-theme-toggle-btn:focus-visible {
  outline: 3px solid var(--afp-accent-01);
  outline-offset: 3px;
}

/* Subscribe buttons */
.afp-subscribe-btn:focus-visible,
.afp-subscribe-button:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* AB test variant toggle (admin helper) */
.afp-ab-variant-toggle:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* Key-quote expand / source-credibility badge (keyboard usable) */
.afp-key-quote-toggle:focus-visible,
.afp-credibility-badge:focus-visible {
  outline: 3px solid var(--afp-accent-02);
  outline-offset: 2px;
}

/* ===================================================================
   ACCESSIBILITY — REDUCED MOTION (WCAG 2.1 SC 2.3.3 AAA / 2.3.1 AA)
   Disable or slow animations for users who request it.
   =================================================================== */
@media (prefers-reduced-motion: reduce) {

  /* Reading progress bar */
  #afp-reading-progress-bar {
    transition: none !important;
  }

  /* Highlight palette slide-in */
  .afp-highlight-palette {
    animation: none !important;
    transition: none !important;
  }

  /* Notes sidebar slide */
  .afp-notes-sidebar {
    transition: none !important;
  }

  /* Key-quote reveal animation */
  .afp-key-quote {
    animation: none !important;
    transition: none !important;
  }

  /* Social share button hover lift */
  .afp-share-btn {
    transition: none !important;
    transform: none !important;
  }

  /* Read-aloud bar */
  .afp-read-aloud-bar {
    animation: none !important;
    transition: none !important;
  }

  /* ToC link underline / border transitions */
  .afp-toc-link {
    transition: none !important;
  }

  /* Theme toggle */
  .afp-theme-toggle-btn {
    transition: none !important;
  }

  /* Text-size button transitions */
  .afp-text-size-btn {
    transition: none !important;
  }

  /* Credibility badge hover */
  .afp-credibility-badge {
    transition: none !important;
  }

  /* Subscribe button */
  .afp-subscribe-btn,
  .afp-subscribe-button {
    transition: none !important;
  }
}

/* ===================================================================
   GEOMETRIC SEPARATORS (Wired editorial system)
   Small squares, thin rules — no rounded shapes.
   =================================================================== */

/* Briefing item divider: thin rule + small square marker in section color */
.entry-content hr {
  border: none;
  border-top: 1px solid var(--afp-border);
  margin: 2rem 0;
  position: relative;
}

/* Small square marker at left of each HR (geometric system) */
.entry-content hr::before {
  content: "";
  position: absolute;
  left: 0;
  top: -3px;
  width: 6px;
  height: 6px;
  background: var(--afp-text-dim);
}

/* (briefing-item and field-label are defined in the BRIEFING ITEMS section above) */

/* ===================================================================
   RELATED ITEMS — use accent colors on hover instead of flat cyan
   =================================================================== */
.afp-related-item:nth-child(3n+1):hover { border-color: var(--afp-s01); }
.afp-related-item:nth-child(3n+2):hover { border-color: var(--afp-s09); }
.afp-related-item:nth-child(3n):hover   { border-color: var(--afp-s06); }

/* ===================================================================
   SITE TITLE / MASTHEAD — editorial identity
   =================================================================== */
.site-title,
.wp-block-site-title {
  font-family: var(--afp-font-sans) !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  text-transform: uppercase !important;
}

.site-title a,
.wp-block-site-title a {
  color: #fff !important;
  text-decoration: none !important;
}

/* Accent bar under site title — marks the publication identity */
.site-title::after,
.wp-block-site-title::after {
  content: "";
  display: block;
  width: 2rem;
  height: 4px;
  background: var(--afp-s01);
  margin-top: 4px;
}

/* (subscribe submit button colors defined in SUBSCRIPTION FORM section above) */

/* ===================================================================
   TWO-COLUMN STICKY SIDEBAR LAYOUT (single.html)
   Sidebar sticks at top; main column scrolls freely.
   Sidebar hidden at ≤1200px — main column fills full width.
   =================================================================== */

/* Columns must start at top so sticky works correctly */
.afp-post-columns.wp-block-columns {
  align-items: flex-start !important;
}

/* Sticky sidebar column */
.afp-post-sidebar-column.wp-block-column {
  position: sticky;
  top: var(--wp--custom--layout--sidebar-top, 5rem);
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--afp-border, #2a2d33) transparent;
}

.afp-post-sidebar-column.wp-block-column::-webkit-scrollbar {
  width: 3px;
}
.afp-post-sidebar-column.wp-block-column::-webkit-scrollbar-thumb {
  background: var(--afp-border, #2a2d33);
  border-radius: 0;
}

/* Sidebar inner wrapper */
.afp-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

/* Edition meta / kicker above ToC */
.afp-sidebar-edition-meta {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--afp-border, #2a2d33);
}

.afp-sidebar-kicker {
  font-family: var(--afp-font-mono, "Fira Code", monospace);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--afp-accent, #00e5ff);
}

/* Hide sidebar and make main column full-width below 1200px */
@media (max-width: 1200px) {
  .afp-post-sidebar-column.wp-block-column {
    display: none !important;
  }
  .afp-post-columns.wp-block-columns .afp-post-main-column.wp-block-column {
    flex-basis: 100% !important;
    max-width: 100% !important;
    border-left: none !important;
    padding-left: var(--wp--preset--spacing--50) !important;
    padding-right: var(--wp--preset--spacing--50) !important;
  }
}

/* ===================================================================
   TOC INSIDE SIDEBAR — override fixed / absolute positioning
   The floating ToC panel behaviour is replaced by inline flow.
   =================================================================== */

#afp-sidebar-toc .afp-toc {
  position: static !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  width: 100% !important;
  max-height: none !important;
  max-width: none !important;
  overflow: visible !important;
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  transform: none !important;
  z-index: auto !important;
}

/* ToC toggle button: hide the collapse handle inside sidebar */
#afp-sidebar-toc .afp-toc-toggle {
  display: none !important;
}

/* ToC heading inside sidebar */
#afp-sidebar-toc .afp-toc-heading {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--afp-text-dim, #666c77);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--afp-border, #2a2d33);
}

/* ToC links inside sidebar */
#afp-sidebar-toc .afp-toc-link {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 0.2rem 0;
  color: var(--afp-text-dim, #666c77);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  transition: color 0.12s ease, border-color 0.12s ease;
}

#afp-sidebar-toc .afp-toc-link:hover,
#afp-sidebar-toc .afp-toc-link.afp-toc-active {
  color: var(--afp-accent, #00e5ff);
  border-left-color: var(--afp-accent, #00e5ff);
}

/* ===================================================================
   BACKDROP-FILTER FORM INPUTS + CUBIC-BEZIER BUTTON TRANSITIONS
   Inspired by Retrospect's glassmorphism subtlety.
   =================================================================== */

/* Subtle saturation boost on focused inputs */
.afp-subscribe-email,
input[type="email"].wp-block-loginout input,
.comment-form input[type="email"],
.comment-form input[type="text"],
.comment-form textarea,
.wp-block-search__input {
  backdrop-filter: saturate(1.075);
  -webkit-backdrop-filter: saturate(1.075);
  transition: border-color 0.15s ease,
              box-shadow 0.15s ease,
              backdrop-filter 0.15s ease;
}

.afp-subscribe-email:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="text"]:focus,
.comment-form textarea:focus,
.wp-block-search__input:focus {
  backdrop-filter: saturate(1.2) brightness(1.04);
  -webkit-backdrop-filter: saturate(1.2) brightness(1.04);
  outline: none;
  box-shadow: 0 0 0 2px var(--afp-accent, #00e5ff);
  border-color: var(--afp-accent, #00e5ff);
}

/* Refined button hover transitions — Material Design easing */
.afp-subscribe-submit,
.wp-block-button__link,
.wp-element-button,
.afp-share-btn,
.afp-subscribe-btn,
.afp-theme-toggle-btn {
  transition: background-color  0.15s cubic-bezier(0.4, 0, 0.2, 1),
              color              0.15s cubic-bezier(0.4, 0, 0.2, 1),
              border-color       0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow         0.15s cubic-bezier(0.4, 0, 0.2, 1),
              backdrop-filter    0.15s ease;
}

.afp-subscribe-submit:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
  backdrop-filter: blur(2px) saturate(1.1);
  -webkit-backdrop-filter: blur(2px) saturate(1.1);
}

/* ===================================================================
   ARCHIVE CARD GRID (archive.html — 3-column)
   Card: bordered, flex column; image 16:9 forced via aspect-ratio;
   body fills remaining height; footer pinned at bottom.
   =================================================================== */

/* Grid container spacing */
.afp-archive-grid.wp-block-post-template {
  gap: 1.25rem !important;
}

/* Card shell */
.afp-archive-card.wp-block-group {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow   0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.afp-archive-card.wp-block-group:hover {
  border-color: var(--afp-accent, #00e5ff) !important;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.08);
}

/* Featured image: lock to 16:9 */
.afp-card-image.wp-block-post-featured-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.afp-card-image.wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.afp-archive-card:hover .afp-card-image.wp-block-post-featured-image img {
  transform: scale(1.03);
}

/* Card body: fills remaining space */
.afp-card-body.wp-block-group {
  flex: 1 1 auto;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.375rem;
}

/* Title link color inside card */
.afp-archive-card .wp-block-post-title a {
  color: var(--wp--preset--color--contrast);
  text-decoration: none;
}
.afp-archive-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--afp-accent);
}

/* Card footer: always at card bottom */
.afp-card-footer.wp-block-group {
  margin-top: auto;
  flex-shrink: 0;
}

/* ===================================================================
   ACCENT SEPARATOR RULES
   height:3px is applied via CSS (not inline HTML) to keep block
   save() output clean and avoid validation errors.
   =================================================================== */
.afp-header-rule,
.afp-title-rule,
.afp-hero-rule {
  height: 3px !important;
  border: none !important;
}

/* Responsive: 2-col at tablet, 1-col at mobile */
@media (max-width: 900px) {
  .afp-archive-grid.wp-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 560px) {
  .afp-archive-grid.wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
}
