/* =====================================================================
   Content Khana — Theme stylesheet
   Base tokens, resets, liquid-glass UI, buttons, and a handful of small
   structural rules that self-hosted Tailwind (tailwind-built.css) can't
   express directly (contact form, floating nav, blog article cards,
   scroll-reveal, unlayered cascade-layer bugfix overrides). Most
   component styling now lives in Tailwind classes in the .php templates.
   ===================================================================== */

/* ---- Fonts (self-hosted Manrope for headlines, Inter for everything else) ---- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/manrope/manrope-variable.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/inter/inter-variable.woff2') format('woff2');
}

/* ---- Design tokens ---- */
:root {
  --ck-navy: #052162;
  --ck-teal: #4c8493;
  --ck-orange: #bd5c1a;
  --ck-mint: #c6e8e0;
  --ck-sky: #c6dae8;
  --ck-paper: #ffffff;
  --ck-black: #000000;

  /* Same HSL triplets as the React source's src/index.css :root block —
     kept in this exact format so `hsl(var(--primary))`-style inline
     styles copied directly from JSX work unchanged. */
  --background: 193 32% 44%;
  --foreground: 0 0% 100%;
  --card: 0 0% 100%;
  --primary: 222 90% 20%;

  --ck-radius: 0.5rem;
  --ck-font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --ck-font-heading: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --ck-font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --ck-shadow-sm: 0 6px 24px rgba(5, 33, 98, 0.08);
  --ck-shadow-md: 0 10px 30px rgba(5, 33, 98, 0.1);
  --ck-shadow-lg: 0 14px 44px rgba(76, 132, 147, 0.3);

  /* ---- New brand palette (client-supplied, Sep 2026) ----
     Used by template-parts/site-header.php and
     template-parts/section-hero-main.php only. Does NOT replace the
     tokens above — every already-built section keeps using
     --background/--foreground/--card/--primary unchanged. */
  --ck-cloud-white: #F7FAFC;
  --ck-sky-blue: #A8DFF0;
  --ck-turquoise: #16C6D1;
  --ck-deep-blue: #0B3558;

  /* Gradient sampled from the client's reference comp (buttons + "Made
     Real." heading text) — deep blue to light cyan, left to right. */
  --ck-gradient-start: #206892;
  --ck-gradient-end: #4FA8C7;
}

/* ---- Reset / base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--ck-font);
  background: var(--ck-paper);
  color: var(--ck-black);
  line-height: 1.5;
  overflow-x: hidden;
}
img,
video,
canvas {
  max-width: 100%;
  height: auto;
  display: block;
}
/*
 * The reset above is unlayered CSS. Tailwind's utility classes (incl.
 * .w-full / .h-full, used by team/gallery/blog thumbnails to make an
 * <img> fill its object-cover container) are emitted inside
 * `@layer utilities` in tailwind-built.css. Per the CSS Cascade Layers
 * spec, ANY unlayered rule always wins over ANY layered rule, regardless
 * of selector specificity or source order — so the reset above was
 * silently defeating .w-full/.h-full on images, leaving them sized to
 * their natural aspect ratio (e.g. ~402px tall in a 420px square
 * container) instead of filling it. That exposed a sliver of the
 * container's background color under object-cover photos (visible as a
 * light-blue bar under Team section portraits). Restating these two
 * utilities here, unlayered, restores normal specificity-based
 * cascading for elements that use them.
 */
img.w-full,
video.w-full,
canvas.w-full {
  width: 100%;
}
img.h-full,
video.h-full,
canvas.h-full {
  height: 100%;
}
/*
 * Same unlayered-vs-layered conflict as above, this time on the footer's
 * headings. The global `h1,h2,h3,h4 { margin:0; font-weight:900 }` reset
 * below is unlayered CSS and unconditionally wins over Tailwind's layered
 * `.mb-6`/`.mb-3`/`.font-bold` utilities used directly on <h4> in
 * template-parts/section-footer.php, wiping out their margin-bottom and
 * forcing font-weight:900 instead of 700. Every other section avoids this
 * by wrapping headings in a custom unlayered `.ck-*` class with its own
 * explicit margin/weight, but the footer is a verbatim Tailwind port that
 * relies on the utility classes directly, so restate the values it needs
 * here, unlayered and scoped to the footer only.
 */
footer h4 {
  margin: 0 0 1.5rem;
  font-weight: 700;
}
footer h4.mb-3 {
  margin-bottom: 0.75rem;
}
/*
 * Same unlayered-vs-layered conflict as the h4 fix above, this time on the
 * Connect column's social-links <ul>. The global `ul { margin: 0; padding: 0 }`
 * reset is unlayered CSS and unconditionally wins over Tailwind's layered
 * `.mb-8` utility applied directly to that <ul> in section-footer.php,
 * wiping out the gap between the last social link and the "Website"
 * heading below it. Restate it here, unlayered and scoped to the footer.
 */
footer ul.mb-8 {
  margin-bottom: 2rem;
}
/*
 * Layered (not left as a bare unlayered rule) so it doesn't silently beat
 * Tailwind utility classes on <a> elements — see the cascade-layers note
 * above img.w-full/etc. This is the exact same bug: an unlayered `a {
 * color: inherit }` was defeating layered `.text-white`/`.text-white/90`
 * utilities on the new site-header.php / section-hero-main.php anchors,
 * forcing every link/button label to the inherited body text color
 * (black) regardless of the class applied. Wrapping it in `@layer base`
 * (the same layer name Tailwind's own preflight uses, and it already
 * loads before Tailwind's `@layer utilities`) restores normal
 * specificity-based cascading so `.text-white` etc. win as expected.
 */
@layer base {
  a {
    color: inherit;
    text-decoration: none;
  }
}
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
input,
textarea {
  font-family: inherit;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 900;
  font-family: var(--ck-font-heading);
}

/* ---- Layout helpers ---- */
.ck-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.ck-h2 {
  font-weight: 900;
  font-family: var(--ck-font-heading);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--ck-teal);
  font-size: clamp(2.5rem, 5vw, 5.5rem);
}
.ck-muted {
  color: rgba(0, 0, 0, 0.55);
}

/* ---- Grain overlay ---- */
.grain-overlay::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* ---- Chronicle progress line ---- */
.chronicle-line {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 0;
  z-index: 100;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--ck-orange),
    transparent
  );
  transition: height 0.1s ease;
}

/* ---- Liquid glass ---- */
.liquid-glass {
  position: relative;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 0.5px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.2),
    0 8px 32px rgba(5, 33, 98, 0.12);
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.6;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0) 45%,
    rgba(255, 255, 255, 0) 100%
  );
}
.liquid-glass-btn {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 0.5px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
    0 4px 16px rgba(5, 33, 98, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.liquid-glass-btn:hover {
  background: rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.8),
    0 6px 22px rgba(5, 33, 98, 0.16);
}

/* ---- Buttons ---- */
.ck-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.6rem;
  border-radius: 9999px;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.ck-btn--primary {
  background: var(--ck-navy);
  color: #fff;
}
.ck-btn--primary:hover {
  transform: scale(1.03);
}
.ck-btn--primary.liquid-glass-btn:hover {
  background: var(--ck-navy);
  color: #fff;
}
.ck-btn--ghost {
  color: var(--ck-teal);
  background: rgba(5, 33, 98, 0.08);
}
.ck-btn--ghost:hover {
  background: rgba(5, 33, 98, 0.14);
}

/* =====================================================================
   CONTACT (form)
   ===================================================================== */
.ck-form__field {
  margin-bottom: 1.25rem;
}
.ck-form__labelrow {
  min-height: 1.5rem;
  margin-bottom: 4px;
}
.ck-form__label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.3);
}
.ck-form__typewriter {
  color: var(--ck-navy);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.ck-form input,
.ck-form textarea {
  background: transparent;
  border: 0;
  border-bottom: 0.5px solid rgba(5, 33, 98, 0.12);
  color: var(--ck-teal);
  font-size: 1.1rem;
  font-family: var(--ck-font);
  padding: 14px 0;
  outline: none;
  width: 100%;
  transition: border-color 0.3s ease;
}
.ck-form input:focus,
.ck-form textarea:focus,
.ck-form__input:focus {
  border-color: hsl(var(--primary)) !important;
}
.ck-form textarea {
  resize: none;
  height: 110px;
}
.ck-form__success {
  padding: 5rem 0;
  text-align: center;
}
.ck-form__success .check {
  font-weight: 900;
  font-size: 3rem;
  color: var(--ck-navy);
  margin-bottom: 1rem;
}

/* =====================================================================
   BLOG article cards (archive.php CPT/category-archive fallback)
   ===================================================================== */
.ck-articles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.ck-article {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
  border: 0.5px solid rgba(5, 33, 98, 0.12);
  box-shadow: var(--ck-shadow-md);
  transition: transform 0.4s ease;
}
.ck-article:hover {
  transform: translateY(-4px);
}
.ck-article__cover {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.ck-article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s;
}
.ck-article:hover .ck-article__cover img {
  transform: scale(1.05);
}
.ck-article__body {
  padding: 1.5rem;
}
.ck-article__body h3 {
  font-weight: 900;
  line-height: 1.15;
  color: var(--ck-navy);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}
.ck-article__body p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgba(5, 33, 98, 0.65);
  margin-bottom: 1.25rem;
}

/* =====================================================================
   FLOATING NAV
   ===================================================================== */
.ck-floatnav {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%) translateY(120px);
  opacity: 0;
  transition: all 0.5s;
}
.ck-floatnav.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* =====================================================================
   Animations
   ===================================================================== */

/* Scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
[data-reveal-delay="1"] {
  transition-delay: 0.08s;
}
[data-reveal-delay="2"] {
  transition-delay: 0.16s;
}
[data-reveal-delay="3"] {
  transition-delay: 0.24s;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (min-width: 768px) {
  .ck-articles {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .ck-articles {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Services archive — title link hover (mirrors ServicesList.jsx's onMouseEnter/onMouseLeave) */
.ck-services-list__title-link:hover {
  color: var(--ck-teal) !important;
}

/* Blog article — share icon hover (mirrors BlogArticle.jsx's onMouseEnter/onMouseLeave) */
.ck-share-icon:hover {
  background: var(--ck-navy);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: #fff;
}
::-webkit-scrollbar-thumb {
  background: var(--ck-orange);
  border-radius: 2px;
}
