/*
Theme Name:   Chengdacai
Theme URI:    https://global.chengdacai.com/
Author:       Chengdacai
Description:  Lightweight classic theme for Chengdacai. Presentation only — custom post types, fields, structured data and the RFQ pipeline live in the Chengdacai Core plugin.
Version:      1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
License:      GPL-2.0-or-later
Text Domain:  chengdacai
*/

/*
 * ---------------------------------------------------------------
 * Design language: precision manufacturing
 * ---------------------------------------------------------------
 * The palette is unchanged. What makes this read as industrial rather
 * than generic-corporate is everything else:
 *
 *   - geometry   2px radii. Machined parts have edges, not pillows.
 *   - type       a monospace face for anything a machine would print:
 *                SKUs, alloy grades, dimensions, eyebrows, metadata.
 *   - surface    hairline rules instead of soft shadows, and a faint
 *                blueprint grid behind inset sections.
 *   - accent     a brand-coloured bar on section headings, like the
 *                datum mark on a technical drawing.
 *   - motion     120ms and linear-ish. Nothing bounces.
 * ---------------------------------------------------------------
 */

/* ---------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------- */
:root {
  /* Colour — unchanged from the original palette. */
  --cdc-ink: #111827;
  --cdc-ink-soft: #374151;
  --cdc-mut: #6b7280;
  --cdc-line: #e5e7eb;
  --cdc-bg: #ffffff;
  --cdc-bg-soft: #f7f8fa;
  --cdc-brand: #0b5cad;
  --cdc-brand-dark: #08417c;
  --cdc-ok: #0d7a45;
  --cdc-warn: #b7791f;
  --cdc-err: #b42318;

  /* Geometry — sharp. */
  --cdc-radius: 2px;
  --cdc-radius-sm: 2px;

  /* Elevation — a printed line rather than a drop shadow. */
  --cdc-shadow: 0 1px 0 rgba(17, 24, 39, .06);
  --cdc-shadow-md: 0 2px 0 rgba(17, 24, 39, .08);
  --cdc-shadow-lg: 0 6px 20px rgba(17, 24, 39, .10);

  --cdc-wrap: 1160px;

  /* Type stacks. */
  --cdc-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --cdc-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Blueprint grid, derived from the existing line colour. */
  --cdc-grid: linear-gradient(to right, rgba(17, 24, 39, .04) 1px, transparent 1px),
              linear-gradient(to bottom, rgba(17, 24, 39, .04) 1px, transparent 1px);
  --cdc-grid-size: 28px;

  --cdc-ease: 120ms cubic-bezier(.2, 0, .2, 1);
}

/* ---------------------------------------------------------------
   Base
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--cdc-bg); color: var(--cdc-ink);
  font: 16px/1.65 var(--cdc-sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cdc-brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--cdc-brand-dark); }

h1, h2, h3, h4 { line-height: 1.22; margin: 1.6em 0 .5em; letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 0; }
h2 { font-size: clamp(22px, 2.6vw, 30px); }
h3 { font-size: clamp(18px, 2vw, 22px); }
h4 { font-size: 17px; }
p, ul, ol { margin: 0 0 1.1em; }

/* Section headings carry a brand datum bar. */
.cdc-section > .cdc-wrap > h2,
.cdc-section > .cdc-wrap > h2:first-child { position: relative; padding-left: 18px; }
.cdc-section > .cdc-wrap > h2::before {
  content: ""; position: absolute; left: 0; top: .16em; bottom: .16em; width: 4px;
  background: var(--cdc-brand);
}

:focus-visible { outline: 2px solid var(--cdc-brand); outline-offset: 2px; }

.cdc-wrap { width: 100%; max-width: var(--cdc-wrap); margin: 0 auto; padding: 0 20px; }
.cdc-section { padding: 60px 0; }

/* Inset sections get the blueprint grid — the surface a draughtsman works on. */
.cdc-section--soft {
  background-color: var(--cdc-bg-soft);
  background-image: var(--cdc-grid);
  background-size: var(--cdc-grid-size) var(--cdc-grid-size);
  border-top: 1px solid var(--cdc-line);
  border-bottom: 1px solid var(--cdc-line);
}

.cdc-lede { font-size: 18px; color: var(--cdc-ink-soft); max-width: 70ch; }
.cdc-mut { color: var(--cdc-mut); }
.cdc-skip { position: absolute; left: -9999px; }
.cdc-skip:focus { left: 8px; top: 8px; z-index: 999; background: #fff; padding: 10px 14px; border-radius: var(--cdc-radius); }

/* Technical label — the monospace voice used for metadata everywhere. */
.cdc-label {
  font-family: var(--cdc-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--cdc-mut);
}

/* Buttons ------------------------------------------------------------- */
.cdc-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--cdc-radius);
  border: 1px solid var(--cdc-line); background: #fff; color: var(--cdc-ink);
  font: inherit; font-size: 14px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background var(--cdc-ease), border-color var(--cdc-ease), color var(--cdc-ease), transform var(--cdc-ease);
}
.cdc-btn:hover { border-color: var(--cdc-brand); color: var(--cdc-brand); }
.cdc-btn:active { transform: translateY(1px); }
.cdc-btn--primary { background: var(--cdc-brand); border-color: var(--cdc-brand); color: #fff; }
.cdc-btn--primary:hover { background: var(--cdc-brand-dark); border-color: var(--cdc-brand-dark); color: #fff; }
.cdc-btn--ghost { border-color: transparent; background: transparent; }
.cdc-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------
   Hero — full-bleed background, reproduced from the old site.
   --------------------------------------------------------------- */
.cdc-western-hero {
  position: relative; isolation: isolate; min-height: 660px;
  display: flex; align-items: center; overflow: hidden;
  background-color: #08111a; background-size: cover; background-position: center;
}
.cdc-western-hero * { box-sizing: border-box; }
.cdc-hero-inner { width: min(1240px, 100%); margin: 0 auto; padding: 64px 32px 148px; }
.cdc-hero-copy { max-width: 700px; }
.cdc-hero-eyebrow {
  margin: 0 0 16px; color: #f6a514;
  font-family: var(--cdc-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
}
.cdc-western-hero h1 { max-width: 700px; margin: 0 0 20px; color: #fff; font-size: clamp(44px, 3.9vw, 60px); font-weight: 780; line-height: 1.04; letter-spacing: -.035em; text-wrap: balance; }
.cdc-hero-lead { max-width: 700px; margin: 0 0 16px; color: #e3eaf0; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.52; }
.cdc-hero-process { margin: 0 0 27px; color: #bac5ce; font-size: 14px; font-weight: 600; letter-spacing: .02em; font-family: var(--cdc-mono); }
.cdc-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cdc-hero-btn {
  display: inline-flex; min-height: 52px; align-items: center; justify-content: center;
  padding: 13px 22px; border: 1px solid transparent; border-radius: var(--cdc-radius);
  font-size: 14px; font-weight: 800; line-height: 1.2; letter-spacing: .05em;
  text-transform: uppercase; text-decoration: none;
  transition: transform var(--cdc-ease), background var(--cdc-ease), border-color var(--cdc-ease), box-shadow var(--cdc-ease);
}
.cdc-hero-btn:hover { transform: translateY(-2px); }
.cdc-hero-primary { background: #f6a514; color: #111820; box-shadow: 0 10px 28px rgba(246, 165, 20, .24); }
.cdc-hero-primary:hover { background: #ffb52d; color: #111820; box-shadow: 0 13px 32px rgba(246, 165, 20, .34); }
.cdc-hero-secondary { border-color: rgba(255, 255, 255, .62); background: rgba(7, 15, 23, .34); color: #fff; }
.cdc-hero-secondary:hover { border-color: #fff; background: rgba(255, 255, 255, .1); color: #fff; }
.cdc-hero-note { margin: 12px 0 0; color: #9fadb8; font-size: 11.5px; line-height: 1.45; font-family: var(--cdc-mono); letter-spacing: .04em; }
.cdc-hero-mobile-visual { display: none; }

.cdc-hero-proof {
  position: absolute; right: 0; bottom: 0; left: 0;
  border-top: 1px solid rgba(255, 255, 255, .16);
  background: rgba(6, 14, 21, .9); backdrop-filter: blur(8px);
}
.cdc-hero-proof-inner { display: grid; width: min(1240px, 100%); margin: 0 auto; grid-template-columns: repeat(4, 1fr); }
.cdc-hero-proof-item { padding: 18px 22px; border-left: 1px solid rgba(255, 255, 255, .12); }
.cdc-hero-proof-item:first-child { border-left: 0; }
.cdc-hero-proof-item strong {
  display: block; color: #fff; font-size: 22px; font-weight: 800;
  line-height: 1.2; letter-spacing: -.01em;
  font-family: var(--cdc-mono); font-variant-numeric: tabular-nums;
}
.cdc-hero-proof-item span { display: block; margin-top: 5px; color: #9fadb8; font-size: 11px; line-height: 1.4; letter-spacing: .04em; text-transform: uppercase; }

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.cdc-header {
  border-bottom: 2px solid var(--cdc-brand);
  background: #fff; position: sticky; top: 0; z-index: 50;
}
.cdc-header__inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.cdc-logo { font-size: 20px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; color: var(--cdc-ink); }

/*
 * Custom logo.
 *
 * the_custom_logo() prints <a class="custom-logo-link"><img class="custom-logo">.
 * Without these rules the image renders at its intrinsic size (the migrated
 * mark is 512x205) and stretches the 68px header. Capping max-height while
 * leaving width/height auto preserves the aspect ratio.
 */
.custom-logo-link { display: inline-flex; align-items: center; flex: 0 0 auto; text-decoration: none; line-height: 0; }
.custom-logo { display: block; width: auto; height: auto; max-height: 44px; max-width: 200px; }

.cdc-nav { margin-left: auto; }
.cdc-nav ul { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
.cdc-nav a {
  position: relative; display: block; padding: 10px 13px; border-radius: var(--cdc-radius);
  font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--cdc-ink-soft); text-decoration: none;
  transition: color var(--cdc-ease), background var(--cdc-ease);
}
.cdc-nav a::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 5px; height: 2px;
  background: var(--cdc-brand); transform: scaleX(0); transform-origin: left;
  transition: transform var(--cdc-ease);
}
.cdc-nav a:hover { color: var(--cdc-brand); }
.cdc-nav a:hover::after, .cdc-nav .current-menu-item > a::after { transform: scaleX(1); }
.cdc-nav .current-menu-item > a { color: var(--cdc-brand); }
.cdc-nav .sub-menu {
  position: absolute; display: none; background: #fff;
  border: 1px solid var(--cdc-line); border-top: 2px solid var(--cdc-brand);
  border-radius: var(--cdc-radius); box-shadow: var(--cdc-shadow-lg);
  padding: 6px; min-width: 240px; flex-direction: column; z-index: 60;
}
.cdc-nav .sub-menu a {
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500;
  padding: 10px 13px;
}
.cdc-nav .sub-menu a::after { display: none; }
.cdc-nav li:hover > .sub-menu, .cdc-nav li:focus-within > .sub-menu { display: flex; }

/*
 * Mega-menu blurb.
 *
 * The panel is wider than a plain dropdown because each entry now carries a
 * line of explanation. The label stays on its own line so entries scan as a
 * list of names first, with the detail available underneath.
 */
.cdc-nav__desc {
  display: block; margin-top: 3px;
  font-size: 12px; font-weight: 400; line-height: 1.4;
  color: var(--cdc-mut); letter-spacing: 0;
}
.cdc-nav .sub-menu li:hover > a .cdc-nav__desc { color: var(--cdc-ink-soft); }

/* Widen only the panels that actually carry blurbs. */
.cdc-nav .sub-menu { min-width: 300px; max-width: 380px; }
.cdc-nav .sub-menu a { padding-right: 16px; }
.cdc-header__cta { margin-left: 8px; }

.cdc-topbar { background: var(--cdc-ink); color: #d1d5db; font-size: 12.5px; font-family: var(--cdc-mono); letter-spacing: .02em; }
.cdc-topbar__inner { display: flex; justify-content: flex-end; gap: 18px; padding: 7px 0; }
.cdc-topbar a { color: #fff; text-decoration: none; }
.cdc-topbar a:hover { color: #fff; text-decoration: underline; }

.cdc-burger { display: none; margin-left: auto; background: none; border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius); padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }

/* ---------------------------------------------------------------
   Breadcrumbs
   --------------------------------------------------------------- */
.cdc-crumbs { font-family: var(--cdc-mono); font-size: 12px; letter-spacing: .02em; color: var(--cdc-mut); padding: 16px 0 0; }
.cdc-crumbs a { color: var(--cdc-mut); text-decoration: none; }
.cdc-crumbs a:hover { color: var(--cdc-brand); }
.cdc-crumbs span[aria-current] { color: var(--cdc-ink); }

/* ---------------------------------------------------------------
   Cards
   --------------------------------------------------------------- */
.cdc-grid { display: grid; gap: 22px; }
.cdc-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cdc-grid--2 { grid-template-columns: repeat(2, 1fr); }

.cdc-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius);
  text-decoration: none;
  transition: border-color var(--cdc-ease), box-shadow var(--cdc-ease), transform var(--cdc-ease);
}
/* Corner tick — the registration mark on a drawing sheet. */
.cdc-card::after {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 18px solid var(--cdc-brand); border-left: 18px solid transparent;
  opacity: 0; transition: opacity var(--cdc-ease);
}
.cdc-card:hover { border-color: var(--cdc-brand); box-shadow: var(--cdc-shadow-md); transform: translateY(-2px); }
.cdc-card:hover::after { opacity: 1; }

.cdc-card__media { aspect-ratio: 4 / 3; background: var(--cdc-bg-soft); overflow: hidden; }
.cdc-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.82) contrast(1.03);
  transition: transform 260ms cubic-bezier(.2, 0, .2, 1), filter var(--cdc-ease);
}
.cdc-card:hover .cdc-card__media img { transform: scale(1.04); filter: saturate(1) contrast(1.05); }

.cdc-card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cdc-card__title { font-size: 16.5px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.cdc-card__title a { text-decoration: none; color: var(--cdc-ink); }
.cdc-card__title a:hover { color: var(--cdc-brand); }
.cdc-card__meta { font-family: var(--cdc-mono); font-size: 11.5px; letter-spacing: .08em; color: var(--cdc-brand); text-transform: uppercase; }
.cdc-card__excerpt { font-size: 14px; color: var(--cdc-mut); margin: 0; }

/* ---------------------------------------------------------------
   Product
   --------------------------------------------------------------- */
.cdc-product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 40px; align-items: start; }
.cdc-gallery { display: grid; gap: 10px; }
.cdc-gallery__main { border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius); overflow: hidden; background: var(--cdc-bg-soft); }
.cdc-gallery__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cdc-gallery__thumbs img { border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius); cursor: pointer; transition: border-color var(--cdc-ease); }
.cdc-gallery__thumbs img:hover { border-color: var(--cdc-brand); }

/* Gallery block for pages and guides (images lifted from the old page body) */
.cdc-gallery-grid { list-style: none; margin: 0; padding: 0; }
.cdc-gallery-grid__item { margin: 0; border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius); overflow: hidden; background: var(--cdc-bg-soft); aspect-ratio: 4 / 3; }
.cdc-gallery-grid__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 260ms cubic-bezier(.2, 0, .2, 1); }
.cdc-gallery-grid__item:hover img { transform: scale(1.04); }

/* Article figures ------------------------------------------------------ */
.cdc-figure { margin: 1.6em 0; }
.cdc-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius); background: var(--cdc-bg-soft); }
.cdc-figure figcaption {
  margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--cdc-brand);
  color: var(--cdc-mut); font-size: 13px; font-family: var(--cdc-mono); letter-spacing: .01em;
}

/* Spec table — the engineering data block ------------------------------ */
.cdc-spec {
  display: grid; gap: 0; margin: 0;
  border: 1px solid var(--cdc-line); border-top: 2px solid var(--cdc-brand);
  border-radius: var(--cdc-radius); overflow: hidden; background: #fff;
}
.cdc-spec__row { display: grid; grid-template-columns: 200px 1fr; gap: 0; border-bottom: 1px solid var(--cdc-line); }
.cdc-spec__row:last-child { border-bottom: 0; }
.cdc-spec__row:nth-child(odd) { background: #fcfcfd; }
.cdc-spec__row dt {
  margin: 0; padding: 11px 14px; background: transparent; border-right: 1px solid var(--cdc-line);
  font-family: var(--cdc-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--cdc-mut);
}
.cdc-spec__row dd { margin: 0; padding: 11px 14px; font-size: 14px; color: var(--cdc-ink); font-variant-numeric: tabular-nums; }

.cdc-pill {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--cdc-line);
  border-radius: var(--cdc-radius); font-size: 11.5px; font-family: var(--cdc-mono);
  letter-spacing: .05em; text-transform: uppercase; color: var(--cdc-ink-soft);
  margin: 0 5px 5px 0; background: #fff;
}

/* ---------------------------------------------------------------
   FAQ
   --------------------------------------------------------------- */
.cdc-faq { border-top: 1px solid var(--cdc-line); }
.cdc-faq details { border-bottom: 1px solid var(--cdc-line); }
.cdc-faq summary {
  cursor: pointer; padding: 15px 0; font-weight: 650; font-size: 16px;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
  transition: color var(--cdc-ease);
}
.cdc-faq summary:hover { color: var(--cdc-brand); }
.cdc-faq summary::-webkit-details-marker { display: none; }
.cdc-faq summary::after {
  content: "+"; color: var(--cdc-brand); font-weight: 400;
  font-family: var(--cdc-mono); font-size: 19px; line-height: 1;
}
.cdc-faq details[open] summary::after { content: "–"; }
.cdc-faq__a { padding: 0 0 16px; color: var(--cdc-ink-soft); }

/* ---------------------------------------------------------------
   Table of contents
   --------------------------------------------------------------- */
.cdc-toc {
  border: 1px solid var(--cdc-line); border-left: 2px solid var(--cdc-brand);
  border-radius: var(--cdc-radius); padding: 18px 22px; background: var(--cdc-bg-soft);
}
.cdc-toc ol { margin: 0; padding-left: 20px; }
.cdc-toc li { margin-bottom: 5px; }
.cdc-toc a { text-decoration: none; color: var(--cdc-ink-soft); }
.cdc-toc a:hover { color: var(--cdc-brand); }

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */
.cdc-table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 14px; font-variant-numeric: tabular-nums; }
.cdc-table th, .cdc-table td { border: 1px solid var(--cdc-line); padding: 10px 12px; text-align: left; vertical-align: top; }
.cdc-table thead th {
  background: var(--cdc-ink); color: #fff;
  font-family: var(--cdc-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.cdc-table tbody tr:nth-child(even) { background: var(--cdc-bg-soft); }
.cdc-table--scroll { display: block; overflow-x: auto; white-space: nowrap; }

/* ---------------------------------------------------------------
   CTA band
   --------------------------------------------------------------- */
.cdc-cta {
  position: relative; overflow: hidden;
  background: var(--cdc-ink); color: #fff;
  border-radius: var(--cdc-radius); border-left: 4px solid var(--cdc-brand);
  padding: 36px; display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between;
}
/* Faint engineering grid, same motif as the inset sections. */
.cdc-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 28px 28px;
}
.cdc-cta > * { position: relative; }
.cdc-cta h2 { margin: 0 0 6px; color: #fff; padding-left: 0; }
.cdc-cta h2::before { display: none; }
.cdc-cta p { margin: 0; color: #cbd5e1; max-width: 56ch; }
.cdc-cta .cdc-btn { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; }
.cdc-cta .cdc-btn:hover { background: #fff; border-color: #fff; color: var(--cdc-ink); }

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.cdc-footer {
  background: var(--cdc-ink); color: #cbd5e1;
  margin-top: 72px; padding: 50px 0 30px; font-size: 14px;
  border-top: 3px solid var(--cdc-brand);
}
.cdc-footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.cdc-footer h3 {
  font-family: var(--cdc-mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: #94a3b8;
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.cdc-footer ul { list-style: none; margin: 0; padding: 0; }
.cdc-footer li { margin-bottom: 7px; }
.cdc-footer a { color: #cbd5e1; text-decoration: none; transition: color var(--cdc-ease); }
.cdc-footer a:hover { color: #fff; }
.cdc-footer__bottom {
  margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1);
  color: #94a3b8; font-size: 12.5px; font-family: var(--cdc-mono); letter-spacing: .02em;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
}

/* ---------------------------------------------------------------
   Weight calculator
   --------------------------------------------------------------- */
.cdc-calc {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 0; margin: 32px 0 0;
  border: 1px solid var(--cdc-line); border-top: 2px solid var(--cdc-brand);
  border-radius: var(--cdc-radius); overflow: hidden; background: #fff;
}
.cdc-calc__controls {
  padding: 26px; display: grid; gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background-color: var(--cdc-bg-soft);
  background-image: var(--cdc-grid);
  background-size: var(--cdc-grid-size) var(--cdc-grid-size);
}
.cdc-calc__field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.cdc-calc__field--wide { grid-column: 1 / -1; }
.cdc-calc__dims { display: contents; }

.cdc-calc__label {
  font-family: var(--cdc-mono); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--cdc-mut);
}
.cdc-calc input[type="number"],
.cdc-calc select {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius);
  background: #fff; color: var(--cdc-ink);
  font: inherit; font-size: 15px; font-variant-numeric: tabular-nums;
  transition: border-color var(--cdc-ease), box-shadow var(--cdc-ease);
}
.cdc-calc input[type="number"]:focus,
.cdc-calc select:focus {
  outline: none; border-color: var(--cdc-brand);
  box-shadow: 0 0 0 3px rgba(11, 92, 173, .12);
}

.cdc-calc__result { padding: 26px; display: flex; flex-direction: column; gap: 6px; }
.cdc-calc__desc {
  margin: 0 0 12px; font-size: 17px; font-weight: 700;
  letter-spacing: -.01em; color: var(--cdc-ink);
}
.cdc-calc__rows { margin: 0 0 20px; display: grid; gap: 0; }
.cdc-calc__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 11px 0; border-bottom: 1px dashed var(--cdc-line);
}
.cdc-calc__row dt { margin: 0; font-size: 13.5px; color: var(--cdc-mut); }
.cdc-calc__row dd {
  margin: 0; font-family: var(--cdc-mono); font-size: 15px; font-weight: 600;
  color: var(--cdc-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cdc-calc__row--total { border-bottom: 0; border-top: 2px solid var(--cdc-brand); padding-top: 14px; }
.cdc-calc__row--total dt { font-weight: 650; color: var(--cdc-ink); }
.cdc-calc__row--total dd { font-size: 22px; color: var(--cdc-brand); }
.cdc-calc__cta { width: 100%; justify-content: center; }
.cdc-calc__note { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--cdc-mut); }

/* ---------------------------------------------------------------
   Standard profile datasheet
   --------------------------------------------------------------- */
.cdc-profile-head {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 40px; align-items: start; margin-bottom: 12px;
}
.cdc-profile-head .cdc-actions { margin-top: 22px; }
.cdc-profile-head h1 { margin-bottom: 14px; }
.cdc-profile-head .cdc-label a { color: var(--cdc-brand); text-decoration: none; }
.cdc-profile-head .cdc-label a:hover { text-decoration: underline; }

.cdc-profile-figure { margin: 0; }
.cdc-profile-figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius);
  background: var(--cdc-bg-soft);
}
.cdc-profile-figure figcaption {
  margin-top: 8px; padding-left: 12px; border-left: 2px solid var(--cdc-brand);
  color: var(--cdc-mut); font-size: 13px; font-family: var(--cdc-mono);
}

/*
 * Placeholder for a profile with no drawing yet.
 *
 * Generated from geometry, so there is no artwork to show. Rather than an empty
 * frame, the block states the size and SKU and uses the blueprint grid that
 * already means "technical surface" elsewhere in this theme.
 */
.cdc-profile-figure__placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; aspect-ratio: 4 / 3;
  border: 1px solid var(--cdc-line); border-radius: var(--cdc-radius);
  background-color: var(--cdc-bg-soft);
  background-image: var(--cdc-grid);
  background-size: var(--cdc-grid-size) var(--cdc-grid-size);
}
.cdc-profile-figure__placeholder .cdc-label { font-size: 15px; color: var(--cdc-ink); letter-spacing: .04em; }
.cdc-profile-figure__sku { font-family: var(--cdc-mono); font-size: 12px; color: var(--cdc-mut); letter-spacing: .08em; }

/* ---------------------------------------------------------------
   Alloy selection ratings
   --------------------------------------------------------------- */
.cdc-ratings { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.cdc-rating {
  display: grid; grid-template-columns: 190px 1fr 100px;
  gap: 16px; align-items: center;
  padding: 11px 0; border-bottom: 1px dashed var(--cdc-line);
}
.cdc-rating:last-child { border-bottom: 0; }
.cdc-rating__label { font-size: 14px; color: var(--cdc-ink-soft); }
.cdc-rating__bar {
  display: block; height: 6px; border-radius: 999px;
  background: var(--cdc-line); overflow: hidden;
}
.cdc-rating__fill { display: block; height: 100%; background: var(--cdc-brand); }
.cdc-rating__word {
  font-family: var(--cdc-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cdc-ink); text-align: right;
}

/* Two data tables side by side on the alloy page. */
.cdc-alloy-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
.cdc-alloy-cols h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------
   Advantages / limitations
   --------------------------------------------------------------- */
.cdc-proscons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
.cdc-proscons h2:first-child { margin-top: 0; }

.cdc-list { list-style: none; margin: 0; padding: 0; }
.cdc-list li {
  position: relative; padding: 9px 0 9px 26px;
  border-bottom: 1px dashed var(--cdc-line); font-size: 14.5px; color: var(--cdc-ink-soft);
}
.cdc-list li:last-child { border-bottom: 0; }
.cdc-list li::before {
  position: absolute; left: 0; top: 9px;
  font-family: var(--cdc-mono); font-weight: 700; font-size: 14px; line-height: 1.5;
}
/* A tick reads as "this works"; a warning triangle as "watch out for this". */
.cdc-list--good li::before { content: "✓"; color: var(--cdc-ok); }
.cdc-list--care li::before { content: "!"; color: var(--cdc-warn); }

/* ---------------------------------------------------------------
   FAQ page, quality plan, documentation blocks
   --------------------------------------------------------------- */
.cdc-faq--accordion details { border-bottom: 1px solid var(--cdc-line); }
.cdc-faq--accordion summary { font-size: 16.5px; }
.cdc-faq__source {
  margin: 10px 0 0; font-family: var(--cdc-mono); font-size: 11.5px;
  letter-spacing: .04em; color: var(--cdc-mut);
}
.cdc-faq__source a { color: var(--cdc-brand); text-decoration: none; }
.cdc-faq__source a:hover { text-decoration: underline; }

/* Numbered quality plan. */
.cdc-steps { counter-reset: cdc-step; list-style: none; margin: 0; padding: 0; max-width: 70ch; }
.cdc-steps li {
  counter-increment: cdc-step; position: relative;
  padding: 14px 0 14px 52px; border-bottom: 1px dashed var(--cdc-line);
  font-size: 15px; color: var(--cdc-ink-soft);
}
.cdc-steps li:last-child { border-bottom: 0; }
.cdc-steps li::before {
  content: counter(cdc-step, decimal-leading-zero);
  position: absolute; left: 0; top: 13px;
  font-family: var(--cdc-mono); font-size: 13px; font-weight: 700;
  color: var(--cdc-brand); letter-spacing: .04em;
}

.cdc-doc { margin-bottom: 34px; }
.cdc-doc:last-child { margin-bottom: 0; }
.cdc-doc h3 { margin: 0 0 10px; font-size: 18px; }

/* ---------------------------------------------------------------
   Homepage sections
   --------------------------------------------------------------- */

/* Section eyebrow: "03 / One-stop manufacturing". */
.cdc-eyebrow {
  margin: 0 0 10px;
  font-family: var(--cdc-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--cdc-brand);
}

/* Section eyebrow owns the top margin, so the h2 below it stays tight. */
.cdc-section .cdc-eyebrow + h2 { margin-top: 0; }

/* Two-column band: copy beside a figure. */
.cdc-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px; align-items: start;
}
.cdc-split .cdc-figure { margin: 0; }
.cdc-split > div > h2:first-child { margin-top: 0; }

/* Snapshot cards: number, title, one line. */
.cdc-snapshot .cdc-card__meta { font-size: 13px; font-weight: 700; }

/* ---------------------------------------------------------------
   Process route (01 … 09)
   --------------------------------------------------------------- */
.cdc-route {
  list-style: none; margin: 32px 0 40px; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; border-top: 2px solid var(--cdc-brand);
}
.cdc-route__step {
  display: flex; align-items: baseline; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--cdc-line);
  border-right: 1px solid var(--cdc-line);
}
.cdc-route__step:nth-child(3n) { border-right: 0; }
.cdc-route__num {
  font-family: var(--cdc-mono); font-size: 12px; font-weight: 700;
  color: var(--cdc-brand); letter-spacing: .06em; flex: 0 0 auto;
}
.cdc-route__label { font-size: 15px; font-weight: 600; color: var(--cdc-ink); }

.cdc-route__photos { margin-top: 0; }
.cdc-route__photos .cdc-figure { margin: 0; }
.cdc-route__photos figcaption { font-size: 12px; }

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

/* Application and finish cards use a shorter media box than the 4:3 default. */
.cdc-card__media--wide { aspect-ratio: 4 / 3; }

/*
 * Product-render media.
 *
 * A profile cross-section is a technical drawing, so it is never cropped: the
 * card shows the whole section inside a neutral field, and the image is inset
 * rather than filling the frame. With `cover` (the photography default) the
 * long fins and thin walls of a heat sink or an LED channel get sliced off.
 */
.cdc-card__media--contain {
  display: flex; align-items: center; justify-content: center;
  padding: 14px; background: #fff;
}
.cdc-card__media--contain img {
  width: 100%; height: 100%;
  object-fit: contain;
  /* Contain can still upscale a small render; keep it near native size. */
  max-width: 100%; max-height: 100%;
}

/* ---------------------------------------------------------------
   Alloy band
   --------------------------------------------------------------- */
.cdc-alloys { margin-top: 26px; }
.cdc-alloy {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  border: 1px solid var(--cdc-line); border-top: 2px solid var(--cdc-brand);
  border-radius: var(--cdc-radius); background: #fff;
  text-decoration: none;
  transition: border-color var(--cdc-ease), box-shadow var(--cdc-ease), transform var(--cdc-ease);
}
.cdc-alloy:hover { border-color: var(--cdc-brand); box-shadow: var(--cdc-shadow-md); transform: translateY(-2px); }
.cdc-alloy__grade {
  font-family: var(--cdc-mono); font-size: 26px; font-weight: 700;
  color: var(--cdc-ink); letter-spacing: -.01em;
}
.cdc-alloy__desc { font-size: 13.5px; line-height: 1.45; color: var(--cdc-mut); }
.cdc-alloy__link {
  margin-top: auto; padding-top: 10px;
  font-family: var(--cdc-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cdc-brand);
}

.cdc-callout {
  margin-top: 22px; padding: 20px 24px;
  border: 1px solid var(--cdc-line); border-left: 3px solid var(--cdc-brand);
  border-radius: var(--cdc-radius); background: #fff;
}
.cdc-callout__title { margin: 0 0 6px; font-size: 16px; }
.cdc-callout p { margin: 0; font-size: 14.5px; color: var(--cdc-ink-soft); }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 960px) {
  .cdc-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .cdc-split { grid-template-columns: 1fr; gap: 28px; }
  .cdc-route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdc-route__step:nth-child(3n) { border-right: 1px solid var(--cdc-line); }
  .cdc-route__step:nth-child(2n) { border-right: 0; }
  .cdc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cdc-stat:nth-child(odd) { border-left: 0; }
  .cdc-stat:nth-child(n + 3) { border-top: 1px solid var(--cdc-line); }
}

@media (max-width: 720px) {
  .cdc-grid--4 { grid-template-columns: 1fr; }
  .cdc-route { grid-template-columns: 1fr; }
  .cdc-route__step { border-right: 0; }
  .cdc-stats { grid-template-columns: 1fr; }
  .cdc-stat { border-left: 0; }
  .cdc-stat + .cdc-stat { border-top: 1px solid var(--cdc-line); }

  /*
   * Narrow screens: the layout goes vertical and the gradient follows.
   *
   * A 90deg gradient over a wide photograph leaves almost no dark area once the
   * image is cover-scaled into a tall viewport, so the copy would sit on a
   * bright patch. Going top-to-bottom guarantees dark behind the text at any
   * aspect ratio.
   */
  .cdc-about-hero { aspect-ratio: auto; min-height: 300px; max-height: none; padding: 48px 0; }
  .cdc-about-hero {
    background-image: linear-gradient(180deg, rgba(8, 72, 152, .90) 0%, rgba(8, 72, 152, .82) 55%, rgba(11, 92, 173, .74) 100%), var(--cdc-about-hero-image);
  }
}

/* ---------------------------------------------------------------
   About page
   --------------------------------------------------------------- */

/*
 * About page header.
 *
 * Full-bleed photograph behind the page title, using the same device as the
 * homepage hero so the two pages read as one site.
 *
 * Two things drive this layout:
 *
 * 1. The image must not be cropped. `aspect-ratio` matches the photograph's own
 *    1920:719, so `background-size: cover` has nothing left to trim. min/max
 *    height only take over at the extremes, where a little cropping is
 *    unavoidable and the vertical gradient below keeps the copy legible.
 *
 *    NOTE: this ratio is tied to the source file. Swapping in a photograph with
 *    different proportions means updating it here too, or cover will start
 *    trimming again — silently, and only from the top and bottom.
 *
 * 2. The overlay is the logo's blue, not black. #084898 is the colour that
 *     accounts for ~70% of the logo's ink, so the band now reads as the brand
 *    rather than as a dark photo — and because blue is lighter than near-black,
 *    the photograph shows through instead of drowning. The copy keeps its
 *    contrast from a text-shadow, which costs nothing visually.
 */
.cdc-about-hero {
  position: relative; isolation: isolate;
  display: flex; align-items: center;
  aspect-ratio: 1920 / 719;
  min-height: 300px;
  max-height: 640px;
  padding: 56px 0;
  background-color: var(--cdc-brand-dark);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.cdc-about-hero .cdc-wrap { width: 100%; }
.cdc-about-hero h1 {
  color: #fff; margin: 0 0 16px; max-width: 22ch;
  /* Carries legibility now that the overlay is blue rather than near-black. */
  text-shadow: 0 2px 14px rgba(4, 26, 56, .55);
}
.cdc-about-hero .cdc-eyebrow {
  color: #f09810;   /* the logo's own accent, sampled not guessed */
  text-shadow: 0 1px 10px rgba(4, 26, 56, .5);
}
.cdc-about-hero .cdc-lede {
  color: #eef4fb; max-width: 62ch; margin: 0;
  text-shadow: 0 1px 12px rgba(4, 26, 56, .55);
}

/* Big-number strip for the capacity figures. */
.cdc-stats {
  list-style: none; margin: 30px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0; border-top: 2px solid var(--cdc-brand); border-bottom: 1px solid var(--cdc-line);
}
.cdc-stat { padding: 22px 20px; border-left: 1px solid var(--cdc-line); }
.cdc-stat:first-child { border-left: 0; }
.cdc-stat strong {
  display: block; font-family: var(--cdc-mono); font-size: 30px; font-weight: 700;
  line-height: 1.1; letter-spacing: -.02em; color: var(--cdc-brand);
}
.cdc-stat span {
  display: block; margin-top: 8px; font-size: 12.5px; line-height: 1.4;
  color: var(--cdc-mut); letter-spacing: .02em;
}

/* Lead figure spans the full height of its column. */
.cdc-figure--lead img { aspect-ratio: 16 / 9; object-fit: cover; }

/* Customer visit cards: photo above a captioned country label. */
.cdc-visits { margin-top: 30px; }
.cdc-visit { margin: 0; }
.cdc-visit img {
  width: 100%; height: auto; display: block; aspect-ratio: 4 / 3;
  object-fit: cover; border: 1px solid var(--cdc-line);
  border-radius: var(--cdc-radius); background: var(--cdc-bg-soft);
}
.cdc-visit figcaption {
  margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--cdc-brand);
  display: flex; flex-direction: column; gap: 2px;
}
.cdc-visit figcaption strong { font-size: 15px; color: var(--cdc-ink); }
.cdc-visit figcaption span {
  font-family: var(--cdc-mono); font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--cdc-mut);
}

/* ---------------------------------------------------------------
   Utilities
   --------------------------------------------------------------- */
.cdc-stack > * + * { margin-top: 1.1em; }
.cdc-mt-0 { margin-top: 0; }
.cdc-mb-0 { margin-bottom: 0; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------
   Responsive
   --------------------------------------------------------------- */
@media (max-width: 960px) {
  .cdc-grid--3, .cdc-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .cdc-product { grid-template-columns: 1fr; }
  .cdc-footer__grid { grid-template-columns: repeat(2, 1fr); }

  /* Hero keeps its photograph but drops the absolute proof bar. */
  .cdc-western-hero { display: block; min-height: 0; background-size: auto 560px; background-repeat: no-repeat; background-position: center top; }
  .cdc-hero-inner { min-height: 560px; display: flex; align-items: center; padding: 62px 26px 60px; }
  .cdc-hero-copy { max-width: 610px; }
  .cdc-western-hero h1 { max-width: 610px; font-size: clamp(38px, 5.4vw, 52px); }
  .cdc-hero-proof { position: relative; right: auto; bottom: auto; left: auto; border-top: 0; background: #08111a; backdrop-filter: none; }
  .cdc-hero-proof-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .cdc-burger { display: block; }
  .cdc-nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 2px solid var(--cdc-brand); padding: 10px; display: none; }
  .cdc-nav.is-open { display: block; }
  .cdc-nav ul { flex-direction: column; }
  .cdc-nav .sub-menu { position: static; display: flex; box-shadow: none; border: 0; border-left: 2px solid var(--cdc-line); padding-left: 14px; }
  .cdc-nav a { text-transform: none; letter-spacing: 0; }
  .cdc-header__cta { display: none; }
  .cdc-header__inner { min-height: 58px; gap: 14px; }
  .custom-logo { max-height: 34px; max-width: 150px; }

  /* Hero: the photograph moves below the copy as a dedicated block. */
  .cdc-western-hero { min-height: 0; background: #08111a; }
  .cdc-hero-inner { display: block; min-height: 0; padding: 40px 20px 25px; }
  .cdc-hero-eyebrow { margin-bottom: 12px; font-size: 10px; letter-spacing: .12em; }
  .cdc-western-hero h1 { margin-bottom: 15px; font-size: 32px; line-height: 1.06; letter-spacing: -.025em; text-wrap: normal; }
  .cdc-hero-lead { margin-bottom: 14px; font-size: 15px; line-height: 1.48; }
  .cdc-hero-process { margin-bottom: 21px; font-size: 10.5px; line-height: 1.5; }
  .cdc-hero-actions { display: grid; gap: 10px; }
  .cdc-hero-btn { width: 100%; min-height: 48px; padding: 11px 14px; font-size: 13px; }
  .cdc-hero-note { margin-top: 10px; font-size: 11px; }
  .cdc-hero-mobile-visual {
    display: block; height: 245px;
    background-image: linear-gradient(180deg, rgba(8, 17, 26, .2) 0%, rgba(8, 17, 26, 0) 48%, rgba(8, 17, 26, .28) 100%), var(--cdc-hero-mobile, none);
    background-size: cover; background-position: center bottom;
  }
  .cdc-hero-proof-inner { grid-template-columns: 1fr; }
  .cdc-hero-proof-item { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); padding: 14px 20px; }
  .cdc-hero-proof-item:first-child { border-top: 0; }

  .cdc-grid--3, .cdc-grid--2 { grid-template-columns: 1fr; }
  .cdc-section { padding: 40px 0; }
  .cdc-cta { padding: 24px; }
  .cdc-spec__row { grid-template-columns: 1fr; }
  .cdc-spec__row dt { border-right: 0; border-bottom: 1px solid var(--cdc-line); }
  .cdc-footer__grid { grid-template-columns: 1fr; }

  /* Calculator stacks: controls above the result panel. */
  .cdc-calc { grid-template-columns: 1fr; }
  .cdc-calc__controls { grid-template-columns: 1fr; padding: 20px; }
  .cdc-calc__result { padding: 20px; }

  /* Datasheet stacks: copy above the figure. */
  .cdc-profile-head { grid-template-columns: 1fr; gap: 26px; }

  /* Ratings and alloy tables stack. */
  .cdc-rating { grid-template-columns: 1fr; gap: 6px; }
  .cdc-rating__word { text-align: left; }
  .cdc-alloy-cols { grid-template-columns: 1fr; gap: 26px; }
  .cdc-proscons { grid-template-columns: 1fr; gap: 26px; }
}

/* ---------------------------------------------------------------
   Floating actions — contact rail and back to top
   --------------------------------------------------------------- */

/*
 * Contact rail, pinned to the middle of the left edge.
 *
 * Fixed to the viewport, so it stays reachable however far the visitor has
 * scrolled. Centred with a transform rather than a negative margin: the rail's
 * height depends on its contents and on how many buttons are present, so a
 * hard-coded offset would drift out of true the moment one is added.
 *
 * The buttons are icon-only at rest and reveal their label on hover or focus.
 * Sitting on the edge of the reading column, permanent labels would eat into the
 * text at every width, and the two icons are unambiguous — WhatsApp's mark and
 * an envelope.
 */
.cdc-fab {
  position: fixed;
  top: 50%; left: 0;
  transform: translateY(-50%);
  z-index: 90;
  display: flex; flex-direction: column; gap: 16px;
  padding: 12px 0 12px 14px;
  /* The rail is decoration over the page until a button is aimed at; letting it
     swallow clicks across its whole box would block links underneath. */
  pointer-events: none;
}

.cdc-fab__btn {
  position: relative;
  pointer-events: auto;
  display: flex; align-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .22), 0 1px 3px rgba(15, 23, 42, .14);
  transition: width var(--cdc-ease), transform var(--cdc-ease), box-shadow var(--cdc-ease);
}

.cdc-fab__btn--whatsapp { background: #25d366; }
.cdc-fab__btn--email { background: var(--cdc-brand); }

.cdc-fab__btn:hover,
.cdc-fab__btn:focus-visible {
  box-shadow: 0 6px 22px rgba(15, 23, 42, .28), 0 1px 3px rgba(15, 23, 42, .16);
  transform: translateX(3px);
}

.cdc-fab__btn:focus-visible { outline: 2px solid var(--cdc-ink); outline-offset: 3px; }

.cdc-fab__icon {
  flex: 0 0 46px;
  display: flex; align-items: center; justify-content: center;
}

/*
 * The label slides out of the button on hover or focus.
 *
 * width: 0 with overflow hidden rather than display: none, so the text is still
 * in the accessibility tree and can be read while it animates. The button's own
 * aria-label carries the name regardless, in case a screen reader skips it.
 */
.cdc-fab__label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: var(--cdc-mono); font-size: 12px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  opacity: 0;
  transition: max-width var(--cdc-ease), opacity var(--cdc-ease), padding-right var(--cdc-ease);
}

.cdc-fab__btn:hover .cdc-fab__label,
.cdc-fab__btn:focus-visible .cdc-fab__label {
  max-width: 120px;
  padding-right: 16px;
  opacity: 1;
}

/* ---------------------------------------------------------------
   The sonar rings
   --------------------------------------------------------------- */

/*
 * Three rings expand out of the button and fade, one after another, so the
 * pulse reads as continuous rather than restarting.
 *
 * They are absolutely positioned inside the button and scaled past its edge,
 * which is why the button itself must not clip: the rail and the buttons carry
 * no overflow rule, so the rings are free to spread.
 *
 * currentColor is used so each button's rings match its own fill without a
 * second colour declaration to keep in sync.
 */
.cdc-fab__wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
  pointer-events: none;
  animation: cdc-sonar 3s cubic-bezier(.2, 0, .2, 1) infinite;
}

.cdc-fab__wave:nth-child(2) { animation-delay: 1s; }
.cdc-fab__wave:nth-child(3) { animation-delay: 2s; }

@keyframes cdc-sonar {
  0%   { transform: scale(1);   opacity: .6; }
  70%  { transform: scale(2.5); opacity: 0; }
  100% { transform: scale(2.5); opacity: 0; }
}

/*
 * Rings are motion, so they stop when motion is unwelcome.
 *
 * They are hidden rather than merely frozen: a static ring around the button
 * would read as a stray outline, and the button's colour and shadow already
 * distinguish it.
 */
@media (prefers-reduced-motion: reduce) {
  .cdc-fab__wave { animation: none; opacity: 0; }
  .cdc-fab__btn { transition: none; }
  .cdc-fab__btn:hover, .cdc-fab__btn:focus-visible { transform: none; }
}

/* ---------------------------------------------------------------
   Back to top
   --------------------------------------------------------------- */

.cdc-to-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 90;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--cdc-ink); color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .24), 0 1px 3px rgba(15, 23, 42, .16);
  transition: background-color var(--cdc-ease), transform var(--cdc-ease), box-shadow var(--cdc-ease);
}

/* The button sets display: flex, which would otherwise defeat [hidden]. */
.cdc-to-top[hidden] { display: none; }

.cdc-to-top:hover { background: var(--cdc-brand); transform: translateY(-3px); }
.cdc-to-top:focus-visible { outline: 2px solid var(--cdc-brand); outline-offset: 3px; }

/* ---------------------------------------------------------------
   Floating actions, narrow screens
   --------------------------------------------------------------- */

@media (max-width: 720px) {
  /* Smaller, and pinned closer to the edge — at this width the rail would
     otherwise overlap the reading column rather than sit beside it. */
  .cdc-fab { gap: 12px; padding-left: 10px; }
  .cdc-fab__btn { width: 42px; height: 42px; }
  .cdc-fab__icon { flex-basis: 42px; }

  /* No hover on touch, so the label never appears — keep it out of the way
     entirely rather than leaving an invisible tap target costing width. */
  .cdc-fab__label { display: none; }

  .cdc-to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* Print: none of this belongs on paper. */
@media print {
  .cdc-fab, .cdc-to-top { display: none !important; }
}
