/*
Theme Name: Custom Mobile Carts
Theme URI: https://custommobilecarts.com
Author: Custom Mobile Carts
Author URI: https://custommobilecarts.com
Description: The official theme for Custom Mobile Carts. Made to order mobile coffee carts, bars and serving stands with a WooCommerce shop, a contact form that delivers to the workshop inbox, and automatic page and menu setup.
Version: 1.0.0
Requires at least: 6.4
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: custom-mobile-carts
Tags: e-commerce, business, custom-colors, custom-logo, custom-menu, featured-images, theme-options
*/

/* ==========================================================================
   Design Tokens: Forest and Gold
   --------------------------------------------------------------------------
   Deep forest green carries the brand and every primary action, gold brings
   the warmth of the wood and marks links and highlights, and a brighter
   brass is a small accent for ratings and badges on dark surfaces. Surfaces
   are ivory and linen rather than pure white. Components should use the
   semantic roles below, never the raw palette or hard coded hex values.
   ========================================================================== */

:root {
    /* Raw palette */
    --palette-ink: #0F1F1B;
    --palette-forest: #1B3A33;
    --palette-forest-700: #142E29;
    --palette-forest-500: #27524A;
    --palette-gold: #B8893A;
    --palette-gold-700: #8A6523;
    --palette-gold-800: #6F5119;
    --palette-gold-300: #D9B874;
    --palette-gold-100: #F0E5CC;
    --palette-gold-50: #FAF5EA;
    --palette-brass: #D4A74A;
    --palette-brass-700: #7E5E1C;
    --palette-brass-50: #FBF6E8;
    --palette-ivory: #FBF8F2;
    --palette-linen: #F3EEE4;
    --palette-linen-200: #E9E2D5;
    --palette-text: #1F2A27;
    --palette-text-600: #44504C;
    --palette-text-muted: #5F6B67;
    --palette-text-400: #8B948F;
    --palette-border-strong: #C8C0B2;
    --palette-line: #E3DDD1;

    /* Brand roles. Primary is the forest green used for actions, secondary
       is the gold used for warmth, accent is brass used sparingly. */
    --color-primary: var(--palette-forest);
    --color-primary-hover: var(--palette-forest-700);
    --color-primary-dark: var(--palette-ink);
    --color-primary-rgb: 27, 58, 51;
    --color-primary-light: rgba(var(--color-primary-rgb), 0.08);
    --color-primary-10: rgba(var(--color-primary-rgb), 0.1);
    --color-primary-12: rgba(var(--color-primary-rgb), 0.12);
    --color-primary-15: rgba(var(--color-primary-rgb), 0.15);
    --color-primary-20: rgba(var(--color-primary-rgb), 0.2);
    --color-primary-30: rgba(var(--color-primary-rgb), 0.3);
    --color-primary-40: rgba(var(--color-primary-rgb), 0.4);
    --color-primary-on-dark: var(--palette-gold-300);

    --color-secondary: var(--palette-gold);
    --color-secondary-hover: var(--palette-gold-700);
    --color-secondary-rgb: 184, 137, 58;
    --color-secondary-90: rgba(var(--color-secondary-rgb), 0.9);
    --color-secondary-75: rgba(var(--color-secondary-rgb), 0.75);
    --color-secondary-60: rgba(var(--color-secondary-rgb), 0.6);

    --color-accent: var(--palette-brass);
    --color-accent-text: var(--palette-brass-700);
    --color-accent-light: var(--palette-brass-50);

    /* Surfaces */
    --color-bg: var(--palette-ivory);
    --color-bg-card: #FFFFFF;
    --color-bg-light: var(--palette-linen);
    --color-bg-subtle: var(--palette-linen-200);
    --color-bg-tint: var(--palette-gold-50);
    --color-bg-dark: var(--palette-ink);
    --color-bg-brand: var(--palette-forest);
    --color-overlay: rgba(15, 31, 27, 0.84);
    --color-overlay-light: rgba(15, 31, 27, 0.6);

    /* Text (muted passes 4.5:1 on ivory and on --color-bg-light) */
    --color-heading: var(--palette-forest);
    --color-text: var(--palette-text);
    --color-text-light: var(--palette-text-600);
    --color-text-muted: var(--palette-text-muted);
    --color-text-white: #F6F2EA;
    --color-text-on-dark: #B9C2BC;

    /* Lines */
    --color-border: var(--palette-line);
    --color-border-light: #EDE8DE;
    --color-border-strong: var(--palette-border-strong);

    /* Contextual roles. Dark surfaces redefine these (see "Surfaces" below)
       so links, eyebrows, chips and borders adapt without extra classes. */
    --color-link: var(--palette-gold-700);
    --color-link-hover: var(--palette-forest);
    --color-eyebrow: var(--palette-gold-700);
    --color-surface-hover: rgba(var(--color-primary-rgb), 0.04);
    --color-chip-bg: var(--palette-gold-50);
    --color-chip-fg: var(--palette-gold-700);

    /* Form controls stay white on every surface, so they get fixed roles.
       The input border keeps 3:1 against white and the light background. */
    --color-input-bg: #FFFFFF;
    --color-input-text: var(--palette-text);
    --color-input-border: var(--palette-text-400);
    --color-input-placeholder: var(--palette-text-muted);

    /* Status */
    --color-success: #2F6B3A;
    --color-success-light: #EEF4EA;
    --color-warning: var(--palette-brass-700);
    --color-warning-light: var(--palette-brass-50);
    --color-error: #B3261E;
    --color-error-light: #FBEFEE;
    --color-error-on-dark: #F2A59F;
    --color-info: var(--palette-forest-500);

    /* Interaction */
    --color-hover: var(--color-primary-hover);
    --color-slate: var(--color-primary);
    --focus-ring: 0 0 0 3px var(--palette-ivory), 0 0 0 5px var(--palette-gold-700);

    /* Typography: Fraunces, a soft high contrast serif, for headings and
       Figtree, a clean geometric sans, for text */
    --font-heading: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;
    --font-size-base: 16px;
    --line-height-base: 1.65;
    --line-height-heading: 1.12;
    --letter-spacing-heading: -0.01em;
    --letter-spacing-eyebrow: 0.12em;

    /* Type scale (fluid between 360px and 1440px viewports) */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: clamp(1.375rem, 1.3rem + 0.35vw, 1.5rem);
    --font-size-3xl: clamp(1.5rem, 1.35rem + 0.7vw, 1.875rem);
    --font-size-4xl: clamp(1.75rem, 1.5rem + 1.1vw, 2.5rem);
    --font-size-5xl: clamp(2.125rem, 1.7rem + 1.9vw, 3.375rem);
    --font-size-6xl: clamp(2.5rem, 1.9rem + 2.7vw, 4.25rem);

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Spacing (4px base) */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: clamp(3rem, 2.4rem + 2.6vw, 4.5rem);
    --spacing-4xl: clamp(4rem, 3rem + 4.4vw, 7rem);

    /* Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
    --radius-full: 9999px;

    /* Elevation: warm, low alpha shadows, never pure black */
    --shadow-xs: 0 1px 2px rgba(31, 42, 39, 0.05);
    --shadow-sm: 0 1px 3px rgba(31, 42, 39, 0.07), 0 1px 2px rgba(31, 42, 39, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(31, 42, 39, 0.08), 0 2px 4px -2px rgba(31, 42, 39, 0.04);
    --shadow-lg: 0 12px 28px -6px rgba(31, 42, 39, 0.12), 0 4px 8px -4px rgba(31, 42, 39, 0.05);
    --shadow-xl: 0 24px 48px -12px rgba(31, 42, 39, 0.16);
    --shadow-focus: var(--focus-ring);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-base: 240ms var(--ease-out);
    --transition-slow: 420ms var(--ease-out);

    /* Layout */
    --container-max: 1280px;
    --container-wide: 1440px;
    --container-narrow: 760px;
    --container-padding: clamp(1rem, 0.6rem + 1.8vw, 2rem);
    --header-height: 76px;
}

/* The header is shorter until the full navigation fits */
@media (max-width: 1199.98px) {
    :root {
        --header-height: 64px;
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --transition-fast: 0ms;
        --transition-base: 0ms;
        --transition-slow: 0ms;
    }

    /* Catch hard coded motion anywhere in the theme. A tiny duration (not
       zero) keeps transitionend firing for scripts that wait on it. */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   Surfaces
   --------------------------------------------------------------------------
   Dark containers flip the contextual roles, so headings, text, links,
   eyebrows, chips, borders and the focus ring all adapt on their own.
   White surfaces placed inside a dark container (.card, .surface-light)
   restore the light values. Keep the light set in sync with :root.
   ========================================================================== */

.card,
.surface-light {
    --color-heading: var(--palette-forest);
    --color-text: var(--palette-text);
    --color-text-light: var(--palette-text-600);
    --color-text-muted: var(--palette-text-muted);
    --color-border: var(--palette-line);
    --color-border-light: #EDE8DE;
    --color-border-strong: var(--palette-border-strong);
    --color-link: var(--palette-gold-700);
    --color-link-hover: var(--palette-forest);
    --color-eyebrow: var(--palette-gold-700);
    --color-surface-hover: rgba(var(--color-primary-rgb), 0.04);
    --color-chip-bg: var(--palette-gold-50);
    --color-chip-fg: var(--palette-gold-700);
    --focus-ring: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--palette-gold-700);
    color: var(--color-text);
}

.section--dark,
.page-hero,
.site-topbar,
.site-footer,
.surface-dark {
    --color-heading: var(--color-text-white);
    --color-text: var(--color-text-on-dark);
    --color-text-light: var(--color-text-on-dark);
    --color-text-muted: rgba(246, 242, 234, 0.6);
    --color-border: rgba(246, 242, 234, 0.14);
    --color-border-light: rgba(246, 242, 234, 0.08);
    --color-border-strong: rgba(246, 242, 234, 0.28);
    --color-link: var(--color-primary-on-dark);
    --color-link-hover: var(--color-text-white);
    --color-eyebrow: var(--palette-brass);
    --color-surface-hover: rgba(246, 242, 234, 0.08);
    --color-chip-bg: rgba(246, 242, 234, 0.08);
    --color-chip-fg: var(--color-primary-on-dark);
    --focus-ring: 0 0 0 2px var(--color-bg-dark), 0 0 0 4px var(--color-primary-on-dark);
    color: var(--color-text);
}

.surface-light {
    background-color: var(--color-bg);
}

.surface-dark {
    background-color: var(--color-bg-dark);
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Anchored content clears the sticky header */
    scroll-padding-top: calc(var(--header-height) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    /* Fraunces is a variable font with an optical size axis: display sizes
       get finer hairlines, small headings get sturdier strokes. */
    font-optical-sizing: auto;
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-heading);
    color: var(--color-heading);
    margin-bottom: var(--spacing-md);
    text-wrap: balance;
    overflow-wrap: break-word;
}

h1 { font-size: var(--font-size-5xl); }
h2 { font-size: var(--font-size-4xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-md); }

p {
    margin-bottom: var(--spacing-md);
    text-wrap: pretty;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
    color: var(--color-link-hover);
}

/* Links inside running text need more than color to stand out (WCAG 1.4.1) */
p a:not([class]) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

p a:not([class]):hover {
    text-decoration-thickness: 2px;
}

strong,
b {
    font-weight: var(--font-weight-semibold);
}

small {
    font-size: var(--font-size-sm);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

hr {
    height: 0;
    border: 0;
    border-top: 1px solid var(--color-border);
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

::selection {
    background-color: var(--color-primary-20);
    color: var(--color-heading);
}

/* One visible focus treatment for everything. The transparent outline
   shows up in Windows high contrast mode, where box shadows are removed. */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

a:focus-visible {
    border-radius: var(--radius-xs);
}

/* Skip target: focusable for the skip link, but no ring around the page */
.site-main:focus,
.site-main:focus-visible {
    box-shadow: none;
}

/* Windows high contrast mode drops box shadows, and a few components set
   outline: none to rely on the shadow ring. Give everything a real outline
   there so keyboard focus never disappears. */
@media (forced-colors: active) {
    :focus-visible {
        outline: 2px solid CanvasText !important;
        outline-offset: 2px;
    }
}

/* ==========================================================================
   Accessibility helpers
   ========================================================================== */

.sr-only,
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    word-wrap: normal !important;
}

.skip-link:focus,
.screen-reader-text:focus {
    position: fixed !important;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0.75rem 1.25rem;
    clip: auto;
    clip-path: none;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-white);
    background-color: var(--palette-ink);
    border-radius: var(--radius-md);
    box-shadow: var(--focus-ring), var(--shadow-lg);
    text-decoration: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding-block: var(--spacing-4xl);
}

.section--light {
    background-color: var(--color-bg-light);
}

.section--tint {
    background-color: var(--color-bg-tint);
}

.section--dark {
    background-color: var(--color-bg-brand);
}

/* Grid: one column on phones, then the requested count */
.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg);
}

@media (min-width: 640px) {
    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .grid {
        gap: var(--spacing-xl);
    }

    .grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Section heading block
   ========================================================================== */

.section-header {
    max-width: 46rem;
    margin: 0 auto var(--spacing-2xl);
    text-align: center;
}

.section-header--left {
    margin-left: 0;
    text-align: left;
}

.section-header > :last-child {
    margin-bottom: 0;
}

.eyebrow,
.section-label {
    display: block;
    margin-bottom: 0.75rem;
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    letter-spacing: var(--letter-spacing-eyebrow);
    text-transform: uppercase;
    color: var(--color-eyebrow);
}

.section-title {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
}

.section-subtitle {
    max-width: 40rem;
    font-size: var(--font-size-lg);
    line-height: 1.6;
    color: var(--color-text-light);
}

.section-header:not(.section-header--left) .section-subtitle {
    margin-inline: auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    --btn-bg: transparent;
    --btn-fg: var(--color-heading);
    --btn-border: transparent;
    --btn-bg-hover: var(--btn-bg);
    --btn-fg-hover: var(--btn-fg);
    --btn-border-hover: var(--btn-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    color: var(--btn-fg);
    background-color: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast),
        transform var(--transition-fast);
}

.btn:hover {
    color: var(--btn-fg-hover);
    background-color: var(--btn-bg-hover);
    border-color: var(--btn-border-hover);
}

.btn:active {
    transform: scale(0.98);
}

.btn svg {
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

/* A trailing icon nudges forward on hover */
@media (hover: hover) {
    .btn:hover > svg:last-child:not(:first-child) {
        transform: translateX(2px);
    }
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn--primary {
    --btn-bg: var(--color-primary);
    --btn-fg: var(--color-text-white);
    --btn-bg-hover: var(--color-primary-hover);
}

/* Deep gold keeps ivory text above 4.5:1; on dark surfaces the
   button flips to brass with ink text for the same reason. */
.btn--secondary {
    --btn-bg: var(--color-secondary-hover);
    --btn-fg: var(--color-text-white);
    --btn-bg-hover: var(--palette-gold-800);
}

.section--dark .btn--secondary,
.site-footer .btn--secondary,
.surface-dark .btn--secondary {
    --btn-bg: var(--palette-brass);
    --btn-fg: var(--palette-ink);
    --btn-bg-hover: var(--palette-gold-300);
}

.btn--outline {
    --btn-fg: var(--color-primary);
    --btn-border: var(--color-primary);
    --btn-bg-hover: var(--color-surface-hover);
    --btn-fg-hover: var(--color-primary);
    --btn-border-hover: var(--color-primary);
}

.btn--ghost {
    --btn-fg: var(--color-heading);
    --btn-bg-hover: var(--color-surface-hover);
}

.btn--on-dark {
    --btn-bg: var(--color-text-white);
    --btn-fg: var(--color-primary);
    --btn-bg-hover: var(--color-bg-tint);
}

/* .btn--outline-white is the old name, kept so existing templates work */
.btn--outline-light,
.btn--outline-white {
    --btn-fg: var(--color-text-white);
    --btn-border: rgba(255, 255, 255, 0.5);
    --btn-bg-hover: rgba(255, 255, 255, 0.1);
    --btn-border-hover: var(--color-text-white);
}

.btn--sm {
    min-height: 38px;
    padding: 0.4375rem 0.875rem;
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

@media (pointer: coarse) {
    .btn--sm {
        min-height: 44px;
    }
}

.btn--lg {
    min-height: 52px;
    padding: 0.8125rem 1.625rem;
    font-size: var(--font-size-md);
}

.btn--block {
    display: flex;
    width: 100%;
}

/* Text link with a trailing arrow. Markup may include its own icon; if it
   does not, the arrow is drawn here. */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--color-link);
    text-decoration: none;
}

.link-arrow:hover {
    color: var(--color-link-hover);
}

.link-arrow:not(:has(svg))::after {
    content: '';
    flex: none;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform var(--transition-fast);
}

.link-arrow svg {
    flex: none;
    transition: transform var(--transition-fast);
}

@media (hover: hover) {
    .link-arrow:hover::after,
    .link-arrow:hover svg,
    .card--link:hover .link-arrow::after,
    .card--link:hover .link-arrow svg {
        transform: translateX(3px);
    }
}

/* ==========================================================================
   Cards, chips, badges
   ========================================================================== */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition:
        transform var(--transition-base),
        box-shadow var(--transition-base),
        border-color var(--transition-base);
}

.card > :last-child {
    margin-bottom: 0;
}

/* The card is a flex column; inline pieces keep their natural width */
.card > :is(.badge, .btn, .link-arrow, .icon-chip) {
    align-self: flex-start;
}

:where(.card) > :where(h2, h3) {
    font-size: var(--font-size-xl);
    margin-bottom: 0.5rem;
}

.card > .icon-chip {
    margin-bottom: 1.25rem;
}

/* Keeps "read more" links on one baseline across a row of cards */
.card > .link-arrow,
.card__footer {
    margin-top: auto;
    padding-top: var(--spacing-md);
}

.card__media {
    margin: calc(-1 * clamp(1.5rem, 1.2rem + 1vw, 2rem));
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card__media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card__title {
    font-size: var(--font-size-xl);
    margin-bottom: 0.5rem;
}

.card__text {
    color: var(--color-text-light);
}

@media (hover: hover) {
    .card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

/* Whole card clickable: either the card is the <a>, or it holds a
   .card__link (usually inside the heading) that stretches over it. */
a.card {
    color: var(--color-text);
    text-decoration: none;
}

.card--link {
    cursor: pointer;
}

.card__link {
    color: inherit;
    text-decoration: none;
}

.card__link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.card__link:focus-visible {
    box-shadow: none;
}

@media (hover: hover) {
    .card--link:hover {
        border-color: var(--color-primary-30);
        box-shadow: var(--shadow-lg);
    }

    .card--link:hover :is(h2, h3, h4, .card__title) {
        color: var(--color-link);
    }
}

/* Focus rings for clickable cards. They come after the card shadows on
   purpose: an equal specificity .card shadow would otherwise hide them.
   The stretched link variant rings the whole card; browsers without :has()
   fall back to :focus-within. */
a.card:focus-visible,
.card--link:has(.card__link:focus-visible) {
    box-shadow: var(--focus-ring);
}

@supports not selector(:has(*)) {
    .card--link:focus-within {
        box-shadow: var(--focus-ring);
    }
}

.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 48px;
    height: 48px;
    color: var(--color-chip-fg);
    background-color: var(--color-chip-bg);
    border-radius: var(--radius-md);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: var(--color-chip-fg);
    background-color: var(--color-chip-bg);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge svg {
    width: 0.875rem;
    height: 0.875rem;
}

.badge--accent {
    color: var(--color-accent-text);
    background-color: var(--color-accent-light);
}

.badge--success {
    color: var(--color-success);
    background-color: var(--color-success-light);
}

:where(.section--dark, .page-hero, .site-footer, .surface-dark) .badge--accent {
    color: var(--color-accent);
    background-color: color-mix(in srgb, var(--color-accent) 16%, transparent);
}

:where(.section--dark, .page-hero, .site-footer, .surface-dark) .badge--success {
    color: var(--color-text-white);
    background-color: color-mix(in srgb, var(--color-success) 45%, transparent);
}

/* ==========================================================================
   Accordion (native details/summary, no script needed)
   ========================================================================== */

.accordion {
    border-top: 1px solid var(--color-border);
}

.accordion__item {
    border-bottom: 1px solid var(--color-border);
}

.accordion__summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: 1.25rem 0;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.45;
    color: var(--color-heading);
    list-style: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.accordion__summary::-webkit-details-marker {
    display: none;
}

.accordion__summary::marker {
    content: '';
}

.accordion__summary::after {
    content: '';
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
    background-color: var(--color-link);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform var(--transition-base);
}

.accordion__summary:hover {
    color: var(--color-link);
}

.accordion__item[open] > .accordion__summary::after {
    transform: rotate(180deg);
}

.accordion__content {
    padding: 0 2.25rem 1.5rem 0;
    color: var(--color-text);
}

.accordion__content > :last-child {
    margin-bottom: 0;
}

.accordion__content a:not([class]) {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.accordion__content ul,
.accordion__content ol {
    margin-bottom: var(--spacing-md);
    padding-left: 1.25rem;
}

.accordion__content ul { list-style: disc; }
.accordion__content ol { list-style: decimal; }

/* Smooth open and close where the browser can animate to auto height */
@supports (interpolate-size: allow-keywords) and selector(::details-content) {
    .accordion {
        interpolate-size: allow-keywords;
    }

    .accordion__item::details-content {
        block-size: 0;
        overflow: clip;
        transition:
            block-size var(--transition-base),
            content-visibility var(--transition-base) allow-discrete;
    }

    .accordion__item[open]::details-content {
        block-size: auto;
    }
}

/* ==========================================================================
   Tabs (behavior in theme.js, [data-tabs])
   ========================================================================== */

.tabs__list {
    display: flex;
    gap: 0.25rem;
    margin-bottom: var(--spacing-xl);
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: inset 0 -1px 0 var(--color-border);
}

.tabs__list::-webkit-scrollbar {
    display: none;
}

.tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-light);
    white-space: nowrap;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.tabs__tab:hover {
    color: var(--color-heading);
}

.tabs__tab[aria-selected="true"] {
    color: var(--color-link);
    border-bottom-color: currentColor;
}

/* The tab list scrolls, so an outer ring would be clipped */
.tabs__tab:focus-visible {
    box-shadow: inset 0 0 0 2px var(--color-link);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tabs__panel:focus-visible {
    border-radius: var(--radius-sm);
}

/* Without JavaScript every panel shows and the tab list is not needed */
.no-js .tabs__list {
    display: none;
}

.no-js .tabs__panel[hidden] {
    display: block !important;
}

.no-js .tabs__panel + .tabs__panel {
    margin-top: var(--spacing-xl);
}

/* ==========================================================================
   Forms
   ========================================================================== */

/* Low specificity defaults for inputs we do not control (comments,
   plugins). Theme forms use the .form__* classes below. */
:where(input:is([type="text"], [type="email"], [type="tel"], [type="url"], [type="password"], [type="search"], [type="number"], [type="date"]), select, textarea) {
    width: 100%;
    min-height: 48px;
    padding: 0.6875rem 0.875rem;
    font-size: var(--font-size-md);
    line-height: 1.4;
    color: var(--color-input-text);
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
}

:where(input, select, textarea)::placeholder {
    color: var(--color-input-placeholder);
    opacity: 1;
}

:where(label) {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-heading);
}

.form {
    display: grid;
    gap: var(--spacing-lg);
}

.form > * {
    min-width: 0;
}

.form fieldset {
    min-width: 0;
    border: 0;
}

.form__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem 1.5rem;
}

@media (min-width: 768px) {
    .form__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.form__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.form__field--full {
    grid-column: 1 / -1;
}

.form__label {
    display: block;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    color: var(--color-heading);
}

/* A legend ignores the field's flex gap */
legend.form__label {
    margin-bottom: 0.5rem;
}

.form__required {
    margin-left: 0.125rem;
    color: var(--color-error);
}

:where(.section--dark, .page-hero, .site-footer, .surface-dark) .form__required {
    color: var(--color-accent);
}

.form__input,
.form__select,
.form__textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0.6875rem 0.875rem;
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    line-height: 1.4;
    color: var(--color-input-text);
    background-color: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form__input::placeholder,
.form__textarea::placeholder {
    color: var(--color-input-placeholder);
    opacity: 1;
}

.form__input:hover,
.form__select:hover,
.form__textarea:hover {
    border-color: var(--color-border-strong);
}

.form__input:focus-visible,
.form__select:focus-visible,
.form__textarea:focus-visible,
:where(input, select, textarea):focus-visible {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.form__textarea {
    min-height: 9rem;
    line-height: 1.55;
    resize: vertical;
}

.form__select {
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B635B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.125rem;
    cursor: pointer;
}

/* Every single choice select on the site gets the same look, including the
   ones WooCommerce and other plugins print without our class. :where()
   keeps the specificity at zero, so a plugin specific rule can still win
   where it needs to (Select2 and the checkout blocks have their own). */
select:where(:not([multiple]):not([size]):not(.form__select)) {
    display: inline-block;
    max-width: 100%;
    min-height: 44px;
    padding: 0.5625rem 2.75rem 0.5625rem 0.875rem;
    font-family: var(--font-body);
    font-size: var(--font-size-md);
    line-height: 1.4;
    color: var(--color-input-text);
    background-color: var(--color-input-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B635B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1.125rem;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    appearance: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

select:where(:not([multiple]):not([size]):not(.form__select)):hover {
    border-color: var(--color-border-strong);
}

select:where(:not([multiple]):not([size]):not(.form__select)):focus-visible {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
    outline: none;
}

select:where(:not([multiple]):not([size]):not(.form__select)):disabled {
    background-color: var(--color-bg-subtle);
    cursor: not-allowed;
    opacity: 0.75;
}

.form__input:disabled,
.form__select:disabled,
.form__textarea:disabled {
    background-color: var(--color-bg-subtle);
    cursor: not-allowed;
    opacity: 0.75;
}

/* Errors appear only after the visitor has interacted with the field */
.form__input:user-invalid,
.form__select:user-invalid,
.form__textarea:user-invalid,
.form__input[aria-invalid="true"],
.form__select[aria-invalid="true"],
.form__textarea[aria-invalid="true"] {
    border-color: var(--color-error);
}

.form__input:user-invalid:focus-visible,
.form__select:user-invalid:focus-visible,
.form__textarea:user-invalid:focus-visible,
.form__input[aria-invalid="true"]:focus-visible,
.form__select[aria-invalid="true"]:focus-visible,
.form__textarea[aria-invalid="true"]:focus-visible {
    box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--color-error);
}

.form__hint {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-text-light);
}

.form__error {
    display: flex;
    align-items: flex-start;
    gap: 0.375rem;
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    color: var(--color-error);
}

:where(.section--dark, .page-hero, .site-footer, .surface-dark) .form__error {
    color: var(--color-error-on-dark);
}

/* Checkbox or radio with its label on one row */
.form__check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
    cursor: pointer;
}

.form__check input[type="checkbox"],
.form__check input[type="radio"] {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form__check input:focus-visible {
    border-radius: var(--radius-xs);
}

.form__check label {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    cursor: pointer;
}

/* Pill options: <label class="form__choice"><input type="radio"><span>Air</span></label>.
   The input covers the pill, invisible, so it keeps native keyboard
   behavior and the label stays the click target. */
.form__choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form__choice,
.form__choice-group > label {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
    color: var(--color-heading);
    background-color: transparent;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.form__choice input,
.form__choice-group > label input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.form__choice:hover,
.form__choice-group > label:hover {
    border-color: var(--color-link);
}

.form__choice:has(input:checked),
.form__choice-group > label:has(input:checked) {
    color: var(--color-primary-dark);
    background-color: var(--color-bg-tint);
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary);
}

.form__choice:has(input:focus-visible),
.form__choice-group > label:has(input:focus-visible) {
    box-shadow: var(--focus-ring);
}

.form__choice input:focus-visible,
.form__choice-group > label input:focus-visible {
    box-shadow: none;
}

:where(.section--dark, .page-hero, .site-footer, .surface-dark) :is(.form__choice, .form__choice-group > label):has(input:checked) {
    color: var(--color-text-white);
    background-color: color-mix(in srgb, var(--color-primary-on-dark) 14%, transparent);
    border-color: var(--color-primary-on-dark);
    box-shadow: inset 0 0 0 1px var(--color-primary-on-dark);
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
}

/* Result message after a submit. It is printed above the form and
   theme.js moves focus to it, so it needs no focus ring of its own. */
.form-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: var(--spacing-lg);
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--palette-ink);
    border: 1px solid;
    border-radius: var(--radius-md);
}

.form-notice:focus,
.form-notice:focus-visible {
    box-shadow: none;
}

/* Safety net printed by inc/forms.php when a template forgot the notice */
.form-notice-fallback {
    padding-block: var(--spacing-lg);
}

.form-notice-fallback .form-notice {
    margin-bottom: 0;
}

.form-notice__body {
    min-width: 0;
}

.form-notice__body > * {
    margin: 0;
}

.form-notice__body > * + * {
    margin-top: 0.5rem;
}

.form-notice__title {
    font-weight: var(--font-weight-semibold);
}

.form-notice__list {
    padding-left: 1.25rem;
    list-style: disc;
}

.form-notice a {
    color: inherit;
    font-weight: var(--font-weight-semibold);
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.form-notice::before {
    content: '';
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.0625rem;
    background-color: currentColor;
    -webkit-mask: center / contain no-repeat;
    mask: center / contain no-repeat;
}

.form-notice--success {
    background-color: var(--color-success-light);
    border-color: color-mix(in srgb, var(--color-success) 30%, transparent);
}

.form-notice--success::before {
    color: var(--color-success);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E");
}

.form-notice--error {
    background-color: var(--color-error-light);
    border-color: color-mix(in srgb, var(--color-error) 30%, transparent);
}

.form-notice--error::before {
    color: var(--color-error);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E");
}

/* Honeypot: out of sight for people, still in the form for bots */
.form-hp {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   Reveal on scroll (theme.js adds .is-revealed)
   --------------------------------------------------------------------------
   Scoped to .js so content is always visible without JavaScript, and only
   applied when the visitor has not asked for reduced motion. If theme.js
   never runs, the head script adds .reveal-fallback after 3s.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] {
        opacity: 0;
        transform: translate3d(0, 1rem, 0);
        transition:
            opacity 600ms var(--ease-out),
            transform 600ms var(--ease-out);
        transition-delay: calc(var(--reveal-delay, 0) * 90ms);
    }

    .js [data-reveal].is-revealed,
    .reveal-fallback [data-reveal] {
        opacity: 1;
        transform: none;
    }

    [data-reveal-delay="1"] { --reveal-delay: 1; }
    [data-reveal-delay="2"] { --reveal-delay: 2; }
    [data-reveal-delay="3"] { --reveal-delay: 3; }
    [data-reveal-delay="4"] { --reveal-delay: 4; }
}

[data-count-to] {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

/* Markup from cmc_breadcrumbs(): nav.breadcrumbs > ol.breadcrumbs__list >
   li.breadcrumbs__item > a.breadcrumbs__link | span.breadcrumbs__current.
   Separators are drawn here, not in the markup. */
.breadcrumbs {
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--color-text-light);
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 0.25rem;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.breadcrumbs__item + .breadcrumbs__item::before {
    content: '';
    flex: none;
    width: 0.375rem;
    height: 0.375rem;
    margin: 0 0.75rem 0 0.5rem;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.55;
}

.breadcrumbs__link {
    padding-block: 0.25rem;
    color: inherit;
    text-decoration: none;
}

.breadcrumbs__link:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* Long page titles truncate instead of wrapping under the trail */
.breadcrumbs__current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: var(--font-weight-medium);
    color: var(--color-heading);
}

/* ==========================================================================
   Prose: content written in the WordPress editor
   ========================================================================== */

.entry-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--color-text);
    overflow-wrap: break-word;
}

.entry-content > * {
    margin-top: 0;
    margin-bottom: 0;
}

.entry-content > * + * {
    margin-top: 1.25em;
}

.entry-content > :is(h2, h3, h4, h5, h6) {
    margin-top: 2em;
}

.entry-content > :is(h2, h3, h4, h5, h6) + * {
    margin-top: 0.75em;
}

.entry-content > :first-child {
    margin-top: 0;
}

.entry-content h2 { font-size: var(--font-size-3xl); }
.entry-content h3 { font-size: var(--font-size-2xl); }
.entry-content h4 { font-size: var(--font-size-xl); }
.entry-content h5 { font-size: var(--font-size-lg); }
.entry-content h6 { font-size: var(--font-size-md); }

.entry-content a:not([class]),
.entry-content p a,
.entry-content li a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.entry-content a:not([class]):hover,
.entry-content p a:hover,
.entry-content li a:hover {
    text-decoration-thickness: 2px;
}

.entry-content strong {
    color: var(--color-heading);
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
}

.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content li + li,
.entry-content li > ul,
.entry-content li > ol {
    margin-top: 0.5em;
}

.entry-content li::marker {
    color: var(--color-primary);
}

.entry-content blockquote,
.entry-content .wp-block-quote {
    padding-left: 1.25em;
    border-left: 3px solid var(--color-primary);
    font-size: var(--font-size-lg);
    color: var(--color-heading);
}

.entry-content blockquote > :last-child {
    margin-bottom: 0;
}

.entry-content cite,
.entry-content blockquote cite {
    display: block;
    margin-top: 0.75em;
    font-size: var(--font-size-sm);
    font-style: normal;
    color: var(--color-text-light);
}

.entry-content .wp-block-pullquote {
    padding: 1.5em 0;
    border-block: 1px solid var(--color-border);
    text-align: left;
}

.entry-content .wp-block-pullquote blockquote {
    padding: 0;
    border: 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-2xl);
    line-height: 1.35;
}

.entry-content hr,
.entry-content .wp-block-separator {
    margin-block: 2.5em;
    border: 0;
    border-top: 1px solid var(--color-border);
}

.entry-content img {
    border-radius: var(--radius-md);
}

.entry-content figure {
    max-width: 100%;
}

.entry-content figcaption,
.wp-caption-text,
.gallery-caption {
    margin-top: 0.75em;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-text-muted);
    text-align: center;
}

/* Tables scroll inside their block instead of widening the page */
.entry-content .wp-block-table {
    overflow-x: auto;
}

.entry-content table {
    width: 100%;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.entry-content th,
.entry-content td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}

.entry-content th {
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
    background-color: var(--color-bg-light);
}

.entry-content code,
.entry-content kbd {
    padding: 0.125em 0.375em;
    font-family: var(--font-mono);
    font-size: 0.875em;
    color: var(--color-heading);
    background-color: var(--color-bg-subtle);
    border-radius: var(--radius-xs);
}

.entry-content pre {
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-text-white);
    background-color: var(--color-bg-dark);
    border-radius: var(--radius-md);
}

.entry-content pre code {
    padding: 0;
    color: inherit;
    background: none;
}

.entry-content .wp-block-button__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-bold);
    text-decoration: none;
    color: var(--color-text-white);
    background-color: var(--color-primary);
    border-radius: var(--radius-md);
}

.entry-content .wp-block-button__link:hover {
    color: var(--color-text-white);
    background-color: var(--color-primary-hover);
}

.entry-content .is-style-outline .wp-block-button__link {
    color: var(--color-link);
    background-color: transparent;
    border: 1px solid currentColor;
}

/* Alignments: floats only once there is room beside them */
.alignleft,
.alignright {
    margin-bottom: 1em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .alignleft {
        float: left;
        max-width: 50%;
        margin-right: 1.5em;
    }

    .alignright {
        float: right;
        max-width: 50%;
        margin-left: 1.5em;
    }

    .entry-content > .alignleft + *,
    .entry-content > .alignright + * {
        margin-top: 0;
    }
}

.entry-content > .alignwide {
    width: min(var(--container-max) - 2 * var(--container-padding), 100vw - 2 * var(--container-padding));
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.entry-content > .alignfull {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
}

.entry-content::after {
    content: '';
    display: table;
    clear: both;
}

.wp-caption {
    max-width: 100%;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-md);
}

.gallery-item {
    margin: 0;
}

/* Required by WordPress; post lists style these themselves */
.sticky,
.bypostauthor {
    position: relative;
}

/* ==========================================================================
   Logo (inc/branding.php). Colors follow the palette so a Customizer
   preset recolors the mark too.
   ========================================================================== */

.site-logo {
    display: block;
    flex: none;
}

/* The mark is drawn with strokes (gold on light, brass on dark) and the
   wordmark is filled type (forest green on light, ivory on dark). */
.site-logo--dark .site-logo__mark { stroke: var(--color-secondary); }
.site-logo--dark .site-logo__type { fill: var(--color-heading); }

.site-logo--light .site-logo__mark { stroke: var(--palette-brass); }
.site-logo--light .site-logo__type { fill: var(--color-text-white); }

/* An uploaded logo is drawn for light backgrounds; show it white on dark */
.site-logo--custom.site-logo--light {
    filter: brightness(0) invert(1);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
