/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  /* Primary */
  --tih-primary:        #2563EB;
  --tih-primary-dark:   #1D4ED8;
  --tih-primary-light:  #EFF6FF;

  /* Extended palette */
  --tih-navy:           #0F172A;
  --tih-sky:            #E0F2FE;
  --tih-teal:           #14B8A6;
  --tih-teal-dark:      #0F766E;
  --tih-sand:           #FEF3C7;
  --tih-warning:        #F59E0B;
  --tih-success:        #22C55E;
  --tih-success-dark:   #16A34A;

  /* Surfaces */
  --tih-bg:             #F8FAFC;
  --tih-surface:        #FFFFFF;
  --tih-surface-alt:    #F1F5F9;

  /* Text */
  --tih-text:           #0F172A;
  --tih-text-muted:     #64748B;

  /* Borders */
  --tih-border:         #E2E8F0;

  /* Radius */
  --tih-radius-sm:   4px;
  --tih-radius-md:   8px;
  --tih-radius-lg:   16px;
  --tih-radius-xl:   24px;
  --tih-radius-pill: 9999px;

  /* Shadows */
  --tih-shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --tih-shadow-md:  0 4px 12px rgba(0,0,0,0.10);
  --tih-shadow-lg:  0 8px 24px rgba(0,0,0,0.12);

  /* Layout */
  --tih-max-content: 1200px;
  --tih-max-wide:    1200px;
  --tih-header-h:    72px;

  /* Align WordPress block layout with site container */
  --wp--style--global--content-size: var(--tih-max-wide);
  --wp--style--global--wide-size: var(--tih-max-wide);
}

/* ── Base Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--tih-text);
  background: var(--tih-bg);
}

img, svg { max-width: 100%; display: block; }
a { color: var(--tih-primary); }
a:hover { color: var(--tih-primary-dark); }

/* ── Layout Utilities ───────────────────────────────────────────────────────── */
.tih-container {
  width: 100%;
  max-width: var(--tih-max-wide);
  margin-inline: auto;
  padding-inline: clamp(16px, 5vw, 48px);
}

/* Keep section content aligned with the hero container site-wide */
.tih-main.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
.tih-section.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)),
.is-layout-constrained > .tih-container,
.is-layout-constrained.tih-container,
.wp-block-group.tih-container {
  max-width: var(--tih-max-wide);
  width: 100%;
}

.tih-section {
  padding-block: clamp(40px, 6vw, 80px);
}

.tih-section--alt {
  background: var(--tih-surface-alt);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.tih-btn,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--tih-radius-md);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.tih-btn--primary,
.wp-element-button.has-primary-background-color {
  background: var(--tih-primary);
  color: #fff !important;
}

.tih-btn--primary:hover,
.wp-element-button.has-primary-background-color:hover {
  background: var(--tih-primary-dark);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--tih-shadow-md);
}

.tih-btn--outline {
  background: transparent;
  color: var(--tih-primary);
  border: 2px solid var(--tih-primary);
}

.tih-btn--outline:hover {
  background: var(--tih-primary-light);
}

.tih-btn--white {
  background: #fff;
  color: var(--tih-primary);
}

.tih-btn--white:hover {
  background: var(--tih-primary-light);
}

.tih-btn--sm {
  padding: 7px 14px;
  font-size: 0.8125rem;
}

.tih-btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--tih-primary);
  outline-offset: 3px;
}

/* ── Typography helpers ─────────────────────────────────────────────────────── */
.tih-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tih-primary);
  margin-bottom: 8px;
}

.tih-lead {
  font-size: 1.125rem;
  color: var(--tih-text-muted);
  line-height: 1.7;
}

.tih-section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--tih-navy);
  margin-bottom: 8px;
}

/* ── Color utilities ─────────────────────────────────────────────────────── */
.tih-text-primary  { color: var(--tih-primary); }
.tih-text-teal     { color: var(--tih-teal); }
.tih-text-muted    { color: var(--tih-text-muted); }
.tih-text-navy     { color: var(--tih-navy); }
.tih-bg-sky        { background: var(--tih-sky); }
.tih-bg-sand       { background: var(--tih-sand); }
.tih-bg-navy       { background: var(--tih-navy); color: #fff; }

/* ── Badge utilities ─────────────────────────────────────────────────────── */
.tih-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--tih-radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.tih-badge--primary   { background: var(--tih-primary-light); color: var(--tih-primary-dark); }
.tih-badge--teal      { background: #CCFBF1; color: var(--tih-teal-dark); }
.tih-badge--success   { background: #DCFCE7; color: var(--tih-success-dark); }
.tih-badge--warning   { background: var(--tih-sand); color: #92400E; }
.tih-badge--promoted  { background: var(--tih-sand); color: #92400E; }
.tih-badge--top-pick  { background: #DCFCE7; color: var(--tih-success-dark); }

/* ── Warning / info boxes ────────────────────────────────────────────────── */
.tih-notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--tih-radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
}
.tih-notice--warning { background: var(--tih-sand); border-left: 4px solid var(--tih-warning); }
.tih-notice--info    { background: var(--tih-sky);  border-left: 4px solid var(--tih-primary); }
.tih-notice--success { background: #DCFCE7;          border-left: 4px solid var(--tih-success); }
.tih-notice__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Grid helpers ────────────────────────────────────────────────────────── */
.tih-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.tih-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tih-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 768px) {
  .tih-grid-2, .tih-grid-3, .tih-grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 480px) and (max-width: 768px) {
  .tih-grid-3, .tih-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Card base ───────────────────────────────────────────────────────────── */
.tih-card {
  background: var(--tih-surface);
  border: 1px solid var(--tih-border);
  border-radius: var(--tih-radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.tih-card:hover {
  box-shadow: var(--tih-shadow-md);
  transform: translateY(-2px);
}

/* ── Section heading ─────────────────────────────────────────────────────── */
.tih-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}
.tih-section-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--tih-navy);
}
.tih-section-header a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tih-primary);
  white-space: nowrap;
}

/* ── No results ──────────────────────────────────────────────────────────── */
.tih-no-results {
  padding: 40px 24px;
  text-align: center;
  color: var(--tih-text-muted);
  background: var(--tih-surface);
  border: 1px dashed var(--tih-border);
  border-radius: var(--tih-radius-lg);
}

/* ── Accessibility ──────────────────────────────────────────────────────────── */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── WordPress alignment classes ────────────────────────────────────────────── */
.alignwide  { max-width: var(--tih-max-wide); margin-inline: auto; }
.alignfull  { width: 100vw; margin-inline: calc(50% - 50vw); }
.aligncenter { text-align: center; }
