/* === Matoo Blog — Full Design System === */

/*
 * Google Fonts (DM Sans + Lora) are loaded via wp_enqueue_style() in functions.php.
 * Do NOT add an @import here — it would cause the fonts to be fetched twice,
 * adding unnecessary render-blocking latency.
 */

/* === Tokens === */
:root {
    --font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    --font-serif: 'Lora', ui-serif, Georgia, serif;
    --color-primary: #00A5E1;
    --color-primary-hover: #0090c5;
    --color-accent: #EF303E;
    --color-brand-orange: #FF4D4D;
    --color-brand-navy: #1A1D2F;
    --color-brand-cream: #FFF9F0;
    --border-rose: #F0C8CC;
    --color-muted: #4E7499;
    --color-text: #071828;
    --color-gold: #B38F00;
    --shadow-card: 0 4px 24px rgba(239,51,64,0.08);
    --shadow-card-hover: 0 12px 48px rgba(239,51,64,0.12);
    --radius-card: 20px;
    --radius-pill: 9999px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    background: #fff;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }

/* === Layout === */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 768px; margin: 0 auto; padding: 0 24px; }

/* === Header === */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #f3f4f6;
    transition: box-shadow 0.2s;
}
.site-header.is-scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.08); }
.header-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 24px;
    height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-logo img { width: 36px; height: 36px; object-fit: contain; }
.site-logo-text {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 700;
    color: #FFD500 !important;
    text-shadow:
        1px 1px 0 rgba(0,0,0,0.6),
        0 2px 6px rgba(0,0,0,0.4);
}
.primary-nav { display: flex; align-items: center; gap: 20px; }
.nav-link {
    font-size: 14px; font-weight: 600; color: #6b7280;
    transition: color 0.2s; white-space: nowrap;
}
.nav-link:hover { color: #111827; }
.nav-link--cta {
    background: var(--color-primary); color: #fff !important;
    padding: 8px 18px; border-radius: 9999px;
    font-weight: 700; font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,165,225,0.25);
    transition: background 0.2s, box-shadow 0.2s;
}
.nav-link--cta:hover { background: var(--color-primary-hover); box-shadow: 0 6px 16px rgba(0,165,225,0.35); }
.nav-toggle {
    display: none; background: none; border: none; cursor: pointer;
    width: 36px; height: 36px; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #374151; border-radius: 2px; transition: all 0.2s; }

/* === Reading Progress === */
.reading-progress {
    position: fixed; top: 0; left: 0; z-index: 100;
    height: 3px; width: 0; background: var(--color-primary);
    transition: width 0.1s linear;
}

/* === Footer === */
.site-footer { background: var(--color-brand-navy); color: #fff; padding: 64px 0 0; }
.footer-grid {
    max-width: 1280px; margin: 0 auto; padding: 0 24px;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 48px;
}
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.footer-logo img { width: 36px; height: 36px; object-fit: contain; }
.footer-logo-text { font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
.footer-tagline { color: #9ca3af; font-size: 14px; line-height: 1.7; }
.footer-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 20px; color: #fff; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-size: 14px; color: #9ca3af; font-weight: 500; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-newsletter-desc { font-size: 14px; color: #9ca3af; margin-bottom: 16px; }
.footer-bottom {
    max-width: 1280px; margin: 0 auto; padding: 24px 24px;
    margin-top: 48px; border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    font-size: 12px; color: #6b7280; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.footer-bottom a { color: #6b7280; transition: color 0.2s; }
.footer-bottom a:hover { color: #fff; }
.footer-bottom-links { display: flex; gap: 24px; }

/* === Buttons === */
.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-primary); color: #fff;
    padding: 10px 22px; border-radius: 9999px; font-weight: 700; font-size: 14px;
    border: none; cursor: pointer; transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0,165,225,0.25); text-decoration: none;
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: 0 6px 18px rgba(0,165,225,0.35); }
.btn-ghost {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: #374151; border: 1.5px solid #e5e7eb;
    padding: 10px 22px; border-radius: 9999px; font-weight: 600; font-size: 14px;
    cursor: pointer; transition: border-color 0.2s, color 0.2s; text-decoration: none;
}
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* === Hero (Blog Home) === */
.blog-hero {
    background: linear-gradient(to bottom, var(--color-brand-cream), #fff);
    padding: 80px 24px 60px; text-align: center;
}
.blog-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(0,165,225,0.1); border: 1px solid rgba(0,165,225,0.2);
    color: var(--color-primary); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    padding: 5px 14px; border-radius: 9999px; margin-bottom: 20px;
}
.blog-hero-title {
    font-family: var(--font-serif); font-size: clamp(36px, 5vw, 64px);
    font-weight: 700; color: var(--color-text); line-height: 1.1;
    letter-spacing: -1.5px; margin-bottom: 16px;
}
.blog-hero-title em { color: var(--color-primary); font-style: italic; }
.blog-hero-tagline { font-size: 18px; color: #6b7280; max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* === Category Pills === */
.category-section { padding: 32px 0; max-width: 1280px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.category-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #9ca3af; margin-bottom: 16px; }
.category-pills-wrap { display: flex; align-items: center; gap: 10px; }
.category-pills { display: flex; gap: 10px; overflow-x: auto; flex: 1; scrollbar-width: none; padding-bottom: 4px; }
.category-pills::-webkit-scrollbar { display: none; }
.pills-btn {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 9999px;
    border: 1.5px solid #e5e7eb; background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s; font-size: 14px; color: #6b7280;
}
.pills-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.filter-chip {
    white-space: nowrap; border-radius: 9999px; padding: 8px 18px;
    font-size: 13px; font-weight: 600; color: #6b7280;
    border: 1.5px solid #e5e7eb; background: #fff; cursor: pointer;
    transition: all 0.2s; text-decoration: none; display: inline-block;
}
.filter-chip:hover, .filter-chip.current-cat { color: var(--color-primary); border-color: rgba(0,165,225,0.4); background: rgba(0,165,225,0.06); }

/* === Post Grid === */
.post-grid-section { max-width: 1280px; margin: 0 auto; padding: 0 24px 80px; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; }
.section-title { font-family: var(--font-serif); font-size: 28px; font-weight: 700; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

/* === Post Card === */
.post-card {
    border-radius: var(--radius-card); overflow: hidden;
    border: 1px solid #f3f4f6; background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: 0 16px 48px rgba(0,0,0,0.1); transform: translateY(-3px); }
.post-card-thumb {
    position: relative; height: 200px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.post-card:hover .post-card-thumb img { transform: scale(1.06); }
.post-card-emoji { font-size: 72px; transition: transform 0.4s; }
.post-card:hover .post-card-emoji { transform: scale(1.1); }
/* Gradient fallbacks cycling (matches HomeEventCard.tsx) */
.card-gradient-1 { background: linear-gradient(135deg, #f87171, #fb923c); }
.card-gradient-2 { background: linear-gradient(135deg, #2dd4bf, #34d399); }
.card-gradient-3 { background: linear-gradient(135deg, #fb923c, #f59e0b); }
.card-gradient-4 { background: linear-gradient(135deg, #c084fc, #f472b6); }
.card-gradient-5 { background: linear-gradient(135deg, #6366f1, #9333ea); }
.card-gradient-6 { background: linear-gradient(135deg, #facc15, #86efac); }
.card-gradient-7 { background: linear-gradient(135deg, #38bdf8, #3b82f6); }
.card-gradient-8 { background: linear-gradient(135deg, #fb7185, #e879f9); }
.post-card-badge {
    position: absolute; top: 14px; left: 14px;
    background: rgba(255,255,255,0.9); backdrop-filter: blur(6px);
    border-radius: 6px; padding: 4px 10px;
    font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--color-primary);
}
.post-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.post-card-date { font-size: 12px; font-weight: 700; color: var(--color-primary); margin-bottom: 8px; }
.post-card-title {
    font-family: var(--font-serif); font-size: 20px; font-weight: 700;
    color: var(--color-text); margin-bottom: 10px; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    transition: color 0.2s;
}
.post-card:hover .post-card-title { color: var(--color-primary); }
.post-card-excerpt {
    font-size: 14px; color: #6b7280; line-height: 1.65; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 20px;
}
.post-card-divider { height: 1px; background: #f3f4f6; margin: 0 0 16px; }
.post-card-footer { display: flex; align-items: center; justify-content: space-between; }
.post-card-category {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 700; color: var(--color-primary);
    background: rgba(0,165,225,0.08); border: 1px solid rgba(0,165,225,0.2);
    padding: 4px 12px; border-radius: 9999px;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none; white-space: nowrap;
}
.post-card-category:hover { background: rgba(0,165,225,0.15); border-color: rgba(0,165,225,0.4); }
.post-card-read { font-size: 11px; font-weight: 700; color: #9ca3af; white-space: nowrap; }

/* === Single Post === */
.single-hero {
    position: relative; width: 100%; height: 420px; overflow: hidden;
    display: flex; align-items: flex-end; background: var(--color-brand-navy);
}
.single-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.single-hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(7,24,40,0.85) 0%, rgba(7,24,40,0.3) 60%, transparent 100%);
}
.single-hero-content { position: relative; z-index: 2; width: 100%; padding: 48px; max-width: 900px; }
.single-hero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(0,165,225,0.25); border: 1px solid rgba(0,165,225,0.4);
    color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    padding: 5px 14px; border-radius: 9999px; margin-bottom: 16px;
}
.single-hero-title {
    font-family: var(--font-serif); font-size: clamp(28px, 3.5vw, 48px);
    font-weight: 700; color: #fff; line-height: 1.15; letter-spacing: -1px;
}
/* Single no-image fallback */
.single-hero--no-image { background: linear-gradient(135deg, var(--color-brand-navy), #2d3561); }
.single-hero-meta {
    display: flex; align-items: center; gap: 20px; margin-top: 24px; flex-wrap: wrap;
}
.single-hero-meta-item { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 600; }
.share-btn {
    padding: 7px 18px; border-radius: 9999px; border: 1.5px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1); color: #fff; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.share-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.6); }

/* === Single Content Layout === */
.single-layout {
    max-width: 1280px; margin: 0 auto; padding: 64px 24px 80px;
    display: grid; grid-template-columns: 1fr 320px; gap: 64px; align-items: start;
}
.single-content { min-width: 0; }
.single-content h2 {
    font-family: var(--font-serif); font-size: 26px; font-weight: 700;
    color: var(--color-text); margin: 40px 0 16px; letter-spacing: -0.5px;
}
.single-content h3 { font-family: var(--font-serif); font-size: 21px; font-weight: 700; color: var(--color-text); margin: 32px 0 12px; }
.single-content h4 { font-size: 17px; font-weight: 700; color: var(--color-text); margin: 24px 0 8px; }
.single-content p { font-size: 16px; color: #2A4255; line-height: 1.85; margin-bottom: 20px; }
.single-content a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.single-content a:hover { color: var(--color-primary-hover); }
.single-content ul, .single-content ol { margin: 0 0 20px 24px; }
.single-content li { font-size: 16px; color: #2A4255; line-height: 1.75; margin-bottom: 6px; }
.single-content blockquote {
    border-left: 4px solid var(--color-gold); background: #FFFBE6;
    margin: 28px 0; padding: 20px 24px; border-radius: 0 12px 12px 0;
}
.single-content blockquote p { color: #5c4a00; font-style: italic; margin-bottom: 0; }
.single-content code {
    background: #f3f4f6; color: var(--color-accent);
    padding: 2px 6px; border-radius: 4px; font-size: 14px;
}
.single-content pre {
    background: #1e293b; color: #e2e8f0; padding: 24px; border-radius: 12px;
    overflow-x: auto; margin: 24px 0; font-size: 14px; line-height: 1.6;
}
.single-content pre code { background: none; color: inherit; padding: 0; }
.single-content img { border-radius: 12px; margin: 28px 0; }
.single-content hr { border: none; height: 1px; background: var(--border-rose); margin: 40px 0; }

/* === Sidebar === */
.single-sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 24px; }
.sidebar-card {
    background: #fff; border: 1.5px solid var(--border-rose);
    border-radius: 16px; padding: 24px;
}
.sidebar-card-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--color-gold); margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-card-title::after { content: ''; flex: 1; height: 1px; background: var(--border-rose); }
.toc { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.toc a { font-size: 13px; color: #6b7280; transition: color 0.2s; padding: 2px 0; display: block; }
.toc a:hover, .toc a.is-active { color: var(--color-primary); }
.toc a.is-active { font-weight: 600; }
.sidebar-cta-card {
    background: linear-gradient(135deg, var(--color-brand-cream), #fff);
    border: 1.5px solid var(--border-rose); border-radius: 16px; padding: 24px; text-align: center;
}
.sidebar-cta-emoji { font-size: 36px; margin-bottom: 10px; }
.sidebar-cta-title { font-family: var(--font-serif); font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.sidebar-cta-desc { font-size: 13px; color: #6b7280; margin-bottom: 16px; line-height: 1.5; }

/* === Section Label === */
.section-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    color: var(--color-gold); margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border-rose); }

/* === Pagination === */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 48px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 9999px;
    font-size: 14px; font-weight: 700; border: 1.5px solid #e5e7eb;
    transition: all 0.2s; color: #374151;
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .current { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* === Search === */
.search-form-wrap { max-width: 560px; margin: 0 auto 40px; }
.search-input-row { display: flex; gap: 10px; }
.search-input {
    flex: 1; padding: 12px 20px; border-radius: 9999px;
    border: 1.5px solid #e5e7eb; font-size: 15px; font-family: var(--font-sans);
    outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,165,225,0.12); }

/* === 404 === */
.error-page { text-align: center; padding: 100px 24px; }
.error-emoji { font-size: 72px; margin-bottom: 24px; }
.error-title { font-family: var(--font-serif); font-size: 40px; font-weight: 700; margin-bottom: 12px; }
.error-desc { font-size: 18px; color: #6b7280; margin-bottom: 32px; }
.error-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* === Animations === */
.animate-fade-up { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.animate-fade-up.is-visible { opacity: 1; transform: translateY(0); }
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* === Responsive === */
@media (max-width: 1024px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 36px; }
    .single-layout { grid-template-columns: 1fr; gap: 40px; }
    .single-sidebar { position: static; }
}
@media (max-width: 768px) {
    .single-hero { height: 300px; }
    .single-hero-content { padding: 28px; }
    .primary-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 20px 24px; border-bottom: 1px solid #f3f4f6; box-shadow: 0 8px 24px rgba(0,0,0,0.08); gap: 12px; }
    .primary-nav.is-open { display: flex; }
    .nav-toggle { display: flex; }
    .site-header { position: relative; }
}
@media (max-width: 640px) {
    .post-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .blog-hero { padding: 60px 20px 48px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* === Print === */
@media print {
    .site-header, .site-footer, .single-sidebar, .reading-progress, .share-btn { display: none !important; }
    .single-layout { grid-template-columns: 1fr; }
    .single-content { font-size: 12pt; }
    a { text-decoration: underline; }
}
