/*
Theme Name: TrackdayFinder
Theme URI: https://trackdayfinder.co.uk/
Author: TrackdayFinder
Description: Classic WordPress theme that matches the TrackdayFinder.co.uk visual identity — navy gradient header, red accent, Inter typeface, white card surfaces. Drop-in for the /blog WP install.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trackdayfinder
*/

:root {
  --fg:#0f172a;
  --muted:#64748b;
  --muted-2:#94a3b8;
  --bg:#f1f5f9;
  --card:#ffffff;
  --line:#e2e8f0;
  --line-2:#cbd5e1;
  --accent:#dc2626;
  --accent-2:#b91c1c;
  --hi-bg:#fef2f2;
  --header-bg:#0b1220;
  --header-fg:#f8fafc;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow:    0 4px 12px rgba(15,23,42,0.06);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height:100%; margin:0; }
body {
  font: 14px/1.55 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Header (mirrors the app shell) ============ */
.tdf-header {
  padding: 14px 24px;
  background: linear-gradient(180deg, #0b1220 0%, #111a2e 100%);
  color: var(--header-fg);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 6px 20px rgba(0,0,0,0.25);
}
.tdf-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.tdf-brand-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  align-self: flex-start;
}
.tdf-brand-logo { height: 44px; width: auto; display: block; }
@media (max-width: 640px) { .tdf-brand-logo { height: 34px; } }
.tdf-tagline {
  color: #94a3b8;
  font-size: 13px;
  padding-right: 4px;
  line-height: 1.1;
}
.tdf-tagline a {
  color: #f8fafc;
  text-decoration: none;
  border-bottom: 1px dashed #475569;
  font-weight: 600;
}
.tdf-tagline a:hover { color: #fff; border-color: #fff; }
.tdf-brand-r { color: var(--accent); }

.tdf-nav {
  display: flex;
  gap: 14px;
}
.tdf-nav a {
  color: #f8fafc;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: background .15s, border-color .15s;
}
.tdf-nav a:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
}

.tdf-meta {
  color: #94a3b8;
  font-size: 12px;
  margin-left: auto;
  background: rgba(255,255,255,0.04);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* ============ Sub-nav / breadcrumbs ============ */
.tdf-crumbs {
  padding: 10px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.tdf-crumbs a { color: var(--accent); text-decoration: none; }
.tdf-crumbs a:hover { text-decoration: underline; }

/* ============ Main content shell ============ */
main.tdf-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

article.tdf-post,
.tdf-page {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  color: var(--fg);
}
h1 { font-size: 32px; font-weight: 800; margin: 0 0 8px; }
h2 { font-size: 22px; font-weight: 700; margin: 28px 0 12px; }
h3 { font-size: 18px; font-weight: 700; margin: 22px 0 10px; }
h4 { font-size: 16px; font-weight: 700; margin: 18px 0 8px; }

p, li { line-height: 1.6; }

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); text-decoration: underline; }

.tdf-post-meta {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin: 0 0 12px;
}
.tdf-post-meta a { color: var(--muted); border-bottom: 1px dotted var(--muted-2); }
.tdf-post-meta a:hover { color: var(--accent); border-color: var(--accent); }

.tdf-readmore {
  display: inline-block;
  margin-top: 10px;
  padding: 6px 14px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s;
}
.tdf-readmore:hover {
  background: var(--accent-2);
  text-decoration: none;
}

/* Code + quote */
pre, code {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  font-family: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px;
}
:not(pre) > code { padding: 2px 6px; }
blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin: 18px 0;
  color: var(--fg);
}

/* Forms */
input[type="text"], input[type="email"], input[type="search"], textarea, select {
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 8px 11px;
  font: 14px 'Inter', system-ui, sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.15);
}
.tdf-search { display: flex; gap: 6px; margin: 6px 0 0; }
.tdf-search input[type=search] { flex: 1 1 auto; }
.tdf-search button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.tdf-search button:hover { background: var(--accent-2); }

/* Pagination */
.tdf-pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}
.tdf-pagination a,
.tdf-pagination span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--fg);
  font-weight: 600;
  font-size: 13px;
}
.tdf-pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tdf-pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============ Footer (mirrors the app) ============ */
.tdf-footer {
  flex: 0 0 auto;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.tdf-footer a {
  color: #1f2937 !important;
  font-weight: 600;
  text-decoration: none;
}
.tdf-footer a:hover { text-decoration: underline; }

/* ============ Mobile tweaks ============ */
@media (max-width: 720px) {
  .tdf-header { padding: 10px 14px; gap: 8px; }
  .tdf-meta { display: none; }
  main.tdf-main { padding: 18px 14px 40px; }
  article.tdf-post, .tdf-page { padding: 18px 18px; }
  h1 { font-size: 26px; }
}
