/*
Theme Name: Dink Theory
Theme URI: https://dinktheory.com/
Author: Dink Theory
Description: SEO-first pickleball blog theme. Implements the Dink Theory design system — four pillars (Rules, Courts, Gear, Drills), a card-grid homepage, a long-form article template, and an internal keyword-map page. Emits its own SEO metadata and JSON-LD, and steps aside automatically if an SEO plugin is active.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dink-theory
Tags: blog, one-column, custom-menu, editor-style, block-styles
*/

/* ============================================================================
   Design tokens and components. Values come from the design handoff; change
   them here only. This file is shared with the Astro build of the same design.
   ========================================================================== */
/* ----------------------------------------------------------------- fonts --
 * Self-hosted, so nothing loads from a third party. font-display: swap keeps
 * text visible during load; the faces are preloaded from functions.php.
 * ------------------------------------------------------------------------ */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/instrument-serif-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-700.woff2') format('woff2');
}

:root {
  /* Surfaces */
  --bg: #f7f4ec;
  --surface: #fffdf7;
  --muted: #ede8da;
  --border: #e1dccd;
  --hairline: #ede8da;

  /* Ink */
  --ink: #10221c;
  --body: #1d2e27;
  --body-muted: #3d4b43;
  --meta: #6e7b71;

  /* Greens */
  --deep: #0e3b2e;
  --accent: #16603f;
  --input-bg: #0a2e24;
  --input-border: #2f5a4b;
  --band-body: #c6d3c8;

  /* Lime */
  --lime: #d7f252;
  --lime-hover: #e4fa6d;
  --underline: #b9d94a;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-ui: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-pill: 999px;
  --r-code: 12px;
  --r-quote: 14px;
  --r-card: 16px;
  --r-panel: 18px;
  --r-featured: 20px;
  --r-band: 22px;

  --gutter: 28px;
  --wrap: 1080px;
  --wrap-narrow: 720px;

  --hover: 120ms ease;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--lime); }

a {
  color: var(--deep);
  text-decoration-color: var(--underline);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

img { max-width: 100%; }

:where(a, button, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link — visible only on focus. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 30;
  background: var(--lime);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-code) 0;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- layout -- */

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap-narrow {
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.page-home { padding-top: 56px; }
.page-doc { padding-top: 52px; }

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo .ball {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lime);
  border: 2px solid var(--ink);
  display: block;
  flex: none;
}
.logo .wordmark {
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  padding: 8px 13px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  transition: background-color var(--hover);
}
.nav-link:hover { background: var(--muted); color: var(--ink); }
.nav-link[data-home]:hover { background: var(--lime); }
.nav-link[aria-current='page'] { background: var(--muted); }

/* --------------------------------------------------------------- footer -- */

.site-footer {
  max-width: var(--wrap);
  margin: 72px auto 0;
  padding: 26px var(--gutter) 40px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  color: var(--meta);
}
.site-footer p { margin: 0; }
.footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.footer-nav a { color: var(--meta); }

/* ------------------------------------------------------------ type bits -- */

.section-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  font-weight: 500;
  margin: 0 0 16px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  margin: 0 0 18px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: var(--r-pill);
}

/* ----------------------------------------------------------------- hero -- */

.hero-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 5.6vw, 70px);
  line-height: 1.03;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 24ch;
  text-wrap: pretty;
}
.lede {
  font-size: 19px;
  line-height: 1.55;
  color: var(--body-muted);
  max-width: 58ch;
  margin: 22px 0 0;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------- chips -- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 14px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--muted);
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--hover);
}
.chip:hover { background: var(--lime); color: var(--ink); }

/* ------------------------------------------------------------- featured -- */

.featured {
  display: grid;
  /* min() lets the track shrink below its floor on viewports narrower than
     the floor itself (320px phones); above that it behaves as specified. */
  grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-featured);
  overflow: hidden;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--hover);
}
.featured:hover { border-color: var(--ink); color: inherit; }
.featured-media { min-height: 320px; position: relative; background: var(--muted); }
.featured-body {
  padding: 34px 34px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.featured-h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.12;
  margin: 18px 0 12px;
  text-wrap: pretty;
}
.featured-dek {
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-muted);
  margin: 0;
  text-wrap: pretty;
}
.featured-meta {
  font-size: 13px;
  color: var(--meta);
  margin: 0;
}

/* ---------------------------------------------------------------- cards -- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 22px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--hover);
}
.card:hover { border-color: var(--ink); color: inherit; }
.card-media { height: 168px; background: var(--muted); position: relative; }
.card-body {
  padding: 20px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-cat {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-h3 {
  font-size: 20px;
  line-height: 1.25;
  margin: 0;
  font-weight: 500;
  text-wrap: pretty;
}
.card-dek {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body-muted);
  margin: 0;
  flex: 1;
}
.card-meta {
  font-size: 12.5px;
  color: var(--meta);
  margin: 0;
}

/* ----------------------------------------------------------- newsletter -- */

.newsletter {
  margin: 60px 0 0;
  background: var(--deep);
  color: var(--bg);
  border-radius: var(--r-band);
  padding: 42px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
}
.newsletter-copy { max-width: 44ch; }
.newsletter h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  margin: 0 0 8px;
}
.newsletter p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--band-body);
}
.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.newsletter-input {
  font-family: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--bg);
  min-width: 240px;
  outline: none;
  transition: border-color var(--hover);
}
.newsletter-input::placeholder { color: #7f9a8e; }
.newsletter-input:focus { border-color: var(--lime); }
.btn-lime {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 22px;
  border-radius: var(--r-pill);
  border: none;
  background: var(--lime);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--hover);
}
.btn-lime:hover { background: var(--lime-hover); }
.btn-lime[disabled] { opacity: 0.6; cursor: progress; }
.form-status {
  flex-basis: 100%;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--band-body);
}
.form-status[data-tone='error'] { color: var(--lime); }
.newsletter-success {
  font-size: 16px;
  line-height: 1.6;
  color: var(--lime);
  margin: 0;
  max-width: 34ch;
}

/* -------------------------------------------------------------- article -- */

.breadcrumb {
  font-size: 13px;
  color: var(--meta);
  margin: 0 0 22px;
}
.breadcrumb a { color: var(--meta); }
.breadcrumb .sep { opacity: 0.5; }

.article-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 18px 0 14px;
  text-wrap: pretty;
}
.byline {
  font-size: 14px;
  color: var(--meta);
  margin: 0 0 26px;
}
.figure { margin: 0 0 12px; }
.figure-frame {
  border-radius: var(--r-panel);
  overflow: hidden;
  background: var(--muted);
  position: relative;
}
.figure-caption {
  font-size: 13px;
  color: var(--meta);
  margin: 0 0 34px;
}

/* Article body. Long-form defaults live here so MD/MDX stays plain prose. */
.prose { color: var(--body); }
.prose > p {
  font-size: 18.5px;
  line-height: 1.68;
  color: var(--body);
  margin: 0 0 30px;
  text-wrap: pretty;
}
.prose > p:first-child { margin-bottom: 22px; }
.prose > h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 12px;
  text-wrap: pretty;
}
.prose > h3 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 10px;
}
.prose > ul,
.prose > ol {
  font-size: 18.5px;
  line-height: 1.68;
  color: var(--body);
  margin: 0 0 30px;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}
.prose > blockquote {
  margin: 0 0 30px;
  padding: 20px 24px;
  border-radius: var(--r-quote);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 18px;
  line-height: 1.6;
  color: var(--accent);
  font-style: italic;
}
.prose > blockquote > p { margin: 0; }
.prose > .spec-table { margin: 0 0 30px; }
.prose strong { font-weight: 700; }

/* Spec table — used by the courts and gear pages. */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  overflow: hidden;
}
.spec-table caption {
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  padding: 0 0 10px;
}
.spec-table th,
.spec-table td {
  text-align: left;
  padding: 11px 18px;
  border-bottom: 1px solid var(--hairline);
}
.spec-table thead th {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td { border-bottom: none; }
.spec-table td:last-child { color: var(--accent); font-weight: 500; }

.read-next {
  margin: 44px 0 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--border);
}
.read-next-links {
  display: grid;
  gap: 10px;
}
.read-next-links a { font-size: 17px; }

/* ---------------------------------------------------- pillar index list -- */

.pillar-list {
  display: grid;
  gap: 0;
  margin: 0 0 8px;
}
.pillar-item {
  display: block;
  padding: 20px 0;
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  color: inherit;
}
.pillar-item:first-child { border-top: 1px solid var(--border); }
.pillar-item:hover .pillar-item-title { color: var(--accent); }
.pillar-item-title {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--ink);
  transition: color var(--hover);
  text-wrap: pretty;
}
.pillar-item-dek {
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--body-muted);
  margin: 0 0 6px;
}
.pillar-item-meta {
  font-size: 12.5px;
  color: var(--meta);
  margin: 0;
}

/* ---------------------------------------------------------------- about -- */

.about-h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.06;
  margin: 0 0 20px;
  letter-spacing: -0.015em;
}
.author-row {
  display: flex;
  gap: 22px;
  align-items: center;
  margin: 0 0 30px;
}
.avatar {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--muted);
  position: relative;
}
.author-bio {
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-muted);
  margin: 0;
}
.panel {
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  padding: 28px 28px 30px;
}
.kmap {
  display: grid;
  gap: 0;
  font-size: 15px;
}
.kmap-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--hairline);
}
.kmap-row:last-child { border-bottom: none; }
.kmap-head {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--meta);
}
.kmap-kw { color: var(--body-muted); }
.kmap-vol { color: var(--accent); font-weight: 500; }
.panel h3 {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--meta);
  margin: 26px 0 12px;
  font-weight: 500;
}
.panel ul {
  margin: 0;
  padding: 0 0 0 20px;
  display: grid;
  gap: 9px;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--body-muted);
}
.codeblock {
  margin: 20px 0 0;
  background: var(--deep);
  color: var(--lime);
  border-radius: var(--r-code);
  padding: 16px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
}

/* --------------------------------------------------------- placeholders -- */

/*
 * No photography exists yet. Each frame reserves its exact final height so
 * dropping in a real <Image> causes no layout shift, and prints the shot to
 * commission. Replace by setting `hero` in the entry's front matter.
 */
.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  margin: 10px;
  border: 1px dashed color-mix(in srgb, var(--meta) 45%, transparent);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--meta);
}
.avatar .media-placeholder {
  margin: 5px;
  padding: 6px;
  font-size: 11px;
}
.media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   WordPress-specific: core block classes, editor output, admin bar.
   Everything above is the shared design system; everything below adapts it.
   ========================================================================== */

/* Core's accessibility helper, aliased to ours. */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.screen-reader-text:focus {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 30;
  width: auto;
  height: auto;
  clip: auto;
  clip-path: none;
  background: var(--lime);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 0 0 var(--r-code) 0;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

/* The logged-in admin bar must not hide the sticky header. */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/*
 * The editor emits <h2 class="wp-block-heading"> and wraps lists/quotes in
 * wp-block-* classes. The .prose child selectors already cover the elements;
 * these rules cover the block wrappers the editor adds around them.
 */
.prose > .wp-block-heading { /* inherits from .prose > h2 / h3 */ }
.prose > figure.wp-block-quote,
.prose > .wp-block-quote {
  margin: 0 0 30px;
  padding: 20px 24px;
  border-radius: var(--r-quote);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 18px;
  line-height: 1.6;
  color: var(--accent);
  font-style: italic;
}
.prose > .wp-block-quote p { margin: 0; font-size: inherit; line-height: inherit; }
.prose > .wp-block-quote cite {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-style: normal;
  color: var(--meta);
}
.prose > .wp-block-list { /* inherits from .prose > ul / ol */ }
.prose > .wp-block-table { margin: 0 0 30px; }
.prose > .wp-block-table table { width: 100%; }
.prose > .wp-block-image {
  margin: 0 0 30px;
}
.prose > .wp-block-image img {
  border-radius: var(--r-panel);
  display: block;
  height: auto;
}
.prose > .wp-block-image figcaption {
  font-size: 13px;
  color: var(--meta);
  margin-top: 10px;
}
.prose > .wp-block-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0 0 30px;
}
.prose > .wp-block-html { margin: 0 0 30px; }

/* Comments are off by design on this site; if enabled, keep them readable. */
.comments-area {
  max-width: var(--wrap-narrow);
  margin: 44px auto 0;
  padding: 28px var(--gutter) 0;
  border-top: 1px solid var(--border);
  font-size: 16px;
}
