/*
Theme Name:  Dan Herbatschek 2026
Theme URI:   https://danherbatschek.net/
Description: Dark, editorial-tech child theme of Royal Elementor Kit. Carries the IBM Plex design system (tokens, animations, form overrides) while page layouts live in importable Elementor templates.
Author:      Freddy Daniel · Ramsey Theory Group
Author URI:  https://www.ramseytheory.com/
Version:     1.2.1
Template:    royal-elementor-kit
Text Domain: dh-2026
Requires PHP: 7.4
Requires at least: 6.0
*/

/* ============================================================
   Design tokens — pasted from handoff colors_and_type.css.
   IBM Plex pairing locked; alternate-pairing blocks dropped.
   ============================================================ */

:root {
  /* Surfaces */
  --bg-primary:   #0B0D10;
  --bg-secondary: #111418;
  --bg-tertiary:  #181C22;
  --bg-inverted:  #ECEFF3;

  /* Foreground */
  --fg-primary:   #ECEFF3;
  --fg-secondary: #A4ADB8;
  --fg-subtle:    #6A7380;
  --fg-inverted:  #0B0D10;

  /* Accent — luminous silver-blue */
  --accent:        #9FC6FF;
  --accent-hover:  #C4DCFF;
  --accent-muted:  #6A8FBF;
  --accent-subtle: rgba(159, 198, 255, 0.10);
  --accent-glow:   rgba(159, 198, 255, 0.35);

  /* Borders */
  --border-primary: #232830;
  --border-subtle:  #1A1E24;

  /* Status */
  --success: #5EE2A0;
  --error:   #FF8080;
  --warning: #FFC85A;
  --info:    #9FC6FF;

  /* Type stack — IBM Plex pairing locked */
  --font-heading: "IBM Plex Sans", system-ui, sans-serif;
  --font-italic:  "Fraunces", "Times New Roman", serif;
  --font-ui:      "IBM Plex Sans", system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --heading-tracking: -0.025em;

  /* Layout */
  --max-width-content: 1400px;
  --spacing-section:   128px;
  --spacing-section-x: 40px;

  /* Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 200ms;
  --dur-mid:  300ms;
  --dur-slow: 600ms;
}

/* ============================================================
   Base — body, selection, focus
   ============================================================ */
html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--fg-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: var(--bg-primary); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Headings — IBM Plex Sans with fluid clamps
   ============================================================ */
h1, .h1 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  color: var(--fg-primary);
}
h2, .h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
}
h3, .h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--fg-primary);
}
h4, .h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--fg-primary);
}

/* ============================================================
   Body copy
   ============================================================ */
p, .p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--fg-secondary);
}
.p-lg { font-size: 1.125rem; line-height: 1.7; }
.p-xl { font-size: 1.25rem;  line-height: 1.6; }

/* ============================================================
   Eyebrow / overline — Plex Mono, tracked
   ============================================================ */
.eyebrow, .overline {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-subtle);
}

/* ============================================================
   UI labels and buttons (default reset; per-button styles in Task 9)
   ============================================================ */
button, .ui, .label {
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: 0;
}

/* ============================================================
   Italic emphasis — global rule swaps any <em> to Fraunces.
   Used inline inside Plex Sans headings to flourish keywords.
   ============================================================ */
em, .italic {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
}

/* ============================================================
   Link hover underline (animated scaleX)
   ============================================================ */
.link-hover {
  position: relative;
  text-decoration: none;
  color: inherit;
}
.link-hover::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 400ms var(--ease-out);
}
.link-hover:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ============================================================
   Blockquote — Fraunces italic, accent left rule
   ============================================================ */
blockquote, .blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--fg-primary);
}

/* Inline code */
code, .code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--bg-tertiary);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

/* ============================================================
   Footer dark override — production decision per handoff README.
   The footer template root container has class `dh-footer`; this
   forces dark tokens regardless of any inverted-bg widget styles.
   ============================================================ */
.dh-footer {
  background: var(--bg-primary) !important;
  color: var(--fg-primary);
  border-top: 1px solid var(--border-primary);
}
.dh-footer * { color: inherit; }
.dh-footer .eyebrow,
.dh-footer .dh-footer-label {
  color: color-mix(in oklab, var(--fg-primary) 50%, transparent);
}
.dh-footer a {
  color: var(--fg-primary);
  text-decoration: none;
}
.dh-footer a:hover { color: var(--accent); }
.dh-footer .dh-accent { color: var(--accent); }
.dh-footer .dh-footer-bottom {
  border-top: 1px solid color-mix(in oklab, var(--fg-primary) 12%, transparent);
  font-family: var(--font-body);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: color-mix(in oklab, var(--fg-primary) 45%, transparent);
}

/* ============================================================
   Elementor Pro Form widget — bottom-border-only field style.
   Targets `.elementor-widget-form` only so we don't accidentally
   restyle other form widgets on the site.
   ============================================================ */
.elementor-widget-form .elementor-field-group {
  margin-bottom: 36px;
}
.elementor-widget-form .elementor-field-group > label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  color: var(--fg-subtle);
}
.elementor-widget-form .elementor-field-textual {
  width: 100%;
  border: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--fg-subtle) 35%, transparent);
  background: transparent;
  padding: 14px 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg-primary);
  outline: none;
  border-radius: 0;
  box-shadow: none;
  transition: border-color 300ms var(--ease-out);
}
.elementor-widget-form .elementor-field-textual::placeholder {
  color: color-mix(in oklab, var(--fg-subtle) 70%, transparent);
}
.elementor-widget-form .elementor-field-textual:focus {
  border-bottom-color: var(--accent);
}
.elementor-widget-form textarea.elementor-field-textual {
  resize: vertical;
  min-height: 120px;
}
.elementor-widget-form .elementor-field-required label::after {
  content: "";
}
.elementor-widget-form .elementor-message {
  margin-top: 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-secondary);
}
.elementor-widget-form .elementor-message-danger {
  color: var(--error);
}
.elementor-widget-form .elementor-message-success {
  color: var(--accent);
}
.elementor-widget-form input[type="submit"],
.elementor-widget-form .elementor-button {
  padding: 16px 32px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  background: var(--accent);
  color: var(--fg-inverted);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.elementor-widget-form input[type="submit"]:hover,
.elementor-widget-form .elementor-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.elementor-widget-form .elementor-field-group.elementor-field-type-acceptance label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  color: var(--fg-secondary);
}

/* ============================================================
   Primary / secondary CTA buttons (when used outside of
   Elementor's button widget — e.g., Form submit handled in Task 8).
   ============================================================ */
.dh-btn-primary {
  display: inline-block;
  padding: 14px 28px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  background: var(--accent);
  color: var(--fg-inverted);
  border: 1px solid var(--accent);
  border-radius: 0;
  text-decoration: none;
  transition: background 200ms ease, border-color 200ms ease;
}
.dh-btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.dh-btn-secondary {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  color: var(--fg-primary);
  text-decoration: none;
}

/* ============================================================
   Press row — 4-col grid with hover treatment
   Markup: each row is an <a class="dh-press-row"> with 4 children
   styled by nth-child below.
   ============================================================ */
.dh-press-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 2.4fr) minmax(0, 1.6fr) 80px;
  align-items: baseline;
  gap: 32px;
  padding: 28px 16px;
  margin: 0 -16px;
  border-top: 1px solid var(--border-primary);
  text-decoration: none;
  color: inherit;
  transition: background 300ms var(--ease-out);
}
.dh-press-row:hover {
  background: color-mix(in oklab, var(--accent-subtle) 50%, transparent);
}
.dh-press-row > :nth-child(1) {           /* outlet */
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-subtle);
}
.dh-press-row > :nth-child(2) {           /* headline */
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.3;
  color: var(--fg-primary);
  transition: color 300ms var(--ease-out);
}
.dh-press-row:hover > :nth-child(2) {
  color: var(--accent);
}
.dh-press-row > :nth-child(3) {           /* summary */
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-secondary);
}
.dh-press-row > :nth-child(4) {           /* date */
  text-align: right;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-subtle);
}
@media (max-width: 768px) {
  .dh-press-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .dh-press-row > :nth-child(4) { text-align: left; }
}

/* ============================================================
   Portrait treatment (hero + about sidebar)
   ============================================================ */
.dh-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
}
.dh-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  filter: saturate(0.92) contrast(1.02);
}
.dh-portrait-caption {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-subtle);
}

/* ============================================================
   Hairline rule
   ============================================================ */
.dh-rule {
  height: 1px;
  background: var(--border-primary);
  border: 0;
  margin: 0;
}

/* ============================================================
   At-a-glance bullets (about sidebar)
   ============================================================ */
.dh-glance-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dh-glance-list li {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-secondary);
}
.dh-glance-list li::before {
  content: "—";
  color: var(--accent);
  margin-right: 10px;
}

/* ============================================================
   Royal Elementor Kit dequeue compensation — reset any inherited
   defaults that clash with our type/layout. Add only as we find
   conflicts during Task 11 visual review.
   ============================================================ */

/* ============================================================
   Reveal animation — once on page load only.
   Wrapped in reduced-motion guard.
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .dh-reveal {
    opacity: 0;
    transform: translateY(16px);
  }
  .dh-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dh-reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Sticky header scroll-state — toggled by reveal.js
   ============================================================ */
.dh-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--bg-primary) 65%, transparent);
  border-bottom: 1px solid transparent;
  transition: background 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}
.dh-header.is-scrolled {
  background: color-mix(in oklab, var(--bg-primary) 92%, transparent);
  border-bottom-color: var(--border-primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   Fellowship (2026-09-15) — /fellowship/ page + homepage
   "Philanthropy" band (Fellowship + Scholarship cards).
   ============================================================ */

/* Stat cell: big figure + mono label */
.dh-stat {
  border-top: 1px solid var(--border-primary);
  padding-top: 20px;
}
.dh-stat .dh-stat-value {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
  margin: 0 0 10px;
}
.dh-stat .dh-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  margin: 0;
}

/* Fact list: label / value rows separated by hairlines */
.dh-fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dh-fact-list li {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-primary);
}
.dh-fact-list li:last-child { border-bottom: 1px solid var(--border-subtle); }
.dh-fact-list li > span:first-child {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  padding-top: 4px;
}
.dh-fact-list a { color: var(--accent); text-decoration: none; }
.dh-fact-list a:hover { color: var(--accent-hover); }
@media (max-width: 540px) {
  .dh-fact-list li { grid-template-columns: 1fr; gap: 4px; }
}

/* Circuit phase: numeral + title + line */
.dh-phase .dh-phase-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 12px;
}

/* Program card (homepage Philanthropy band + page callout) */
.dh-program-card {
  transition: border-color var(--dur-fast) var(--ease-out);
}
.dh-program-card:hover { border-color: var(--accent-muted) !important; }
.dh-program-card .dh-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 8px;
}
.dh-program-card .dh-card-links a {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}
.dh-program-card .dh-card-links a.is-muted { color: var(--fg-secondary); }
.dh-program-card .dh-card-links a:hover { color: var(--accent-hover); }

/* "Not the Scholarship" callout */
.dh-callout {
  border-left: 2px solid var(--accent);
  background: var(--accent-subtle);
}
.dh-callout p { margin: 0; }
.dh-callout a { color: var(--accent); text-decoration: none; }
.dh-callout a:hover { color: var(--accent-hover); }

/* Ghost button (accent text, hairline border) */
.dh-btn-ghost .elementor-button,
.dh-btn-ghost.elementor-button {
  background: transparent !important;
  color: var(--accent) !important;
  border: 1px solid var(--border-primary) !important;
  border-radius: 0 !important;
}
.dh-btn-ghost .elementor-button:hover { border-color: var(--accent) !important; }

/* Button widgets carrying .dh-btn-primary / .dh-btn-ghost: style the inner
   <a class="elementor-button">, not the widget wrapper (1.2.1 fix). */
.elementor-widget-button.dh-btn-primary,
.elementor-widget-button.dh-btn-ghost {
  display: block;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
.elementor-widget-button.dh-btn-primary .elementor-button {
  background: var(--accent);
  color: var(--fg-inverted);
  border: 1px solid var(--accent);
  border-radius: 0;
  padding: 14px 28px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2.4px;
  transition: background 200ms ease, border-color 200ms ease;
}
.elementor-widget-button.dh-btn-primary .elementor-button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--fg-inverted);
}
.elementor-widget-button.dh-btn-ghost .elementor-button {
  padding: 14px 28px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2.4px;
}
