/* ==========================================================================
   KATHMANDU CANCER CENTER — MODERN UNIFIED DESIGN SYSTEM (2027 VISION)
   File: /assets/css/kcc-2027.css
   Standards: WCAG 2.1 AAA · Mobile-First · Zero Build Step
   ========================================================================== */

/* ── 1. DESIGN TOKENS & DESIGN SYSTEM CORE ────────────────────────────────── */
:root {
  /* Official Brand Colors */
  --kcc-navy:          #2b318c;
  --kcc-navy-dark:     #1e2368;
  --kcc-navy-light:    #3d44b0;
  --kcc-magenta:       #ec008c;
  --kcc-magenta-dark:  #c4006e;
  --kcc-magenta-pale:  #fce8f4;
  --kcc-wa:            #25d366;

  /* Page-Specific Theme Overrides (Defaults to Navy) */
  --page-accent:       var(--kcc-navy);
  --page-light:        #f0f3ff;
  --page-mid:          #c7d0ff;
  --page-dark:         var(--kcc-navy-dark);

  /* Surface Neutrals */
  --color-white:       #ffffff;
  --color-surface:     #fafafa;
  --color-surface-2:   #f3f4f8;
  --color-surface-cream: #fafbff;
  --color-border:      #e8e9f0;
  --color-border-strong: #cccdd8;

  /* Typography Colors */
  --color-text:        #1c1c30;
  --color-text-sub:    #4a4a68;
  --color-text-muted:  #888899;

  /* Typography Stack */
  --font-heading:     'Lora', Georgia, serif; /* Editorial Headings */
  --font-ui:          'Sora', system-ui, sans-serif; /* Subheadings / UI Labels */
  --font-body:        'Plus Jakarta Sans', system-ui, sans-serif; /* Body Text */
  --font-devanagari:  'Noto Sans Devanagari', var(--font-body);

  /* Elevation Shadows */
  --shadow-sm:        0 2px 8px rgba(28, 35, 90, 0.04);
  --shadow-md:        0 6px 20px rgba(28, 35, 90, 0.07);
  --shadow-lg:        0 16px 40px rgba(28, 35, 90, 0.12);
  --shadow-accent:    0 8px 24px rgba(236, 0, 140, 0.20);

  /* Border Radius System */
  --radius-sm:        8px;
  --radius-md:        14px;
  --radius-lg:        20px;
  --radius-xl:        28px;
  --radius-full:      9999px;

  /* Transitions */
  --transition-fast:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 2. GLOBAL RESET & BASE STYLES ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-surface);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Devanagari Language Auto-Adjustment */
[lang="ne"], .lang-ne, .ne {
  font-family: var(--font-devanagari);
  line-height: 1.85;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── 3. CONTAINER & GRID LAYOUTS ─────────────────────────────────────────── */
.kcc-container {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.kcc-container--narrow { max-width: 768px; }
.kcc-container--wide   { max-width: 1360px; }

.kcc-section {
  padding-top: clamp(3rem, 6vw, 5.5rem);
  padding-bottom: clamp(3rem, 6vw, 5.5rem);
}

.kcc-section--white   { background-color: var(--color-white); }
.kcc-section--surface { background-color: var(--color-surface-2); }
.kcc-section--dark    { background-color: var(--kcc-navy-dark); color: var(--color-white); }
.kcc-section--tinted  { background-color: var(--page-light); }

.kcc-grid-2 { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.kcc-grid-3 { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.kcc-grid-4 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .kcc-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .kcc-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .kcc-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .kcc-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── 4. MODERN TYPOGRAPHY ─────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--kcc-navy);
  line-height: 1.25;
  font-weight: 700;
}

.kcc-display-xl { font-size: clamp(2.25rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
.kcc-display-lg { font-size: clamp(1.85rem, 4vw, 2.75rem); }
.kcc-heading-md { font-size: clamp(1.35rem, 3vw, 1.85rem); }

.kcc-overline {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--page-accent);
  margin-bottom: 0.5rem;
  display: inline-block;
}

/* ── 6. HERO SECTION (EDITORIAL & REASSURING) ────────────────────────────── */
.kcc-hero {
  position: relative;
  background: linear-gradient(135deg, var(--kcc-navy-dark) 0%, var(--kcc-navy) 60%, var(--page-dark) 100%);
  color: var(--color-white);
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
}

.kcc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(236, 0, 140, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.kcc-hero__content {
  max-width: 680px;
}

.kcc-hero__title {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.kcc-hero__title em {
  font-style: italic;
  color: var(--kcc-magenta-pale);
}

.kcc-hero__lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ── 7. STICKY ANCHOR NAVIGATION BAR ────────────────────────────────────── */
.kcc-anchor-nav {
  position: sticky;
  top: 64px; /* Matches fixed navbar height */
  z-index: 90;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 0;
}

.kcc-anchor-nav__inner {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.kcc-anchor-nav__inner::-webkit-scrollbar { display: none; }

.kcc-anchor-link {
  font-family: var(--font-ui);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-text-sub);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--color-surface-2);
  text-decoration: none;
  transition: var(--transition-fast);
}

.kcc-anchor-link:hover, .kcc-anchor-link.active {
  background: var(--page-accent);
  color: var(--color-white);
}

/* ── 8. MODERN CARDS & SURFACES ──────────────────────────────────────────── */
.kcc-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.kcc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--page-mid);
}

.kcc-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--page-light);
  color: var(--page-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
}

/* ── 9. BUTTONS & INTERACTIVE ACTION SYSTEM ──────────────────────────────── */
.kcc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.kcc-btn--primary {
  background: var(--kcc-navy);
  color: var(--color-white);
}

.kcc-btn--primary:hover {
  background: var(--kcc-navy-dark);
}

.kcc-btn--accent {
  background: var(--kcc-magenta);
  color: var(--color-white);
  box-shadow: var(--shadow-accent);
}

.kcc-btn--accent:hover {
  background: var(--kcc-magenta-dark);
}

.kcc-btn--whatsapp {
  background: var(--kcc-wa);
  color: var(--color-white);
}

.kcc-btn--whatsapp:hover {
  background: #1eb954;
}

.kcc-btn--outline {
  border-color: var(--color-border-strong);
  color: var(--kcc-navy);
  background: transparent;
}

.kcc-btn--outline:hover {
  border-color: var(--kcc-navy);
  background: var(--color-surface-2);
}

/* ── 10. ACCORDIONS (FAQ & CLINICAL STEPS) ────────────────────────────────── */
.kcc-accordion {
  border-bottom: 1px solid var(--color-border);
}

.kcc-accordion__trigger {
  width: 100%;
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--kcc-navy);
  cursor: pointer;
}

.kcc-accordion__content {
  padding-bottom: 1.25rem;
  color: var(--color-text-sub);
  line-height: 1.7;
}

/* ── 11. ACCESSIBILITY & PRINT STYLES ────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--kcc-magenta);
  outline-offset: 2px;
}

@media print {
  .kcc-anchor-nav, .whatsapp-float, .mobile-bar, #kcc-nav {
    display: none !important;
  }
}


/* ── 5. AI SUMMARY / KEY FACTS BOX (SEARCH SNIPPET OPTIMIZED) ─────────────── */
.ai-summary {
  background: var(--color-white);
  border: 1px solid var(--page-mid);
  border-left: 4px solid var(--page-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.ai-summary__title {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  color: var(--page-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ai-summary__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-summary__list li {
  font-size: 0.95rem;
  color: var(--color-text-sub);
  position: relative;
  padding-left: 1.25rem;
}

.ai-summary__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--page-accent);
  font-weight: 700;
}
