/*
 Theme Name:   Ticino Top
 Description:  Ticino Top Child Theme
 Author:       Kyle AI
 Template:     ticinoweb-ai-theme
 Version:      1.6.1
 Text Domain:  ticinotop
*/

/* Font self-hosted (SIL Open Font License): Inter, Playfair Display. Subset latin + latin-ext. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('assets/fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('assets/fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url('assets/fonts/playfair-display-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
    src: url('assets/fonts/playfair-display-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   TICINO TOP - DESIGN SYSTEM (Premium, Editorial, Trust-based)
   ========================================================================== */

:root {
    /* Colors - Premium Palette */
    --tt-black: #0A0A0A;
    --tt-dark: #1C1C1E;
    --tt-antracite: #2C2C2E;
    --tt-blue-notte: #0A192F;
    --tt-white: #FFFFFF;
    --tt-gray-light: #F9FAFB;
    --tt-gray-border: #E5E7EB;
    --tt-gray-text: #6B7280;
    --tt-gold-champagne: #D4AF37;
    --tt-gold-light: #F9F5EB;
    
    /* Status Colors */
    --tt-success: #10B981;
    --tt-trust: #3B82F6;

    /* Typography */
    --tt-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --tt-font-serif: 'Playfair Display', Georgia, serif;
    
    /* Shadows */
    --tt-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.04);
    --tt-shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
    --tt-shadow-premium: 0 20px 40px rgba(10, 25, 47, 0.08);
    
    /* Radius */
    --tt-radius-sm: 4px;
    --tt-radius-md: 8px;
    --tt-radius-lg: 12px;
}

html {
    overflow-x: clip;
    width: 100%;
    background-color: #FDF9EE; /* warm ivory base to complement golden canvas */
}

/* Base resets & Typography */
body {
    font-family: var(--tt-font-sans);
    color: var(--tt-black);
    background-color: transparent;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--tt-black);
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.font-serif {
    font-family: var(--tt-font-serif);
    letter-spacing: normal;
}

a {
    color: var(--tt-black);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--tt-gold-champagne);
}

/* Layout Utilities */
.tt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.tt-section {
    padding: 80px 0;
}

.tt-section-dark {
    background-color: var(--tt-blue-notte);
    color: var(--tt-white);
}

.tt-section-dark h1, 
.tt-section-dark h2, 
.tt-section-dark h3 {
    color: var(--tt-white);
}

/* Header */
.tt-header {
    background-color: var(--tt-white);
    border-bottom: 1px solid var(--tt-gray-border);
    position: sticky;
    top: 0;
    z-index: 1001; /* Stays above the mobile overlay drawer */
    padding: 16px 0;
}

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

.tt-logo {
    font-family: var(--tt-font-serif);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--tt-black);
}

.tt-logo span {
    color: var(--tt-gold-champagne);
}

.tt-nav, .tt-nav ul {
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-items: center;
}

.tt-nav li {
    display: block;
    margin: 0;
    padding: 0;
}

.tt-nav a {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tt-black);
}

/* Buttons */
.tt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--tt-radius-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.tt-btn-primary {
    background-color: var(--tt-black);
    color: var(--tt-white);
}

.tt-btn-primary:hover {
    background-color: var(--tt-antracite);
    color: var(--tt-white);
}

.tt-btn-premium {
    background-color: var(--tt-gold-champagne);
    color: var(--tt-black) !important;
    border: 1px solid transparent;
}

.tt-btn-premium:hover {
    background-color: var(--tt-gold-light) !important;
    color: var(--tt-black) !important;
    border-color: var(--tt-gold-champagne) !important;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2);
}

.tt-btn-outline {
    background-color: transparent;
    border: 1px solid var(--tt-gray-border);
    color: var(--tt-black);
    transition: all 0.3s ease;
}

.tt-btn-outline:hover {
    background-color: var(--tt-black) !important;
    color: var(--tt-white) !important;
    border-color: var(--tt-black) !important;
    box-shadow: 0 8px 24px rgba(10, 10, 10, 0.1);
}

/* Light/Dark contextual override for outline buttons on dark background (with inline white text) */
.tt-btn-outline[style*="color: white"]:hover,
.tt-btn-outline[style*="color:white"]:hover,
.tt-btn-outline[style*="color: var(--tt-white)"]:hover,
.tt-btn-outline[style*="color:var(--tt-white)"]:hover,
.tt-btn-outline[style*="color: #fff"]:hover,
.tt-btn-outline[style*="color:#fff"]:hover {
    background-color: var(--tt-white) !important;
    color: var(--tt-black) !important;
    border-color: var(--tt-white) !important;
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

/* Hero Section */
.tt-hero {
    text-align: center;
    padding: 100px 0 80px;
    background: transparent;
}

.tt-hero h1 {
    font-size: 56px;
    line-height: 1.1;
    margin-bottom: 24px;
    font-family: var(--tt-font-serif);
}

.tt-hero p.tt-subtitle {
    font-size: 20px;
    color: var(--tt-gray-text);
    max-width: 700px;
    margin: 0 auto 40px;
}

.tt-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Cards */
.tt-card {
    background: var(--tt-white);
    border-radius: var(--tt-radius-md);
    box-shadow: var(--tt-shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.03);
}

.tt-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tt-shadow-hover);
}

.tt-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 992px) {
    .tt-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .tt-grid-3 { grid-template-columns: 1fr; }
    .tt-nav { display: none; /* Add mobile menu later */ }
    .tt-hero h1 { font-size: 40px; }
}

/* Badges */
.tt-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tt-badge-gold {
    background-color: var(--tt-gold-light);
    color: var(--tt-gold-champagne);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.tt-badge-dark {
    background-color: var(--tt-black);
    color: var(--tt-white);
}

/* Scores */
.tt-score-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--tt-font-sans);
}

.tt-score-num {
    font-size: 18px;
    font-weight: 700;
}

.tt-score-label {
    font-size: 12px;
    color: var(--tt-gray-text);
    text-transform: uppercase;
}

/* Ranking Card Specific */
.tt-ranking-card .tt-card-img {
    height: 200px;
    background-color: var(--tt-gray-border);
    background-size: cover;
    background-position: center;
    position: relative;
}

.tt-ranking-position {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--tt-black);
    color: var(--tt-gold-champagne);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--tt-font-serif);
    font-size: 20px;
    border-radius: 50%;
    border: 2px solid var(--tt-gold-champagne);
}

.tt-ranking-card .tt-card-body {
    padding: 24px;
}

.tt-ranking-title {
    font-size: 20px;
    margin-bottom: 8px;
}

.tt-ranking-title a {
    transition: color 0.2s ease;
}

.tt-ranking-title a:hover {
    color: var(--tt-gold-champagne) !important;
}

.tt-ranking-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--tt-gray-text);
}

.tt-ai-box {
    background-color: var(--tt-gray-light);
    padding: 12px;
    border-radius: var(--tt-radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border-left: 2px solid var(--tt-gold-champagne);
}

.tt-ai-box-title {
    font-weight: 600;
    color: var(--tt-black);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

/* Search Input Customizations */
input[type="search"]::-webkit-search-cancel-button {
    cursor: pointer;
}

/* ==========================================================================
   TICINO TOP - ENTRANCE & SCROLL ANIMATIONS (Premium, Apple-like fluid feel)
   ========================================================================== */

/* Keyframe Animations */
@keyframes ttSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ttFadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ttFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ttZoomIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Page Load Immediate Animations */
.animate-header {
    animation: ttSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-hero-logo {
    opacity: 0;
    animation: ttZoomIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.animate-hero-title {
    opacity: 0;
    animation: ttFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.animate-hero-subtitle {
    opacity: 0;
    animation: ttFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.animate-hero-search {
    opacity: 0;
    animation: ttFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

.animate-hero-btns {
    opacity: 0;
    animation: ttFadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

/* Scroll-driven Reveal Animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Grid Reveal Delays */
.reveal-grid {
    display: grid;
}

.reveal-grid > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-grid.in-view > * {
    opacity: 1;
    transform: translateY(0);
}

/* Children delays up to 6 items */
.reveal-grid.in-view > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-grid.in-view > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-grid.in-view > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-grid.in-view > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-grid.in-view > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-grid.in-view > *:nth-child(6) { transition-delay: 0.6s; }

/* Footer Menu Styling */
.tt-footer-title {
    color: var(--tt-white);
    margin-bottom: 24px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--tt-font-sans);
    font-weight: 700;
    opacity: 0.9;
}

.tt-footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 48px;
}

.tt-footer-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

.tt-footer-menu li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease;
    display: inline-flex;
    position: relative;
    padding-bottom: 2px;
}

.tt-footer-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--tt-gold-champagne);
    transition: width 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tt-footer-menu li a:hover {
    color: var(--tt-gold-champagne) !important;
}

.tt-footer-menu li a:hover::after {
    width: 100%;
}

@media (max-width: 576px) {
    .tt-footer-menu {
        grid-template-columns: 1fr;
        gap: 12px 0;
    }
}

/* ==========================================================================
   TICINO TOP - RESPONSIVE MOBILE LAYOUT SYSTEM (Premium & Sleek Feel)
   ========================================================================== */

/* Hamburger Button Icon - Animated pure CSS */
.tt-hamburger {
    display: none;
    background: transparent;
    border: none;
    width: 24px;
    height: 18px;
    position: relative;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    margin-left: 16px;
    outline: none;
}

.tt-hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: var(--tt-black);
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: transform 0.25s ease-in-out, top 0.25s ease-in-out, opacity 0.25s ease-in-out;
}

.tt-hamburger span:nth-child(1) { top: 0px; }
.tt-hamburger span:nth-child(2) { top: 8px; }
.tt-hamburger span:nth-child(3) { top: 16px; }

.tt-hamburger.active span:nth-child(1) {
    top: 8px;
    transform: rotate(135deg);
}

.tt-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.tt-hamburger.active span:nth-child(3) {
    top: 8px;
    transform: rotate(-135deg);
}

/* Premium Mobile Drawer Overlay */
.tt-mobile-menu {
    position: fixed;
    top: 73px; /* Sits perfectly under sticky header */
    left: 0;
    width: 100%;
    height: calc(100vh - 73px);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 40px 24px 40px; /* Reduced top padding as it sits under header */
}

.tt-mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tt-mobile-menu-inner {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

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

.tt-mobile-nav li {
    display: block;
    margin: 0;
    padding: 0;
}

.tt-mobile-nav a {
    font-family: var(--tt-font-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--tt-black);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.tt-mobile-nav a:hover {
    color: var(--tt-gold-champagne);
    transform: translateY(-2px);
}

.tt-mobile-actions {
    margin-top: 10px;
    width: 100%;
}

/* Custom overflow block on body */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh !important;
}

/* General Layout Breakpoint for Mobile and Tablets */
@media (max-width: 992px) {
    /* Magazine Hero Card Stack */
    .tt-featured-hero {
        flex-direction: column !important;
        min-height: auto !important;
    }
    
    .tt-featured-hero-img {
        width: 100% !important;
        height: 280px !important;
        min-height: auto !important;
    }
    
    .tt-featured-hero-body {
        width: 100% !important;
        padding: 32px 24px !important;
    }
    
    .tt-featured-hero-body h2 {
        font-size: 28px !important;
    }
}

@media (max-width: 768px) {
    /* Hide standard nav links and button */
    .tt-nav, .tt-desktop-only-btn {
        display: none !important;
    }
    
    .tt-hamburger {
        display: block;
    }
    
    /* Layout Container & White spaces scaling */
    .tt-container {
        padding: 0 20px !important;
    }
    
    .tt-section {
        padding: 50px 0 !important;
    }
    
    /* Typography Fluid Scaling */
    h1 {
        font-size: 34px !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 26px !important;
        line-height: 1.25 !important;
    }
    
    h3 {
        font-size: 20px !important;
    }
    
    .tt-hero h1 {
        font-size: 36px !important;
        line-height: 1.15 !important;
    }
    
    .tt-hero p.tt-subtitle {
        font-size: 16px !important;
        margin-bottom: 24px !important;
    }
    
    .tt-hero-actions {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
    }
    
    .tt-hero-actions .tt-btn {
        width: 100% !important;
    }
    
    /* Sticky Stack Scrolling disablers on Mobile Viewports */
    section[style*="position: sticky"],
    header[style*="position: sticky"],
    .tt-topscan-hero,
    .tt-chisiamo-sticky-section,
    .tt-awards-sticky-section,
    .post-type-archive-classifica .tt-hero,
    .post-type-archive-classifica .tt-section,
    .page-template-template-candidati .tt-section,
    .page-template-template-topscan .tt-section {
        position: relative !important;
        top: auto !important;
        min-height: auto !important;
        height: auto !important;
        transform: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
    
    /* Re-adjust Classifiche background elements */
    .post-type-archive-classifica .tt-section {
        background: var(--tt-black) !important;
    }
    
    /* Stacking Manifesto Grid */
    .tt-manifesto-grid {
        grid-template-columns: 1fr !important;
        gap: 36px !important;
    }
    
    .tt-manifesto-grid div[style*="padding: 40px"] {
        padding: 24px !important;
    }
    
    /* Single Ranking row stacked cards */
    .tt-ranking-row-card {
        flex-direction: column !important;
        min-height: auto !important;
    }
    
    .tt-ranking-row-img {
        width: 100% !important;
        height: 200px !important;
    }
    
    .tt-ranking-row-body {
        width: 100% !important;
        padding: 24px !important;
    }
    
    .tt-ranking-row-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .tt-ranking-row-header div[style*="text-align: right"] {
        text-align: left !important;
    }
    
    /* Single Company (Azienda) template overrides */
    .tt-company-hero-inner {
        position: static !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 24px !important;
        padding: 40px 20px 24px !important;
        background: linear-gradient(to top, rgba(10,25,47,0.95), rgba(10,25,47,0.8)) !important;
    }
    
    .tt-company-hero-inner h1.tt-company-hero-title {
        font-size: 32px !important;
    }
    
    .tt-company-hero-rank {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 16px !important;
    }
    
    .tt-company-grid {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }
    
    .tt-company-grid div[style*="position: sticky"] {
        position: static !important;
        padding: 24px !important;
    }
    
    .tt-indicators-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Global Footer Stack wrap */
    .tt-footer-inner {
        flex-direction: column !important;
        gap: 32px !important;
        align-items: flex-start !important;
    }
    
    /* Auto-collapse any styled 1fr 1fr grids on mobile (e.g. inside TopScan) */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

@media (max-width: 480px) {
    /* Centering and scaling Search Bar */
    #tt-search-form {
        padding: 6px !important;
    }
    
    #tt-search-input {
        padding: 0 8px !important;
        font-size: 14px !important;
    }
    
    #tt-search-form button {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   TICINO TOP - DYNAMIC BADGE SYSTEM (Premium & Responsive Overlay)
   ========================================================================== */

.tt-badges-flex-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.tt-dynamic-badge {
    position: relative;
    display: inline-block;
    width: 100px; /* Dimensione aumentata per una leggibilità e impatto eccezionali */
    height: 100px;
    container-type: inline-size;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.tt-badge-graphic {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tt-dynamic-badge:hover {
    transform: scale(1.06);
}

.tt-badge-rating {
    position: absolute;
    top: 76.3%; /* Centrato verticalmente nel cerchio inferiore del badge */
    left: 50.2%; /* Centrato orizzontalmente nel cerchio inferiore */
    transform: translate(-50%, -50%);
    z-index: 2; /* Sempre stampata sopra la grafica */
    font-family: var(--tt-font-sans), -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10cqw; /* Scalamento matematico automatico basato sulla larghezza del badge! */
    font-weight: 800;
    color: #031836; /* Profondo blu navy identico alla grafica SVG */
    background: #ffffff; /* Sfondo bianco solido ad alta leggibilità */
    width: 22cqw; /* Copertura del cerchio trasparente del badge */
    height: 22cqw;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Sfumatura per l'effetto di rilievo */
    pointer-events: none;
    user-select: none;
}

/* Tooltip Hover Elegante in stile Glassmorphism Dark */
.tt-badge-tooltip {
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(10, 25, 47, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    width: max-content;
    max-width: 220px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1000;
    text-align: center;
    pointer-events: none;
}

.tt-badge-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: rgba(10, 25, 47, 0.96) transparent transparent transparent;
}

.tt-dynamic-badge:hover .tt-badge-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tt-badge-tooltip-title {
    display: block;
    font-weight: 700;
    color: var(--tt-gold-champagne);
    font-size: 12px;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tt-badge-tooltip-desc {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.3;
}

/* Sticky Header Scrolled Styles - Premium Apple-like Glassmorphism */
.tt-header {
    transition: padding 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, border-color 0.3s ease;
}

.tt-header.scrolled {
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    box-shadow: 0 10px 30px rgba(10, 25, 47, 0.04);
    border-color: rgba(212, 175, 55, 0.15);
}

/* Force background elements to always render behind everything */
#tt-golden-fabric {
    z-index: -10 !important;
}
.tt-svg-stars {
    z-index: -9 !important;
}
div[style*="background-image"][style*="fixed"] {
    z-index: -9 !important;
}


/* ===== News: filtri (ordine, categoria, tag) e letture ===== */
.tt-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 20px;
    margin: 0 0 40px;
    padding: 20px 24px;
    background: var(--tt-white);
    border: 1px solid var(--tt-gray-border);
    border-radius: var(--tt-radius-md);
}
.tt-filters-order { display: flex; gap: 8px; }
.tt-chip {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--tt-gray-border);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: var(--tt-black);
    text-decoration: none;
    background: var(--tt-white);
    transition: all 0.2s ease;
}
.tt-chip:hover { border-color: var(--tt-gold-champagne); }
.tt-chip.is-active {
    background: var(--tt-blue-notte);
    border-color: var(--tt-blue-notte);
    color: var(--tt-white);
}
.tt-filter-field { display: flex; flex-direction: column; gap: 6px; min-width: 190px; flex: 1 1 190px; }
.tt-filter-field span { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--tt-gray-text); }
.tt-filter-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tt-gray-border);
    border-radius: var(--tt-radius-sm, 8px);
    background: var(--tt-white);
    font-size: 14px;
    color: var(--tt-black);
}
.tt-filters-apply { padding: 11px 22px; }
.tt-filters-reset { font-size: 14px; font-weight: 600; color: var(--tt-gray-text); text-decoration: underline; align-self: center; }
.tt-filters-count { margin: -20px 0 32px; font-size: 14px; color: var(--tt-gray-text); }
.tt-views-badge { font-size: 12px; font-weight: 600; color: var(--tt-gray-text); white-space: nowrap; }
.tt-post-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 24px; }
.tt-post-tags a {
    padding: 6px 14px;
    border: 1px solid var(--tt-gray-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tt-black);
    text-decoration: none;
    background: var(--tt-white);
}
.tt-post-tags a:hover { border-color: var(--tt-gold-champagne); }
@media (max-width: 700px) {
    .tt-filters { padding: 16px; }
    .tt-filter-field { flex-basis: 100%; }
    .tt-filters-apply { width: 100%; }
}
