/* ==========================================================================
   Base: document typography, links, focus, buttons, utilities.

   Specificity convention (keeps Astra overridden without an arms race):
   - element defaults:  body.sk-site h1        (0,1,2)  beats Astra's .entry-content h1 (0,1,1)
   - components:        .sk-site .sk-button    (0,2,0)  beats element defaults
   - sections:          .sk-hero .sk-hero__x   (0,2,0)  same tier as components
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

/* Smooth scroll (Lenis, assets/js/smooth-scroll.js): the library's recommended CSS. */
html.lenis,
html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }

body.sk-site,
.sk-site button,
.sk-site input,
.sk-site select,
.sk-site textarea {
  font-family: var(--font-sans);
}

body.sk-site {
  background: var(--surface-page);
  color: var(--text-secondary);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.sk-site :is(h1, h2, h3, h4, h5, h6):where(:not(.skx-scene *)) {
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
  margin-block: 0;
}

body.sk-site h1:where(:not(.skx-scene *)) { font-size: var(--text-h1); letter-spacing: var(--tracking-display); }
body.sk-site h2:where(:not(.skx-scene *)) { font-size: var(--text-h2); }
body.sk-site h3:where(:not(.skx-scene *)) { font-size: var(--text-h3); letter-spacing: var(--tracking-tight); }
body.sk-site h4:where(:not(.skx-scene *)) { font-size: var(--text-h4); letter-spacing: var(--tracking-normal); }

body.sk-site p {
  text-wrap: pretty;
  margin-block: 0;
}

body.sk-site :is(strong, b):where(:not(.skx-scene *)) {
  font-weight: var(--weight-strong);
  color: var(--text-primary);
}

/* Arabic runs need extra line height and no negative tracking. */
body.sk-site [lang="ar"] {
  line-height: var(--leading-arabic);
  letter-spacing: 0;
}

/* ---------- Links ---------- */
body.sk-site a:where(:not(.skx-scene *)) {
  color: var(--text-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--duration-quick) var(--ease-out);
}
body.sk-site a:where(:not(.skx-scene *)):hover {
  color: var(--text-link-hover);
}

/* ---------- Focus ---------- */
.sk-site :focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: 3px;
  border-radius: 2px;
}
.sk-site :focus:not(:focus-visible) {
  outline: none;
}

::selection {
  background: var(--signal-300);
  color: var(--ink-900);
}

/* ---------- Buttons ----------
   .sk-button is the theme component. Core button blocks are mapped onto the
   same look in blocks.css so editors get identical buttons. */
.sk-site .sk-button,
.sk-site .wp-block-button__link {
  --_bg: var(--button-primary-bg);
  --_fg: var(--button-primary-text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--button-height);
  padding: 0 var(--button-padding-inline);
  border: 0;
  border-radius: var(--radius-control);
  background: var(--_bg);
  color: var(--_fg);
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  line-height: var(--leading-ui);
  letter-spacing: var(--tracking-ui);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: none; /* Astra adds a soft shadow to every button */
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-smooth-out),
    transform var(--duration-quick) var(--ease-out);
}
.sk-site .sk-button:hover,
.sk-site .wp-block-button__link:hover {
  --_bg: var(--button-primary-bg-hover);
  color: var(--_fg);
}
.sk-site .sk-button:active,
.sk-site .wp-block-button__link:active {
  transform: scale(var(--scale-small));
  transition-duration: var(--duration-micro);
}
.sk-site .sk-button:focus-visible,
.sk-site .wp-block-button__link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.sk-site .sk-button[aria-disabled="true"],
.sk-site .sk-button:disabled {
  --_bg: var(--paper-200);
  --_fg: var(--text-tertiary);
  cursor: not-allowed;
  transform: none;
}
.sk-site .sk-button--block {
  display: flex;
  width: 100%;
}

/* Label roll: the label slides up and an identical copy follows it in.
   Signals "this goes somewhere" without an arrow glyph. */
.sk-button__label {
  position: relative;
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-smooth-out);
}
.sk-button__label[data-label]::after {
  content: attr(data-label);
  position: absolute;
  inset-inline-start: 0;
  top: calc(100% + 1.25em);   /* far enough to sit outside the button */
}
@media (hover: hover) {
  .sk-site .sk-button:hover .sk-button__label[data-label] {
    transform: translateY(calc(-100% - 1.25em));
  }
}

/* ---------- Utilities ---------- */
.sk-site .screen-reader-text:not(:focus) {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  word-wrap: normal !important;
}

/* Astra's skip link, restyled to match. */
.sk-site .skip-link.screen-reader-text:focus {
  z-index: var(--z-skip-link);
  inset-inline-start: var(--space-4);
  top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
  border-radius: var(--radius-control);
  font-size: var(--text-ui);
  box-shadow: var(--shadow-float);
}
