/*
Theme Name: Agenda Creativa Theme
Theme URI: https://agendacreativa.com
Author: Agenda Creativa
Author URI: https://agendacreativa.com
Description: A modern, clean theme for Digital Atelier.
Version: 1.0.1
Text Domain: agenda-creativa-theme
*/

/* ===========================
   DESIGN TOKENS (MOBILE-FIRST)
   Dark mode is default
   =========================== */
:root {
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Space Grotesk', 'Inter', -apple-system, sans-serif;

    /* Dark theme (default) */
    --color-bg: #0c0e12;
    --color-surface: #151820;
    --color-surface-2: #1c2029;
    --color-surface-hover: #242833;
    --color-border: #2a2f3a;
    --color-border-subtle: #1e222b;
    --color-text: #d8dae0;
    --color-text-secondary: #8b90a0;
    --color-text-muted: #5c6070;
    --color-heading: #f0f1f4;
    --color-accent: #6366f1;
    --color-accent-soft: rgba(99, 102, 241, 0.15);
    --color-accent-hover: #818cf8;
    --color-accent-glow: rgba(99, 102, 241, 0.25);
    --color-green: #34d399;
    --color-green-soft: rgba(52, 211, 153, 0.12);
    --color-amber: #fbbf24;
    --color-pink: #f472b6;
    --color-terracotta: #c2704e;
    --color-terracotta-soft: rgba(194, 112, 78, 0.15);
    --color-sage: #7c9a72;
    --color-sage-soft: rgba(124, 154, 114, 0.15);
    --color-gold: #d4a853;
    --color-gold-soft: rgba(212, 168, 83, 0.15);
    --color-card-overlay: linear-gradient(180deg, transparent 30%, rgba(12, 14, 18, 0.85) 100%);
    --color-hero-gradient: linear-gradient(135deg, #151820 0%, #1a1040 50%, #151820 100%);

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--color-accent-glow);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.5);

    --transition-fast: 0.15s ease;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --max-width: 1200px;
    --gap: 16px;
}

/* Light theme */
[data-theme="light"] {
    /* Light Mode Overrides */
    --color-bg: #f3f4f6;
    --color-surface: #ffffff;
    --color-surface-2: #e5e7eb;
    --color-surface-hover: #f9fafb;
    --color-text: #1f2937;
    /* Renamed from --color-text-main to --color-text */
    --color-text-secondary: #4b5563;
    --color-text-muted: #9ca3af;
    --color-heading: #111827;
    --color-border: #e5e7eb;
    --color-border-subtle: #f3f4f6;

    /* Header specific for Light Mode */
    --header-bg: rgba(255, 255, 255, 0.85);
    --header-text: #111827;

    --color-accent: #4f46e5;
    --color-accent-soft: rgba(79, 70, 229, 0.1);
    --color-accent-hover: #6366f1;
    --color-accent-glow: rgba(79, 70, 229, 0.15);
    --color-terracotta: #a85d3e;
    --color-terracotta-soft: rgba(168, 93, 62, 0.12);
    --color-sage: #5c7d52;
    --color-sage-soft: rgba(92, 125, 82, 0.12);
    --color-gold: #b8912e;
    --color-gold-soft: rgba(184, 145, 46, 0.12);
    --color-card-overlay: linear-gradient(180deg, transparent 30%, rgba(255, 255, 255, 0.9) 100%);
    --color-hero-gradient: linear-gradient(135deg, #f5f5f7 0%, #e8e0f0 50%, #f5f5f7 100%);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
}

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

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

body {
    font-family: var(--font-main);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Heading font */
h1,
h2,
h3,
.font-heading {
    font-family: var(--font-heading);
}

/* Grain texture overlay (dark mode only) */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.025;
    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)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px;
}

[data-theme="light"] body::after {
    opacity: 0.015;
}

/* ===========================
   SCROLL ANIMATIONS
   CSS-first, triggered by IntersectionObserver
   =========================== */
.animate-fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

.animate-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-in {
    opacity: 0;
    transition: opacity 0.7s var(--ease-out-expo);
}

.animate-fade-in.is-visible {
    opacity: 1;
}

.animate-scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-spring);
}

.animate-scale-in.is-visible {
    opacity: 1;
    transform: scale(1);
}

.animate-slide-right {
    opacity: 0;
    transform: translateX(-32px);
    transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.animate-slide-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered children */
.stagger-children>* {
    transition-delay: calc(var(--i, 0) * 0.08s);
}

.stagger-children>*:nth-child(1) {
    --i: 0;
}

.stagger-children>*:nth-child(2) {
    --i: 1;
}

.stagger-children>*:nth-child(3) {
    --i: 2;
}

.stagger-children>*:nth-child(4) {
    --i: 3;
}

.stagger-children>*:nth-child(5) {
    --i: 4;
}

.stagger-children>*:nth-child(6) {
    --i: 5;
}

.stagger-children>*:nth-child(7) {
    --i: 6;
}

.stagger-children>*:nth-child(8) {
    --i: 7;
}

.stagger-children>*:nth-child(9) {
    --i: 8;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {

    .animate-fade-up,
    .animate-fade-in,
    .animate-scale-in,
    .animate-slide-right {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* ===========================
   HEADER (Mobile-first)
   =========================== */
#site-header {
    background: rgba(var(--color-surface-rgb, 21, 24, 32), 0.85);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    transition: height 0.3s var(--ease-out-expo), box-shadow 0.3s ease;
}

#site-header.is-scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 12px;
    transition: height 0.3s var(--ease-out-expo);
}

#site-header.is-scrolled .header-inner {
    height: 48px;
}

.site-branding a,
.site-title-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-heading);
    font-weight: 700;
    font-size: 1em;
    white-space: nowrap;
}

.site-logo-icon {
    background: linear-gradient(135deg, var(--color-accent), #a855f7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: 800;
    flex-shrink: 0;
}

/* Hide site name on small screens, keep AC logo icon only */
@media (max-width: 768px) {
    .site-title {
        display: none;
    }
}

/* Nav hidden on mobile */
.main-navigation {
    display: none;
}

/* --- LEVEL 1: Top bar items --- */
.main-navigation>ul {
    list-style: none;
    display: flex;
    gap: 2px;
    align-items: center;
}

.main-navigation>ul>li {
    position: relative;
}

.main-navigation>ul>li>a {
    color: var(--color-text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    font-weight: 500;
    transition: color var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* Animated underline */
.main-navigation>ul>li>a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease-out-expo);
}

.main-navigation>ul>li>a:hover::after,
.main-navigation>ul>li.current-menu-item>a::after,
.main-navigation>ul>li.current-menu-parent>a::after {
    transform: scaleX(1);
}

.main-navigation>ul>li.current-menu-item>a,
.main-navigation>ul>li.current-menu-parent>a {
    color: var(--color-heading);
}

.main-navigation>ul>li>a:hover,
.main-navigation>ul>li:hover>a {
    color: var(--color-heading);
    background: var(--color-surface-hover);
}

/* Arrow indicator for items with children */
.main-navigation>ul>li.menu-item-has-children>a::after {
    content: '▾';
    font-size: 0.65em;
    opacity: 0.5;
    margin-left: 2px;
}

/* --- LEVEL 2: Dropdown --- */
.main-navigation ul ul {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: 1000;
}

.main-navigation>ul>li:hover>ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-navigation ul ul li a {
    display: block;
    padding: 8px 14px;
    color: var(--color-text);
    font-size: 0.85em;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: var(--transition-fast);
}

.main-navigation ul ul li a:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
}

/* Arrow for sub-items with children */
.main-navigation ul ul li.menu-item-has-children>a::after {
    content: '›';
    float: right;
    font-size: 1.1em;
    opacity: 0.4;
}

/* --- LEVEL 3: Flyout sub-sub-menu --- */
.main-navigation ul ul ul {
    top: -6px;
    left: 100%;
    margin-left: 4px;
}

.main-navigation ul ul li:hover>ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Separator between groups */
.main-navigation ul ul li.menu-item-has-children {
    border-bottom: 1px solid var(--color-border-subtle);
    margin-bottom: 4px;
    padding-bottom: 4px;
}

/* GTranslate — hide floating widget visually but keep in DOM for JS */
#gt_float_wrapper {
    position: fixed !important;
    left: -9999px !important;
    top: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

body>.gtranslate_wrapper,
.header-actions .gtranslate_wrapper {
    display: none !important;
}

/* Language dropdown (triggered by globe button) */
.ac-lang-dropdown {
    position: fixed;
    z-index: 10000;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 160px;
    max-height: 260px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.ac-lang-dropdown.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ac-lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.85em;
    font-family: var(--font-main);
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}

.ac-lang-item:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
}

.ac-lang-item.is-active {
    color: var(--color-accent);
    font-weight: 600;
}

.ac-lang-item img {
    border-radius: 2px;
    flex-shrink: 0;
}

/* Globe button active state */
#lang-toggle.is-active {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.switcher {
    font-family: var(--font-main);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-cta {
    background: var(--color-accent);
    color: #fff !important;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8em;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
}

.header-cta:hover {
    background: var(--color-accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Theme Toggle */
.theme-toggle {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
    border-color: var(--color-accent);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.4em;
    cursor: pointer;
    padding: 4px;
    display: flex;
}

/* ===========================
   MOBILE NAV DRAWER
   =========================== */
/* ===========================
   MOBILE NAV DRAWER (Full screen)
   =========================== */
.mobile-nav {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: rgba(var(--color-bg-rgb, 12, 14, 18), 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out-expo), visibility 0.4s;
}

.mobile-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mobile-nav li {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo);
}

.mobile-nav.is-open li {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for mobile menu items */
.mobile-nav.is-open li:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-nav.is-open li:nth-child(2) {
    transition-delay: 0.15s;
}

.mobile-nav.is-open li:nth-child(3) {
    transition-delay: 0.2s;
}

.mobile-nav.is-open li:nth-child(4) {
    transition-delay: 0.25s;
}

.mobile-nav.is-open li:nth-child(5) {
    transition-delay: 0.3s;
}

.mobile-nav.is-open li:nth-child(6) {
    transition-delay: 0.35s;
}

.mobile-nav li a {
    display: block;
    font-family: var(--font-heading);
    font-size: 2em;
    font-weight: 700;
    color: var(--color-heading);
    transition: color 0.2s ease;
}

.mobile-nav li a:hover {
    color: var(--color-accent);
    transform: scale(1.05);
}

.mobile-search {
    margin-bottom: 40px;
    width: 100%;
    max-width: 320px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s var(--ease-out-expo);
}

.mobile-nav.is-open .mobile-search {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.mobile-search .search-input {
    width: 100%;
    padding: 16px;
    border-radius: 50px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.1em;
    text-align: center;
}

/* Hide toggle on desktop */
@media (min-width: 960px) {
    .mobile-menu-toggle {
        display: none;
    }

    .mobile-nav {
        display: none !important;
    }
}

/* ===========================
   HERO (Mobile-first)
   =========================== */
.hero-section {
    background: var(--color-hero-gradient);
    padding: 48px 16px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, var(--color-accent-glow) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes heroGlow {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(5%, -5%);
    }
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid var(--color-accent-glow);
}

.hero-section h1,
.hero-title-gradient {
    font-size: 2em;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 14px;
    background: linear-gradient(135deg, var(--color-heading) 0%, var(--color-accent) 50%, var(--color-terracotta) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Hero ambient orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(80px);
    opacity: 0.3;
}

.hero-orb--1 {
    width: 300px;
    height: 300px;
    background: var(--color-accent);
    top: -80px;
    left: -60px;
    animation: orbFloat1 10s ease-in-out infinite alternate;
}

.hero-orb--2 {
    width: 250px;
    height: 250px;
    background: var(--color-terracotta);
    bottom: -60px;
    right: -40px;
    animation: orbFloat2 12s ease-in-out infinite alternate;
}

@keyframes orbFloat1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.15);
    }
}

@keyframes orbFloat2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-30px, -20px) scale(1.1);
    }
}

.hero-subtitle {
    font-size: 0.95em;
    color: var(--color-text-secondary);
    margin: 0 0 28px;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-bottom: 32px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 280px;
}

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

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

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

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
}

.hero-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stats .stat strong {
    font-size: 1.4em;
    color: var(--color-heading);
    font-weight: 800;
}

.hero-stats .stat span {
    font-size: 0.7em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* ===========================
   TOOLS STRIP (Mobile-first)
   =========================== */
.tools-strip {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 16px;
    border-bottom: 1px solid var(--color-border-subtle);
}

/* Tools carousel: horizontal scroll on mobile, grid on desktop */
.tools-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.tools-carousel::-webkit-scrollbar {
    height: 4px;
}

.tools-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.tools-carousel::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--color-text);
    transition: transform 0.35s var(--ease-out-expo), box-shadow 0.35s var(--ease-out-expo), border-color 0.35s ease;
    min-width: 200px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.tool-card:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 0 24px var(--color-accent-glow), var(--shadow-md);
    color: var(--color-heading);
}

.tool-card:hover .tool-card-icon {
    animation: iconWiggle 0.5s var(--ease-spring);
}

@keyframes iconWiggle {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(8deg);
    }
}

.tool-card-icon {
    font-size: 1.6em;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-2);
    border-radius: var(--radius-sm);
}

.tool-card strong {
    display: block;
    font-size: 0.88em;
    margin-bottom: 1px;
    color: var(--color-heading);
}

.tool-card-desc {
    font-size: 0.75em;
    color: var(--color-text-muted);
}

/* ===========================
   SECTION HEADERS
   =========================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0;
    color: var(--color-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-count {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-size: 0.55em;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.see-all-link {
    font-size: 0.82em;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    transition: var(--transition-fast);
}

.see-all-link:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
}

/* ===========================
   CONTENT LAYOUT (Mobile-first)
   =========================== */
#app-container {
    background: transparent;
    box-shadow: none;
    padding: 0;
    max-width: none;
    min-height: auto;
}

.content-layout {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ===========================
   CATEGORY SECTIONS
   =========================== */
.category-section {
    margin-bottom: 16px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--color-border-subtle);
}

.category-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ===========================
   POST CARDS - Magazine Style (Mobile-first)
   =========================== */
.post-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Center orphans */
    gap: var(--gap);
}

.post-card {
    flex: 1 1 100%;
    /* Default mobile: full width */
    max-width: 100%;
}

.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.post-card:hover {
    border-color: hsl(var(--cat-hue, 245) 60% 60%);
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
}

.post-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-2);
    position: relative;
}

.post-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.post-card:hover .post-thumb::after {
    opacity: 1;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.post-card:hover .post-thumb img {
    transform: scale(1.06);
}

.post-card:hover .post-thumb img {
    transform: scale(1.06);
}

/* --- Text excerpt placeholder (no featured image) --- */
.post-thumb--text {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 20px;
    background: linear-gradient(135deg,
            hsl(var(--card-hue, 245) 30% 18%) 0%,
            hsl(var(--card-hue, 245) 40% 12%) 100%);
    position: relative;
    overflow: hidden;
}

.thumb-excerpt {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .post-thumb--text {
    background: linear-gradient(135deg,
            hsl(var(--card-hue, 245) 40% 92%) 0%,
            hsl(var(--card-hue, 245) 50% 85%) 100%);
}

.post-thumb--text::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: hsl(var(--card-hue, 245) 50% 50% / 0.15);
    border: 2px solid hsl(var(--card-hue, 245) 50% 50% / 0.2);
}

.thumb-excerpt {
    font-size: 0.82em;
    line-height: 1.55;
    color: hsl(var(--card-hue, 245) 15% 70%);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
    letter-spacing: 0.01em;
}

[data-theme="light"] .thumb-excerpt {
    color: hsl(var(--card-hue, 245) 20% 35%);
}

.post-card-body {
    padding: 16px;
}

.post-card-category {
    display: inline-block;
    background: hsl(var(--cat-hue, 245) 60% 55% / 0.15);
    color: hsl(var(--cat-hue, 245) 60% 60%);
    padding: 3px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.65em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}

.post-card-title {
    margin: 0 0 8px;
    font-size: 0.95em;
    font-weight: 650;
    line-height: 1.4;
}

.post-card-title a {
    color: var(--color-heading);
    transition: color var(--transition-fast);
}

.post-card-title a:hover {
    color: hsl(var(--cat-hue, 245) 60% 60%);
}

.post-card-excerpt {
    font-size: 0.82em;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    gap: 6px;
    font-size: 0.72em;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ===========================
   LAYOUT VARIANTS
   =========================== */

/* --- FEATURED: 1 big + 2 small --- */
.layout-featured .post-card:first-child {
    grid-column: 1 / -1;
}

/* --- LIST: horizontal row cards --- */
.layout-list {
    grid-template-columns: 1fr !important;
}

.layout-list .post-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: center;
}

.layout-list .post-card .post-thumb {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    height: 100%;
}

.layout-list .post-card .post-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
}

/* --- GRID: equal cards, no special first --- */
.layout-grid .post-card--featured {
    grid-column: auto;
}

/* --- SPOTLIGHT: big hero card, 2 smaller below --- */
.layout-spotlight .post-card--featured {
    grid-column: 1 / -1;
}

.layout-spotlight .post-card--featured .post-thumb {
    aspect-ratio: 21 / 9;
}

.layout-spotlight .post-card--featured .post-card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.layout-spotlight .post-card--featured .post-card-category {
    background: hsl(var(--cat-hue, 245) 60% 55% / 0.3);
}

.layout-spotlight .post-card--featured .post-card-title a {
    color: #fff;
}

.layout-spotlight .post-card--featured .post-card-meta {
    color: rgba(255, 255, 255, 0.6);
}

.layout-spotlight .post-card--featured .post-card-excerpt {
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================
   SIDEBAR (Mobile-first)
   =========================== */
#secondary-sidebar {
    order: 2;
}

.sidebar-widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.widget-title {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--color-heading);
}

.tool-list {
    list-style: none;
    margin: 0 0 14px;
}

.tool-list li {
    margin-bottom: 2px;
}

.tool-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.88em;
    font-weight: 500;
    transition: var(--transition-fast);
}

.tool-list li a:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
}

.tool-icon {
    font-size: 1.1em;
}

/* ===========================
   FOOTER & NEWSLETTER
   =========================== */
.footer-support-section {
    padding: 60px 24px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.newsletter-section {
    padding: 80px 24px;
    background: var(--color-surface-2);
    border-top: 1px solid var(--color-border);
}

.newsletter-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-text h3 {
    font-size: 1.8em;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--color-heading);
}

.newsletter-text p {
    color: var(--color-text-secondary);
    margin-bottom: 32px;
    font-size: 1.1em;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.newsletter-input {
    flex: 1;
    min-width: 240px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1em;
}

#site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 60px 24px 40px;
    font-size: 0.95em;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}

.footer-brand {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--color-heading);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--color-text-secondary);
    font-weight: 500;
}

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

.footer-social {
    display: flex;
    gap: 16px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}

.social-icon:hover {
    transform: scale(1.15) rotate(-5deg);
    background: var(--color-surface-hover);
    color: var(--color-heading);
    border-color: var(--color-accent);
}

.footer-copy {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85em;
    padding-top: 40px;
    border-top: 1px solid var(--color-border-subtle);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: all 0.4s var(--ease-spring);
    z-index: 900;
}

.back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-4px);
    background: var(--color-surface-hover);
    color: var(--color-accent);
    box-shadow: var(--shadow-lg);
}

/* Cookie Consent */
.cookie-consent {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 9990;
    /* High but below GTranslate usually */
    animation: slideUp 0.5s ease-out;
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-consent-text {
    margin: 0;
    font-size: 0.9em;
}

.cookie-consent-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cookie-consent-link {
    font-size: 0.85em;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .footer-brand,
    .footer-links,
    .footer-social {
        justify-content: center;
    }
}

/* ===========================
   SINGLE POST - ARTICLE HERO
   =========================== */
/* ===========================
   ARTICLE HERO
   =========================== */
.article-hero {
    background: var(--color-hero-gradient);
    padding: 120px 24px 64px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Ambient glow in hero */
.article-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, hsl(var(--cat-hue, 245) 80% 60% / 0.15) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.article-hero-inner {
    max-width: 840px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.article-breadcrumbs {
    justify-content: center;
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-weight: 500;
}

.article-breadcrumbs a {
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

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

.bc-sep {
    opacity: 0.4;
}

.bc-current {
    color: var(--color-text-muted);
}

.article-hero-meta-top {
    margin-bottom: 16px;
}

.article-title {
    font-size: 2.8em;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-heading);
    margin: 0 0 32px;
    letter-spacing: -0.02em;
}

.article-hero-meta {
    display: flex;
    justify-content: center;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--color-surface);
    padding: 8px 16px 8px 8px;
    border-radius: 50px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.author-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.author-name {
    font-weight: 700;
    font-size: 0.9em;
    color: var(--color-heading);
    display: block;
}

.article-date-reading {
    font-size: 0.8em;
    color: var(--color-text-muted);
}

@media (max-width: 600px) {
    .article-hero {
        padding: 96px 16px 40px;
    }

    .article-title {
        font-size: 2em;
    }
}

/* Featured image (inside content column) */
.article-featured-image {
    margin: 0 0 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-lg);
}

/* ===========================
   SINGLE POST - 3-COLUMN LAYOUT
   =========================== */
.article-layout {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Sidebars hidden on mobile */
.article-sidebar--left {
    display: none;
}

.article-sidebar--right {
    order: 2;
}

.sidebar-sticky {
    position: relative;
}

/* ===========================
   SINGLE POST - ARTICLE CONTENT
   =========================== */
.article-content-wrap {
    min-width: 0;
    order: 1;
}

/* ===========================
   ARTICLE CONTENT
   =========================== */
.entry-content {
    font-size: 1.125em;
    line-height: 1.8;
    color: var(--color-text);
}

.entry-content p {
    margin-bottom: 1.5em;
}

/* Drop cap for first letter of first paragraph */
.entry-content>p:first-of-type::first-letter {
    float: left;
    font-size: 3.5em;
    line-height: 0.7;
    font-weight: 800;
    margin-right: 0.15em;
    margin-top: 0.1em;
    color: var(--color-accent);
    font-family: var(--font-heading);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    color: var(--color-heading);
    margin: 2em 0 0.8em;
    position: relative;
    scroll-margin-top: 100px;
    /* For sticky header anchor */
}

.entry-content h2 {
    font-size: 1.75em;
    letter-spacing: -0.01em;
}

.entry-content h3 {
    font-size: 1.4em;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}

.entry-content li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

.entry-content li::marker {
    color: var(--color-accent);
    font-weight: bold;
}

.entry-content blockquote {
    margin: 2em 0;
    padding: 24px 32px;
    border-left: 4px solid var(--color-accent);
    background: var(--color-surface-2);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 1.1em;
    font-style: italic;
    color: var(--color-heading);
}

.entry-content img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 2em 0;
}

.entry-content figure {
    margin: 2em 0;
}

.entry-content figcaption {
    text-align: center;
    font-size: 0.85em;
    color: var(--color-text-muted);
    margin-top: 16px;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 56px;
    /* Below header */
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-terracotta));
    z-index: 998;
    transition: width 0.1s linear;
}

/* Scrolled header logic adjustments */
#site-header.is-scrolled~.reading-progress {
    top: 48px;
}

.entry-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

/* ===========================
   ARTICLE TAGS
   =========================== */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.tag-badge {
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid var(--color-border);
    transition: var(--transition-fast);
}

.tag-badge:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ===========================
   AUTHOR BIO CARD
   =========================== */
.author-bio-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin: 24px 0;
}

.author-bio-avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.author-bio-label {
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    font-weight: 600;
}

.author-bio-name {
    margin: 2px 0 6px;
    font-size: 1em;
    color: var(--color-heading);
}

.author-bio-desc {
    font-size: 0.88em;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ===========================
   SEARCH OVERLAY
   =========================== */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.search-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-inner {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    width: 100%;
    max-width: 600px;
    position: relative;
    box-shadow: var(--shadow-lg), 0 0 100px rgba(0, 0, 0, 0.5);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.4s var(--ease-spring);
}

.search-overlay.is-active .search-overlay-inner {
    transform: scale(1) translateY(0);
}

/* ===========================
   PAGE TRANSITIONS
   =========================== */
body {
    transition: opacity 0.3s ease;
}

body.page-is-changing {
    opacity: 0;
    pointer-events: none;
}

#main-content {
    animation: pageEnter 0.6s var(--ease-out-expo) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   SHARE BUTTONS
   =========================== */
.share-buttons {
    display: flex;
    gap: 8px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    transition: transform 0.3s var(--ease-spring), background 0.2s ease, color 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
    font-size: 1.1em;
}

.share-btn:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #fff;
    border-color: transparent;
}

.share-btn--twitter:hover {
    background: #000000;
}

.share-btn--facebook:hover {
    background: #1877F2;
}

.share-btn--pinterest:hover {
    background: #E60023;
}

.share-btn--linkedin:hover {
    background: #0077b5;
}

.share-btn--copy:hover {
    background: var(--color-success, #10b981);
}

.share-btn.is-copied {
    background: var(--color-success, #10b981);
    color: #fff;
    transform: scale(1);
    border-color: transparent;
}

/* ===========================
   SIDEBARS (Sticky & Scrollable)
   =========================== */
.sidebar-sticky {
    position: sticky;
    top: 90px;
    /* Below header */
    max-height: calc(100vh - 110px);
    /* Fit within viewport */
    overflow-y: auto;
    /* Independent scrolling */
    padding-right: 8px;
    /* Space for scrollbar */
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: var(--color-border) transparent;
}

.sidebar-sticky::-webkit-scrollbar {
    width: 4px;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background-color: var(--color-border);
    border-radius: 4px;
}

.article-sidebar {
    height: 100%;
    /* Ensure full height for sticky context */
}

/* ===========================
   READER MODE (Phase 9)
   =========================== */
[data-reader-mode="true"] {
    --color-bg: #fdf6e3;
    /* Solarized Light / Sepia */
    --color-surface: #fdf6e3;
    --color-surface-2: #eee8d5;
    --color-text: #586e75;
    --color-heading: #b58900;
    /* Warm Accent */
    --color-border: #e0d6c0;

    --header-bg: rgba(253, 246, 227, 0.95);
}

[data-reader-mode="true"] body {
    background-image: none;
    /* Remove texture */
}

/* Hide distractions in reader mode - DISABLED for Free Tier (moved to Pro)
[data-reader-mode="true"] .article-sidebar,
[data-reader-mode="true"] .site-footer,
[data-reader-mode="true"] .article-hero-meta-top,
[data-reader-mode="true"] .related-section,
[data-reader-mode="true"] .comments-area {
    display: none !important;
}
*/

/* Center content in reader mode - DISABLED for Free Tier
[data-reader-mode="true"] .article-layout {
    grid-template-columns: 1fr;
    max-width: 740px;
    margin: 0 auto;
}
*/

/*
[data-reader-mode="true"] .article-content-wrap {
    box-shadow: none;
    background: transparent;
    border: none;
    padding: 0;
}

[data-reader-mode="true"] .article-title {
    font-size: 3em;
    text-align: center;
    color: #b58900;
}
*/

[data-reader-mode="true"] p {
    font-size: 1.25rem;
    line-height: 1.8;
}

/* ===========================
   TOOLPAD TEMPLATE (Phase 7)
   =========================== */
.toolpad-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: var(--color-bg);
}

.toolpad-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 800px;
    overflow: hidden;
    position: relative;
}

.toolpad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--color-hero-gradient);
}

.toolpad-header {
    padding: 32px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--color-surface-2);
}

.toolpad-icon {
    font-size: 2.5em;
}

.toolpad-title {
    font-size: 1.8em;
    margin: 0;
    flex: 1;
    font-family: var(--font-heading);
}

.toolpad-actions {
    display: flex;
    gap: 8px;
}

.toolpad-body {
    padding: 32px;
}

.toolpad-footer {
    padding: 16px 32px;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.8em;
    color: var(--color-text-muted);
}

@media print {
    .toolpad-layout {
        padding: 0;
        background: #fff;
    }

    .toolpad-card {
        box-shadow: none;
        border: none;
        max-width: 100%;
    }

    .toolpad-actions,
    .toolpad-footer {
        display: none;
    }

    #site-header,
    #site-footer {
        display: none;
    }
}

/* ===========================
   TYPOGRAPHY
   =========================== */
/* ===========================
   PATTERN SHEET MODE (Phase 7)
   =========================== */
.pattern-sheet-mode .entry-content ul {
    background: var(--color-surface-2);
    padding: 24px 24px 24px 40px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
    list-style-type: none;
}

.pattern-sheet-mode .entry-content ul li {
    position: relative;
    margin-bottom: 12px;
    padding-left: 24px;
}

.pattern-sheet-mode .entry-content ul li::before {
    content: '☐';
    position: absolute;
    left: 0;
    color: var(--color-terracotta);
    font-weight: bold;
}

.pattern-sheet-mode .entry-content ol {
    counter-reset: pattern-step;
    list-style: none;
    padding: 0;
}

.pattern-sheet-mode .entry-content ol li {
    counter-increment: pattern-step;
    margin-bottom: 32px;
    position: relative;
    padding-left: 50px;
}

.pattern-sheet-mode .entry-content ol li::before {
    content: counter(pattern-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
}

.pattern-badge {
    margin-bottom: 32px;
}

/* ===========================
   FOOTER
   =========================== */
/* ===========================
   TOC WIDGET
   =========================== */
.article-toc a {
    display: block;
    padding: 5px 0;
    font-size: 0.82em;
    color: var(--color-text-secondary);
    border-left: 2px solid transparent;
    padding-left: 12px;
    transition: var(--transition-fast);
}

.article-toc a:hover,
.article-toc a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}

.article-toc a.toc-h3 {
    padding-left: 24px;
    font-size: 0.78em;
}

.toc-placeholder {
    font-size: 0.8em;
    color: var(--color-text-muted);
    font-style: italic;
}

/* ===========================
   RELATED POSTS SIDEBAR
   =========================== */
.related-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.related-post-item {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-subtle);
    color: var(--color-text);
    transition: var(--transition-fast);
}

.related-post-item:hover {
    color: var(--color-heading);
}

.related-post-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--color-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-thumb--text {
    font-size: 1.4em;
}

.related-post-title {
    font-size: 0.82em;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.related-post-date {
    font-size: 0.7em;
    color: var(--color-text-muted);
}

/* ===========================
   CATEGORY TAGS (SIDEBAR)
   =========================== */
.category-tags-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cat-tag-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78em;
    font-weight: 500;
    border: 1px solid var(--color-border);
    transition: var(--transition-fast);
}

.cat-tag-link:hover {
    background: var(--color-accent-soft);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.cat-tag-count {
    font-size: 0.85em;
    opacity: 0.5;
}

/* ===========================
   TOOLS PROMO WIDGET
   =========================== */
.tools-promo-widget {
    background: linear-gradient(135deg, hsl(245 40% 18%), hsl(280 30% 15%));
    border-color: hsl(245 40% 30%);
}

[data-theme="light"] .tools-promo-widget {
    background: linear-gradient(135deg, hsl(245 60% 95%), hsl(280 60% 92%));
    border-color: hsl(245 40% 80%);
}

.tools-promo-text {
    font-size: 0.85em;
    color: var(--color-text-secondary);
    margin: 0 0 14px;
    line-height: 1.6;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.82em;
    width: 100%;
    text-align: center;
}

/* ===========================
   SUPPORT CTA (Buy Me a Coffee)
   =========================== */
.support-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    margin: 32px 0;
}

.support-cta-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.support-cta-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0 0 12px;
}

.support-cta-content p {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin: 0 0 12px;
    max-width: 520px;
}

.btn-coffee {
    background: #ffdd00;
    color: #1a1a1a !important;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.92em;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 16px;
    border: none;
    cursor: pointer;
}

.btn-coffee:hover {
    background: #e6c800;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 221, 0, 0.3);
}

/* Sidebar coffee widget */
.coffee-widget {
    text-align: center;
    padding: 20px 16px !important;
    background: var(--color-surface) !important;
    border: 1px solid var(--color-border);
    border-top: 3px solid #ffdd00;
    position: relative;
}

.coffee-widget-icon {
    font-size: 2em;
    margin-bottom: 8px;
}

.coffee-widget-title {
    font-size: 0.92em !important;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0 0 6px;
}

.coffee-widget-desc {
    font-size: 0.78em;
    line-height: 1.5;
    color: var(--color-text-secondary);
    margin: 0 0 12px;
}

.btn-coffee-sidebar {
    width: 100%;
    justify-content: center;
    font-size: 0.85em;
    padding: 10px 20px;
}

.support-cta-footer {
    font-size: 0.82em !important;
    color: var(--color-text-muted) !important;
    font-style: italic;
    margin-bottom: 0 !important;
}

.footer-support-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px 32px;
}

/* ===========================
   CATEGORY ARCHIVE PAGE
   =========================== */
.archive-hero {
    background: var(--color-hero-gradient);
    padding: 32px 16px 28px;
    border-bottom: 3px solid hsl(var(--cat-hue, 245) 60% 55%);
}

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

.archive-title {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--color-heading);
    margin: 0 0 8px;
}

.archive-description {
    font-size: 0.92em;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 8px 0 0;
    max-width: 600px;
}

/* Collapsible "About this category" */
.archive-about {
    margin: 0;
}

.archive-about-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82em;
    font-weight: 600;
    color: hsl(var(--cat-hue, 245) 60% 60%);
    background: hsl(var(--cat-hue, 245) 60% 55% / 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
    list-style: none;
}

.archive-about-toggle::-webkit-details-marker {
    display: none;
}

.archive-about-toggle::after {
    content: '▾';
    font-size: 0.8em;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.archive-about[open] .archive-about-toggle::after {
    transform: rotate(180deg);
}

.archive-about-toggle:hover {
    background: hsl(var(--cat-hue, 245) 60% 55% / 0.18);
}

.archive-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.archive-count {
    font-size: 0.82em;
    font-weight: 600;
    color: hsl(var(--cat-hue, 245) 60% 60%);
    background: hsl(var(--cat-hue, 245) 60% 55% / 0.12);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Sub-categories */
.archive-subcats {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 16px;
}

.archive-subcats-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.archive-subcats-inner::-webkit-scrollbar {
    display: none;
}

.archive-subcats-inner .cat-tag-link {
    flex-shrink: 0;
    scroll-snap-align: start;
}

/* Archive content area */
.archive-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 16px;
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

/* --- Archive Card --- */
.archive-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.archive-card:hover {
    border-color: hsl(var(--cat-hue, 245) 60% 60%);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.archive-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.archive-card-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: var(--color-surface-2);
}

.archive-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.archive-card:hover .archive-card-thumb img {
    transform: scale(1.06);
}

.archive-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.35) 100%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}

.archive-card:hover .archive-card-overlay {
    opacity: 1;
}

/* No-image fallback */
.archive-card-excerpt-bg {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 20px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            hsl(var(--cat-hue, 245) 30% 18%) 0%,
            hsl(var(--cat-hue, 245) 40% 12%) 100%);
}

[data-theme="light"] .archive-card-excerpt-bg {
    background: linear-gradient(135deg,
            hsl(var(--cat-hue, 245) 40% 92%) 0%,
            hsl(var(--cat-hue, 245) 50% 85%) 100%);
}

.archive-card-excerpt-bg p {
    font-size: 0.82em;
    line-height: 1.55;
    color: hsl(var(--cat-hue, 245) 15% 70%);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="light"] .archive-card-excerpt-bg p {
    color: hsl(var(--cat-hue, 245) 20% 35%);
}

/* ===========================
   ARCHIVE HERO
   =========================== */
.archive-hero {
    background: var(--color-surface);
    padding: 80px 24px 40px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.archive-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 300%;
    background: radial-gradient(circle, hsl(var(--cat-hue, 245) 80% 60% / 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.archive-hero-inner {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.archive-label {
    display: inline-block;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.archive-title {
    font-size: 2.5em;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--color-heading);
}

.archive-description {
    font-size: 1.1em;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Pagination */
.archive-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.archive-pagination .page-numbers {
    list-style: none;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.archive-pagination .page-numbers li {
    margin: 0;
}

.archive-pagination .page-numbers a,
.archive-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-size: 1em;
    font-weight: 600;
    border: 1px solid var(--color-border);
    transition: var(--transition);
    color: var(--color-text);
}

.archive-pagination .page-numbers a:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
    color: var(--color-heading);
}

.archive-pagination .page-numbers.current .page-numbers {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.archive-pagination .current {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}



.archive-pagination .page-numbers .prev,
.archive-pagination .page-numbers .next {
    font-weight: 500;
    gap: 4px;
}

/* Empty state */
.archive-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

.archive-empty-icon {
    font-size: 3em;
    margin-bottom: 16px;
}

.archive-empty h2 {
    color: var(--color-heading);
    margin-bottom: 8px;
}

.archive-empty p {
    margin-bottom: 20px;
}

/* ===========================
   RELATED SECTION (Full-width bottom)
   =========================== */
.related-section {
    border-top: 1px solid var(--color-border);
    padding: 0;
}

.related-section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 16px;
}

/* ===========================
   HANDCRAFTED ACCENTS (Start Phase 7)
   =========================== */
.stitched-border {
    position: relative;
}

.stitched-border::after {
    content: '';
    position: absolute;
    inset: 4px;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: inherit;
    pointer-events: none;
    transition: var(--transition);
    opacity: 0;
}

.stitched-border:hover::after {
    opacity: 1;
    animation: stitch-dash 20s linear infinite;
}

@keyframes stitch-dash {
    to {
        stroke-dashoffset: -100px;
    }

    /* Simple rotation effect if SVG, here just opacity fade for CSS border */
}

.texture-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1h2v2H1V1zm4 4h2v2H5V5zm4 4h2v2H9V9zm4 4h2v2h-2v-2zm4 4h2v2h-2v-2z' fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Update Buttons with specific Hover */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    box-shadow: 0 4px 14px var(--color-accent-glow);
}

/* Pinned Note Style */
.pinned-note {
    background: var(--color-surface-2);
    border-left: 4px solid var(--color-terracotta);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    position: relative;
    margin: 24px 0;
}

.pinned-note::before {
    content: '📌';
    position: absolute;
    top: -12px;
    right: -8px;
    font-size: 1.2em;
    transform: rotate(15deg);
}

/* ===========================
   ANIMATIONS
   =========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation: fadeInUp 0.5s ease both;
}

.category-section:nth-child(2) {
    animation-delay: 0.1s;
}

.category-section:nth-child(3) {
    animation-delay: 0.2s;
}

.category-section:nth-child(4) {
    animation-delay: 0.3s;
}

.category-section:nth-child(5) {
    animation-delay: 0.4s;
}

.category-section:nth-child(6) {
    animation-delay: 0.5s;
}

/* ===========================
   RESPONSIVE: TABLET (min-width: 600px)
   =========================== */
@media (min-width: 600px) {
    .header-inner {
        padding: 0 24px;
        height: 60px;
    }

    .hero-section {
        padding: 64px 24px 56px;
    }

    .hero-section h1 {
        font-size: 2.6em;
    }

    .hero-buttons {
        flex-direction: row;
        justify-content: center;
    }

    .btn {
        width: auto;
    }

    .tools-strip {
        padding: 40px 24px;
    }

    .tools-carousel {
        flex-wrap: wrap;
        justify-content: center;
        gap: 24px;
    }

    .tool-card {
        flex: 0 0 calc(50% - 12px);
        max-width: calc(50% - 12px);
    }

    .content-layout {
        padding: 40px 24px;
    }

    /* Tablet: 2 columns */

    .post-card {
        flex: 0 0 calc(50% - var(--gap) / 2);
        max-width: calc(50% - var(--gap) / 2);
    }

    /* Featured & spotlight: first card spans full on tablet */
    .layout-featured .post-card:first-child,
    .layout-spotlight .post-card:first-child {
        grid-column: 1 / -1;
    }

    /* List layout: larger thumb on tablet/desktop */
    .layout-list .post-card {
        grid-template-columns: 200px 1fr;
        gap: 24px;
    }

    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        padding: 40px 24px;
        text-align: left;
    }

    /* Article layout: right sidebar visible on tablet */
    .article-hero {
        padding: 32px 24px 40px;
    }

    .article-title {
        font-size: 2.2em;
    }

    .article-layout {
        padding: 40px 24px;
    }

    /* Archive grid: 2 columns on tablet */
    .archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .archive-hero {
        padding: 40px 24px 32px;
    }

    .archive-title {
        font-size: 2.2em;
    }

    .archive-content {
        padding: 40px 24px;
    }
}

/* ===========================
   RESPONSIVE: DESKTOP (min-width: 960px)
   =========================== */
@media (min-width: 960px) {

    /* Article layout: 3-column on desktop */
    .article-layout {
        display: grid;
        grid-template-columns: 200px 1fr 280px;
        gap: 40px;
    }

    .article-sidebar--left {
        display: block;
        order: 0;
    }

    .article-content-wrap {
        order: 1;
    }

    .article-sidebar--right {
        order: 2;
    }

    .sidebar-sticky {
        position: sticky;
        top: 80px;
        align-self: start;
    }

    .article-title {
        font-size: 2.6em;
    }

    /* Archive grid: 3 columns on desktop */
    .archive-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .archive-title {
        font-size: 2.6em;
    }

    .main-navigation {
        display: block;
    }

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

    .hero-section h1 {
        font-size: 3.2em;
    }

    .tools-carousel {
        flex-wrap: wrap;
        justify-content: center;
        gap: 24px;
    }

    .tool-card {
        flex: 0 0 calc(33.333% - 16px);
        /* 3 columns with 24px gap */
        max-width: calc(33.333% - 16px);
    }

    .content-layout {
        display: grid;
        grid-template-columns: 1fr 280px;
        gap: 48px;
    }

    #secondary-sidebar {
        position: sticky;
        top: 80px;
        align-self: start;
    }

    /* Desktop: 3 columns */

    .post-card {
        flex: 0 0 calc(33.333% - var(--gap) * 2 / 3);
        max-width: calc(33.333% - var(--gap) * 2 / 3);
    }

    /* Featured: big card side-by-side on desktop */
    .layout-featured .post-card:first-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1.5fr 1fr;
    }

    .layout-featured .post-card:first-child .post-thumb {
        aspect-ratio: auto;
        min-height: 240px;
    }

    .layout-featured .post-card:first-child .post-card-body {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 28px;
    }

    .layout-featured .post-card:first-child .post-card-title {
        font-size: 1.3em;
    }

    /* List: wider thumb on desktop */
    .layout-list .post-card {
        grid-template-columns: 220px 1fr;
    }

    /* Spotlight: hero card full width */
    .layout-spotlight .post-card:first-child {
        grid-column: 1 / -1;
    }

    .layout-spotlight .post-card:first-child .post-thumb {
        aspect-ratio: 21 / 9;
        min-height: 280px;
    }
}

/* ===========================
   RESPONSIVE: LARGE DESKTOP (min-width: 1200px)
   =========================== */
@media (min-width: 1200px) {
    .content-layout {
        grid-template-columns: 1fr 300px;
    }

    .article-layout {
        max-width: 1280px;
        grid-template-columns: 210px 1fr 300px;
        gap: 48px;
    }

    .article-hero-inner {
        max-width: 820px;
    }
}

/* ===========================
   RESPONSIVE: XL DESKTOP (min-width: 1440px)
   =========================== */
@media (min-width: 1440px) {

    /* Widen content area to use more screen real-estate */
    :root {
        --max-width: 1320px;
    }

    .article-layout {
        max-width: 1360px;
        grid-template-columns: 220px 1fr 320px;
    }
}

/* --- Ad slot placeholders (future use) --- */
.ad-slot {
    display: none;
    min-height: 250px;
    border-radius: var(--radius-md);
    /* Uncomment below to visualise ad slots during development:
    background: var(--color-surface-2);
    border: 1px dashed var(--color-border);
    */
}

@media (min-width: 1440px) {
    .ad-slot {
        display: block;
    }
}

/* ===========================
   COMMENTS SECTION
   =========================== */
.comments-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 24px;
}

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

.comment-item {
    margin-bottom: 20px;
}

.comment-item .children {
    list-style: none;
    padding-left: 24px;
    margin-top: 16px;
    border-left: 2px solid var(--color-border);
}

.comment-body {
    display: flex;
    gap: 12px;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.comment-author,
.comment-author a {
    font-size: 0.9em;
    color: var(--color-heading);
    text-decoration: none;
}

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

.comment-date {
    font-size: 0.78em;
    color: var(--color-text-muted);
}

.comment-awaiting {
    font-size: 0.85em;
    color: var(--color-amber);
    margin: 4px 0;
}

.comment-text {
    font-size: 0.92em;
    line-height: 1.6;
    color: var(--color-text);
}

.comment-text p {
    margin: 0 0 8px;
}

.comment-actions {
    margin-top: 6px;
    display: flex;
    gap: 12px;
}

.comment-actions a,
.reply-link a,
.edit-link a {
    font-size: 0.78em;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
}

.comment-actions a:hover {
    text-decoration: underline;
}

.comments-closed {
    font-size: 0.9em;
    color: var(--color-text-muted);
    font-style: italic;
    padding: 16px 0;
}

/* Comment form */
.comment-form label {
    display: block;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 0.92em;
    margin-bottom: 12px;
    transition: border-color var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

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

.comment-notes {
    font-size: 0.8em;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.comment-respond .comment-reply-title {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 12px;
}

/* ===========================
   INLINE SHARE BUTTONS
   =========================== */
.inline-share {
    margin-top: 32px;
    padding: 20px 24px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.inline-share-label {
    display: block;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--color-heading);
    margin-bottom: 12px;
}

.inline-share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 0.9em;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Author archive header */
.author-archive-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 16px 0 8px;
}

.author-archive-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
}

.author-archive-info {
    flex: 1;
}

.author-website-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.85em;
    color: var(--color-accent);
    text-decoration: none;
}

.author-website-link:hover {
    text-decoration: underline;
}

/* Homepage all-articles button */
.homepage-all-articles {
    text-align: center;
    padding: 40px 0 16px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: 1em;
}

.share-btn--twitter:hover {
    background: #1da1f2;
    color: #fff;
    border-color: #1da1f2;
}

.share-btn--facebook:hover {
    background: #1877f2;
    color: #fff;
    border-color: #1877f2;
}

.share-btn--linkedin:hover {
    background: #0a66c2;
    color: #fff;
    border-color: #0a66c2;
}

.share-btn--copy:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.share-btn--copy.is-copied {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

/* ===========================
   404 PAGE
   =========================== */
.error-404-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.error-404-inner {
    max-width: 600px;
    text-align: center;
}

.error-404-icon {
    font-size: 4em;
    margin-bottom: 16px;
}

.error-404-title {
    font-size: 2em;
    font-weight: 800;
    color: var(--color-heading);
    margin-bottom: 12px;
}

.error-404-desc {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.error-404-search form {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.95em;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-input:focus {
    border-color: var(--color-accent);
}

.error-404-links h3 {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.error-404-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.error-404-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.error-404-card:hover {
    border-color: var(--color-accent);
    background: var(--color-surface-hover);
    transform: translateY(-2px);
}

.error-404-card-icon {
    font-size: 1.6em;
}

/* ===========================
   STATIC PAGE TEMPLATE
   =========================== */
.page-hero {
    background: var(--color-hero-gradient);
    padding: 24px 16px 32px;
    border-bottom: 1px solid var(--color-border);
}

.page-hero-inner {
    max-width: 750px;
    margin: 0 auto;
}

.page-hero-subtitle {
    color: var(--color-text-secondary);
    font-size: 1.05em;
    line-height: 1.6;
    margin-top: 12px;
}

.page-layout {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px;
}

.page-content-wrap .entry-content {
    line-height: 1.8;
}

/* ===========================
   ACCESSIBILITY
   =========================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 10000;
    padding: 10px 20px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 8px;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ===========================
   READING PROGRESS BAR
   =========================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
    z-index: 9999;
    transition: width 0.1s linear;
}

body.admin-bar .reading-progress {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .reading-progress {
        top: 46px;
    }
}

/* ===========================
   BACK TO TOP BUTTON
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: var(--transition);
    z-index: 900;
    box-shadow: var(--shadow-md);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/* ===========================
   HEADER & NAVIGATION
   =========================== */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: all var(--transition-slow);
    background: transparent;
    /* Start transparent */
    color: var(--color-heading);
}

#site-header.is-scrolled {
    background: var(--color-surface);
    /* Becomes solid surface color */
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Specific fix for Light Mode Header Visibility */
[data-theme="light"] #site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

.site-title-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-heading);
    /* Ensure this uses the variable that flips */
    font-weight: 700;
    font-size: 1.25em;
    font-family: var(--font-heading);
}

/* ===========================
   COOKIE CONSENT BANNER
   =========================== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(0);
    transition: transform var(--transition);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    font-size: 0.85em;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
    flex: 1;
    min-width: 200px;
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.82em;
}

.cookie-consent-link {
    font-size: 0.8em;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
}

.cookie-consent-link:hover {
    text-decoration: underline;
}

/* ===========================
   SEARCH OVERLAY
   =========================== */
.theme-toggle,
.header-search-toggle,
.reader-toggle {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-size: 1.25em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover,
.header-search-toggle:hover,
.reader-toggle:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
}

.reader-toggle.is-active {
    color: var(--color-accent);
    background: var(--color-accent-soft);
}

.header-search-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color var(--transition-fast);
}

.header-search-toggle:hover {
    color: var(--color-accent);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20vh;
    animation: fadeIn 0.2s ease;
}

.search-overlay[hidden] {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.search-overlay-inner {
    width: 90%;
    max-width: 560px;
    position: relative;
}

.search-overlay-form {
    display: flex;
    gap: 8px;
}

.search-overlay-input {
    flex: 1;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1.1em;
    font-family: var(--font-main);
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-overlay-input:focus {
    border-color: var(--color-accent);
}

.search-overlay-close {
    position: absolute;
    top: -48px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.4em;
    cursor: pointer;
    padding: 8px;
}

.search-overlay-close:hover {
    color: var(--color-text);
}

/* ===========================
   NEWSLETTER SECTION
   =========================== */
.newsletter-section {
    border-top: 2px solid var(--color-accent);
    background: var(--color-surface);
    padding: 40px 20px;
}

.newsletter-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.newsletter-text h3 {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--color-heading);
    margin: 0 0 4px;
}

.newsletter-text p {
    font-size: 0.9em;
    color: var(--color-text-secondary);
    margin: 0;
}

.newsletter-form {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.newsletter-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 0.9em;
    outline: none;
    transition: border-color var(--transition-fast);
}

.newsletter-input:focus {
    border-color: var(--color-accent);
}

@media (max-width: 600px) {
    .newsletter-inner {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-form {
        max-width: 100%;
    }
}

.mobile-search {
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 8px;
}

.mobile-search .search-input {
    width: 100%;
}

/* ===========================
   WORDPRESS ADMIN BAR FIX
   =========================== */
body.admin-bar #site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #site-header {
        top: 46px;
    }
}

/* ===========================
   AUTHENTICATION MODAL
   =========================== */
.ac-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ac-modal.active {
    opacity: 1;
    visibility: visible;
}

.ac-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.ac-modal-content {
    position: relative;
    z-index: 2;
    background: var(--color-surface);
    width: 90%;
    max-width: 420px;
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--color-border);
}

.ac-modal.active .ac-modal-content {
    transform: translateY(0);
}

.ac-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.ac-modal-close:hover {
    color: var(--color-heading);
}

.ac-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.ac-auth-header h3 {
    margin: 0 0 8px;
    font-size: 1.5em;
    color: var(--color-heading);
}

.ac-auth-header p {
    font-size: 0.95em;
    color: var(--color-text-secondary);
    margin: 0;
}

.ac-form-group {
    margin-bottom: 16px;
}

.ac-form-group label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-heading);
}

.ac-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1em;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.2s;
}

.ac-form-group input:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.ac-auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 0.9em;
}

.ac-auth-footer p {
    margin: 5px 0;
    color: var(--color-text-secondary);
}

.ac-auth-footer a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

.ac-auth-message {
    padding: 10px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    display: none;
    text-align: center;
}

.ac-auth-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid #28a745;
}

.ac-auth-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.ac-terms-text {
    font-size: 0.8em;
    color: var(--color-text-tertiary);
    text-align: center;
    margin-top: 12px;
}

/* Header Auth Button */
.btn-auth-trigger {
    background: transparent;
    border: 1px solid var(--color-border);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-heading);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-auth-trigger:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-text-secondary);
}

/* ===========================
   MY WORKSHOP DASHBOARD
   =========================== */
.ac-workshop-dashboard {
    max-width: 900px;
    margin: 40px auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ac-workshop-header {
    background: var(--color-surface-2);
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--color-border);
}

.ac-user-avatar img {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ac-user-info h2 {
    margin: 0 0 5px;
    font-size: 1.5em;
    color: var(--color-heading);
}

.ac-user-info p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.9em;
}

.ac-workshop-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
}

.ac-tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.ac-tab-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-heading);
}

.ac-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.ac-workshop-content {
    display: none;
    padding: 30px;
}

.ac-workshop-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Projects Grid */
.ac-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ac-project-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--color-bg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ac-project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.ac-project-icon {
    font-size: 2em;
    background: var(--color-surface-2);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ac-project-details {
    flex: 1;
}

.ac-project-details h4 {
    margin: 0 0 4px;
    font-size: 1.1em;
    color: var(--color-heading);
}

.ac-project-tool {
    display: block;
    font-size: 0.85em;
    color: var(--color-primary);
    font-weight: 600;
}

.ac-project-date {
    display: block;
    font-size: 0.8em;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

.ac-project-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 1.2em;
}

.btn-icon:hover {
    opacity: 1;
}

/* Activity List */
.ac-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ac-activity-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.ac-activity-list li:last-child {
    border-bottom: none;
}

.ac-activity-list a {
    color: var(--color-heading);
    font-weight: 500;
    text-decoration: none;
}

.ac-activity-list a:hover {
    color: var(--color-primary);
}

.ac-activity-date {
    color: var(--color-text-tertiary);
    font-size: 0.9em;
}

/* Empty State */
.ac-workshop-login-prompt,
.ac-empty-state {
    text-align: center;
    padding: 40px;
    background: var(--color-surface-2);
    border-radius: var(--radius-lg);
}

/* ===========================
   AUTHENTICATION MODAL
   =========================== */
.ac-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out-expo), visibility 0.3s;
}

.ac-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ac-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ac-modal-content {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    transform: translateY(20px);
    transition: transform 0.4s var(--ease-out-expo);
    z-index: 1;
}

.ac-modal.active .ac-modal-content {
    transform: translateY(0);
}

.ac-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.ac-modal-close:hover {
    color: var(--color-heading);
    background: var(--color-surface-hover);
}

.ac-auth-header {
    text-align: center;
    margin-bottom: 25px;
}

.ac-auth-header h3 {
    margin: 0 0 10px 0;
    color: var(--color-heading);
    font-size: 1.5em;
    font-family: var(--font-heading);
}

.ac-auth-header p {
    color: var(--color-text-secondary);
    font-size: 0.95em;
    margin: 0;
}

.ac-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.ac-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ac-form-group input {
    width: 100%;
    padding: 12px 15px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.2s ease;
}

.ac-form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.ac-auth-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    text-align: center;
    display: none;
    font-weight: 500;
}

.ac-auth-message.success {
    background: var(--color-green-soft);
    color: var(--color-green);
    border: 1px solid var(--color-green);
}

.ac-auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.ac-auth-footer {
    text-align: center;
    margin-top: 25px;
    font-size: 0.95em;
    color: var(--color-text-secondary);
}

.ac-switch-auth {
    font-weight: 600;
    text-decoration: underline;
}

.ac-terms-text {
    font-size: 0.8em;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 15px;
}

body.no-scroll {
    overflow: hidden;
}