/*
Theme Name: Flavor Starter
Theme URI: https://gianlucagentile.com
Author: Gianluca Gentile
Author URI: https://gianlucagentile.com
Description: Tema personalizzato per il blog di Gianluca Gentile - Consulente Web Marketing e Full Stack Developer
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor-starter
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --primary: #fcb321;
    --primary-dark: #e5a21e;
    --secondary: #000222;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --text: #000222;
    --text-light: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --radius: 12px;
    --radius-lg: 24px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Fix for iOS fixed positioning */
    height: 100%;
    overflow-x: hidden;
}

html, body {
    /* Prevent horizontal scroll and fix iOS fixed position issues */
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    min-height: 100%;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--secondary);
}

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

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

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Extra spacing for blog grid container */
.site-main > .container {
    padding-top: 20px;
}

.site-main {
    padding: 0 0 100px !important;
    min-height: calc(100vh - 400px) !important;
}

/* Space before content when no page-header */
.site-main > .container:first-child {
    padding-top: 100px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important;
    padding: 20px 0 !important;
    transition: var(--transition) !important;
    background: transparent !important;
    /* iOS fixed position fix */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* On blog pages, header always has dark background */
body.blog .header,
body.single .header,
body.archive .header,
body.search .header,
body.page .header {
    background: var(--secondary) !important;
}

body.blog .header.scrolled,
body.single .header.scrolled,
body.archive .header.scrolled,
body.search .header.scrolled,
body.page .header.scrolled {
    background: var(--white) !important;
    box-shadow: var(--shadow) !important;
    padding: 12px 0 !important;
}

.header.scrolled {
    background: var(--white) !important;
    box-shadow: var(--shadow) !important;
    padding: 12px 0 !important;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px;
    transition: var(--transition);
}

.logo-white { display: block !important; }
.logo-color { display: none !important; }

.header.scrolled .logo-white { display: none !important; }
.header.scrolled .logo-color { display: block !important; }

/* On blog pages - show white logo by default */
body.blog .header .logo-white,
body.single .header .logo-white,
body.archive .header .logo-white,
body.search .header .logo-white,
body.page .header .logo-white {
    display: block !important;
}
body.blog .header .logo-color,
body.single .header .logo-color,
body.archive .header .logo-color,
body.search .header .logo-color,
body.page .header .logo-color {
    display: none !important;
}
body.blog .header.scrolled .logo-white,
body.single .header.scrolled .logo-white,
body.archive .header.scrolled .logo-white,
body.search .header.scrolled .logo-white,
body.page .header.scrolled .logo-white {
    display: none !important;
}
body.blog .header.scrolled .logo-color,
body.single .header.scrolled .logo-color,
body.archive .header.scrolled .logo-color,
body.search .header.scrolled .logo-color,
body.page .header.scrolled .logo-color {
    display: block !important;
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a {
    padding: 10px 16px !important;
    color: var(--white) !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    transition: var(--transition) !important;
}

.header.scrolled .nav a {
    color: var(--text) !important;
}

/* Blog pages nav styling */
body.blog .header .nav a,
body.single .header .nav a,
body.archive .header .nav a,
body.search .header .nav a,
body.page .header .nav a {
    color: var(--white) !important;
}
body.blog .header.scrolled .nav a,
body.single .header.scrolled .nav a,
body.archive .header.scrolled .nav a,
body.search .header.scrolled .nav a,
body.page .header.scrolled .nav a {
    color: var(--text) !important;
}

.nav a:hover {
    background: rgba(252, 179, 33, 0.1);
    color: var(--primary);
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.nav-item:hover svg {
    transform: rotate(180deg);
}

/* Button Nav */
.btn-nav {
    background: linear-gradient(135deg, var(--primary), #ffd700) !important;
    color: var(--secondary) !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(252, 179, 33, 0.4);
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    min-width: 700px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-inner {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 32px;
}

.mega-menu-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 16px;
    padding-left: 12px;
}

.mega-menu-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    color: var(--text);
}

.mega-menu-item:hover {
    background: var(--gray-50);
}

.mega-menu-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(252, 179, 33, 0.1), rgba(252, 179, 33, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mega-menu-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--primary);
}

.mega-menu-text strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
}

.mega-menu-text span {
    font-size: 0.8rem;
    color: var(--text-light);
}

.mega-menu-cta {
    background: linear-gradient(135deg, var(--secondary), #1a1a3e);
    padding: 24px;
    border-radius: var(--radius);
    color: var(--white);
    min-width: 200px;
}

.mega-menu-cta-icon {
    width: 48px;
    height: 48px;
    background: rgba(252, 179, 33, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.mega-menu-cta-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--primary);
}

.mega-menu-cta h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.mega-menu-cta p {
    font-size: 0.85rem;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.btn-small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: var(--secondary);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
}

.btn-small svg {
    width: 16px;
    height: 16px;
    stroke: var(--secondary);
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
}

.header.scrolled .menu-toggle span {
    background: var(--secondary);
}

/* Hamburger to X animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-overlay {
    display: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--secondary);
    color: var(--white);
    padding: 80px 0 40px;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(252, 179, 33, 0.3), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand img {
    height: 50px;
    margin-bottom: 20px;
}

.footer-brand p {
    color: var(--gray-300);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

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

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    color: var(--secondary);
    transform: translateY(-3px);
}

.footer-column h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 12px;
}

.footer-column a {
    color: var(--gray-300);
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-partner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
    margin: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-partner img {
    height: 100px;
    transition: var(--transition);
}

.footer-partner img:hover {
    transform: scale(1.05);
}

.footer-partner p {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 30px;
}

.footer-bottom p {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    padding-top: 20px;
    width: 100%;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    transition: color 0.3s;
    white-space: nowrap;
}

.footer-legal a:hover {
    color: var(--primary);
}

.footer-legal span {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   BLOG STYLES
   ============================================ */

/* Page Header with Video Background */
.page-header {
    background: var(--secondary) !important;
    padding: 160px 0 100px !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 380px !important;
}

/* Centered content only on blog index */
body.blog .page-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Single post header adjustments */
body.single .page-header {
    padding: 180px 0 80px !important;
    min-height: auto !important;
}

/* Video Background */
.page-header-video {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    width: auto !important;
    height: auto !important;
    transform: translate(-50%, -50%) !important;
    object-fit: cover !important;
    z-index: 0 !important;
    opacity: 0.4 !important;
}

.page-header-video.hidden {
    display: none !important;
}

/* Video Overlay */
.page-header-overlay {
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(
        180deg,
        rgba(0, 2, 34, 0.7) 0%,
        rgba(0, 2, 34, 0.5) 50%,
        rgba(0, 2, 34, 0.8) 100%
    ) !important;
    z-index: 1 !important;
}

/* Background Effects */
.page-header-bg {
    position: absolute !important;
    inset: 0 !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

.page-header-bg::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background:
        radial-gradient(circle at 20% 80%, rgba(252, 179, 33, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(252, 179, 33, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(252, 179, 33, 0.05) 0%, transparent 60%) !important;
    animation: float 20s ease-in-out infinite !important;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

.page-header-grid {
    position: absolute !important;
    inset: 0 !important;
    background-image:
        linear-gradient(rgba(252, 179, 33, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(252, 179, 33, 0.03) 1px, transparent 1px) !important;
    background-size: 60px 60px !important;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%) !important;
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%) !important;
}

.page-header-glow {
    position: absolute !important;
    width: 500px !important;
    height: 500px !important;
    background: radial-gradient(circle, rgba(252, 179, 33, 0.25) 0%, transparent 70%) !important;
    border-radius: 50% !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    filter: blur(60px) !important;
    animation: pulse-glow 4s ease-in-out infinite !important;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.page-header .container {
    position: relative !important;
    z-index: 10 !important;
    width: 100% !important;
}

.page-header h1 {
    color: var(--white);
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 16px;
}

/* Single post title in header */
body.single .page-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.8rem);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}

.page-header h1 span {
    background: linear-gradient(135deg, var(--primary), #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--gray-300);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Space after page-header before content */
.page-header + .breadcrumbs + .blog-layout,
.page-header + .blog-layout,
.page-header + .breadcrumbs + article,
.page-header + article {
    margin-top: 0;
}

body.blog .page-header {
    margin-bottom: 60px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 20px 0;
    background: var(--gray-50);
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--text-light);
}

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

.breadcrumbs span {
    color: var(--text-light);
    margin: 0 8px;
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 500;
}

/* Blog Content Full Width (no sidebar) */
.blog-content-full {
    width: 100% !important;
}

/* Blog Grid */
.blog-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 40px !important;
}

/* 3 Column Grid for main blog */
.blog-grid-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* ============================================
   PREMIUM ARTICLE CARDS
   ============================================ */

/* Article Card Base */
.article-card {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 2, 34, 0.08);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-200);
}

.article-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 2, 34, 0.18);
    border-color: var(--primary);
}

/* Top Gradient Bar */
.article-card-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #ffd700);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
}

.article-card:hover .article-card-top-bar {
    transform: scaleX(1);
}

/* Image Wrapper */
.article-card-image-wrapper {
    position: relative;
    overflow: hidden;
}

/* Image Link */
.article-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--secondary), #1a1a3e);
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover .article-card-image img {
    transform: scale(1.15);
}

/* Image Overlay Gradient */
.article-card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 2, 34, 0.7) 0%,
        rgba(0, 2, 34, 0.3) 40%,
        rgba(0, 2, 34, 0) 100%
    );
    pointer-events: none;
    z-index: 5;
}

/* Animated Placeholder */
.article-card-image .placeholder-image {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary) 0%, #1a1a3e 50%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Geometric Pattern Background */
.article-card-image .placeholder-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(30deg, rgba(252, 179, 33, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(252, 179, 33, 0.1) 87.5%, rgba(252, 179, 33, 0.1)),
        linear-gradient(150deg, rgba(252, 179, 33, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(252, 179, 33, 0.1) 87.5%, rgba(252, 179, 33, 0.1)),
        linear-gradient(30deg, rgba(252, 179, 33, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(252, 179, 33, 0.1) 87.5%, rgba(252, 179, 33, 0.1)),
        linear-gradient(150deg, rgba(252, 179, 33, 0.1) 12%, transparent 12.5%, transparent 87%, rgba(252, 179, 33, 0.1) 87.5%, rgba(252, 179, 33, 0.1)),
        linear-gradient(60deg, rgba(255, 215, 0, 0.08) 25%, transparent 25.5%, transparent 75%, rgba(255, 215, 0, 0.08) 75%, rgba(255, 215, 0, 0.08)),
        linear-gradient(60deg, rgba(255, 215, 0, 0.08) 25%, transparent 25.5%, transparent 75%, rgba(255, 215, 0, 0.08) 75%, rgba(255, 215, 0, 0.08));
    background-size: 40px 70px;
    background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
    animation: patternMove 20s linear infinite;
    opacity: 0.8;
}

@keyframes patternMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(40px, 70px); }
}

.article-card-image .placeholder-icon {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    stroke: var(--primary);
    opacity: 0.6;
    filter: drop-shadow(0 4px 20px rgba(252, 179, 33, 0.3));
}

/* Glass Morphism Badges */
.article-card-badge {
    position: absolute;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.article-card-badge svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Category Badge - Bottom Left */
.article-card-category {
    bottom: 16px;
    left: 16px;
    text-decoration: none;
}

.article-card-category:hover {
    background: rgba(252, 179, 33, 0.9);
    color: var(--secondary);
    text-shadow: none;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Reading Time Badge - Bottom Right */
.article-card-reading-time {
    bottom: 16px;
    right: 16px;
}

/* Content Section */
.article-card-content {
    padding: 28px 28px 32px;
    position: relative;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
    transition: background 0.3s ease;
}

.article-card:hover .article-card-content {
    background: linear-gradient(180deg, var(--white) 0%, rgba(252, 179, 33, 0.05) 100%);
}

/* Date */
.article-card-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 14px;
}

.article-card-date svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary);
    flex-shrink: 0;
}

.article-card-date time {
    font-weight: 500;
}

/* Title */
.article-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-title a {
    color: var(--secondary);
    text-decoration: none;
    background: linear-gradient(to right, var(--primary), var(--primary));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.4s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

.article-card:hover .article-card-title a {
    background-size: 100% 2px;
}

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

/* Excerpt */
.article-card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* CTA Button - Full Width */
.article-card-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #ffd700 100%);
    color: var(--secondary);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(252, 179, 33, 0.3);
    position: relative;
    overflow: hidden;
}

.article-card-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ffd700 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.article-card-cta span {
    position: relative;
    z-index: 1;
}

.article-card-cta svg {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    stroke: var(--secondary);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover .article-card-cta {
    box-shadow: 0 8px 25px rgba(252, 179, 33, 0.45);
    transform: translateY(-2px);
}

.article-card:hover .article-card-cta::before {
    opacity: 1;
}

.article-card:hover .article-card-cta svg {
    transform: translateX(6px);
}

/* Legacy read-more class support */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 24px;
    background: rgba(252, 179, 33, 0.1);
    border-radius: 50px;
    transition: var(--transition);
}

.read-more:hover {
    background: var(--primary);
    color: var(--secondary);
}

.read-more svg {
    width: 18px;
    height: 18px;
    transition: var(--transition);
}

.read-more:hover svg {
    transform: translateX(4px);
    stroke: var(--secondary);
}

/* Accessibility - Focus States */
.article-card:focus-within {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary), 0 25px 50px rgba(0, 2, 34, 0.18);
}

.article-card-image:focus {
    outline: none;
}

.article-card-image:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.article-card-title a:focus {
    outline: none;
}

.article-card-title a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.article-card-cta:focus {
    outline: none;
}

.article-card-cta:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

.article-card-category:focus {
    outline: none;
}

.article-card-category:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Single Post */
.single-post {
    max-width: none !important;
    margin: 0 !important;
    padding: 60px 0 80px !important;
}

.single-post > .container {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

.single-post-header {
    margin-bottom: 40px;
}

.single-post-category {
    display: inline-block;
    background: var(--primary);
    color: var(--secondary);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.single-post-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.3;
    margin-bottom: 20px;
}

.single-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    color: var(--gray-300);
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.single-post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.single-post-meta svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
    flex-shrink: 0;
}

.single-post-featured {
    margin-bottom: 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.single-post-featured img {
    width: 100%;
    height: auto;
}

/* Post Content */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 1.75rem;
    margin: 48px 0 20px;
}

.post-content h3 {
    font-size: 1.4rem;
    margin: 40px 0 16px;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content ul, .post-content ol {
    margin: 24px 0;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 12px;
}

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 24px 32px;
    background: var(--gray-50);
    margin: 32px 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    font-size: 1.15rem;
}

.post-content pre {
    background: var(--secondary);
    color: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 32px 0;
}

.post-content code {
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre code {
    background: transparent;
    padding: 0;
}

.post-content img {
    border-radius: var(--radius);
    margin: 32px 0;
}

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

/* Post Tags */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

.post-tags a {
    background: var(--gray-100);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.post-tags a:hover {
    background: var(--primary);
    color: var(--secondary);
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--gray-200);
}

.nav-previous, .nav-next {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-previous:hover, .nav-next:hover {
    background: var(--gray-100);
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.nav-title {
    font-weight: 600;
    color: var(--secondary);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 24px;
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    margin-top: 60px;
}

.author-avatar {
    flex-shrink: 0;
}

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

.author-info h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.author-info p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* Related Posts */
.related-posts {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid var(--gray-200);
}

.related-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-align: center;
}

/* Related Posts Carousel */
.related-posts-carousel {
    position: relative;
    overflow: hidden;
    margin: 0 -20px;
    padding: 0 20px;
}

.related-posts-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0 20px;
}

.related-posts-track::-webkit-scrollbar {
    display: none;
}

.related-posts-track .article-card {
    flex: 0 0 calc(33.333% - 16px);
    min-width: 280px;
    max-width: 400px;
    scroll-snap-align: start;
    animation: none;
    opacity: 1;
}

/* Carousel Navigation */
.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--gray-200);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--secondary);
}

.carousel-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--secondary);
    transform: scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.carousel-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.carousel-dot:hover {
    background: var(--primary-dark);
}

/* Related posts card adjustments - fix badge overlap */
.related-posts .article-card .article-card-badge {
    padding: 6px 10px;
    font-size: 0.65rem;
}

.related-posts .article-card .article-card-category {
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-posts .article-card .article-card-reading-time {
    bottom: auto;
    top: 16px;
    right: 12px;
}

.related-posts .article-card .article-card-category {
    bottom: 12px;
    left: 12px;
}

.related-posts .article-card .article-card-content {
    padding: 20px 20px 24px;
}

.related-posts .article-card .article-card-title {
    font-size: 1.1rem;
}

.related-posts .article-card .article-card-excerpt {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
}

.related-posts .article-card .article-card-cta {
    padding: 12px 16px;
    font-size: 0.75rem;
}

/* Responsive carousel */
@media (max-width: 1024px) {
    .related-posts-track .article-card {
        flex: 0 0 calc(50% - 12px);
        min-width: 260px;
    }
}

@media (max-width: 600px) {
    .related-posts-track .article-card {
        flex: 0 0 calc(100% - 40px);
        min-width: 240px;
        max-width: none;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

    .carousel-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* Sidebar */
.blog-layout {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 60px !important;
    padding-top: 20px !important;
}

.blog-content {
    min-width: 0 !important;
}

.sidebar {
    position: sticky !important;
    top: 120px !important;
    align-self: start !important;
}

.widget {
    background: var(--white) !important;
    border-radius: var(--radius-lg) !important;
    padding: 28px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 4px 20px rgba(0, 2, 34, 0.08) !important;
    border: 1px solid var(--gray-100) !important;
    transition: var(--transition) !important;
}

.widget:hover {
    border-color: rgba(252, 179, 33, 0.3) !important;
    box-shadow: 0 8px 30px rgba(0, 2, 34, 0.12) !important;
}

.widget-title {
    font-size: 1.15rem !important;
    margin-bottom: 24px !important;
    padding-bottom: 16px !important;
    border-bottom: 2px solid var(--primary) !important;
    color: var(--secondary) !important;
    font-weight: 700 !important;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.widget a {
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.widget .count {
    background: var(--gray-100);
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Search Widget */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form button {
    background: var(--primary);
    color: var(--secondary);
    border: none;
    padding: 12px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius);
    font-weight: 600;
    transition: var(--transition);
}

.pagination a {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--gray-200);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .current {
    background: var(--primary);
    color: var(--secondary);
    border: 2px solid var(--primary);
}

/* Comments */
.comments-area {
    margin-top: 80px;
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

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

.comment-author .fn {
    font-weight: 600;
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--text-light);
}

.comment-content {
    line-height: 1.7;
}

.comment-reply-link {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 12px;
    display: inline-block;
}

/* Comment Form */
.comment-respond {
    margin-top: 40px;
    padding: 32px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.comment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    margin-bottom: 20px;
}

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

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

.comment-form .submit {
    background: linear-gradient(135deg, var(--primary), #ffd700);
    color: var(--secondary);
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form .submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(252, 179, 33, 0.4);
}

/* ============================================
   WORDPRESS OVERRIDES & FIXES
   ============================================ */

/* Reset WordPress defaults */
body.blog,
body.single,
body.archive,
body.search,
body.page {
    margin: 0 !important;
    padding: 0 !important;
    background: var(--white) !important;
}

/* Remove WordPress admin bar space when logged in */
body.admin-bar .header {
    top: 32px !important;
}

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

/* WordPress block styling overrides */
.wp-block-image img {
    border-radius: var(--radius) !important;
}

.wp-block-quote {
    border-left: 4px solid var(--primary) !important;
    padding: 24px 32px !important;
    background: var(--gray-50) !important;
    margin: 32px 0 !important;
    border-radius: 0 var(--radius) var(--radius) 0 !important;
    font-style: italic !important;
}

.wp-block-code {
    background: var(--secondary) !important;
    color: var(--white) !important;
    padding: 24px !important;
    border-radius: var(--radius) !important;
}

/* Category list in widget */
.widget_categories ul,
.widget_archive ul,
.widget_recent_entries ul,
.widget_pages ul,
.widget_meta ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget_categories li,
.widget_archive li,
.widget_recent_entries li,
.widget_pages li,
.widget_meta li {
    padding: 12px 0 !important;
    border-bottom: 1px solid var(--gray-100) !important;
    margin: 0 !important;
}

.widget_categories li:last-child,
.widget_archive li:last-child,
.widget_recent_entries li:last-child,
.widget_pages li:last-child,
.widget_meta li:last-child {
    border-bottom: none !important;
}

.widget_categories a,
.widget_archive a,
.widget_recent_entries a,
.widget_pages a,
.widget_meta a {
    color: var(--text) !important;
    font-size: 0.95rem !important;
    display: block !important;
}

.widget_categories a:hover,
.widget_archive a:hover,
.widget_recent_entries a:hover,
.widget_pages a:hover,
.widget_meta a:hover {
    color: var(--primary) !important;
}

/* No posts styling */
.no-posts {
    text-align: center;
    padding: 80px 40px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.no-posts h2 {
    margin-bottom: 16px;
    color: var(--secondary);
}

.no-posts p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(252, 179, 33, 0.2);
    z-index: 100000;
}

.reading-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), #ffd700);
    transition: width 0.1s ease;
}

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

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

/* ============================================
   ENHANCED ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(0, 2, 34, 0.08);
    }
    50% {
        box-shadow: 0 8px 30px rgba(252, 179, 33, 0.15);
    }
}

/* Staggered Card Animations */
.article-card {
    opacity: 0;
    animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.article-card:nth-child(1) { animation-delay: 0s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.2s; }
.article-card:nth-child(4) { animation-delay: 0.3s; }
.article-card:nth-child(5) { animation-delay: 0.4s; }
.article-card:nth-child(6) { animation-delay: 0.5s; }
.article-card:nth-child(7) { animation-delay: 0.6s; }
.article-card:nth-child(8) { animation-delay: 0.7s; }
.article-card:nth-child(9) { animation-delay: 0.8s; }

/* Image hover zoom enhancement */
.article-card-image img {
    position: relative;
    z-index: 2;
}

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

/* Desktop Large (1200px+) */
@media (min-width: 1200px) {
    .blog-grid-3 .article-card-title {
        font-size: 1.3rem;
    }
}

/* Tablet & Desktop (max 1024px) */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 30px !important;
    }

    .blog-grid-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .blog-layout {
        grid-template-columns: 1fr !important;
        gap: 50px !important;
    }

    .sidebar {
        position: static !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .sidebar .widget {
        margin-bottom: 0 !important;
    }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .mega-menu {
        display: none !important;
    }

    .page-header {
        padding: 150px 0 80px !important;
        min-height: 340px !important;
    }

    /* Card adjustments for tablet */
    .article-card-content {
        padding: 24px 24px 28px;
    }

    .article-card-title {
        font-size: 1.25rem;
    }

    .article-card-cta {
        padding: 14px 20px;
        font-size: 0.8rem;
    }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
    /* Ensure header stays fixed on mobile */
    .header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 99999 !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .header .container {
        padding: 0 16px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
        background: var(--white);
        flex-direction: column;
        align-items: stretch;
        padding: 80px 24px 24px;
        gap: 0;
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
        z-index: 1000;
        overflow-y: auto;
    }

    .nav.active {
        right: 0;
    }

    /* Force dark text in mobile menu - override all other rules */
    .nav a,
    .header .nav a,
    body.blog .header .nav a,
    body.single .header .nav a,
    body.archive .header .nav a,
    body.search .header .nav a,
    body.page .header .nav a {
        color: var(--secondary) !important;
        padding: 16px !important;
        border-bottom: 1px solid var(--gray-100);
        min-height: 54px;
    }

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

    .nav a:hover,
    .header .nav a:hover {
        color: var(--primary) !important;
        background: rgba(252, 179, 33, 0.1);
    }


    .btn-nav {
        margin-top: 20px;
        text-align: center;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        z-index: 999;
    }

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

    .blog-grid,
    .blog-grid-3 {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .sidebar {
        grid-template-columns: 1fr !important;
    }

    .page-header {
        padding: 140px 0 70px !important;
        min-height: 320px !important;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand {
        grid-column: span 2;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    /* Card adjustments for mobile */
    .article-card {
        border-radius: 16px;
    }

    .article-card:hover {
        transform: translateY(-8px);
    }

    .article-card-content {
        padding: 20px 20px 24px;
    }

    .article-card-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .article-card-excerpt {
        font-size: 0.9rem;
        margin-bottom: 20px;
        -webkit-line-clamp: 3;
    }

    .article-card-badge {
        padding: 6px 12px;
        font-size: 0.7rem;
    }

    .article-card-category {
        bottom: 12px;
        left: 12px;
    }

    .article-card-reading-time {
        bottom: 12px;
        right: 12px;
    }

    .article-card-cta {
        padding: 14px 20px;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .article-card-date {
        font-size: 0.8rem;
    }
}

/* Small Mobile (max 480px) */
@media (max-width: 480px) {
    .page-header {
        padding: 130px 0 60px !important;
        min-height: 280px !important;
    }

    .page-header h1 {
        font-size: 1.75rem !important;
        padding: 0 10px;
    }

    .page-header p {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Card adjustments for small mobile */
    .article-card-image {
        aspect-ratio: 16 / 9;
    }

    .article-card-content {
        padding: 18px 18px 22px;
    }

    .article-card-title {
        font-size: 1.1rem;
    }

    .article-card-excerpt {
        font-size: 0.85rem;
    }

    .article-card-cta {
        padding: 12px 16px;
        gap: 8px;
    }

    .article-card-cta svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

/* Touch-friendly targets (min 44px) */
@media (max-width: 768px) {
    /* Ensure all interactive elements are touch-friendly */
    .nav a,
    .btn-nav,
    .read-more,
    .article-card-cta,
    .carousel-btn,
    .carousel-dot,
    .pagination a,
    .pagination span,
    .post-tags a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-dot {
        width: 12px;
        height: 12px;
        padding: 8px;
        box-sizing: content-box;
    }

    /* Remove hover effects on touch devices */
    .article-card:hover {
        transform: translateY(-4px);
    }

    .article-card:hover .article-card-image img {
        transform: scale(1.05);
    }

    .article-card:hover .article-card-cta {
        transform: none;
    }

    /* Tap highlight */
    .article-card,
    .article-card-cta,
    .carousel-btn {
        -webkit-tap-highlight-color: rgba(252, 179, 33, 0.2);
    }

    /* Single post mobile adjustments */
    body.single .page-header {
        padding: 140px 0 60px !important;
    }

    body.single .page-header h1 {
        font-size: 1.5rem !important;
        line-height: 1.35;
        padding: 0 16px;
    }

    .single-post-meta {
        flex-direction: column;
        gap: 12px;
    }

    .single-post-meta span {
        font-size: 0.85rem;
    }

    .single-post > .container {
        padding: 0 16px !important;
    }

    .single-post {
        padding: 40px 0 60px !important;
    }

    /* Post content mobile */
    .post-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .post-content h2 {
        font-size: 1.4rem;
        margin: 36px 0 16px;
    }

    .post-content h3 {
        font-size: 1.2rem;
        margin: 28px 0 12px;
    }

    .post-content blockquote {
        padding: 16px 20px;
        margin: 24px 0;
        font-size: 1rem;
    }

    .post-content pre {
        padding: 16px;
        font-size: 0.85rem;
        overflow-x: auto;
    }

    .post-content img {
        margin: 24px -16px;
        width: calc(100% + 32px);
        max-width: calc(100% + 32px);
        border-radius: 0;
    }

    /* Author box mobile */
    .author-box {
        padding: 24px 20px;
    }

    .author-avatar img {
        width: 60px;
        height: 60px;
    }

    /* Post navigation mobile */
    .nav-previous,
    .nav-next {
        padding: 16px;
    }

    .nav-title {
        font-size: 0.9rem;
    }

    /* Related posts carousel mobile */
    .related-posts {
        margin-top: 50px;
        padding-top: 40px;
    }

    .related-posts h3 {
        font-size: 1.25rem;
        margin-bottom: 20px;
    }

    .related-posts-carousel {
        margin: 0 -16px;
        padding: 0 16px;
    }

    /* Comments mobile */
    .comments-area {
        margin-top: 50px;
    }

    .comment {
        padding: 16px;
    }

    .comment-respond {
        padding: 20px;
    }

    .comment-form input,
    .comment-form textarea {
        padding: 12px 14px;
    }

    /* Container padding mobile */
    .container {
        padding: 0 16px;
    }

    /* Breadcrumbs mobile */
    .breadcrumbs {
        padding: 12px 0;
        font-size: 0.8rem;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .article-card-image img,
    .article-card-cta,
    .article-card-top-bar,
    .placeholder-pattern {
        animation: none !important;
        transition: none !important;
    }

    .article-card {
        opacity: 1 !important;
    }

    .related-posts-track {
        scroll-behavior: auto;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .container {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .footer {
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }
}

/* Fix iOS input zoom */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Disable smooth scroll on mobile - can cause fixed positioning issues on iOS */
@media (max-width: 768px) {
    html {
        scroll-behavior: auto;
    }
}

/* Landscape mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .page-header {
        padding: 100px 0 40px !important;
        min-height: auto !important;
    }

    body.single .page-header {
        padding: 100px 0 30px !important;
    }

    .nav {
        padding-top: 60px;
    }
}

/* Print styles */
@media print {
    .header,
    .footer,
    .reading-progress,
    .carousel-nav,
    .related-posts,
    .comments-area,
    .post-navigation,
    .breadcrumbs {
        display: none !important;
    }

    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

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

    .post-content {
        font-size: 12pt;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
