/**
 * CREATESONLINE — WordPress-Inspired Headless CMS Theme
 * =====================================================
 * Clean, modern, SEO-friendly design system
 * Light mode default, Dark mode support
 * Mobile-first responsive design
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
    /* Brand Colors */
    --co-primary: var(--accent);
    --co-primary-hover: #1d4ed8;
    --co-primary-light: #dbeafe;
    --co-primary-50: #eff6ff;
    --co-secondary: var(--fg-muted);
    --co-accent: var(--warning);
    --co-accent-hover: var(--warning);
    --co-success: var(--success);
    --co-danger: var(--danger);

    /* Neutral Palette */
    --co-white: var(--bg);
    --co-gray-50: var(--surface);
    --co-gray-100: var(--surface);
    --co-gray-200: var(--border);
    --co-gray-300: var(--border-strong);
    --co-gray-400: var(--fg-subtle);
    --co-gray-500: var(--fg-muted);
    --co-gray-600: var(--fg-muted);
    --co-gray-700: var(--fg-muted);
    --co-gray-800: #1e293b;
    --co-gray-900: var(--fg);

    /* Background */
    --co-bg: var(--bg);
    --co-bg-alt: var(--surface);
    --co-bg-muted: var(--surface);
    --co-bg-dark: var(--fg);

    /* Text */
    --co-text: #1e293b;
    --co-text-secondary: var(--fg-muted);
    --co-text-muted: var(--fg-subtle);
    --co-text-inverse: var(--bg);
    --co-heading: var(--fg);

    /* Borders */
    --co-border: var(--border);
    --co-border-hover: var(--border-strong);

    /* Shadows */
    --co-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --co-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --co-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --co-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --co-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --co-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Typography */
    --co-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --co-font-serif: Georgia, 'Times New Roman', serif;
    --co-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --co-container: 1200px;
    --co-container-narrow: 780px;
    --co-container-wide: 1400px;
    --co-gutter: 1.5rem;

    /* Border Radius */
    --co-radius-sm: 0.375rem;
    --co-radius: 0.5rem;
    --co-radius-md: 0.75rem;
    --co-radius-lg: 1rem;
    --co-radius-xl: 1.5rem;
    --co-radius-full: 9999px;

    /* Transitions */
    --co-transition: 0.2s ease;
    --co-transition-slow: 0.3s ease;
}

/* Dark mode */
[data-theme="dark"],
.co-dark {
    --co-bg: var(--fg);
    --co-bg-alt: #1e293b;
    --co-bg-muted: var(--fg-muted);
    --co-text: var(--border);
    --co-text-secondary: var(--fg-subtle);
    --co-text-muted: var(--fg-muted);
    --co-heading: var(--surface);
    --co-border: var(--fg-muted);
    --co-border-hover: var(--fg-muted);
    --co-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --co-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--co-font-sans);
    color: var(--co-text);
    background: var(--co-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: var(--co-primary);
    text-decoration: none;
    transition: color var(--co-transition);
}

a:hover {
    color: var(--co-primary-hover);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--co-heading);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); margin-bottom: 0.5rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h5 { font-size: 1.125rem; margin-bottom: 0.5rem; }
h6 { font-size: 1rem; margin-bottom: 0.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--co-text-secondary);
}

/* ============================================
   LAYOUT — CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: var(--co-container);
    margin: 0 auto;
    padding: 0 var(--co-gutter);
}

.container--narrow {
    max-width: var(--co-container-narrow);
}

.container--wide {
    max-width: var(--co-container-wide);
}

/* ============================================
   SKIP LINK (Accessibility)
   ============================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--co-primary);
    color: var(--co-white);
    padding: 0.75rem 1.5rem;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 var(--co-radius) 0;
}
.skip-link:focus {
    top: 0;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--co-border);
    transition: box-shadow var(--co-transition);
}

.site-header.scrolled {
    box-shadow: var(--co-shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    max-width: var(--co-container-wide);
    margin: 0 auto;
    padding: 0 var(--co-gutter);
}

/* Logo / Brand */
.site-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--co-heading);
    flex-shrink: 0;
}

.site-brand__logo {
    width: 36px;
    height: 36px;
    border-radius: var(--co-radius);
}

.site-brand__name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-brand__tagline {
    font-size: 0.75rem;
    color: var(--co-text-muted);
    display: none;
}

/* Primary Navigation */
.primary-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.primary-nav__link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--co-text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--co-radius);
    transition: all var(--co-transition);
    white-space: nowrap;
}

.primary-nav__link:hover,
.primary-nav__link.active {
    color: var(--co-primary);
    background: var(--co-primary-50);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    color: var(--co-text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--co-radius);
    transition: all var(--co-transition);
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.nav-dropdown__trigger:hover {
    color: var(--co-primary);
    background: var(--co-primary-50);
}

.nav-dropdown__trigger::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform var(--co-transition);
}

.nav-dropdown:hover .nav-dropdown__trigger::after {
    transform: rotate(180deg);
}

.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: var(--co-bg);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-md);
    padding: 0.5rem;
    box-shadow: var(--co-shadow-lg);
    z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown__menu {
    display: block;
    animation: fadeInDown 0.2s ease;
}

.nav-dropdown__item {
    display: block;
    padding: 0.625rem 1rem;
    color: var(--co-text-secondary);
    font-size: 0.9375rem;
    border-radius: var(--co-radius);
    transition: all var(--co-transition);
}

.nav-dropdown__item:hover {
    color: var(--co-primary);
    background: var(--co-primary-50);
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--co-text);
    cursor: pointer;
    border-radius: var(--co-radius);
}

.mobile-menu-toggle:hover {
    background: var(--co-bg-muted);
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: background var(--co-transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    transition: transform var(--co-transition);
}

.hamburger::before { top: -7px; }
.hamburger::after { bottom: -7px; }

/* ============================================
   BREADCRUMBS (SEO-important)
   ============================================ */
.breadcrumbs {
    padding: 1rem 0;
    background: var(--co-bg-alt);
    border-bottom: 1px solid var(--co-border);
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    font-size: 0.875rem;
    max-width: var(--co-container);
    margin: 0 auto;
    padding: 0 var(--co-gutter);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--co-text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    color: var(--co-gray-400);
    font-size: 1rem;
}

.breadcrumb-item a {
    color: var(--co-text-secondary);
    transition: color var(--co-transition);
}

.breadcrumb-item a:hover {
    color: var(--co-primary);
}

.breadcrumb-item.active {
    color: var(--co-text);
    font-weight: 500;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--fg) 0%, #1e293b 50%, var(--fg-muted) 100%);
    color: var(--co-text-inverse);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero--light {
    background: var(--co-bg-alt);
    color: var(--co-text);
}

.hero--light .hero__title {
    color: var(--co-heading);
}

.hero--light .hero__subtitle {
    color: var(--co-text-secondary);
}

.hero--featured-image {
    background-size: cover;
    background-position: center;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero--featured-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.4));
}

.hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--co-container);
    margin: 0 auto;
    padding: 0 var(--co-gutter);
}

.hero__content {
    max-width: 720px;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.hero__category {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--co-primary);
    color: var(--co-white);
    border-radius: var(--co-radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero__date,
.hero__author {
    color: rgba(255, 255, 255, 0.7);
}

.hero--light .hero__date,
.hero--light .hero__author {
    color: var(--co-text-muted);
}

.hero__title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.03em;
}

.hero__subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--co-font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--co-radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--co-transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn--primary {
    background: var(--co-primary);
    color: var(--co-white);
    border-color: var(--co-primary);
}

.btn--primary:hover {
    background: var(--co-primary-hover);
    border-color: var(--co-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    color: var(--co-white);
}

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

.btn--secondary:hover {
    border-color: var(--co-primary);
    color: var(--co-primary);
    background: var(--co-primary-50);
}

.btn--ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--co-white);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--co-white);
}

.btn--accent {
    background: var(--co-accent);
    color: var(--co-white);
    border-color: var(--co-accent);
}

.btn--accent:hover {
    background: var(--co-accent-hover);
    border-color: var(--co-accent-hover);
    color: var(--co-white);
}

.btn--lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn--sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn--block {
    width: 100%;
}

/* ============================================
   CARDS (WordPress Post Cards)
   ============================================ */
.card {
    background: var(--co-bg);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-lg);
    overflow: hidden;
    transition: all var(--co-transition-slow);
}

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

.card__image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--co-bg-muted);
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__body {
    padding: 1.5rem;
}

.card__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--co-primary);
    margin-bottom: 0.5rem;
}

.card__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.card__title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--co-transition);
}

.card__title a:hover {
    color: var(--co-primary);
}

.card__excerpt {
    font-size: 0.9375rem;
    color: var(--co-text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--co-text-muted);
}

.card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.card__meta-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--co-radius-full);
    background: var(--co-primary-light);
    color: var(--co-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

.card__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--co-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card__read-more {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--co-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.card__read-more:hover {
    gap: 0.625rem;
}

/* Featured Card (first post emphasis) */
.card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.card--featured .card__image {
    aspect-ratio: auto;
    min-height: 320px;
}

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

.card--featured .card__title {
    font-size: 1.75rem;
}

/* Horizontal card */
.card--horizontal {
    display: grid;
    grid-template-columns: 280px 1fr;
}

.card--horizontal .card__image {
    aspect-ratio: auto;
}

/* ============================================
   GRID SYSTEM
   ============================================ */
.grid {
    display: grid;
    gap: 2rem;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--sidebar { grid-template-columns: 1fr 340px; gap: 3rem; }

@media (max-width: 1024px) {
    .grid--sidebar { grid-template-columns: 1fr; }
}

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

/* ============================================
   ARTICLE / POST CONTENT (Prose)
   ============================================ */
.article {
    max-width: var(--co-container-narrow);
    margin: 3rem auto;
    padding: 0 var(--co-gutter);
}

.article__header {
    margin-bottom: 2rem;
    text-align: center;
}

.article__category {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--co-primary);
    margin-bottom: 1rem;
}

.article__title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article__subtitle {
    font-size: 1.25rem;
    color: var(--co-text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.article__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9375rem;
    color: var(--co-text-muted);
    flex-wrap: wrap;
}

.article__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.article__featured-image {
    margin: 2rem 0;
    border-radius: var(--co-radius-lg);
    overflow: hidden;
}

.article__featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Prose typography */
.prose {
    color: var(--co-text);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.prose > * + * {
    margin-top: 1.25rem;
}

.prose h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--co-border);
}

.prose h3 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.prose h4 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
}

.prose p {
    color: var(--co-text);
    margin-bottom: 1.25rem;
}

.prose a {
    color: var(--co-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:hover {
    color: var(--co-primary-hover);
}

.prose img {
    border-radius: var(--co-radius);
    margin: 2rem 0;
    box-shadow: var(--co-shadow-sm);
}

.prose blockquote {
    border-left: 4px solid var(--co-primary);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--co-bg-alt);
    border-radius: 0 var(--co-radius) var(--co-radius) 0;
    font-style: italic;
    color: var(--co-text-secondary);
}

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

.prose li {
    margin-bottom: 0.5rem;
}

.prose pre {
    background: var(--co-gray-900);
    color: var(--co-gray-100);
    padding: 1.25rem;
    border-radius: var(--co-radius);
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 2rem 0;
}

.prose code {
    font-family: var(--co-font-mono);
    font-size: 0.875em;
    background: var(--co-bg-muted);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.prose th, .prose td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--co-border);
    text-align: left;
}

.prose th {
    background: var(--co-bg-alt);
    font-weight: 600;
}

.prose figure {
    margin: 2rem 0;
}

.prose figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--co-text-muted);
    margin-top: 0.75rem;
}

.prose hr {
    border: none;
    height: 1px;
    background: var(--co-border);
    margin: 3rem 0;
}

/* ============================================
   SIDEBAR (WordPress-like)
   ============================================ */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background: var(--co-bg);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-lg);
    padding: 1.5rem;
}

.widget__title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--co-heading);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--co-primary);
}

.widget__list {
    list-style: none;
}

.widget__list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--co-border);
}

.widget__list li:last-child {
    border-bottom: none;
}

.widget__list a {
    color: var(--co-text-secondary);
    font-size: 0.9375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.widget__list a:hover {
    color: var(--co-primary);
}

.widget__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--co-bg-muted);
    color: var(--co-text-secondary);
    border-radius: var(--co-radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--co-transition);
}

.tag:hover {
    background: var(--co-primary);
    color: var(--co-white);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 0;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    color: var(--co-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--co-transition);
}

.pagination__link:hover {
    border-color: var(--co-primary);
    color: var(--co-primary);
    background: var(--co-primary-50);
}

.pagination__link.active {
    background: var(--co-primary);
    border-color: var(--co-primary);
    color: var(--co-white);
}

.pagination__link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.pagination__ellipsis {
    color: var(--co-text-muted);
    padding: 0 0.25rem;
}

/* ============================================
   FOOTER (WordPress-like)
   ============================================ */
.site-footer {
    background: var(--co-gray-900);
    color: var(--co-gray-300);
    margin-top: auto;
}

.footer-main {
    padding: 4rem 0;
    max-width: var(--co-container-wide);
    margin: 0 auto;
    padding-left: var(--co-gutter);
    padding-right: var(--co-gutter);
}

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

.footer-brand__name {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--co-white);
    margin-bottom: 1rem;
}

.footer-brand__description {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--co-gray-400);
    margin-bottom: 1.5rem;
    max-width: 320px;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--co-radius);
    background: rgba(255, 255, 255, 0.08);
    color: var(--co-gray-400);
    transition: all var(--co-transition);
}

.footer-social__link:hover {
    background: var(--co-primary);
    color: var(--co-white);
}

.footer-col__title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--co-white);
    margin-bottom: 1.25rem;
}

.footer-col__list {
    list-style: none;
}

.footer-col__list li {
    margin-bottom: 0.75rem;
}

.footer-col__list a {
    color: var(--co-gray-400);
    font-size: 0.9375rem;
    transition: color var(--co-transition);
}

.footer-col__list a:hover {
    color: var(--co-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 0;
    max-width: var(--co-container-wide);
    margin: 0 auto;
    padding-left: var(--co-gutter);
    padding-right: var(--co-gutter);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom__text {
    font-size: 0.875rem;
    color: var(--co-gray-500);
}

.footer-bottom__links {
    display: flex;
    gap: 1.5rem;
}

.footer-bottom__links a {
    color: var(--co-gray-500);
    font-size: 0.875rem;
}

.footer-bottom__links a:hover {
    color: var(--co-gray-300);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 5rem 0;
}

.section--alt {
    background: var(--co-bg-alt);
}

.section--dark {
    background: var(--co-bg-dark);
    color: var(--co-text-inverse);
}

.section__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.section__eyebrow {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--co-primary);
    margin-bottom: 0.75rem;
}

.section__title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: 1rem;
}

.section__subtitle {
    font-size: 1.125rem;
    color: var(--co-text-secondary);
    line-height: 1.7;
}

/* ============================================
   CMS COMPONENTS
   ============================================ */
/* Gallery */
.cms-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.cms-gallery__item {
    border-radius: var(--co-radius);
    overflow: hidden;
    aspect-ratio: 1;
}

.cms-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.cms-gallery__item:hover img {
    transform: scale(1.1);
}

/* Media */
.cms-media {
    margin: 2rem 0;
    border-radius: var(--co-radius-lg);
    overflow: hidden;
}

.cms-media img,
.cms-media video {
    width: 100%;
}

/* Rich Text Container */
.cms-richtext {
    margin: 2rem 0;
}

/* JSON Grid / Feature Cards */
.cms-json-section {
    margin: 3rem 0;
}

.cms-json-section .section-title {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 2rem;
}

/* Component Wrappers */
.cms-component-wrapper,
.cms-components-list,
.cms-dynamic-zone {
    margin: 2rem 0;
}

/* Relation Links */
.cms-relation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.cms-relation a {
    padding: 0.5rem 1rem;
    background: var(--co-primary-50);
    color: var(--co-primary);
    border-radius: var(--co-radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.cms-relation a:hover {
    background: var(--co-primary);
    color: var(--co-white);
}

/* ============================================
   SEARCH
   ============================================ */
.search-form {
    display: flex;
    max-width: 400px;
}

.search-form__input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--co-border);
    border-right: none;
    border-radius: var(--co-radius) 0 0 var(--co-radius);
    font-size: 0.9375rem;
    font-family: var(--co-font-sans);
    background: var(--co-bg);
    color: var(--co-text);
    outline: none;
}

.search-form__input:focus {
    border-color: var(--co-primary);
    box-shadow: 0 0 0 3px var(--co-primary-light);
}

.search-form__btn {
    padding: 0.75rem 1.25rem;
    background: var(--co-primary);
    color: var(--co-white);
    border: 1px solid var(--co-primary);
    border-radius: 0 var(--co-radius) var(--co-radius) 0;
    cursor: pointer;
    font-weight: 600;
}

/* ============================================
   TABLE OF CONTENTS (SEO)
   ============================================ */
.toc {
    background: var(--co-bg-alt);
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius-lg);
    padding: 1.5rem;
    margin: 2rem 0;
}

.toc__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.toc__list {
    list-style: none;
    counter-reset: toc-counter;
}

.toc__list li {
    counter-increment: toc-counter;
    padding: 0.375rem 0;
}

.toc__list li::before {
    content: counter(toc-counter) ". ";
    color: var(--co-primary);
    font-weight: 600;
}

.toc__list a {
    color: var(--co-text-secondary);
    font-size: 0.9375rem;
}

.toc__list a:hover {
    color: var(--co-primary);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state__icon {
    font-size: 4rem;
    color: var(--co-gray-300);
    margin-bottom: 1.5rem;
}

.empty-state__title {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.empty-state__text {
    color: var(--co-text-muted);
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   ERROR PAGES
   ============================================ */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem var(--co-gutter);
}

.error-page__code {
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, var(--co-primary), var(--co-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.error-page__title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.error-page__text {
    color: var(--co-text-muted);
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--co-heading);
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--co-border);
    border-radius: var(--co-radius);
    font-size: 1rem;
    font-family: var(--co-font-sans);
    color: var(--co-text);
    background: var(--co-bg);
    transition: all var(--co-transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--co-primary);
    box-shadow: 0 0 0 3px var(--co-primary-light);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.py-8 { padding-top: 4rem; padding-bottom: 4rem; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Print styles for SEO/accessibility */
@media print {
    .site-header, .site-footer, .breadcrumbs, .sidebar, .pagination {
        display: none !important;
    }
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: var(--fg);
        background: var(--bg);
    }
    .article, .prose {
        max-width: 100%;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --co-gutter: 1.25rem;
    }
}

@media (max-width: 768px) {
    :root {
        --co-gutter: 1rem;
    }

    .primary-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Mobile menu open state */
    .mobile-nav-open .primary-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--co-bg);
        padding: 1.5rem;
        z-index: 999;
        border-top: 1px solid var(--co-border);
        overflow-y: auto;
    }

    .mobile-nav-open .primary-nav__link {
        padding: 0.875rem 1rem;
        font-size: 1.0625rem;
        border-bottom: 1px solid var(--co-border);
        border-radius: 0;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero__title {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }

    .section {
        padding: 3rem 0;
    }

    .footer-main {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    :root {
        --co-gutter: 0.75rem;
    }

    .hero__actions {
        flex-direction: column;
    }

    .btn--lg {
        width: 100%;
        justify-content: center;
    }
}
