/*
Theme Name: DPP Signal
Theme URI: https://dppsignal.com
Author: Nick (DPP Signal)
Author URI: https://dppsignal.com
Description: A modern-tech custom theme for DPP Signal — a fortnightly EU Digital Product Passport intelligence brief plus a citation-optimised DPP knowledge base. Built for WPForms, The Newsletter Plugin, and WP Mail SMTP. Engineered for LLM/AI-search citations with Article + FAQ schema and answer-first layouts.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dpp-signal
*/

/* ============================================================
   Design tokens — "modern tech" palette (Inter, blue accent)
   ============================================================ */
:root {
  --ink: #0f172a;        /* slate-900 — headings */
  --body: #334155;       /* slate-700 — body text */
  --muted: #64748b;      /* slate-500 — meta */
  --accent: #2563eb;     /* blue-600 — primary accent */
  --accent-dark: #1d4ed8;/* blue-700 */
  --teal: #0d9488;       /* teal-600 — secondary accent */
  --bg: #ffffff;
  --surface: #f8fafc;    /* slate-50 — section bg / cards */
  --surface-2: #f1f5f9;  /* slate-100 */
  --border: #e2e8f0;     /* slate-200 */
  --ink-invert: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --readw: 720px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { color: var(--ink); line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1.15em; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
strong { color: var(--ink); font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
code { background: var(--surface-2); padding: .15em .4em; border-radius: 4px; font-size: .9em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.readable { max-width: var(--readw); margin-left: auto; margin-right: auto; }
.section { padding: 72px 0; }
.section--surface { background: var(--surface); }
.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: .6rem; }
.lede { font-size: 1.2rem; color: var(--muted); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block; font-weight: 700; font-size: 1rem;
  padding: 13px 22px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff !important; text-decoration: none !important;
  border: 1px solid var(--accent); cursor: pointer; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--accent) !important; }
.btn--ghost:hover { background: var(--surface-2); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.main-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; align-items: center; }
.main-nav a { color: var(--body); font-weight: 600; font-size: .98rem; }
.main-nav a:hover { color: var(--accent); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; color: var(--ink); cursor: pointer; }

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 84px 0 76px; background: var(--ink); }
.hero h1 { color: #ffffff; }
.hero .eyebrow { color: #818cf8; }
.hero .lede { color: #cbd5e1; }
.hero .signup-card { box-shadow: 0 1px 2px rgba(2,6,23,.2), 0 18px 48px rgba(2,6,23,.45); }
.hero .lede { max-width: 640px; margin-left: auto; margin-right: auto; }
.hero-cta { margin-top: 26px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Signup card (wraps The Newsletter Plugin / WPForms shortcode) */
.signup-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; max-width: 540px; margin: 32px auto 0;
}
.signup-card h3 { margin-bottom: .3em; }
.signup-card p { color: var(--muted); font-size: 1rem; }
/* Normalise the embedded form (The Newsletter Plugin / WPForms) so fields
   always stack vertically and full width — stops the submit button being
   pushed to the right of the email input on wider (desktop) viewports.
   Forced as a flex column so it overrides any inline-block / float / flex-row
   layout (and inline styles) the plugin applies. */
.signup-card form,
.signup-card .tnp,
.signup-card .tnp-form,
.signup-card .tnp-subscription,
.signup-card .wpforms-form {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: 0 !important;
}
/* Every direct child / field wrapper: full width, stacked, no float. */
.signup-card form > *,
.signup-card .tnp-field,
.signup-card .tnp-field-button,
.signup-card .wpforms-field-container,
.signup-card .wpforms-field,
.signup-card .wpforms-field-row,
.signup-card .wpforms-submit-container {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}
.signup-card .tnp-field, .signup-card .wpforms-field-row { margin: 0 0 12px !important; }
.signup-card label { display: block !important; }
.signup-card input[type="email"], .signup-card input[type="text"] {
  width: 100% !important; box-sizing: border-box; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 1rem; font-family: var(--font); margin-bottom: 12px;
}
/* Subscribe button — always full width and centred under the email field,
   and always the brand blue. !important on layout + colour overrides the
   inline styles the plugin applies to its submit button. */
.signup-card input[type="submit"],
.signup-card button[type="submit"],
.signup-card .tnp-submit,
.signup-card .wpforms-submit,
.signup-card button {
  display: block !important; width: 100% !important; max-width: 100% !important;
  box-sizing: border-box !important; float: none !important; margin: 0 auto !important;
  padding: 13px; border: 0; border-radius: var(--radius-sm);
  background: var(--accent) !important; color: #fff !important; font-weight: 700; font-size: 1rem; cursor: pointer;
}
.signup-card input[type="submit"]:hover,
.signup-card button[type="submit"]:hover,
.signup-card .tnp-submit:hover,
.signup-card .wpforms-submit:hover,
.signup-card button:hover { background: var(--accent-dark) !important; }

/* ============================================================
   Cards / grids
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .tag { align-self: flex-start; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); margin-bottom: 12px; }
.card h3 { font-size: 1.2rem; margin-bottom: .4em; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card .excerpt { color: var(--muted); font-size: .97rem; }
.card .meta { color: var(--muted); font-size: .85rem; margin-top: auto; padding-top: 14px; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 32px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* ============================================================
   Article (single post / KB entry)
   ============================================================ */
.article-header { padding: 56px 0 28px; background: var(--surface); border-bottom: 1px solid var(--border); }
.article-header .container { max-width: var(--readw); }
.article-meta { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.entry-content { padding: 44px 0 64px; }
.entry-content p, .entry-content ul, .entry-content ol { font-size: 1.08rem; }
.entry-content h2 { margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .98rem; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.entry-content th { background: var(--surface); font-weight: 700; color: var(--ink); }
.entry-content blockquote { border-left: 4px solid var(--accent); margin: 1.5em 0; padding: .4em 0 .4em 20px; color: var(--ink); font-style: italic; }

/* Answer-first callout — for GEO. Put a 40-60 word direct answer here. */
.answer-box {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm); padding: 18px 20px; margin: 0 0 28px;
}
.answer-box .label { display: block; text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 700; color: var(--teal); margin-bottom: 6px; }
.answer-box p { margin: 0; color: var(--ink); font-size: 1.05rem; }

/* FAQ block (renders FAQPage schema via shortcode/template) */
.faq { margin: 2.5em 0; }
.faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq-item h3 { font-size: 1.1rem; margin-bottom: .4em; }

/* KB directory filters */
.kb-tax { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.kb-tax a { font-size: .9rem; font-weight: 600; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; color: var(--body); background: #fff; }
.kb-tax a:hover, .kb-tax a.active { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: #cbd5e1; padding: 56px 0 32px; margin-top: 0; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer h4 { color: #fff; font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: .95rem; }
.footer-bottom { border-top: 1px solid #1e293b; margin-top: 36px; padding-top: 20px; font-size: .85rem; color: #94a3b8; }

/* ============================================================
   Pagination / misc
   ============================================================ */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--body); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 16px; }
  .main-nav li { width: 100%; padding: 10px 0; border-bottom: 1px solid var(--surface-2); }
  .nav-toggle { display: block; }
  .section { padding: 52px 0; }
}
