/*
Theme Name: The Care Panel
Theme URI: https://thecarepanel.co.uk
Author: The Care Panel
Description: A fast, configurable block theme for editorial publishing. Typography-led, no page builder, no jQuery, no external font requests. Colour, type scale and spacing are all editable from Appearance > Editor > Styles.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
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: carepanel
Tags: blog, news, one-column, block-patterns, full-site-editing, editor-style, accessibility-ready, wide-blocks
*/

/* ---------------------------------------------------------------
   Almost everything lives in theme.json. What follows is only what
   theme.json genuinely cannot express.
   --------------------------------------------------------------- */

/* Optical refinements — the difference between "clean" and "premium" */
:root {
  --cp-eyebrow-size: 0.75rem;
  --cp-eyebrow-track: 0.2em;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: oldstyle-nums;
}

/* Tabular figures wherever numbers are compared */
table, .cp-rate, .wp-block-table {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Hanging punctuation on the display face, where supported */
h1, h2, .wp-block-pullquote p, .wp-block-quote p {
  hanging-punctuation: first last;
  text-wrap: balance;
}

/* Standfirst / lead paragraph */
.is-style-lead {
  font-size: var(--wp--preset--font-size--lead);
  line-height: 1.6;
  color: var(--wp--preset--color--ink-soft);
  max-width: 34em;
}

/* Eyebrow label — small caps, tracked, used above every section */
.is-style-eyebrow {
  font-size: var(--cp-eyebrow-size);
  font-weight: 700;
  letter-spacing: var(--cp-eyebrow-track);
  text-transform: uppercase;
  color: var(--wp--preset--color--ink-mute);
  margin-bottom: 1rem;
}

/* Editorial tables: rules, not boxes */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table thead { border-bottom: 1px solid var(--wp--preset--color--rule-firm); }
.wp-block-table thead th {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--cp-eyebrow-size);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wp--preset--color--ink-mute);
  padding: 0.875rem 0;
  text-align: left;
}
.wp-block-table td { padding: 1rem 0; border-bottom: 1px solid var(--wp--preset--color--rule); }
.wp-block-table tr td:last-child, .wp-block-table tr th:last-child { text-align: right; }
.wp-block-table figcaption { color: var(--wp--preset--color--ink-mute); }

/* Lists in article body get the same rhythm as paragraphs */
.entry-content li { line-height: 1.85; margin-bottom: 0.5rem; }

/* Article measure: constrain the body, let tables and figures breathe wider */
.entry-content > * { max-width: var(--wp--custom--measure); }
.entry-content > .alignwide,
.entry-content > .alignfull,
.entry-content > .wp-block-table { max-width: none; }

/* Links inside running copy are underlined; navigation links are not */
.entry-content a { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

/* Focus ring — visible, not a browser default blur */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
}

/* Inputs: rules underneath, not boxes */
input[type="text"], input[type="email"], input[type="tel"], input[type="search"] {
  border: 0;
  border-bottom: 1px solid var(--wp--preset--color--ink-mute);
  background: transparent;
  border-radius: 0;
  padding: 0.875rem 0;
  font-family: inherit;
  font-size: 1.0625rem;
  color: inherit;
  min-height: 44px;
}

/* Every tappable thing clears 44px */
.wp-block-button__link, button, .wp-block-navigation-item__content { min-height: 44px; display: inline-flex; align-items: center; }

/* Skip link */
.skip-link:focus { top: 1rem; left: 1rem; z-index: 999; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Print: readers do print funding guides and take them to family meetings */
@media print {
  .wp-block-navigation, .wp-site-blocks > footer, .cp-no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .entry-content > * { max-width: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}


/* ---------------------------------------------------------------
   Responsive masthead — the title and its eyebrow share a flex row;
   below 620px let the title take the full line so it stops wrapping
   mid-word, and drop the eyebrow, which the site tagline repeats.
   --------------------------------------------------------------- */
@media (max-width: 620px) {
  header .wp-block-site-title { flex-basis: 100%; }
  header .wp-block-site-title a { white-space: nowrap; }
  header .is-style-eyebrow { display: none; }
}
