/* ==========================================================================
   Maleenha Guideon — Stylesheet
   Design DNA: D-01BDAF-04 (Archetype Structured Reference Hub)
   Color System: Color Warm Neutral Sage
   Typography: Type Large Modern Sans
   Layout System: Layout Zoned Sections
   ========================================================================== */

:root {
  /* Typography Tokens */
  --font-sans: 'Inter', 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: ui-serif, serif;
  --font-mono: ui-monospace, monospace;

  /* Color Palette — Color Warm Neutral Sage */
  --bg: #F9F8F6;
  --surface: #FFFFFF;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --accent: #2A5A4A;
  --border: #E5E0D8;
  --bg-muted: #F0EFEA;
  --interactive: #1E4236;

  /* Spacing Tokens */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;
  
  /* Containers */
  --max-width: 1200px;
  --radius: 4px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base & Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility: Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent);
  color: var(--surface);
  padding: 0.75rem 1.25rem;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--text-primary);
  letter-spacing: -0.03em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

p {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  max-width: 75ch;
}

p.lead {
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}

a:hover, a:focus {
  color: var(--interactive);
  text-decoration-thickness: 2px;
}

img, table, video, iframe, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Focus styles */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Header & Navigation — nav-sticky-compact
   ========================================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(249, 248, 246, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  width: 100%;
}

.header-inner {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-icon {
  width: 24px;
  height: 24px;
  fill: var(--accent);
  display: inline-block;
  flex-shrink: 0;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--bg-muted);
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  margin-left: 0.25rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  vertical-align: middle;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-links li {
  margin: 0;
  display: flex;
  align-items: center;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.4rem 0.35rem;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s ease;
  line-height: 1.3;
}

.nav-link:hover, .nav-link:focus {
  color: var(--accent);
  text-decoration: none;
}

.nav-link.active {
  color: var(--accent);
  font-weight: 800;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0.35rem;
  right: 0.35rem;
  height: 2px;
  background-color: var(--accent);
  border-radius: 1px;
}

.nav-cta-btn {
  background: var(--accent);
  color: var(--surface) !important;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none !important;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.nav-cta-btn:hover {
  background: var(--interactive);
  transform: translateY(-1px);
}

/* Mobile Nav Toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: var(--text-primary);
}

/* ==========================================================================
   Main & Section Layout — Layout Zoned Sections
   ========================================================================== */

main {
  flex: 1;
  width: 100%;
}

section {
  padding: var(--space-xl) 1.5rem;
  border-bottom: 1px solid var(--border);
}

section:nth-of-type(even) {
  background-color: var(--bg-muted);
}

section:nth-of-type(odd) {
  background-color: var(--bg);
}

.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-lg);
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ==========================================================================
   Hero Split Editorial System
   ========================================================================== */

.hero-split {
  padding: 0 !important;
  border-bottom: 1px solid var(--border);
  min-height: calc(100vh - 65px);
  display: flex;
}

.hero-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: calc(100vh - 65px);
}

.hero-content-col {
  padding: clamp(2rem, 6vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.hero-image-col {
  position: relative;
  overflow: hidden;
  background: var(--bg-muted);
}

.hero-image-col img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  background: rgba(26, 26, 26, 0.85);
  color: var(--surface);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius);
  backdrop-filter: blur(4px);
}

/* Page Header for Interior Pages */
.page-header {
  padding: clamp(2.5rem, 5vw, 4.5rem) 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
}

.breadcrumbs li {
  margin: 0;
}

.breadcrumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs span[aria-hidden="true"] {
  color: var(--border);
}

/* ==========================================================================
   Card System — Cards Featured Modular
   ========================================================================== */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent);
}

.card-text {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-footer {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--accent);
}

/* Featured Card with Shared Image */
.card-featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  overflow: hidden;
}

.card-featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 240px;
}

.card-featured-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==========================================================================
   Article System — Article Data Supported
   ========================================================================== */

article {
  max-width: 820px;
  margin: 0 auto;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.article-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.toc-box {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.toc-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.45rem;
}

.toc-list a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc-list a:hover {
  text-decoration: underline;
}

.pull-quote {
  font-size: 1.35rem;
  line-height: 1.45;
  font-weight: 600;
  font-style: italic;
  color: var(--accent);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.evidence-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.evidence-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   CTA System — Cta Inline Soft
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--surface);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--interactive);
  color: var(--surface);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: rgba(42, 90, 74, 0.08);
  color: var(--interactive);
}

.btn-soft {
  background-color: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-soft:hover {
  background-color: var(--surface);
  border-color: var(--accent);
}

.cta-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin: 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-banner-text h3 {
  margin-bottom: 0.5rem;
}

.cta-banner-text p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

/* ==========================================================================
   Accordion / FAQ System
   ========================================================================== */

.faq-group {
  margin-bottom: 2rem;
}

details.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

details.faq-item[open] {
  border-color: var(--accent);
}

summary.faq-question {
  padding: 1.25rem 1.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  color: var(--text-primary);
}

summary.faq-question::-webkit-details-marker {
  display: none;
}

summary.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s;
}

details.faq-item[open] summary.faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 1.5rem 1.25rem 1.5rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Forms & Checklists
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 90, 74, 0.15);
}

textarea {
  min-height: 130px;
  resize: vertical;
}

.form-feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  display: none;
}

.form-feedback.success {
  display: block;
  background: #E8F5E9;
  border: 1px solid #A5D6A7;
  color: #1B5E20;
}

.form-feedback.error {
  display: block;
  background: #FFEBEE;
  border: 1px solid #FFCDD2;
  color: #B71C1C;
}

/* Checklist items */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
  cursor: pointer;
}

.checklist-item:hover {
  border-color: var(--accent);
}

.checklist-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 0.2rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-content {
  flex-grow: 1;
}

.checklist-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.checklist-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Data Table Responsive */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th, td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-muted);
  font-weight: 700;
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Footer — footer-editorial
   ========================================================================== */

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 1.5rem var(--space-lg);
  margin-top: auto;
  width: 100%;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  max-width: 36ch;
}

.footer-col h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: 0.65rem;
}

.footer-col a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-col a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-disclaimer {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-legal-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-legal-links a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Responsive & Mobile Compact Reference
   ========================================================================== */

@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

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

  .hero-split-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-content-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hero-image-col {
    min-height: 400px;
  }
}

@media (max-width: 1400px) {
  .header-inner {
    padding: 0.65rem 1rem;
    gap: 0.75rem;
  }

  .nav-links {
    gap: 0.45rem;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 0.35rem 0.2rem;
  }

  .nav-cta-btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.75rem;
  }

  .brand-logo {
    font-size: 1.1rem;
  }
}

@media (max-width: 1280px) {
  .menu-toggle {
    display: inline-flex;
    order: 2;
  }

  .nav-cta-btn {
    display: none;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    font-size: 1rem;
    padding: 0.6rem 0.5rem;
    width: 100%;
    border-radius: var(--radius);
  }

  .nav-link:hover {
    background: var(--bg-muted);
  }

  .nav-link.active::after {
    display: none;
  }

  .nav-link.active {
    background: var(--bg-muted);
  }
}

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

  .card-featured {
    grid-column: span 1;
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cta-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
