/*
Theme Name: Auto361 Magazine
Theme URI: https://auto361.it
Author: Bruno Bellini
Author URI: https://auto361.it
Description: Tema magazine automobilistico professionale con gestione pubblicità integrata, mega-menu marche, dark mode, SEO e performance ottimizzati.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: auto361
Tags: magazine, automotive, news, responsive, custom-logo, custom-menu, featured-images, theme-options

Auto361 Magazine - Il magazine dell'automobilismo italiano.
*/

/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */

:root {
    /* Brand Colors — Celeste & Blu */
    --a361-primary: #1976D2;
    --a361-primary-hover: #42A5F5;
    --a361-primary-dark: #0D47A1;
    --a361-secondary: #00ACC1;
    --a361-secondary-hover: #26C6DA;
    --a361-accent: #0288D1;

    /* Neutrals */
    --a361-dark: #0d1117;
    --a361-dark-alt: #161b22;
    --a361-dark-surface: #21262d;
    --a361-gray-900: #1a1a2e;
    --a361-gray-800: #2d2d44;
    --a361-gray-700: #444;
    --a361-gray-600: #666;
    --a361-gray-500: #888;
    --a361-gray-400: #aaa;
    --a361-gray-300: #ccc;
    --a361-gray-200: #e2e2e2;
    --a361-gray-100: #f0f0f0;
    --a361-white: #ffffff;

    /* Layout */
    --a361-max-width: 1280px;
    --a361-content-width: 860px;
    --a361-sidebar-width: 340px;
    --a361-gap: 24px;
    --a361-radius: 8px;
    --a361-radius-sm: 4px;

    /* Typography */
    --a361-font-heading: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --a361-font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --a361-font-mono: 'JetBrains Mono', monospace;

    /* Shadows */
    --a361-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --a361-shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --a361-shadow-lg: 0 8px 30px rgba(0,0,0,0.18);

    /* Light theme defaults */
    --a361-bg: #f5f5f5;
    --a361-bg-card: #ffffff;
    --a361-text: #1a1a2e;
    --a361-text-secondary: #555;
    --a361-text-muted: #888;
    --a361-border: #e2e2e2;
}

/* Dark mode */
[data-theme="dark"] {
    --a361-bg: #0d1117;
    --a361-bg-card: #161b22;
    --a361-text: #e6edf3;
    --a361-text-secondary: #b1bac4;
    --a361-text-muted: #768390;
    --a361-border: #30363d;
    --a361-shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --a361-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --a361-shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--a361-font-body);
    background: var(--a361-bg);
    color: var(--a361-text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--a361-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--a361-primary-hover); }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--a361-font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--a361-text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

.container {
    max-width: var(--a361-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--a361-primary), var(--a361-secondary));
    z-index: 10000;
    transition: width 0.1s linear;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.topbar {
    background: var(--a361-dark);
    color: var(--a361-gray-400);
    font-size: 0.75rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.topbar-date { opacity: 0.8; }

.topbar-trending {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-trending .badge {
    background: var(--a361-primary);
    color: #fff;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.topbar-trending a { color: var(--a361-gray-300); }
.topbar-trending a:hover { color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-social {
    display: flex;
    gap: 8px;
}

.topbar-social a {
    color: var(--a361-gray-500);
    font-size: 0.85rem;
    transition: color 0.2s;
}
.topbar-social a:hover { color: #fff; }

/* Dark mode toggle */
.dark-toggle {
    background: none;
    border: 1px solid var(--a361-gray-700);
    color: var(--a361-gray-400);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dark-toggle:hover { border-color: var(--a361-gray-400); color: #fff; }

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background: var(--a361-bg-card);
    border-bottom: 1px solid var(--a361-border);
    position: relative;
    z-index: 1000;
}

.header-main {
    padding: 16px 0;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo img {
    max-height: 48px;
    width: auto;
}

.site-logo .site-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--a361-text);
    letter-spacing: -0.5px;
}
.site-logo .site-title span { color: var(--a361-primary); }

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

.header-search-btn,
.header-menu-btn {
    background: none;
    border: none;
    color: var(--a361-text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--a361-radius-sm);
    transition: background 0.2s;
    font-size: 1.1rem;
}
.header-search-btn:hover,
.header-menu-btn:hover { background: var(--a361-gray-100); }
[data-theme="dark"] .header-search-btn:hover,
[data-theme="dark"] .header-menu-btn:hover { background: var(--a361-dark-surface); }

.header-menu-btn { display: none; }

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.nav-bar {
    background: var(--a361-dark);
}

.nav-bar .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 0;
}

.main-nav > ul > li > a {
    display: block;
    padding: 14px 20px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: relative;
    transition: background 0.2s;
}

.main-nav > ul > li > a:hover,
.main-nav > ul > li.current-menu-item > a,
.main-nav > ul > li.current-menu-parent > a {
    background: rgba(255,255,255,0.08);
    color: var(--a361-primary-hover);
}

.main-nav > ul > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--a361-primary);
    transition: width 0.3s ease;
}
.main-nav > ul > li > a:hover::after,
.main-nav > ul > li.current-menu-item > a::after {
    width: 100%;
}

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

.main-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--a361-bg-card);
    border: 1px solid var(--a361-border);
    border-radius: 0 0 var(--a361-radius) var(--a361-radius);
    box-shadow: var(--a361-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 999;
    padding: 8px 0;
}

.main-nav li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav .sub-menu a {
    display: block;
    padding: 8px 20px;
    color: var(--a361-text);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.15s, padding-left 0.15s;
}

.main-nav .sub-menu a:hover {
    background: var(--a361-gray-100);
    padding-left: 26px;
    color: var(--a361-primary);
}
[data-theme="dark"] .main-nav .sub-menu a:hover { background: var(--a361-dark-surface); }

/* Has children arrow */
.main-nav > ul > li.menu-item-has-children > a::before {
    content: '▾';
    margin-left: 4px;
    font-size: 0.7em;
    opacity: 0.6;
}

/* Mega Menu for Marche */
.main-nav li.mega-menu > .sub-menu {
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 700px;
    max-width: 900px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 16px;
}

.main-nav li.mega-menu:hover > .sub-menu {
    transform: translateX(-50%) translateY(0);
}

.main-nav li.mega-menu .sub-menu li {
    padding: 0;
}

.main-nav li.mega-menu .sub-menu .menu-item-header > a {
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--a361-text-muted);
    padding: 8px 12px 4px;
    cursor: default;
    border-bottom: 1px solid var(--a361-border);
    margin-bottom: 4px;
}
.main-nav li.mega-menu .sub-menu .menu-item-header > a:hover {
    background: transparent;
    padding-left: 12px;
}

.main-nav li.mega-menu .sub-menu a {
    padding: 5px 12px;
    font-size: 0.82rem;
}

/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.search-overlay.active { opacity: 1; visibility: visible; }

.search-overlay-inner {
    width: 100%;
    max-width: 640px;
    padding: 0 20px;
}

.search-overlay input[type="search"] {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 1.8rem;
    font-family: var(--a361-font-heading);
    padding: 16px 0;
    outline: none;
}
.search-overlay input[type="search"]::placeholder { color: rgba(255,255,255,0.4); }
.search-overlay input[type="search"]:focus { border-bottom-color: var(--a361-primary); }

.search-overlay-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
}
.search-overlay-close:hover { opacity: 1; }

/* ==========================================================================
   STICKY HEADER
   ========================================================================== */

.sticky-header {
    position: fixed;
    top: -60px;
    left: 0;
    right: 0;
    background: var(--a361-dark);
    z-index: 999;
    box-shadow: var(--a361-shadow-lg);
    transition: top 0.3s ease;
}
.sticky-header.visible { top: 0; }

.sticky-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.sticky-logo img { max-height: 28px; }
.sticky-logo .site-title { font-size: 1.1rem; font-weight: 800; color: #fff; }
.sticky-logo .site-title span { color: var(--a361-primary); }

.sticky-nav ul { display: flex; gap: 0; }
.sticky-nav a {
    display: block;
    padding: 16px 14px;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sticky-nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }

.sticky-search-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 8px;
    font-size: 1rem;
}

/* ==========================================================================
   HERO / HOMEPAGE
   ========================================================================== */

.hero-section {
    padding: 24px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    min-height: 420px;
}

.hero-main {
    position: relative;
    border-radius: var(--a361-radius);
    overflow: hidden;
}

.hero-main .hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.hero-main:hover .hero-img { transform: scale(1.03); }

.hero-main .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 24px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
}

.hero-main .hero-cat {
    display: inline-block;
    background: var(--a361-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

.hero-main .hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 8px;
    color: #fff;
}
.hero-main .hero-title a { color: #fff; }
.hero-main .hero-title a:hover { color: var(--a361-gray-200); }

.hero-main .hero-excerpt {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    margin-bottom: 8px;
}

.hero-main .hero-meta {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}

.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-sidebar-item {
    position: relative;
    border-radius: var(--a361-radius);
    overflow: hidden;
    flex: 1;
}

.hero-sidebar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.hero-sidebar-item:hover img { transform: scale(1.04); }

.hero-sidebar-item .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.hero-sidebar-item .hero-cat {
    display: inline-block;
    background: var(--a361-secondary);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.hero-sidebar-item .hero-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}
.hero-sidebar-item .hero-title a { color: #fff; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section {
    padding: 32px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--a361-primary);
    padding-bottom: 10px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-more {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--a361-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   POST CARDS
   ========================================================================== */

.card {
    background: var(--a361-bg-card);
    border-radius: var(--a361-radius);
    overflow: hidden;
    border: 1px solid var(--a361-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--a361-shadow-md);
}

.card-thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.card:hover .card-thumb img { transform: scale(1.06); }

.card-thumb .card-cat {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--a361-primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-thumb .gallery-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}
.card-title a { color: var(--a361-text); }
.card-title a:hover { color: var(--a361-primary); }

.card-excerpt {
    font-size: 0.85rem;
    color: var(--a361-text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--a361-text-muted);
}

.card-meta .author { font-weight: 600; color: var(--a361-text-secondary); }

/* Card grid */
.card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--a361-gap); }
.card-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--a361-gap); }

/* List card */
.card-list {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--a361-border);
    background: transparent;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
}
.card-list:hover { transform: none; box-shadow: none; }

.card-list .card-thumb {
    flex-shrink: 0;
    width: 140px;
    aspect-ratio: 16/10;
    border-radius: var(--a361-radius);
}

.card-list .card-body { padding: 0; flex: 1; }
.card-list .card-title { font-size: 0.95rem; }

/* Ranked list */
.ranked-list { counter-reset: rank; }

.ranked-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--a361-border);
    counter-increment: rank;
}

.ranked-item::before {
    content: counter(rank);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--a361-primary);
    min-width: 24px;
    line-height: 1.3;
}

.ranked-item .ranked-title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
}
.ranked-item .ranked-title a { color: var(--a361-text); }
.ranked-item .ranked-title a:hover { color: var(--a361-primary); }

.ranked-item .ranked-meta {
    font-size: 0.7rem;
    color: var(--a361-text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   MAIN + SIDEBAR LAYOUT
   ========================================================================== */

.content-sidebar {
    display: grid;
    grid-template-columns: 1fr var(--a361-sidebar-width);
    gap: 32px;
}

.sidebar .widget {
    background: var(--a361-bg-card);
    border: 1px solid var(--a361-border);
    border-radius: var(--a361-radius);
    padding: 20px;
    margin-bottom: 24px;
}

.sidebar .widget-title {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 3px solid var(--a361-primary);
}

/* ==========================================================================
   AD SPOTS
   ========================================================================== */

.ad-slot {
    text-align: center;
    margin: 20px 0;
    padding: 0;
    position: relative;
}

.ad-slot img { margin: 0 auto; max-width: 100%; }

.ad-slot--leaderboard { padding: 12px 0; }
.ad-slot--sidebar { margin-bottom: 24px; }

.ad-label {
    display: block;
    font-size: 0.6rem;
    color: var(--a361-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-align: center;
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */

.single-header {
    padding: 30px 0 20px;
}

.single-breadcrumbs {
    font-size: 0.78rem;
    color: var(--a361-text-muted);
    margin-bottom: 16px;
}
.single-breadcrumbs a { color: var(--a361-text-secondary); }
.single-breadcrumbs a:hover { color: var(--a361-primary); }
.single-breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }

.single-cat {
    display: inline-block;
    background: var(--a361-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

.single-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
}

.single-excerpt {
    font-size: 1.1rem;
    color: var(--a361-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.single-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--a361-text-muted);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--a361-border);
}

.single-meta .author-name { font-weight: 700; color: var(--a361-text); }

.single-featured {
    margin: 24px 0;
    border-radius: var(--a361-radius);
    overflow: hidden;
}

.entry-content {
    max-width: var(--a361-content-width);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--a361-text);
}

.entry-content p { margin-bottom: 1.4em; }
.entry-content h2 { font-size: 1.5rem; margin: 2em 0 0.8em; }
.entry-content h3 { font-size: 1.25rem; margin: 1.6em 0 0.6em; }
.entry-content blockquote {
    border-left: 4px solid var(--a361-primary);
    padding: 16px 24px;
    margin: 1.5em 0;
    background: var(--a361-bg);
    border-radius: 0 var(--a361-radius) var(--a361-radius) 0;
    font-style: italic;
    color: var(--a361-text-secondary);
}
.entry-content ul, .entry-content ol {
    margin: 1em 0 1em 24px;
    list-style: disc;
}
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content img {
    border-radius: var(--a361-radius);
    margin: 1.5em 0;
}
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }

/* Share buttons (sticky) */
.share-sticky {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 30px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.9rem;
    transition: transform 0.2s;
}
.share-btn:hover { transform: scale(1.1); color: #fff; }
.share-btn--fb { background: #1877F2; }
.share-btn--tw { background: #1DA1F2; }
.share-btn--wa { background: #25D366; }
.share-btn--tg { background: #0088cc; }
.share-btn--li { background: #0A66C2; }

/* ==========================================================================
   AUTHOR BOX
   ========================================================================== */

.author-box {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--a361-bg);
    border-radius: var(--a361-radius);
    margin: 32px 0;
    border: 1px solid var(--a361-border);
}

.author-box-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.author-box-bio {
    font-size: 0.85rem;
    color: var(--a361-text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   RELATED POSTS
   ========================================================================== */

.related-posts {
    padding: 32px 0;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 32px 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--a361-radius-sm);
    border: 1px solid var(--a361-border);
    color: var(--a361-text);
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--a361-primary);
    color: #fff;
    border-color: var(--a361-primary);
}
.pagination .current {
    background: var(--a361-primary);
    color: #fff;
    border-color: var(--a361-primary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--a361-dark);
    color: var(--a361-gray-400);
    padding: 48px 0 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-widget-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--a361-primary);
    display: inline-block;
}

.footer-about-text {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.footer-social { display: flex; gap: 8px; }
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    color: var(--a361-gray-400);
    transition: all 0.2s;
}
.footer-social a:hover { background: var(--a361-primary); color: #fff; }

.footer-links li { margin-bottom: 8px; }
.footer-links a {
    color: var(--a361-gray-400);
    font-size: 0.85rem;
    transition: color 0.2s, padding-left 0.2s;
}
.footer-links a:hover { color: #fff; padding-left: 4px; }

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.78rem;
}

.footer-bottom a { color: var(--a361-gray-400); }
.footer-bottom a:hover { color: #fff; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; min-height: auto; }
    .hero-sidebar { flex-direction: row; }
    .hero-sidebar-item { height: 180px; }
    .content-sidebar { grid-template-columns: 1fr; }
    .sidebar { order: 2; }
    .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .main-nav li.mega-menu > .sub-menu { min-width: 500px; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    :root { --a361-gap: 16px; }
    h1, .single-title { font-size: 1.5rem; }
    .topbar { display: none; }
    .header-menu-btn { display: block; }
    .main-nav { display: none; }
    .main-nav.active {
        display: block;
        position: fixed;
        inset: 0;
        background: var(--a361-bg-card);
        z-index: 9998;
        padding: 72px 24px 24px;
        overflow-y: auto;
    }
    .main-nav.active ul { flex-direction: column; }
    .main-nav.active > ul > li > a {
        color: var(--a361-text);
        padding: 14px 0;
        border-bottom: 1px solid var(--a361-border);
        font-size: 1rem;
    }
    .main-nav.active .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 16px;
    }
    .main-nav li.mega-menu > .sub-menu {
        display: block;
        min-width: unset;
    }
    .nav-bar { display: none; }
    .hero-sidebar { flex-direction: column; }
    .hero-sidebar-item { height: 160px; }
    .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
    .card-list .card-thumb { width: 110px; }
    .footer-grid { grid-template-columns: 1fr; }
    .share-sticky { flex-direction: row; position: static; padding: 16px 0; }
    .sticky-header { display: none; }
    .single-meta { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .hero-main .hero-title { font-size: 1.2rem; }
    .card-list .card-thumb { width: 90px; }
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}
.lightbox.active { opacity: 1; visibility: visible; }

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--a361-radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    padding: 16px;
    cursor: pointer;
    border-radius: var(--a361-radius);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.comments-area { padding: 32px 0; }

.comment-list .comment {
    padding: 20px 0;
    border-bottom: 1px solid var(--a361-border);
}

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

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--a361-border);
    border-radius: var(--a361-radius-sm);
    background: var(--a361-bg-card);
    color: var(--a361-text);
    font-family: var(--a361-font-body);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--a361-primary);
}

.comment-form .submit {
    background: var(--a361-primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--a361-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.comment-form .submit:hover { background: var(--a361-primary-hover); }

/* ==========================================================================
   404
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 80px 20px;
}

.error-404 h1 {
    font-size: 6rem;
    font-weight: 900;
    color: var(--a361-primary);
    line-height: 1;
    margin-bottom: 16px;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

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

.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
