/* ============================================================
   Pedantic Design System — pedantic.css  v1.0.0
   The design system for aCo (Agency Couture) web properties.
   Tokens first, components second, documentation chrome last.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Color — every text/background pair below meets WCAG 2.2 AA */
  --pds-navy: #0f2a48;          /* brand navy: headings, header, footer */
  --pds-navy-deep: #0a1e35;     /* header/footer gradient end */
  --pds-cream: #f7f3ee;         /* page background tint */
  --pds-paper: #ffffff;         /* content surface */
  --pds-ink: #0f2a48;           /* body text on light (14.5:1 on white) */
  --pds-slate: #45586c;         /* secondary text on white (7.3:1) */
  --pds-accent: #9d2c54;        /* raspberry: primary actions (white text 7.2:1) */
  --pds-accent-dark: #7e2143;   /* primary hover (white text 9.6:1) */
  --pds-accent-pale: #f3d9e2;   /* secondary action fill (navy text 11:1) */
  --pds-success: #1b6b4a;       /* white text 6.5:1 */
  --pds-warning-bg: #f6c453;    /* with --pds-warning-ink text (8.1:1) */
  --pds-warning-ink: #3d2e00;
  --pds-danger: #b3261e;        /* white text 6.5:1 */
  --pds-danger-dark: #8f1d17;
  --pds-border: #c9d2dc;        /* decorative borders only, never text */
  --pds-border-strong: #5a6b7f;
  --pds-focus: #9d2c54;         /* focus ring on light surfaces */
  --pds-focus-on-dark: #f6c453; /* focus ring on navy surfaces */

  /* Type */
  --pds-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --pds-font-mono: "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --pds-text-xs: 0.8125rem;   /* 13px */
  --pds-text-sm: 0.9375rem;   /* 15px */
  --pds-text-md: 1.0625rem;   /* 17px — body default */
  --pds-text-lg: 1.25rem;     /* 20px */
  --pds-text-xl: 1.5625rem;   /* 25px */
  --pds-text-2xl: 1.9375rem;  /* 31px */
  --pds-text-3xl: 2.4375rem;  /* 39px */
  --pds-leading: 1.55;

  /* Spacing — 4px base scale */
  --pds-space-1: 0.25rem;
  --pds-space-2: 0.5rem;
  --pds-space-3: 0.75rem;
  --pds-space-4: 1rem;
  --pds-space-6: 1.5rem;
  --pds-space-8: 2rem;
  --pds-space-12: 3rem;
  --pds-space-16: 4rem;

  /* Shape + elevation */
  --pds-radius: 0.75rem;
  --pds-radius-pill: 999px;
  --pds-shadow: 0 2px 10px rgba(15, 42, 72, 0.12);
}

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

body {
  margin: 0;
  font-family: var(--pds-font);
  font-size: var(--pds-text-md);
  line-height: var(--pds-leading);
  color: var(--pds-ink);
  background: var(--pds-cream);
}

:focus-visible {
  outline: 3px solid var(--pds-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.pds-header :focus-visible,
.pds-footer :focus-visible { outline-color: var(--pds-focus-on-dark); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--pds-space-4);
  top: -100px;
  z-index: 100;
  background: var(--pds-navy);
  color: #fff;
  padding: var(--pds-space-2) var(--pds-space-4);
  border-radius: 0 0 var(--pds-radius) var(--pds-radius);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0; color: #fff; }

/* ============================================================
   COMPONENT: Buttons
   Filled pills. Never blue, never underlined.
   Labels are Title Case.
   ============================================================ */
.pds-btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--pds-radius-pill);
  padding: 0.6875rem 1.375rem;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.pds-btn:hover { text-decoration: none; }

.pds-btn--primary { background: var(--pds-accent); color: #fff; }
.pds-btn--primary:hover { background: var(--pds-accent-dark); }

.pds-btn--secondary { background: var(--pds-accent-pale); color: var(--pds-navy); }
.pds-btn--secondary:hover { background: #eabfd0; }

.pds-btn--navy { background: var(--pds-navy); color: #fff; }
.pds-btn--navy:hover { background: var(--pds-navy-deep); }

.pds-btn--danger { background: var(--pds-danger); color: #fff; }
.pds-btn--danger:hover { background: var(--pds-danger-dark); }

.pds-btn--sm { padding: 0.4375rem 1rem; font-size: var(--pds-text-sm); }
.pds-btn--lg { padding: 0.875rem 1.75rem; font-size: var(--pds-text-lg); }

.pds-btn:disabled,
.pds-btn[aria-disabled="true"] {
  background: #e3e8ed;
  color: var(--pds-slate);
  cursor: not-allowed;
}

/* ============================================================
   COMPONENT: Header
   ============================================================ */
.pds-header {
  background: linear-gradient(180deg, var(--pds-navy), var(--pds-navy-deep));
  color: #fff;
}
.pds-header__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--pds-space-3) var(--pds-space-4);
  display: flex;
  align-items: center;
  gap: var(--pds-space-4);
  flex-wrap: wrap;
}
.pds-header__brand {
  display: flex;
  align-items: center;
  gap: var(--pds-space-3);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--pds-text-lg);
}
.pds-header__brand img { width: 40px; height: 40px; border-radius: 50%; }
.pds-header__brand small {
  display: block;
  font-size: var(--pds-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pds-accent-pale);
}

/* ============================================================
   COMPONENT: Navigation (primary, inside header)
   ============================================================ */
.pds-nav { margin-left: auto; }
.pds-nav__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: var(--pds-space-1);
  flex-wrap: wrap;
}
.pds-nav__link {
  display: block;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: var(--pds-space-2) var(--pds-space-3);
  border-radius: var(--pds-radius-pill);
}
.pds-nav__link:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; }
.pds-nav__link[aria-current="page"] { background: var(--pds-accent); }

.pds-nav__toggle {
  display: none;
  margin-left: auto;
  background: var(--pds-accent);
  color: #fff;
  border: 0;
  border-radius: var(--pds-radius-pill);
  font: inherit;
  font-weight: 600;
  padding: var(--pds-space-2) var(--pds-space-4);
  cursor: pointer;
}
@media (max-width: 44rem) {
  .pds-nav { margin-left: 0; width: 100%; }
  .pds-nav__toggle { display: inline-block; }
  .pds-nav__list { display: none; flex-direction: column; padding-top: var(--pds-space-2); }
  .pds-nav__list.is-open { display: flex; }
}

/* ============================================================
   COMPONENT: Breadcrumbs
   ============================================================ */
.pds-breadcrumbs { font-size: var(--pds-text-sm); }
.pds-breadcrumbs__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--pds-space-2);
  align-items: center;
}
.pds-breadcrumbs__item + .pds-breadcrumbs__item::before {
  content: "›";
  margin-right: var(--pds-space-2);
  color: var(--pds-slate);
  font-weight: 700;
}
.pds-breadcrumbs a { color: var(--pds-accent); font-weight: 600; }
.pds-breadcrumbs [aria-current="page"] { color: var(--pds-ink); font-weight: 600; }

/* ============================================================
   COMPONENT: Search
   ============================================================ */
.pds-search { display: flex; gap: var(--pds-space-2); max-width: 34rem; }
.pds-search__input {
  flex: 1;
  font: inherit;
  color: var(--pds-ink);
  background: #fff;
  border: 2px solid var(--pds-border-strong);
  border-radius: var(--pds-radius-pill);
  padding: 0.625rem 1.125rem;
  min-width: 0;
}
.pds-search__input::placeholder { color: var(--pds-slate); opacity: 1; }

/* ============================================================
   COMPONENT: Table
   ============================================================ */
.pds-table-wrap { overflow-x: auto; }
.pds-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--pds-paper);
  font-size: var(--pds-text-sm);
}
.pds-table caption {
  text-align: left;
  font-weight: 700;
  font-size: var(--pds-text-md);
  padding: var(--pds-space-3) 0;
  color: var(--pds-ink);
}
.pds-table th, .pds-table td {
  text-align: left;
  padding: var(--pds-space-3) var(--pds-space-4);
  border-bottom: 1px solid var(--pds-border);
  vertical-align: top;
}
.pds-table thead th {
  background: var(--pds-navy);
  color: #fff;
  border-bottom: 0;
}
.pds-table tbody tr:nth-child(even) { background: var(--pds-cream); }
.pds-table tbody th { font-weight: 600; }

/* ============================================================
   COMPONENT: Forms
   Label above the field. Help text directly under the label.
   Button labels are Title Case.
   ============================================================ */
.pds-field { margin-bottom: var(--pds-space-6); max-width: 34rem; }
.pds-field label,
.pds-field legend {
  display: block;
  font-weight: 700;
  margin-bottom: var(--pds-space-1);
}
.pds-field .pds-required { color: var(--pds-danger); font-weight: 700; }
.pds-help {
  margin: 0 0 var(--pds-space-2);
  font-size: var(--pds-text-sm);
  color: var(--pds-slate);
}
.pds-input, .pds-select, .pds-textarea {
  font: inherit;
  color: var(--pds-ink);
  background: #fff;
  border: 2px solid var(--pds-border-strong);
  border-radius: var(--pds-radius);
  padding: 0.625rem 0.875rem;
  width: 100%;
}
.pds-textarea { min-height: 7rem; resize: vertical; }
.pds-input[aria-invalid="true"],
.pds-select[aria-invalid="true"],
.pds-textarea[aria-invalid="true"] { border-color: var(--pds-danger); }
.pds-error {
  margin: var(--pds-space-2) 0 0;
  font-size: var(--pds-text-sm);
  font-weight: 600;
  color: var(--pds-danger);
}
.pds-fieldset { border: 0; margin: 0 0 var(--pds-space-6); padding: 0; }
.pds-check { display: flex; gap: var(--pds-space-2); align-items: flex-start; margin-bottom: var(--pds-space-2); }
.pds-check input { width: 1.25rem; height: 1.25rem; margin-top: 0.2rem; accent-color: var(--pds-accent); flex: none; }
.pds-check label { font-weight: 400; margin: 0; }

/* Status / badge helpers used by several components */
.pds-badge {
  display: inline-block;
  font-size: var(--pds-text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: var(--pds-radius-pill);
  padding: 0.15rem 0.625rem;
}
.pds-badge--success { background: var(--pds-success); color: #fff; }
.pds-badge--warning { background: var(--pds-warning-bg); color: var(--pds-warning-ink); }
.pds-badge--danger { background: var(--pds-danger); color: #fff; }
.pds-badge--neutral { background: var(--pds-accent-pale); color: var(--pds-navy); }

/* ============================================================
   COMPONENT: Footer
   ============================================================ */
.pds-footer {
  background: linear-gradient(180deg, var(--pds-navy), var(--pds-navy-deep));
  color: #fff;
  margin-top: var(--pds-space-16);
}
.pds-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--pds-space-8) var(--pds-space-4);
  display: grid;
  gap: var(--pds-space-6);
}
@media (min-width: 44rem) {
  .pds-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
}
.pds-footer h2 { font-size: var(--pds-text-md); margin: 0 0 var(--pds-space-3); color: #fff; }
.pds-footer a { color: #fff; }
.pds-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--pds-space-2); }
.pds-footer__credit {
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding-top: var(--pds-space-4);
  font-size: var(--pds-text-sm);
  display: flex;
  align-items: center;
  gap: var(--pds-space-2);
  flex-wrap: wrap;
}
.pds-footer__credit img { width: 20px; height: 20px; }
.pds-social { list-style: none; display: flex; gap: var(--pds-space-2); margin: 0; padding: 0; }
.pds-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}
.pds-social a:hover { background: var(--pds-accent); }
.pds-social svg { width: 1.25rem; height: 1.25rem; fill: #fff; }

/* ============================================================
   Documentation chrome (this site only — not part of the system)
   ============================================================ */
.doc-layout {
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--pds-space-6) var(--pds-space-4) 0;
  display: grid;
  gap: var(--pds-space-8);
}
@media (min-width: 60rem) {
  .doc-layout { grid-template-columns: 15rem 1fr; }
}
.doc-main { min-width: 0; }
.doc-main h1 { font-size: var(--pds-text-3xl); line-height: 1.15; margin: 0 0 var(--pds-space-3); }
.doc-main h2 { font-size: var(--pds-text-2xl); line-height: 1.2; margin: var(--pds-space-12) 0 var(--pds-space-3); }
.doc-main h3 { font-size: var(--pds-text-xl); margin: var(--pds-space-8) 0 var(--pds-space-2); }
.doc-main p, .doc-main li { max-width: 44rem; }
.doc-lede { font-size: var(--pds-text-lg); color: var(--pds-slate); max-width: 44rem; }

.doc-sidenav {
  background: var(--pds-paper);
  border: 1px solid var(--pds-border);
  border-radius: var(--pds-radius);
  padding: var(--pds-space-4);
  align-self: start;
  box-shadow: var(--pds-shadow);
}
@media (min-width: 60rem) { .doc-sidenav { position: sticky; top: var(--pds-space-4); } }
.doc-sidenav h2 { font-size: var(--pds-text-sm); text-transform: uppercase; letter-spacing: 0.06em; margin: var(--pds-space-4) 0 var(--pds-space-2); color: var(--pds-slate); }
.doc-sidenav h2:first-child { margin-top: 0; }
.doc-sidenav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.doc-sidenav a {
  display: block;
  padding: var(--pds-space-1) var(--pds-space-2);
  border-radius: 0.5rem;
  color: var(--pds-ink);
  text-decoration: none;
  font-size: var(--pds-text-sm);
  font-weight: 600;
}
.doc-sidenav a:hover { background: var(--pds-cream); }
.doc-sidenav a[aria-current="page"] { background: var(--pds-accent-pale); color: var(--pds-navy); }

.doc-example {
  background: var(--pds-paper);
  border: 1px solid var(--pds-border);
  border-radius: var(--pds-radius);
  padding: var(--pds-space-6);
  margin: var(--pds-space-4) 0;
  box-shadow: var(--pds-shadow);
}
.doc-example__label {
  font-size: var(--pds-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pds-slate);
  margin: 0 0 var(--pds-space-3);
}
.doc-code { position: relative; margin: var(--pds-space-4) 0; }
.doc-code pre {
  background: var(--pds-navy-deep);
  color: #f2ede6;
  border-radius: var(--pds-radius);
  padding: var(--pds-space-4);
  overflow-x: auto;
  font-family: var(--pds-font-mono);
  font-size: var(--pds-text-sm);
  line-height: 1.5;
  margin: 0;
}
.doc-copy {
  position: absolute;
  top: var(--pds-space-2);
  right: var(--pds-space-2);
  background: var(--pds-accent-pale);
  color: var(--pds-navy);
  border: 0;
  border-radius: var(--pds-radius-pill);
  font: inherit;
  font-size: var(--pds-text-xs);
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
}
.doc-copy:hover { background: #eabfd0; }

.doc-cards { display: grid; gap: var(--pds-space-4); margin: var(--pds-space-6) 0; }
@media (min-width: 44rem) { .doc-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .doc-cards { grid-template-columns: repeat(3, 1fr); } }
.doc-card {
  background: var(--pds-paper);
  border: 1px solid var(--pds-border);
  border-radius: var(--pds-radius);
  padding: var(--pds-space-6);
  box-shadow: var(--pds-shadow);
}
.doc-card h3 { margin-top: 0; }
.doc-card a { color: var(--pds-accent); font-weight: 600; }

.doc-swatches { display: grid; gap: var(--pds-space-4); margin: var(--pds-space-4) 0; }
@media (min-width: 44rem) { .doc-swatches { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 60rem) { .doc-swatches { grid-template-columns: repeat(3, 1fr); } }
.doc-swatch { border: 1px solid var(--pds-border); border-radius: var(--pds-radius); overflow: hidden; background: var(--pds-paper); }
.doc-swatch__color { height: 5.5rem; }
.doc-swatch__meta { padding: var(--pds-space-3) var(--pds-space-4); font-size: var(--pds-text-sm); }
.doc-swatch__meta strong { display: block; font-size: var(--pds-text-md); }
.doc-swatch__meta code { font-family: var(--pds-font-mono); font-size: var(--pds-text-xs); }

.doc-do, .doc-dont {
  border-radius: var(--pds-radius);
  padding: var(--pds-space-4) var(--pds-space-6);
  margin: var(--pds-space-3) 0;
}
.doc-do { background: #e7f2ec; border-left: 6px solid var(--pds-success); }
.doc-dont { background: #fbeae9; border-left: 6px solid var(--pds-danger); }
.doc-do p, .doc-dont p { margin: var(--pds-space-1) 0; }

.doc-hero {
  background: linear-gradient(135deg, var(--pds-navy), var(--pds-navy-deep));
  color: #fff;
  border-radius: var(--pds-radius);
  padding: var(--pds-space-12) var(--pds-space-8);
  margin-bottom: var(--pds-space-8);
}
.doc-hero h1 { color: #fff; }
.doc-hero .doc-lede { color: var(--pds-accent-pale); }
.doc-hero__actions { display: flex; gap: var(--pds-space-3); flex-wrap: wrap; margin-top: var(--pds-space-6); }
