/* Dark Mode Financial Dashboard Theme */

:root {
    /* Color Palette */
    --color-bg: #121212;
    --color-bg-secondary: #1E1E1E;
    --color-accent: #D32F2F;
    /* Market Red */
    --color-accent-hover: #b71c1c;
    --color-highlight: #FFC107;
    /* Wheat Yellow */
    --color-text: #FFFFFF;
    --color-text-secondary: #B0B0B0;
    --color-border: #333333;
    --color-success: #4CAF50;

    /* Typography */
    --font-heading: 'Inter', 'Roboto Condensed', sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Layout */
    --container-width: 1000px;
    /* Updated to 1000px for two-column layout */
    --header-height: 100px;
}

/* Light mode overrides - "Clean Financial Light" theme
   Uses :root[data-theme="light"] (specificity 0,2,0) to beat
   screen.css :root.has-light-text (also 0,2,0) via source order
   
   Color science principles:
   - Warm white base matches grain/agriculture theme
   - Pure white cards for clear visual hierarchy
   - Proper WCAG AA contrast ratios (4.5:1 minimum)
   - Cooler grays for reduced eye strain
*/
:root[data-theme="light"] {
    /* Warm white base - clean but not clinical */
    --color-bg: #FAFAF9;
    --color-bg-secondary: #FFFFFF;
    
    /* Text hierarchy - WCAG AA compliant */
    --color-text: #1A1A1C;
    --color-text-secondary: #52525B;
    
    /* Borders - clear but not harsh */
    --color-border: #E4E4E7;
    
    /* Override screen.css variables */
    --color-primary-text: #1A1A1C;
    --color-secondary-text: #52525B;
    --color-darker-gray: #1A1A1C;
    --color-lighter-gray: rgb(0 0 0 / 0.04);
    --color-dark-border: rgb(0 0 0 / 0.35);
    
    /* Improved success green for light mode */
    --color-success: #16A34A;
}

/* Logo visibility */
.logo-light { display: none; }
.logo-dark  { display: block; }
[data-theme="light"] .logo-light { display: block; }
[data-theme="light"] .logo-dark  { display: none; }

/* Theme toggle button */
.mg-theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: currentColor;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.mg-theme-toggle:hover { opacity: 1; }
.mg-icon-moon { display: none; }
.mg-icon-sun  { display: block; }
[data-theme="light"] .mg-icon-moon { display: block; }
[data-theme="light"] .mg-icon-sun  { display: none; }

/* ── Light mode: nav text & borders ──────────────────────── */
[data-theme="light"] .gh-nav-strip-link,
[data-theme="light"] .gh-nav-dropdown-toggle {
    color: #444;
}
[data-theme="light"] .gh-nav-strip-link:hover,
[data-theme="light"] .gh-nav-dropdown-wrap:hover .gh-nav-dropdown-toggle {
    color: #15171a;
}
[data-theme="light"] .gh-nav-strip-link + .gh-nav-strip-link,
[data-theme="light"] .gh-nav-dropdown-wrap + .gh-nav-strip-link,
[data-theme="light"] .gh-nav-strip-link + .gh-nav-dropdown-wrap,
[data-theme="light"] .gh-nav-dropdown-wrap + .gh-nav-dropdown-wrap {
    border-left-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .gh-nav-dropdown-item {
    color: #444;
}
[data-theme="light"] .gh-nav-dropdown-item:hover {
    color: #15171a;
    background-color: rgba(0, 0, 0, 0.04);
}
/* Mobile nav */
[data-theme="light"] .gh-mobile-nav-link,
[data-theme="light"] .gh-mobile-section-label,
[data-theme="light"] .gh-mobile-sub-link {
    color: #444;
}
[data-theme="light"] .gh-mobile-section {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* ── Light mode: widget chart ────────────────────────────── */
/* Financial charts stay DARK in light mode (industry standard)
   - Better contrast for line charts
   - Reduces glare during extended viewing
   - Matches Bloomberg, TradingView, financial terminals
*/
[data-theme="light"] #mg-wrap {
    background: #0e0e10;
    color: #d1d4dc;
}
[data-theme="light"] #mg-wrap h1,
[data-theme="light"] #mg-wrap h2,
[data-theme="light"] #mg-wrap h3,
[data-theme="light"] #mg-wrap h4,
[data-theme="light"] #mg-wrap h5,
[data-theme="light"] #mg-wrap h6,
[data-theme="light"] #mg-wrap a {
    color: #d1d4dc;
}

/* Global Reset & Base */
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    /* Center the viewport */
    min-height: 100vh;
    margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

/* Layout Containers */
.gh-viewport {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: var(--container-width);
    /* 1000px for two-column layout */
    background-color: var(--color-bg);
    /* Ensure background matches */
    border-left: 1px solid var(--color-border);
    /* Optional: distinct borders */
    border-right: 1px solid var(--color-border);
}

.gh-container {
    max-width: 100%;
    /* Fill the 1000px viewport */
    margin: 0 auto;
    padding: 0 20px;
    /* Reduced padding for compact look */
    width: 100%;
    box-sizing: border-box;
}

/* Two-Column Layout for Homepage */
.gh-main .gh-outer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns */
    gap: 24px;
    /* Space between columns */
    padding: 20px 20px 0 20px;
}

.gh-news-column {
    /* Left column (news feed) */
    min-width: 0;
    /* Prevent overflow */
}

/* Desktop only: scrollable news column */
@media (min-width: 901px) {
    .gh-news-column {
        max-height: calc(100vh - var(--header-height) - 40px);
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Custom scrollbar for news column */
.gh-news-column::-webkit-scrollbar {
    width: 8px;
}

.gh-news-column::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

.gh-news-column::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.gh-news-column::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.gh-widget-column {
    /* Right column (widgets) */
    min-width: 0;
    /* Prevent overflow */
    max-height: calc(100vh - var(--header-height) - 40px);
    /* Match news column height */
    position: sticky;
    top: calc(var(--header-height) + 20px);
    /* Stick below header */
    align-self: start;
}

.gh-widget-container {
    background-color: transparent;
    border: none;
    min-height: 200px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gh-widget-placeholder {
    padding: 40px 20px;
}

/* Location Cards Section - Below News */
.gh-location-section {
    margin-top: 40px;
    padding-bottom: 40px;
}

.gh-location-section .location-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Location Cards - 2x2 Grid in Widget Column */
.location-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.location-card {
    position: relative;
    display: block;
    height: 220px;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.location-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* City background images - clear base */
.location-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.location-card:hover .location-card-bg {
    transform: scale(1.05);
}

/* Blurred overlay layer - gradual blur effect */
.location-card-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    filter: blur(12px);
    mask-image: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 20%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.85) 80%,
        rgba(0, 0, 0, 1) 100%
    );
    -webkit-mask-image: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 20%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.85) 80%,
        rgba(0, 0, 0, 1) 100%
    );
    z-index: 1;
}

/* Dark gradient overlay for better text readability */
.location-card-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 30%,
        rgba(0, 0, 0, 0.5) 100%
    );
    z-index: 2;
}

/* Bologna - Unsplash image */
.location-card[data-city="bologna"] .location-card-bg {
    background-image: url('https://images.unsplash.com/photo-1635469019177-7264fc1e013c?w=600&q=80');
}

/* Roma - Unsplash image */
.location-card[data-city="roma"] .location-card-bg {
    background-image: url('https://images.unsplash.com/photo-1552832230-c0197dd311b5?w=600&q=80');
}

/* Foggia - Wikipedia Commons */
.location-card[data-city="foggia"] .location-card-bg {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/a/a8/Piazza_Camillo_Benso_conte_di_Cavour.jpg');
}

/* Frosted glass overlay - only at bottom */
.location-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 2;
}

.location-card-text h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-transform: none;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.location-card-text .location-city {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.location-card-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    color: #FFFFFF;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.location-card:hover .location-card-arrow {
    background: rgba(250, 198, 0, 0.9);
    transform: translateX(4px);
}

.location-card-arrow svg {
    width: 18px;
    height: 18px;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 900px) {
    .gh-main .gh-outer {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .gh-widget-column {
        position: static;
        /* Remove sticky on mobile */
        max-height: none;
    }

    /* News column - full width on mobile */
    .gh-news-column {
        width: 100%;
        padding: 0;
    }

    /* News list full width - padding on individual items so borders go edge-to-edge */
    .gh-compact-list {
        padding: 0;
    }

    .gh-compact-list .gh-date-header {
        padding-left: 20px;
        padding-right: 20px;
    }

    .gh-compact-list .gh-compact-card {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* Hide news after first 5 on mobile initially */
    .gh-compact-card:nth-child(n+7):not(.show-more) {
        display: none;
    }

    /* Show all button */
    .gh-view-all {
        display: block;
    }

    /* Add padding to widget column to match news padding */
    .gh-widget-column {
        padding: 0 20px;
    }

    /* Location cards full width on mobile */
    .gh-location-section .location-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .location-card {
        height: 180px;
    }

    .location-card-content {
        padding: 14px 16px;
    }

    .location-card-text h3 {
        font-size: 0.65rem;
    }

    .location-card-text .location-city {
        font-size: 1.2rem;
    }

    /* Smaller arrow on mobile */
    .location-card-arrow {
        width: 36px;
        height: 36px;
    }

    .location-card-arrow svg {
        width: 16px;
        height: 16px;
    }
}

/* Header (Market Alert Style) */
.gh-head {
    background-color: var(--color-bg);
    border-bottom: 4px solid var(--color-accent);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Desktop only: ensure nav is sticky, above the hero, and clickable */
@media (min-width: 768px) {
    #gh-navigation {
        position: sticky;
        top: 0;
        z-index: 1001;
        background-color: var(--color-bg); /* solid background on all non-hero desktop pages */
    }
}

/* ============================================
   Two-Layer Navigation (desktop)
   ============================================ */

/* Inner container stacks rows vertically on desktop */
@media (min-width: 768px) {
    /* Remove gh-outer's default padding so our explicit 20px padding aligns with content */
    #gh-navigation.gh-outer {
        padding: 0 !important;
    }

    #gh-navigation .gh-navigation-inner {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 0 !important;
        align-items: stretch !important;
    }

    /* Top row: logo left, actions right */
    .gh-nav-top-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 62px;
        padding: 0 20px 0 38px;
        width: 100%;
        box-sizing: border-box;
    }

    /* Brand inside top row */
    .gh-nav-top-row .gh-navigation-brand {
        display: flex;
        align-items: center;
        gap: 0;
    }

    /* Optical alignment: nudge logo left by 5px */
    .gh-nav-top-row .gh-navigation-logo {
        margin-left: -5px;
    }

    /* Hide the search-toggle that lives inside brand (mobile-only slot) */
    .gh-nav-top-row .gh-navigation-brand .gh-search-toggle,
    .gh-nav-top-row .gh-navigation-brand [class*="search"] {
        display: none !important;
    }

    /* Hide burger on desktop */
    .gh-nav-top-row .gh-burger {
        display: none !important;
    }

    /* Actions: search + sign in + subscribe */
    .gh-navigation-actions {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    /* --- Nav strip --- */
    /* strip left-pad 26px + link left-pad 12px = 38px → aligns with news text */
    .gh-nav-strip {
        display: flex;
        align-items: stretch;
        height: 38px;
        padding: 0 8px 0 26px;
        border-top: 1px solid var(--color-border);
        width: 100%;
        box-sizing: border-box;
    }

    /* Links and dropdown toggles in the strip */
    .gh-nav-strip-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        height: 100%;
        padding: 0 12px;
        font-family: var(--font-heading);
        font-size: 1.2rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: var(--color-text-secondary);
        background: none;
        border: none;
        cursor: pointer;
        text-decoration: none;
        transition: color 0.15s;
        white-space: nowrap;
        line-height: 1;
        position: relative;
    }

    .gh-nav-strip-link:hover {
        color: var(--color-text);
    }

    /* Separator dots between items */
    .gh-nav-strip-link + .gh-nav-strip-link,
    .gh-nav-dropdown-wrap + .gh-nav-strip-link,
    .gh-nav-strip-link + .gh-nav-dropdown-wrap,
    .gh-nav-dropdown-wrap + .gh-nav-dropdown-wrap {
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Chevron icon */
    .gh-nav-chevron {
        flex-shrink: 0;
        opacity: 0.5;
        transition: transform 0.2s ease, opacity 0.15s;
    }

    /* --- Dropdown --- */
    .gh-nav-dropdown-wrap {
        position: relative;
        height: 100%;
        display: flex;
        align-items: stretch;
    }

    /* Show dropdown on hover */
    .gh-nav-dropdown-wrap:hover .gh-nav-dropdown-menu {
        display: block;
    }

    .gh-nav-dropdown-wrap:hover .gh-nav-chevron {
        transform: rotate(180deg);
        opacity: 1;
    }

    .gh-nav-dropdown-wrap:hover .gh-nav-dropdown-toggle {
        color: var(--color-text);
    }

    .gh-nav-dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 210px;
        background: var(--color-bg-secondary);
        border: 1px solid var(--color-border);
        border-top: 2px solid #FAC600;
        border-radius: 0 0 6px 6px;
        z-index: 1100;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        padding: 4px 0;
    }

    .gh-nav-dropdown-item {
        display: block;
        padding: 10px 16px;
        font-family: var(--font-body);
        font-size: 1.2rem;
        font-weight: 400;
        color: var(--color-text-secondary);
        text-decoration: none;
        text-transform: none;
        letter-spacing: 0;
        transition: color 0.15s, background-color 0.15s;
    }

    .gh-nav-dropdown-item:hover {
        color: var(--color-text);
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Hide mobile menu on desktop */
    #gh-navigation .gh-navigation-menu {
        display: none !important;
    }
}

/* ============================================
   Two-Layer Navigation (mobile)
   ============================================ */

@media (max-width: 767px) {
    /* Hide desktop nav strip */
    .gh-nav-strip {
        display: none !important;
    }

    /* Hide desktop actions (sign-in/subscribe shown inside burger menu) */
    .gh-nav-top-row .gh-navigation-actions {
        display: none !important;
    }

    /* Top row wraps brand bar at 50px height */
    .gh-nav-top-row {
        flex-shrink: 0;
        width: 100%;
    }

    /* Mobile nav links container */
    .gh-mobile-nav-links {
        padding: 8px 0;
        display: flex;
        flex-direction: column;
    }

    .gh-mobile-nav-link {
        display: block;
        padding: 14px 20px;
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--color-text);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        text-decoration: none;
        transition: color 0.15s;
    }

    .gh-mobile-nav-link:hover {
        color: var(--color-highlight);
    }

    /* Section (Quotazioni / Website) */
    .gh-mobile-section {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .gh-mobile-section-label {
        display: block;
        padding: 12px 20px 6px;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.3px;
        color: var(--color-text-secondary);
    }

    .gh-mobile-section-links {
        display: flex;
        flex-direction: column;
        padding-bottom: 4px;
    }

    /* Sub-links */
    .gh-mobile-sub-link {
        padding: 10px 20px 10px 32px;
        font-size: 1.2rem;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.65);
        border-bottom: none;
    }

    .gh-mobile-sub-link:hover {
        color: var(--color-text);
    }

    /* Sign-in / subscribe at bottom of mobile menu */
    .gh-mobile-nav-actions {
        padding: 20px;
        display: flex;
        gap: 14px;
        align-items: center;
        border-top: 1px solid var(--color-border);
        margin-top: 8px;
    }

    .gh-mobile-action-link {
        font-size: 1rem;
        font-weight: 500;
        color: var(--color-text-secondary);
        text-decoration: none;
    }

    /* Show mobile nav menu when burger is open */
    .is-open#gh-navigation .gh-navigation-menu {
        display: block !important;
        flex: 1;
        overflow-y: auto;
    }
}

.gh-head-inner {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.gh-head-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-highlight);
    text-transform: uppercase;
}

/* Navigation */
.gh-head-menu .nav {
    display: flex;
    gap: 16px;
    /* Compact gap */
    list-style: none;
    margin: 0;
    padding: 0;
}

.gh-head-menu .nav li a {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    /* Smaller for dashboard feel */
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.gh-head-menu .nav li a:hover {
    color: var(--color-accent);
}


/* Compact News List Styles (Modern Feed) */
.gh-compact-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

/* View All Button */
.gh-view-all {
    padding: 16px 18px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
}

.gh-view-all-btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.gh-view-all-btn:hover {
    color: var(--color-highlight);
}

/* Date Header */
.gh-date-header {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--color-text-secondary);
    text-align: left;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    border-top: 1px solid var(--color-border);
}

.gh-date-header:first-child {
    border-top: none;
}

/* Card Container */
.gh-compact-card {
    display: flex;
    flex-direction: column;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    gap: 8px;
    transition: background-color 0.15s ease;
}

.gh-compact-card:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.gh-compact-card:last-child {
    border-bottom: none;
}

/* Meta Row: Avatar + Time + Tag */
.gh-compact-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Avatar */
.gh-compact-avatar {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gh-compact-avatar img {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Time + Tag */
.gh-compact-time-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: #888;
    opacity: 0.9;
}

.gh-time {
    white-space: nowrap;
}

.gh-tag-separator {
    opacity: 0.5;
}

.gh-tag-name {
    font-weight: 500;
    opacity: 0.8;
}

/* Content */
.gh-compact-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gh-compact-title {
    font-family: var(--font-body);
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.4;
    font-weight: 600;
    color: var(--color-text);
}

.gh-compact-title a {
    color: var(--color-text);
    transition: color 0.15s ease;
    text-decoration: none;
}

.gh-compact-title a:hover {
    color: var(--color-highlight);
}

.gh-compact-excerpt {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    color: #999;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer Styling - for partials/components/footer.hbs */
.gh-footer {
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    margin-top: 32px;
    color: var(--color-text-secondary);
}

.gh-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px;
    font-size: 0.8rem;
}

.gh-footer-copyright {
    color: var(--color-text-secondary);
}

.gh-footer-social {
    display: flex;
    gap: 16px;
    align-items: center;
}

.gh-social-link {
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.gh-social-link:hover {
    color: var(--color-text-primary, #fff);
}

.gh-social-link svg {
    width: 18px;
    height: 18px;
}

/* Footer Styling - for default.hbs */
.gh-foot-simple {
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    margin-top: 32px;
    padding: 24px 0;
    color: var(--color-text-secondary);
}

.gh-foot-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0 20px;
}

.gh-foot-copyright {
    color: var(--color-text-secondary);
}


/* Icon button size adjustment */
.gh-icon-button svg {
    height: 25px;
    width: 25px;
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    /* Remove all padding from container on mobile */
    .gh-container.gh-outer {
        padding: 0 !important;
    }

    /* Remove top padding from main */
    .gh-main {
        padding-top: 0px !important;
    }

    /* Navigation fixed at top on mobile */
    #gh-navigation {
        position: fixed !important;
        top: 0 !important;
        left: 0;
        right: 0;
        height: 50px;
        z-index: 1000 !important;
        background-color: #121212 !important;
        padding-bottom: 10px;
    }

    /* Remove outer padding from navigation to prevent double padding */
    #gh-navigation.gh-outer {
        padding: 0 !important;
    }

    /* Burger menu icon size */
    .gh-burger svg {
        height: 35px;
        width: 35px;
    }

    /* Keep navigation brand consistent - prevent repositioning */
    #gh-navigation .gh-navigation-brand {
        height: 50px !important;
        width: 100% !important;
        display: grid !important;
        grid-template-columns: 1fr auto auto !important;
        align-items: center !important;
        padding: 0 20px !important;
        background-color: #121212 !important;
    }

    /* Lock logo image size on mobile to prevent jump when menu opens */
    #gh-navigation .gh-navigation-logo img {
        max-height: 30px !important;
        height: auto !important;
        width: auto !important;
    }

    /* Full-screen burger menu when open */
    .is-open#gh-navigation {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        background-color: #121212 !important;
    }

    /* Remove outer padding when menu is open */
    .is-open#gh-navigation.gh-outer {
        padding: 0 !important;
    }

    /* Keep top row (brand bar) sticky at top when menu is open */
    .is-open#gh-navigation .gh-nav-top-row {
        position: sticky !important;
        top: 0 !important;
        z-index: 10000 !important;
        background-color: #121212 !important;
        flex-shrink: 0 !important;
    }

    /* Brand inside top row when open */
    .is-open#gh-navigation .gh-navigation-brand {
        height: 50px !important;
        display: grid !important;
        grid-template-columns: 1fr auto auto !important;
        align-items: center !important;
        padding: 0 20px !important;
        background-color: #121212 !important;
        width: 100% !important;
    }

    /* Prevent logo from changing position */
    .is-open#gh-navigation .gh-navigation-logo {
        font-size: inherit !important;
        justify-self: start !important;
    }

    /* Inner container styling when open */
    .is-open#gh-navigation .gh-navigation-inner {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        background-color: #121212 !important;
    }

    /* Menu background */
    .is-open#gh-navigation .gh-navigation-menu {
        background-color: #121212 !important;
        width: 100% !important;
    }
}

@media (max-width: 600px) {
    /* Logo size adjustment for mobile */
    .gh-navigation-logo img {
        max-height: 30px;
    }

    /* Footer logo size on mobile */
    .gh-footer-logo img,
    .gh-foot-logo {
        max-height: 24px;
    }

    /* Footer layout on mobile */
    .gh-foot-inner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .gh-foot-left {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .gh-foot-left-top {
        flex-direction: column;
        gap: 12px;
    }

    .gh-foot-right {
        flex-direction: column;
        gap: 12px;
    }
}

/* ============================================
   Analisi Previsionali - Featured Slider
   ============================================ */

.gh-featured-section {
    width: 100%;
    max-width: var(--container-width, 1320px);
    margin: 0 auto;
    padding: 24px 20px 32px;
}

.gh-featured-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.gh-featured-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.gh-featured-arrows {
    display: flex;
    gap: 6px;
}

.gh-featured-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.gh-featured-arrow:hover:not(:disabled) {
    border-color: var(--color-highlight);
    color: var(--color-highlight);
}

.gh-featured-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

.gh-featured-track-wrapper {
    overflow: hidden;
}

.gh-featured-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s ease;
}

.gh-featured-card {
    flex: 0 0 calc((100% - 32px) / 3);
    display: flex;
    flex-direction: column;
    background: var(--color-bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gh-featured-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.gh-featured-card-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.gh-featured-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gh-featured-card:hover .gh-featured-card-img img {
    transform: scale(1.05);
}

.gh-featured-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gh-featured-card-body h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gh-featured-card-body p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.5;
    color: #999;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Mobile: horizontal scroll, hide arrows */
@media (max-width: 900px) {
    .gh-featured-section {
        padding: 20px 0 24px;
    }

    .gh-featured-header {
        padding: 0 20px;
    }

    .gh-featured-arrows {
        display: none;
    }

    .gh-featured-track-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .gh-featured-track-wrapper::-webkit-scrollbar {
        display: none;
    }

    .gh-featured-track {
        padding: 0 20px;
    }

    .gh-featured-card {
        flex: 0 0 260px;
    }
}

/* ============================================
   Post / Page Hero Image
   ============================================ */

/* Navigation: gradient from black at top to transparent at bottom */
body.has-hero-image #gh-navigation {
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.82) 0%,
        rgba(0,0,0,0)    100%
    ) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom-color: transparent !important;
    box-shadow: none !important;
    transition: background 0.35s ease, border-bottom-color 0.35s ease !important;
}

/* Navigation turns fully solid once hero scrolls out of view */
body.has-hero-image #gh-navigation.gh-nav-solid {
    background: var(--color-bg) !important;
    border-bottom-color: var(--color-accent) !important;
}

/* Mobile: also clear the brand area background so gradient shows through */
@media (max-width: 767px) {
    body.has-hero-image #gh-navigation {
        background: linear-gradient(to bottom,
            rgba(0,0,0,0.82) 0%,
            rgba(0,0,0,0)    100%
        ) !important;
    }
    body.has-hero-image #gh-navigation .gh-navigation-brand {
        background-color: transparent !important;
    }
    body.has-hero-image #gh-navigation.gh-nav-solid {
        background: var(--color-bg) !important;
    }
    body.has-hero-image #gh-navigation.gh-nav-solid .gh-navigation-brand {
        background-color: var(--color-bg) !important;
    }
}

/* Hero wrapper — pulls up behind the sticky nav on desktop */
.gh-post-hero {
    position: relative;
    z-index: 0; /* creates its own stacking context; keeps hero below nav (z-index: 1000) */
    width: 100%;
    min-height: 62vh;
    margin-top: calc(-1 * var(--header-height)); /* slide up behind sticky nav */
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

/* Progressive blur layer: sharp at top, blurred at bottom */
.gh-post-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: inherit;
    background-size: cover;
    background-position: center top;
    filter: blur(18px);
    transform: scale(1.06); /* prevent blur edges */
    mask-image: linear-gradient(to bottom,
        rgba(0,0,0,0)   0%,
        rgba(0,0,0,0)   45%,
        rgba(0,0,0,0.6) 65%,
        rgba(0,0,0,1)   82%,
        rgba(0,0,0,1)   100%
    );
    -webkit-mask-image: linear-gradient(to bottom,
        rgba(0,0,0,0)   0%,
        rgba(0,0,0,0)   45%,
        rgba(0,0,0,0.6) 65%,
        rgba(0,0,0,1)   82%,
        rgba(0,0,0,1)   100%
    );
    z-index: 1;
}

/* Gradient: 10% base overlay everywhere + dark at the bottom for text */
.gh-post-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0.10) 0%,    /* subtle 10% tint across the whole image */
        rgba(0,0,0,0.10) 40%,
        rgba(0,0,0,0.35) 62%,
        rgba(0,0,0,0.75) 82%,
        rgba(0,0,0,0.92) 100%   /* dark at bottom for text */
    );
    z-index: 2;
}

/* Content sits above overlays */
.gh-post-hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    box-sizing: border-box;
    padding: 0 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gh-post-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.gh-post-hero-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
    max-width: 560px;
}

/* Footer meta row */
.gh-post-hero-footer {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    margin-top: 6px;
}

.gh-post-hero-meta-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gh-post-hero-meta-label {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.5);
}

.gh-post-hero-meta-value {
    font-size: 1.7rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

a.gh-post-hero-meta-value:hover {
    color: var(--color-highlight);
}

/* Tag gets the accent yellow */
.gh-post-hero-tag-value {
    color: var(--color-highlight) !important;
    font-weight: 600;
}

.gh-post-hero-tag-value:hover {
    color: #e0a800 !important;
}

/* Author row with profile image */
.gh-post-hero-author-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gh-post-hero-author-img {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.3);
}

/* No image: suppress the blur and gradient overlays — dark bg is enough */
.gh-post-hero:not(.gh-post-hero-has-image)::before,
.gh-post-hero:not(.gh-post-hero-has-image)::after {
    display: none;
}

/* Padding between hero and article/page body text */
.gh-post-main {
    padding-top: 40px;
}

/* Also remove screen.css top padding when image hero is present */
body.has-hero-image .gh-main {
    padding-top: 40px !important;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .gh-post-hero {
        margin-top: 0; /* fixed nav is out of flow and overlays from above */
        min-height: 60vh;
    }

    .gh-post-hero-content {
        padding: 0 20px 24px;
    }

    .gh-post-hero-title {
        font-size: 3rem;
    }

    .gh-post-hero-footer {
        flex-direction: column;
        gap: 14px;
    }

    .gh-post-hero-meta-label {
        font-size: 1rem;
    }

    .gh-post-hero-meta-value {
        font-size: 1.4rem;
    }
}

/* Legacy imported post images */
.gh-content img {
    max-width: 100%;
    height: auto;
}

/* ── Notizie dropdown (scrollable tag list) ───────────────── */
.gh-nav-dropdown-tags {
    max-height: 400px;
    overflow-y: auto;
}

/* ── Tag archive page ─────────────────────────────────────── */

.gh-archive-wrap {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 40px 20px 60px;
}

/* Full-width compact list */
.gh-archive-list {
    max-width: 100%;
    border-radius: 8px;
}

/* Controls row: year filter + per-page side by side */
.gh-archive-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.gh-perpage-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Year filter bar */
.gh-year-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gh-year-filter-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.gh-year-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gh-year-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.gh-year-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

/* Years with posts on this page — fully visible */
.gh-year-btn-has-posts {
    color: var(--color-text);
    border-color: var(--color-text-secondary);
}

/* Years on other pages — dimmed, still clickable (filters to nothing, shows user they exist) */
.gh-year-btn-other-page {
    opacity: 0.4;
}

.gh-year-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/* Numbered pagination */
.gh-pagination-numbered {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
    padding-bottom: 20px;
}

.gh-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

a.gh-page-btn:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-text-secondary);
}

.gh-page-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    font-weight: 700;
}

.gh-page-btn.disabled {
    opacity: 0.3;
    cursor: default;
}

/* ── Homepage 2-column layout with futures widget ───────── */

.mg-hp-layout {
    display: flex;
    align-items: flex-start;
    gap: 0;
    max-width: var(--container-width);
    margin: 0 auto;
    width: 100%;
}

.mg-hp-news {
    flex: 1;
    min-width: 0;
}

.mg-hp-futures {
    width: 300px;
    flex-shrink: 0;
    padding: 20px 20px 0 0;
}

@media (max-width: 900px) {
    .mg-hp-layout {
        flex-direction: column;
    }
    .mg-hp-futures {
        width: 100%;
        padding: 0 20px 20px;
    }
}

/* ── Futures Widget ─────────────────────────────────────── */

.mg-futures-widget {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--font-body);
    position: sticky;
    top: calc(var(--header-height, 80px) + 12px);
}

.mg-futures-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.mg-futures-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mg-futures-timestamp {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.mg-futures-section {
    padding: 10px 14px 4px;
}

.mg-futures-section + .mg-futures-section {
    border-top: 1px solid var(--color-border);
}

.mg-futures-section-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-highlight, #FFC107);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.mg-ft-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.mg-ft-table thead th {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: right;
    padding: 2px 4px 4px;
    border-bottom: 1px solid var(--color-border);
}

.mg-ft-table thead th:first-child {
    text-align: left;
}

.mg-ft-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}

[data-theme="light"] .mg-ft-table tbody tr:hover {
    background: rgba(0,0,0,0.03);
}

.mg-ft-table td {
    padding: 4px 4px;
    text-align: right;
    white-space: nowrap;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.mg-ft-name {
    text-align: left !important;
    color: var(--color-text-secondary) !important;
    font-size: 0.95rem;
}

.mg-ft-price {
    font-weight: 600;
}

.mg-ft-chg.up, .mg-ft-pct.up {
    color: var(--color-success, #4CAF50);
    background-color: rgba(76, 175, 80, 0.15);
    border-radius: 3px;
    padding: 2px 5px;
}

.mg-ft-chg.down, .mg-ft-pct.down {
    color: var(--color-accent, #D32F2F);
    background-color: rgba(211, 47, 47, 0.15);
    border-radius: 3px;
    padding: 2px 5px;
}

.mg-ft-chg.neutral, .mg-ft-pct.neutral {
    color: var(--color-text-secondary);
}

:root[data-theme="light"] .mg-ft-chg.up,
:root[data-theme="light"] .mg-ft-pct.up {
    background-color: rgba(76, 175, 80, 0.12);
}

:root[data-theme="light"] .mg-ft-chg.down,
:root[data-theme="light"] .mg-ft-pct.down {
    background-color: rgba(211, 47, 47, 0.1);
}

.mg-futures-loading,
.mg-futures-empty,
.mg-futures-error {
    padding: 14px;
    font-size: 1rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.mg-futures-error small {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
    opacity: 0.7;
}

.mg-futures-footer {
    padding: 6px 14px 8px;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    text-align: right;
    border-top: 1px solid var(--color-border);
    opacity: 0.7;
}

/* Light mode adjustments */
[data-theme="light"] .mg-futures-widget {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.gh-page-ellipsis {
    border-color: transparent;
    background: transparent;
    cursor: default;
}