/* ==========================================================================
   Components.
   Part 1: the Modernist design system's own components, unchanged
   (.btn, .field / .input, .card, .tag, .nav, .table, .dialog).
   Part 2: Atlas components (page shell, header, footer, links, slots ...).
   ========================================================================== */

/* ---------- Part 1: design system ---------- */

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: flex-start; text-align: left; }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-divider);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 2px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }



/* ---------- Part 2: Atlas ---------- */

/* ==========================================================================
   Atlas components: page shell, navigation, footer, links, image slots,
   pagination, default page content.
   Design-system classes (.btn, .tag, .table, .input ...) live above, in the
   "Modernist design system" block, untouched.
   ========================================================================== */

/* --- Page shell (the original #page-root / #home-root wrapper) ----------- */
.atlas-page {
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: clip;
  font-family: var(--font-body);
}

/* --- Header / primary navigation ---------------------------------------- */
.atlas-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px,5vw,72px);
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-text);
  transition: box-shadow .35s ease;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--color-text);
}

.nav-logo {
  height: 49px;
  width: 173px;
  display: block;
}

.nav-logo--sub {
  height: 38px;
  width: auto;
}

.nav-logo--custom {
  width: auto;
  max-width: 220px;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  font-weight: 500;
}

.atlas-navlink {
  position: relative;
  color: var(--color-text);
  text-decoration: none;
}

.atlas-navlink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width .3s ease;
}

.atlas-navlink:hover::after,
.atlas-navlink[data-active]::after {
  width: 100%;
}

.nav-cta {
  text-decoration: none;
}

.nav-rule {
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 3px;
  width: 0%;
  background: var(--color-accent);
  z-index: 3;
}

/* Mobile menu toggle: hidden on desktop (see responsive.css) */
.nav-toggle {
  display: none;
}

/* Article reading progress bar */
#read-bar {
  position: fixed;
  left: 0;
  top: 0;
  height: 3px;
  background: var(--color-accent);
  width: 0;
  z-index: 200;
}

/* --- Footer --------------------------------------------------------------- */
.atlas-footer {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 64px clamp(20px,5vw,72px) 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 2px solid rgba(243,242,242,.28);
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-img {
  height: 46px;
  width: auto;
  display: block;
}

.footer-text {
  margin: 20px 0 0;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.01em;
  max-width: 16ch;
}

.footer-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-accent-400);
  margin-bottom: 18px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 11px;
  font-size: 14px;
}

.footer-link {
  color: var(--color-bg);
  text-decoration: none;
}

.footer-link:hover {
  color: var(--color-accent-400) !important;
}

.footer-span {
  color: rgba(243,242,242,.6);
}

.footer-row-2 {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-size: 12px;
  color: rgba(243,242,242,.6);
}

/* --- Mail link (envelope nudges, label underlines on hover) --------------- */
.atlas-mail {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.atlas-mail svg {
  transition: transform .35s cubic-bezier(.16,1,.3,1);
}

.atlas-mail:hover svg {
  transform: translateX(4px) rotate(-10deg);
}

.atlas-mail .atlas-mail-label {
  background-image: linear-gradient(currentColor,currentColor);
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .35s cubic-bezier(.16,1,.3,1);
}

.atlas-mail:hover .atlas-mail-label {
  background-size: 100% 2px;
}

/* --- Image slots (team portraits, case-study images) ---------------------- */
.atlas-slot,
.atlas-slot__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.atlas-slot__img {
  object-fit: cover;
}

.atlas-slot {
  display: block;
}

/* --- Pagination (Insights) ------------------------------------------------- */
.atlas-pagination {
  margin-top: 56px;
}

.atlas-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.atlas-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 2px solid var(--color-text);
  color: var(--color-text);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  transition: background .25s ease, color .25s ease;
}

.atlas-pagination a.page-numbers:hover {
  background: var(--color-accent-100);
}

.atlas-pagination .page-numbers.current {
  background: var(--color-text);
  color: var(--color-bg);
}

.atlas-pagination .page-numbers.dots {
  border-color: transparent;
}

.atlas-empty {
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
}

.atlas-404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

/* --- Default page / block-editor content ---------------------------------- */
.atlas-entry__header {
  padding-top: clamp(56px,8vw,96px);
  padding-left: clamp(20px,5vw,72px);
  padding-right: clamp(20px,5vw,72px);
}

.atlas-entry__title {
  font-size: clamp(36px,5.6vw,72px);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0;
  text-wrap: balance;
}

.atlas-entry__content {
  padding: clamp(28px,4vw,48px) clamp(20px,5vw,72px) clamp(64px,8vw,112px);
}

.atlas-entry__content > * + * {
  margin-top: 22px;
}

.atlas-entry__content p,
.atlas-entry__content li {
  font-size: clamp(17px,1.35vw,19px);
  line-height: 1.72;
  max-width: 66ch;
}

.atlas-entry__content h2 {
  font-size: clamp(24px,2.6vw,34px);
  margin: 44px 0 0;
}

.atlas-entry__content h3 {
  font-size: clamp(20px,2vw,26px);
  margin: 32px 0 0;
}

.atlas-entry__content a {
  color: var(--color-accent-700);
}

.atlas-entry__content blockquote {
  margin-left: 0;
  padding-left: 20px;
  border-left: 2px solid var(--color-accent);
  font-size: clamp(20px,2vw,26px);
  line-height: 1.4;
}

.atlas-entry__content img {
  height: auto;
}

.atlas-entry__content ul,
.atlas-entry__content ol {
  padding-left: 1.2em;
}

/* Form plugin output placed in the newsletter band */
.atlas-form-embed input[type="email"],
.atlas-form-embed input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font: inherit;
  color: var(--color-bg);
  background: transparent;
  border: 2px solid rgba(243,242,242,.4);
}

.atlas-form-embed input[type="submit"],
.atlas-form-embed button[type="submit"] {
  cursor: pointer;
  padding: 12px 20px;
  font: inherit;
  font-weight: 800;
  color: var(--color-bg);
  background: var(--color-accent);
  border: 0;
}
