/**
 * assets/css/main.css — FinWise Rocks Theme
 *
 * Design system, typography, layout, components, dark mode.
 * Written in a mobile-first approach. No external CSS dependencies.
 *
 * Table of Contents:
 *  1.  CSS Custom Properties (Design Tokens)
 *  2.  Reset & Base
 *  3.  Typography
 *  4.  Layout Utilities
 *  5.  Reading Progress Bar
 *  6.  Site Header & Navigation
 *  7.  Category Strip
 *  8.  Search Overlay
 *  9.  Hero Section
 * 10.  Cards & Grid
 * 11.  Sections
 * 12.  Sidebar
 * 13.  Single Article
 * 14.  Table of Contents
 * 15.  Author Box
 * 16.  Related Posts
 * 17.  Social Sharing
 * 18.  Category Banner
 * 19.  Archive / Search Headers
 * 20.  Newsletter Section
 * 21.  Pagination
 * 22.  Comments
 * 23.  404 Page
 * 24.  Footer
 * 25.  Widgets
 * 26.  AdSense Units
 * 27.  Dark Mode
 * 28.  Accessibility
 * 29.  Animations
 * 30.  Print
 */

/* ============================================================
   1. CSS CUSTOM PROPERTIES
   ============================================================ */

:root {
    /* — Colours — */
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fb;
    --color-bg-card: #ffffff;
    --color-surface: #f2f4f7;
    --color-border: #e5e7eb;
    --color-border-light: #f0f1f4;

    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-text-light: #9ca3af;

    --color-primary: #1a56db;
    /* Vibrant but professional blue */
    --color-primary-h: #1747c0;
    --color-accent: #7c3aed;
    /* Purple accent */
    --color-accent-h: #6d28d9;
    --color-success: #059669;
    --color-warning: #d97706;
    --color-danger: #dc2626;

    /* — Category colours (Italian finance blog) — */
    --cat-finanza: #1a56db;
    --cat-investimenti: #059669;
    --cat-psicologia: #7c3aed;
    --cat-ai: #0891b2;

    /* — Typography — */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

    --fs-xs: 0.75rem;
    /* 12px */
    --fs-sm: 0.875rem;
    /* 14px */
    --fs-base: 1rem;
    /* 16px */
    --fs-lg: 1.125rem;
    /* 18px */
    --fs-xl: 1.25rem;
    /* 20px */
    --fs-2xl: 1.5rem;
    /* 24px */
    --fs-3xl: 1.875rem;
    /* 30px */
    --fs-4xl: 2.25rem;
    /* 36px */
    --fs-5xl: 3rem;
    /* 48px */

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semi: 600;
    --fw-bold: 700;
    --fw-black: 800;

    --lh-tight: 1.2;
    --lh-snug: 1.35;
    --lh-normal: 1.5;
    --lh-relaxed: 1.7;
    --lh-article: 1.85;
    /* Optimised for long-form reading */

    /* — Spacing — */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* — Layout — */
    --container-max: 1200px;
    --content-max: 720px;
    --sidebar-width: 300px;
    --header-height: 68px;
    --cat-strip-height: 40px;

    /* — Radius — */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 999px;

    /* — Shadows — */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .06);
    --shadow: 0 4px 16px rgba(0, 0, 0, .08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .10);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, .12);

    /* — Transitions — */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --duration-sm: 150ms;
    --duration: 200ms;
    --duration-md: 300ms;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--duration-sm) var(--ease);
}

a:hover {
    color: var(--color-primary-h);
    text-decoration: underline;
}

ul,
ol {
    list-style: none;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--color-text);
    letter-spacing: -0.02em;
}

h1 {
    font-size: var(--fs-4xl);
}

h2 {
    font-size: var(--fs-3xl);
}

h3 {
    font-size: var(--fs-2xl);
}

h4 {
    font-size: var(--fs-xl);
}

h5 {
    font-size: var(--fs-lg);
}

h6 {
    font-size: var(--fs-base);
}

p {
    line-height: var(--lh-relaxed);
}

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

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-5);
}

@media (min-width: 640px) {
    .container {
        padding-inline: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-inline: var(--space-8);
    }
}

/* Two column layout: main content + sidebar */
.layout-two-col {
    display: grid;
    gap: var(--space-6);
    padding-block: var(--space-6);
}

@media (min-width: 1024px) {
    .layout-two-col {
        grid-template-columns: 1fr var(--sidebar-width);
        align-items: start;
        gap: var(--space-8);
        padding-block: var(--space-8);
    }
}

/* Single-post (no sidebar, centred content) */
.layout-single {
    max-width: 760px;
    margin-inline: auto;
    padding-block: var(--space-5);
}

@media (min-width: 768px) {
    .layout-single {
        padding-block: var(--space-8);
    }
}

.content-area {
    min-width: 0;
}

/* ============================================================
   5. READING PROGRESS BAR
   ============================================================ */

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    background: transparent;
    pointer-events: none;
}

#reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width 50ms linear;
}

/* ============================================================
   6. SITE HEADER & NAVIGATION
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-xs);
    /* Needed so absolute mobile nav overflows below correctly */
    overflow: visible;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    height: var(--header-height);
}

/* Branding */
.site-branding {
    flex-shrink: 0;
}

.site-name-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.site-name {
    font-size: var(--fs-xl);
    font-weight: var(--fw-black);
    letter-spacing: -0.03em;
    color: var(--color-text);
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-tagline {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    font-weight: var(--fw-regular);
    letter-spacing: 0;
    -webkit-text-fill-color: var(--color-text-muted);
    /* override gradient */
}

/* Custom Logo */
.custom-logo {
    height: 36px;
    width: auto;
}

@media (min-width: 768px) {
    .custom-logo {
        height: 40px;
    }
}

/* Primary Nav */
.primary-nav {
    flex: 1;
    display: none;
}

@media (min-width: 768px) {
    .primary-nav {
        display: flex;
    }
}

.nav-menu {
    display: flex;
    gap: var(--space-1);
    align-items: center;
}

.nav-menu a {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-muted);
    border-radius: var(--radius);
    transition: background var(--duration-sm) var(--ease), color var(--duration-sm) var(--ease);
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu .current-menu-item>a {
    color: var(--color-text);
    background: var(--color-surface);
}

/* Header Buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-left: auto;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background var(--duration-sm) var(--ease), color var(--duration-sm) var(--ease);
}

.header-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

/* Dark/Light icon toggle */
.icon-moon {
    display: none;
}

[data-theme="dark"] .icon-sun {
    display: none;
}

[data-theme="dark"] .icon-moon {
    display: block;
}

/* Hamburger */
.hamburger-line {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--duration) var(--ease), opacity var(--duration) var(--ease);
}

.hamburger-line+.hamburger-line {
    margin-top: 4px;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }
}

/* ── Mobile Nav Drawer ─────────────────────────────────
   position:absolute relative al .site-header sticky.
   Cade sempre subito sotto l'header, senza pixel fissi
   e senza conflitti con la WP admin bar.
──────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    .primary-nav {
        display: block;
        position: absolute;
        top: 100%;
        /* flush con il fondo dell'header */
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-top: 2px solid var(--color-primary);
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .13);
        padding: var(--space-2) var(--space-4) var(--space-4);
        z-index: 999;

        /* Stato nascosto: slide up + fade */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition:
            opacity var(--duration-md) var(--ease),
            transform var(--duration-md) var(--ease),
            visibility 0s var(--duration-md);
        pointer-events: none;
    }

    .primary-nav.is-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition:
            opacity var(--duration-md) var(--ease),
            transform var(--duration-md) var(--ease),
            visibility 0s 0s;
        pointer-events: auto;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .nav-menu li {
        border-bottom: 1px solid var(--color-border-light);
    }

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

    .nav-menu a {
        width: 100%;
        padding: var(--space-4) var(--space-2);
        font-size: var(--fs-base);
        font-weight: var(--fw-medium);
        color: var(--color-text);
        border-radius: 0;
        white-space: normal;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .nav-menu a:hover,
    .nav-menu .current-menu-item>a {
        color: var(--color-primary);
        background: rgba(26, 86, 219, .05);
        padding-left: var(--space-4);
    }

    /* Bottoni header più grandi per il touch */
    .header-btn {
        width: 44px;
        height: 44px;
    }
}

/* ============================================================
   7. CATEGORY STRIP
   ============================================================ */

.category-strip {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border-light);
    height: var(--cat-strip-height);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-strip::-webkit-scrollbar {
    display: none;
}

.cat-strip-list {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    height: var(--cat-strip-height);
    white-space: nowrap;
}

.cat-strip-list a {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: color var(--duration-sm);
}

.cat-strip-list a:hover,
.cat-strip-list a[aria-current] {
    color: var(--color-primary);
}

/* ============================================================
   8. SEARCH OVERLAY
   ============================================================ */

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(17, 24, 39, .9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    animation: overlayIn var(--duration-md) var(--ease);
}

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

@keyframes overlayIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.search-close {
    position: absolute;
    top: var(--space-6);
    right: var(--space-6);
    background: rgba(255, 255, 255, .15);
    border: none;
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background var(--duration-sm);
}

.search-close:hover {
    background: rgba(255, 255, 255, .25);
}

/* WordPress search form inside overlay */
.search-overlay .search-form {
    width: 100%;
    max-width: 600px;
}

.search-overlay .search-field {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--fs-2xl);
    font-family: var(--font-sans);
    background: white;
    border: none;
    border-radius: var(--radius-md);
    outline: none;
    color: var(--color-text);
}

.search-overlay .search-submit {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-6);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: var(--fs-base);
    font-weight: var(--fw-semi);
    cursor: pointer;
    transition: background var(--duration-sm);
}

.search-overlay .search-submit:hover {
    background: var(--color-primary-h);
}

/* ============================================================
   9. HERO SECTION
   ============================================================ */

.hero-section {
    padding-block: var(--space-5) var(--space-4);
}

@media (min-width: 768px) {
    .hero-section {
        padding-block: var(--space-8) var(--space-6);
    }
}

.hero-card {
    display: grid;
    gap: 0;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
}

@media (min-width: 768px) {
    .hero-card {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }
}

.hero-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
    .hero-image-link {
        aspect-ratio: unset;
    }
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-md) var(--ease);
}

@media (min-width: 768px) {
    .hero-image {
        min-height: 420px;
    }
}

.hero-image-link:hover .hero-image {
    transform: scale(1.03);
}

.hero-content {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .hero-content {
        padding: var(--space-6) var(--space-8);
        gap: var(--space-4);
    }
}

.hero-title {
    font-size: clamp(var(--fs-xl), 5vw, var(--fs-4xl));
    line-height: var(--lh-snug);
    letter-spacing: -0.03em;
}

.hero-title a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    padding-block: var(--space-1);
}

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

.hero-excerpt {
    font-size: var(--fs-base);
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-excerpt {
        font-size: var(--fs-lg);
        -webkit-line-clamp: unset;
        overflow: visible;
    }
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.meta-sep {
    color: var(--color-border);
}

/* ============================================================
   10. CARDS & GRID
   ============================================================ */

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

@media (min-width: 480px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
        gap: var(--space-5);
    }
}

.posts-grid--3 {
    grid-template-columns: 1fr;
}

@media (min-width: 480px) {
    .posts-grid--3 {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Post Card */
.post-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    overflow: hidden;
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* List variant (.posts-list) */
@media (min-width: 640px) {
    .posts-list .post-card {
        flex-direction: row;
        gap: 0;
    }

    .posts-list .post-card-image-link {
        width: 180px;
        min-width: 180px;
        overflow: hidden;
    }
}

.posts-list .post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-md) var(--ease);
}

.post-card:hover .post-card-image {
    transform: scale(1.04);
}

/* Grid image */
.posts-grid .post-card-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.posts-grid .post-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-md) var(--ease);
}

.post-card-body {
    padding: var(--space-4) var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
}

.post-card-title {
    font-size: var(--fs-lg);
    line-height: var(--lh-snug);
    font-weight: var(--fw-bold);
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    padding-block: var(--space-1);
}

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

.post-card-excerpt {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: auto;
    padding-top: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ============================================================
   11. SECTIONS (homepage)
   ============================================================ */

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.section-title {
    font-size: clamp(var(--fs-xl), 4vw, var(--fs-2xl));
    font-weight: var(--fw-black);
    letter-spacing: -0.02em;
}

.section-link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.section-link:hover {
    text-decoration: underline;
}

.latest-section,
.category-section,
.trending-section {
    padding-block: var(--space-6);
    border-top: 1px solid var(--color-border-light);
}

@media (min-width: 768px) {

    .latest-section,
    .category-section,
    .trending-section {
        padding-block: var(--space-8);
    }
}

.category-desc {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
    margin-top: calc(-1 * var(--space-4));
}

/* Trending list */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.trending-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--color-border-light);
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-rank {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-black);
    color: var(--color-border);
    line-height: 1;
    min-width: 52px;
    letter-spacing: -0.03em;
}

.trending-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.trending-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semi);
    line-height: var(--lh-snug);
}

.trending-title a {
    color: inherit;
    text-decoration: none;
}

.trending-title a:hover {
    color: var(--color-primary);
}

.trending-meta {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* ============================================================
   12. SIDEBAR
   ============================================================ */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        top: calc(var(--header-height) + var(--cat-strip-height) + var(--space-4));
        max-height: calc(100vh - var(--header-height) - var(--cat-strip-height) - var(--space-8));
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

/* ============================================================
   13. SINGLE ARTICLE
   ============================================================ */

.single-article {
    padding-block: 0;
}

.article-header {
    margin-bottom: var(--space-6);
}

.article-title {
    font-size: clamp(var(--fs-2xl), 4vw, var(--fs-5xl));
    line-height: var(--lh-snug);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-4);
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding-block: var(--space-4);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
}

.meta-author-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.meta-avatar {
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.meta-author {
    font-weight: var(--fw-semi);
    font-size: var(--fs-sm);
}

.meta-details {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.article-featured-image {
    margin-block: var(--space-6);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-img {
    width: 100%;
    max-height: 540px;
    object-fit: cover;
}

.image-caption {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-align: center;
    padding-top: var(--space-2);
    font-style: italic;
}

/* Article Body typography */
.article-content {
    font-size: var(--fs-lg);
    line-height: var(--lh-article);
    color: var(--color-text);
}

.article-content>*+* {
    margin-top: 1.5em;
}

.article-content h2 {
    font-size: var(--fs-2xl);
    margin-top: 2em;
    margin-bottom: .6em;
    padding-bottom: .4em;
    border-bottom: 2px solid var(--color-border-light);
}

.article-content h3 {
    font-size: var(--fs-xl);
    margin-top: 1.8em;
    margin-bottom: .5em;
}

.article-content h4 {
    font-size: var(--fs-lg);
    margin-top: 1.6em;
}

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

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--space-4) var(--space-6);
    background: var(--color-bg-alt);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    font-size: var(--fs-xl);
    color: var(--color-text-muted);
}

.article-content code {
    font-family: var(--font-mono);
    font-size: .85em;
    background: var(--color-surface);
    padding: .1em .35em;
    border-radius: var(--radius-sm);
}

.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: var(--space-5);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    line-height: 1.6;
}

.article-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-content ul,
.article-content ol {
    padding-left: var(--space-6);
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li+li {
    margin-top: var(--space-2);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
    overflow-x: auto;
    display: block;
}

.article-content th,
.article-content td {
    border: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
    text-align: left;
}

.article-content th {
    background: var(--color-surface);
    font-weight: var(--fw-semi);
}

.article-content img {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.article-content .wp-caption-text,
.article-content figcaption {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-align: center;
    margin-top: var(--space-2);
    font-style: italic;
}

/* Article footer */
.article-footer {
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}

.tags-label {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.tag-pill {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-surface);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background var(--duration-sm), color var(--duration-sm);
}

.tag-pill:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

.article-updated {
    font-size: var(--fs-xs);
    color: var(--color-text-light);
}

/* ============================================================
   14. TABLE OF CONTENTS
   ============================================================ */

.table-of-contents {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-6);
    margin-block: var(--space-6);
}

.toc-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-3);
}

#toc-nav ol {
    padding-left: var(--space-5);
    list-style: decimal;
}

#toc-nav li {
    margin-block: var(--space-1);
}

#toc-nav a {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--duration-sm);
}

#toc-nav a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

#toc-nav .toc-h3 {
    margin-left: var(--space-4);
    list-style-type: lower-alpha;
}

/* ============================================================
   15. AUTHOR BOX
   ============================================================ */

.author-box {
    display: flex;
    gap: var(--space-5);
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-top: var(--space-8);
    border: 1px solid var(--color-border-light);
}

.author-avatar-img {
    border-radius: var(--radius-full);
    width: 80px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0;
}

.author-label {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    font-weight: var(--fw-semi);
}

.author-name {
    font-size: var(--fs-xl);
    margin-block: var(--space-1) var(--space-2);
}

.author-name a {
    color: inherit;
    text-decoration: none;
}

.author-name a:hover {
    color: var(--color-primary);
}

.author-bio {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
}

.author-links {
    display: flex;
    gap: var(--space-4);
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

.author-posts-link {
    color: var(--color-primary);
    text-decoration: none;
}

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

.author-website-link {
    color: var(--color-text-muted);
    text-decoration: none;
}

.author-website-link:hover {
    color: var(--color-text);
}

@media (max-width: 480px) {
    .author-box {
        flex-direction: column;
    }
}

/* ============================================================
   16. RELATED POSTS
   ============================================================ */

.related-posts {
    margin-top: var(--space-10);
}

.related-title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-black);
    margin-bottom: var(--space-5);
}

/* ============================================================
   17. SOCIAL SHARING
   ============================================================ */

.social-share {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.share-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--color-text-muted);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    text-decoration: none;
    transition: opacity var(--duration-sm), transform var(--duration-sm);
    color: white;
    line-height: 1;
}

.share-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.share-twitter {
    background: #000;
}

.share-linkedin {
    background: #0a66c2;
}

.share-whatsapp {
    background: #25d366;
}

.share-telegram {
    background: #229ed9;
}

.share-text {
    display: none;
}

@media (min-width: 480px) {
    .share-text {
        display: inline;
    }
}

/* ============================================================
   18. CATEGORY BANNER
   ============================================================ */

.category-banner {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    padding-block: var(--space-8);
    color: white;
}

@media (min-width: 768px) {
    .category-banner {
        padding-block: var(--space-10);
    }
}

.category-banner-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.back-link {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
}

.back-link:hover {
    color: white;
}

.category-banner-title {
    font-size: clamp(var(--fs-3xl), 5vw, var(--fs-5xl));
    color: white;
    letter-spacing: -0.03em;
}

.category-banner-desc {
    font-size: var(--fs-lg);
    color: rgba(255, 255, 255, .8);
    max-width: 560px;
}

.category-post-count {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, .2);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semi);
    color: white;
}

/* ============================================================
   19. ARCHIVE / SEARCH HEADERS
   ============================================================ */

.archive-header,
.search-header {
    padding-block: var(--space-6);
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: var(--space-6);
}

.archive-title {
    font-size: var(--fs-3xl);
    font-weight: var(--fw-black);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-2);
}

.archive-desc {
    color: var(--color-text-muted);
    font-size: var(--fs-base);
}

.search-count {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

.search-term {
    background: none;
    color: var(--color-primary);
    font-style: normal;
}

.search-refine {
    margin-bottom: var(--space-6);
}

.search-field {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    font-size: var(--fs-base);
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color var(--duration-sm);
}

.search-field:focus {
    outline: none;
    border-color: var(--color-primary);
}

.no-results {
    text-align: center;
    padding-block: var(--space-12);
}

.no-results-title {
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-4);
}

.no-results-msg {
    color: var(--color-text-muted);
}

/* ============================================================
   20. NEWSLETTER SECTION
   ============================================================ */

.newsletter-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding-block: var(--space-10);
}

@media (min-width: 768px) {
    .newsletter-section {
        padding-block: var(--space-16);
    }
}

.newsletter-inner {
    display: grid;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .newsletter-inner {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: var(--space-8);
    }
}

.newsletter-title {
    font-size: clamp(var(--fs-xl), 4vw, var(--fs-4xl));
    color: white;
    line-height: var(--lh-snug);
    margin-bottom: var(--space-3);
}

.newsletter-subtitle {
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, .7);
    line-height: var(--lh-relaxed);
}

@media (min-width: 768px) {
    .newsletter-subtitle {
        font-size: var(--fs-base);
    }
}

.newsletter-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

@media (min-width: 480px) {
    .newsletter-fields {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.newsletter-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: var(--space-4);
    border: none;
    border-radius: var(--radius);
    font-size: var(--fs-base);
    font-family: var(--font-sans);
    background: white;
    color: var(--color-text);
}

.newsletter-input:focus {
    outline: 2px solid var(--color-accent);
}

.newsletter-btn {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    cursor: pointer;
    transition: background var(--duration-sm), transform var(--duration-sm);
    white-space: nowrap;
    min-height: 48px;
}

@media (min-width: 480px) {
    .newsletter-btn {
        width: auto;
    }
}

.newsletter-btn:hover {
    background: var(--color-accent-h);
    transform: translateY(-1px);
}

.newsletter-disclaimer {
    margin-top: var(--space-2);
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, .5);
}

/* Sidebar mini newsletter */
.widget-newsletter .btn-subscribe {
    display: inline-block;
    margin-top: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    text-decoration: none;
    transition: background var(--duration-sm);
}

.widget-newsletter .btn-subscribe:hover {
    background: var(--color-primary-h);
    text-decoration: none;
}

/* ============================================================
   21. PAGINATION
   ============================================================ */

.pagination {
    margin-top: var(--space-8);
    display: flex;
    justify-content: center;
}

.pagination .page-numbers {
    display: flex;
    gap: var(--space-1);
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-numbers li a,
.pagination .page-numbers li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-text-muted);
    text-decoration: none;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    transition: background var(--duration-sm), color var(--duration-sm), border-color var(--duration-sm);
}

.pagination .page-numbers li a:hover {
    background: var(--color-surface);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.pagination .page-numbers li span.current {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ============================================================
   22. COMMENTS
   ============================================================ */

.comments-section {
    margin-top: var(--space-10);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-light);
}

/* ============================================================
   23. 404 PAGE
   ============================================================ */

.error-404-wrapper {
    display: grid;
    gap: var(--space-8);
    padding-block: var(--space-16);
    max-width: 600px;
    margin-inline: auto;
    text-align: center;
}

.error-404-number {
    font-size: clamp(80px, 15vw, 160px);
    font-weight: var(--fw-black);
    line-height: 1;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.error-title {
    font-size: var(--fs-3xl);
    margin-bottom: var(--space-3);
}

.error-desc {
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
}

.error-cats {
    margin-block: var(--space-5);
}

.error-cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    margin-top: var(--space-3);
}

/* ============================================================
   24. FOOTER
   ============================================================ */

.site-footer {
    background: #0f172a;
    color: rgba(255, 255, 255, .7);
}

.footer-top {
    display: grid;
    gap: var(--space-8);
    padding-block: var(--space-10);
}

@media (min-width: 768px) {
    .footer-top {
        grid-template-columns: 280px 1fr;
        gap: var(--space-10);
        padding-block: var(--space-12);
    }
}

.footer-site-name {
    display: block;
    font-size: var(--fs-xl);
    font-weight: var(--fw-black);
    color: white;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
}

.footer-desc {
    font-size: var(--fs-sm);
    line-height: var(--lh-relaxed);
    color: rgba(255, 255, 255, .5);
    margin-bottom: var(--space-5);
}

.social-links {
    display: flex;
    gap: var(--space-2);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    color: rgba(255, 255, 255, .7);
    transition: background var(--duration-sm), color var(--duration-sm);
    text-decoration: none;
}

.social-links a:hover {
    background: var(--color-primary);
    color: white;
}

.footer-widgets {
    display: grid;
    gap: var(--space-8);
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.footer-cat-list a,
.footer-link-list a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
    font-size: var(--fs-sm);
    display: block;
    padding-block: var(--space-1);
    transition: color var(--duration-sm);
}

.footer-cat-list a:hover,
.footer-link-list a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-block: var(--space-5);
}

.footer-bottom-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
}

@media (min-width: 640px) {
    .footer-bottom-inner {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.copyright,
.footer-disclaimer {
    font-size: var(--fs-xs);
    color: rgba(255, 255, 255, .4);
}

.copyright a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
}

.copyright a:hover {
    color: white;
}

/* ============================================================
   25. WIDGETS
   ============================================================ */

.widget {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.widget-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
}

/* Footer widget overrides */
.site-footer .widget-title {
    color: rgba(255, 255, 255, .4);
}

.sidebar-cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: var(--space-2);
    font-size: var(--fs-sm);
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
    transition: color var(--duration-sm);
}

.sidebar-cat-list li a:hover {
    color: var(--color-primary);
}

.sidebar-cat-list .count {
    color: var(--color-text-muted);
    font-size: var(--fs-xs);
    background: var(--color-surface);
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

/* Popular posts widget */
.popular-post-item {
    display: flex;
    gap: var(--space-3);
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
}

.popular-post-item:last-child {
    border-bottom: none;
}

.popular-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.popular-post-title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semi);
    color: var(--color-text);
    text-decoration: none;
    line-height: var(--lh-snug);
    display: block;
}

.popular-post-title:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.popular-post-meta {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.widget-text {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: var(--lh-relaxed);
    margin-bottom: var(--space-3);
}

/* ============================================================
   26. ADSENSE UNITS
   ============================================================ */

.adunit {
    overflow: hidden;
    border-radius: var(--radius);
    text-align: center;
}

.ad-below-title {
    margin-block: var(--space-5);
}

.ad-in-content {
    margin-block: var(--space-8);
}

.ad-between-sections {
    margin-block: var(--space-6);
}

.ad-sidebar {
    margin-bottom: var(--space-4);
}

/* ============================================================
   27. DARK MODE
   ============================================================ */

[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-bg-card: #1e293b;
    --color-surface: #334155;
    --color-border: #334155;
    --color-border-light: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-light: #64748b;
}

[data-theme="dark"] .site-header {
    background: #0f172a;
    border-color: #1e293b;
}

[data-theme="dark"] .post-card,
[data-theme="dark"] .hero-card,
[data-theme="dark"] .widget,
[data-theme="dark"] .table-of-contents,
[data-theme="dark"] .author-box {
    border-color: var(--color-border);
}

[data-theme="dark"] .article-content blockquote {
    background: #1e293b;
}

[data-theme="dark"] .category-strip {
    background: #1e293b;
}

/* ============================================================
   28. CATEGORY BADGES
   ============================================================ */

.category-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(26, 86, 219, .1);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: background var(--duration-sm), color var(--duration-sm);
}

.category-badge:hover {
    background: var(--color-primary);
    color: white;
    text-decoration: none;
}

.category-badge--sm {
    font-size: 10px;
    padding: 2px var(--space-2);
}

/* ============================================================
   29. BUTTONS
   ============================================================ */

.btn-read-more,
.btn-primary,
.btn-subscribe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius);
    font-weight: var(--fw-semi);
    font-size: var(--fs-sm);
    text-decoration: none;
    transition: background var(--duration-sm), transform var(--duration-sm);
    border: none;
    cursor: pointer;
    min-height: 44px;
}

/* Full-width CTA on mobile */
.hero-content .btn-read-more {
    width: 100%;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-content .btn-read-more {
        width: auto;
    }
}

.btn-read-more:hover,
.btn-primary:hover,
.btn-subscribe:hover {
    background: var(--color-primary-h);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* ============================================================
   30. ACCESSIBILITY
   ============================================================ */

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    z-index: 99999;
    background: var(--color-primary);
    color: white;
    padding: var(--space-3) var(--space-5);
    border-radius: 0 0 var(--radius) var(--radius);
    font-weight: var(--fw-semi);
    text-decoration: none;
    transition: top var(--duration-sm);
}

.skip-link:focus {
    top: 0;
}

/* ============================================================
   31. ANIMATIONS
   ============================================================ */

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

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

.hero-card {
    animation: fadeInUp .5s var(--ease) both;
}

.post-card {
    animation: fadeInUp .4s var(--ease) both;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ============================================================
   32. MOBILE POLISH — Extra overrides for small screens
   ============================================================ */

@media (max-width: 479px) {

    /* Container padding più stretto su mobile piccolo */
    .container {
        padding-inline: var(--space-4);
    }

    /* Hero meta su mobile: stack verticalmente */
    .hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-1);
    }

    .hero-meta .meta-sep {
        display: none;
    }

    /* Trending rank più piccolo */
    .trending-rank {
        font-size: var(--fs-2xl);
        min-width: 40px;
    }

    /* Article title su mobile */
    .article-title {
        font-size: clamp(var(--fs-xl), 6vw, var(--fs-3xl));
    }

    /* Article meta: stack su mobile piccolo */
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Social share: icon only su mobile piccolo (già gestito via .share-text display:none < 480px) */

    /* Post card list: sempre verticale su mobile piccolo */
    .posts-list .post-card {
        flex-direction: column;
    }

    /* Author box mobile */
    .author-box {
        flex-direction: column;
        padding: var(--space-4);
    }

    /* Footer widgets: unica colonna */
    .footer-widgets {
        grid-template-columns: 1fr 1fr;
    }

    /* Section header: wrap su mobile */
    .section-header {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
}

/* Aggiustamenti specifici 480-767px (telefoni grandi) */
@media (min-width: 480px) and (max-width: 767px) {
    .hero-title {
        font-size: clamp(var(--fs-xl), 4vw, var(--fs-3xl));
    }

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

/* ============================================================
   33. PRINT
   ============================================================ */

@media print {

    .site-header,
    .sidebar,
    .social-share,
    .author-box,
    .related-posts,
    .newsletter-section,
    .site-footer,
    .adunit,
    #reading-progress,
    .search-overlay,
    .category-strip {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .article-content {
        font-size: 11pt;
    }

    a::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}