/* ===================================
   FINBLOCK MAGAZINE - STYLE.CSS
   Professional & High-Level Fintech Design
   =================================== */

   :root {
    /* Palette: Professional Fintech */
    --color-bg: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #f1f3f5;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #555555;
    --color-text-muted: #888888;
    
    /* Brand Colors */
    --color-accent: #0044cc;
    --color-accent-hover: #003399;
    --color-accent-subtle: rgba(0, 68, 204, 0.05);
    
    /* UI Elements */
    --color-border: #e9ecef;
    --color-border-hover: #ced4da;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 16px 32px rgba(0,0,0,0.08);
    
    /* Typography */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Layout */
    --container-width: 1280px;
    --header-height: 90px;
    --gap-md: 2rem;
    --gap-lg: 4rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
    --color-bg: #0f1115;
    --color-bg-secondary: #161920;
    --color-bg-tertiary: #1c2029;
    --color-text-primary: #f8f9fa;
    --color-text-secondary: #b0b3b8;
    --color-text-muted: #6c757d;
    --color-accent: #4dabf7;
    --color-accent-hover: #74c0fc;
    --color-accent-subtle: rgba(77, 171, 247, 0.1);
    --color-border: #2d3139;
    --color-border-hover: #3d424d;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.3);
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    font-weight: 300;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
a:hover { color: var(--color-accent); }
ul { list-style: none; }
img { max-width: 100%; display: block; height: auto; }

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* --- HEADER --- */
.site-header {
    height: var(--header-height);
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
    height: 70px;
}

.nav-inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* LOGO STYLING */
.logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 10px 0;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}

.site-header.scrolled .logo-img {
    height: 40px;
}

[data-theme="dark"] .logo-img {
    filter: brightness(0) invert(1); 
}

.back-link {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    transition: var(--transition);
}

.back-link:hover {
    color: var(--color-accent);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: var(--transition);
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    background-color: var(--color-bg-secondary);
}

/* --- AUTH UI --- */
.auth-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 400;
    background: transparent;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.auth-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.auth-btn-primary {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.auth-btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: white;
}

.user-menu {
    position: relative;
}

.user-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background: transparent;
    color: var(--color-text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 400;
    transition: var(--transition);
}

.user-button:hover {
    border-color: var(--color-accent);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-weight: 400;
}

.user-dropdown a:hover {
    background-color: var(--color-bg-secondary);
}

/* --- AUTH MODAL --- */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

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

.auth-modal-content {
    background: var(--color-bg);
    border-radius: 8px;
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}

.auth-modal-close:hover {
    color: var(--color-text-primary);
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-border);
}

.auth-tab {
    flex: 1;
    padding: 0.8rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.auth-tab.active {
    color: var(--color-accent);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 0.3rem;
}

.form-group-i {
    margin-bottom: 1rem;
}

.form-group-i label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.form-group-i input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--color-bg);
    color: var(--color-text-primary);
    transition: var(--transition);
    font-weight: 300;
}

.form-group-i input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--color-bg);
    color: var(--color-text-primary);
    transition: var(--transition);
    font-weight: 300;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.auth-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    min-height: 20px;
    font-weight: 400;
    display: none;
}

.auth-error:not(:empty) {
    display: block;
}

.btn-block {
    width: 100%;
}

/* --- GOOGLE OAUTH BUTTON --- */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    font-weight: 500;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.btn-google:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: #d1d5db;
    box-shadow: var(--shadow-sm);
}

.btn-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

[data-theme="dark"] .btn-google {
    background-color: #1f2937;
    color: #f3f4f6;
    border-color: #374151;
}

[data-theme="dark"] .btn-google:hover:not(:disabled) {
    background-color: #374151;
    border-color: #4b5563;
}

.btn-google svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* --- AUTH DIVIDER --- */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: var(--color-border);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

/* --- HERO SECTION --- */
.hero-wrapper {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid var(--color-border);
    background: radial-gradient(circle at top right, var(--color-accent-subtle), transparent 40%);
}

.hero-wrapper.hero-compact {
    padding: 2rem 0 1.5rem;
}

/* MOBILE HERO - SOTTILE CON LAYOUT ORIZZONTALE */
@media (max-width: 768px) {
    .hero-wrapper.hero-compact {
        padding: 1rem 0;
    }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

/* MOBILE HERO LAYOUT */
@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 0.6fr 1.4fr;
        gap: 1rem;
        align-items: center;
    }
}

@media (min-width: 992px) {
    .hero-grid { 
        grid-template-columns: 1.3fr 0.7fr;
        gap: 3rem;
    }
}

.hero-label {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.8rem;
    display: block;
    font-size: 0.75rem;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    line-height: 1.15;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
}

.hero-content p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    max-width: 600px;
    line-height: 1.65;
    font-weight: 300;
}

@media (max-width: 768px) {
    .hero-content p {
        font-size: 0.75rem;
        margin-bottom: 0.8rem;
        display: none;
    }
}

.hero-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

@media (max-width: 768px) {
    .hero-logo-container {
        padding: 0;
        order: -1;
    }
}

.hero-logo-large {
    width: 100%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 68, 204, 0.12));
}

@media (max-width: 768px) {
    .hero-logo-large {
        max-width: 80px;
    }
}

[data-theme="dark"] .hero-logo-large {
    filter: brightness(0) invert(1) drop-shadow(0 8px 24px rgba(77, 171, 247, 0.15));
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .hero-actions {
        display: none;
    }
}

.btn {
    padding: 0.7rem 1.4rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-block;
}

.btn-primary {
    background-color: var(--color-text-primary);
    color: var(--color-bg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    opacity: 0.9;
}

.btn-outline {
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    border-color: var(--color-text-primary);
}

/* --- SECTION HEADERS --- */
.section-header {
    padding: 2.5rem 0 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-header h2 {
    font-size: 1.8rem;
    font-family: var(--font-serif);
    font-weight: 600;
}

.section-link {
    font-weight: 500;
    color: var(--color-accent);
    font-size: 0.95rem;
}

.section-title-center {
    font-size: 1.8rem;
    font-family: var(--font-serif);
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

/* --- ARCHIVE HERO --- */
.archive-hero {
    background-color: var(--color-bg-secondary);
    padding: 3rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.archive-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.archive-hero p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 300;
}

.archive-content {
    padding: 3rem 0 5rem;
}

/* --- ARTICLE HERO --- */
.article-hero {
    background-color: var(--color-bg-secondary);
    padding: 3rem 0 2rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.article-hero-inner {
    max-width: 800px;
}

.article-category {
    color: var(--color-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.article-hero-title {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    line-height: 1.15;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.article-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-weight: 300;
}

.article-meta-hero {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    flex-wrap: wrap;
    font-weight: 300;
}

/* --- ARTICLE LAYOUT --- */
.article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    padding: 3.5rem 0;
}

@media (min-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr 340px;
        align-items: start;
    }
}

.article-content {
    font-family: var(--font-serif);
    font-size: 0.98rem;
    line-height: 1.8;
    position: relative;
    font-weight: 400;
}

.article-featured-image {
    max-width: 1200px;
    width: 100%;
    aspect-ratio: 3 / 2; /* 1200x800 */
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 2rem;
}

.article-content .lead {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    font-weight: 400;
}

.article-content p { 
    margin-bottom: 1.5rem;
    text-align: justify;
    font-weight: 400;
}

.article-content h2 { 
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 900;
}

.article-content h3 { 
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.article-callout {
    background-color: var(--color-bg-secondary);
    padding: 1.8rem;
    border-left: 3px solid var(--color-accent);
    margin: 2rem 0;
}

.article-callout h4 {
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 900;
}

.article-callout p {
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 300;
}

.article-callout ul {
    padding-left: 1.2rem;
    list-style: disc;
}

.article-callout li {
    margin-bottom: 0.5rem;
    font-weight: 400;
}

/* BLUR EFFECT FOR RESTRICTED CONTENT */
.blurred-content {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

.content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent, var(--color-bg) 30%);
    padding: 8rem 2rem 2rem;
    text-align: center;
    z-index: 10;
}

.overlay-content {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    margin: 0 auto;
}

.overlay-content svg {
    margin: 0 auto 1.5rem;
    color: var(--color-accent);
}

.overlay-content h3 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.overlay-content p {
    color: var(--color-text-secondary);
    margin-bottom: 0;
    font-weight: 300;
}

/* Sticky Sidebar */
.sidebar-sticky-container {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.sidebar-widget {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-widget:last-child { border: none; }

.widget-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.author-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.author-role {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 300;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    border: 1px solid var(--color-border);
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    background: transparent;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 400;
}

.share-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ToC Styles */
.toc-list li { margin-bottom: 0.8rem; }
.toc-list a {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    display: block;
    padding-left: 10px;
    border-left: 2px solid transparent;
    font-weight: 300;
}
.toc-list a:hover, .toc-list a.active {
    color: var(--color-accent);
    border-left-color: var(--color-accent);
}
.toc-list .toc-h3 { padding-left: 25px; font-size: 0.8rem; }

/* --- CARDS --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 0 5rem;
}

/* VARIED CARD GRID */
.card-grid-varied {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem 0 5rem;
}

@media (max-width: 480px) {
    .card-grid-varied {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        padding: 1rem 0 2rem;
    }
    
    .card-img-wrap {
        aspect-ratio: 16/9;
        min-height: 100px;
    }
    
    .card-body {
        padding: 0.8rem;
    }
    
    .card-tag {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }
    
    .card-title {
        font-size: 0.95rem;
        line-height: 1.25;
        margin-bottom: 0.4rem;
        font-weight: 600;
    }
    
    .card-excerpt {
        font-size: 0.8rem;
        line-height: 1.5;
        margin-bottom: 0.4rem;
        max-height: 3em;
        -webkit-line-clamp: 2;
    }
    
    .card-meta {
        font-size: 0.7rem;
        padding-top: 0.4rem;
        margin-top: auto;
    }
}

@media (min-width: 768px) {
    .card-grid-varied {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        padding: 2rem 0 5rem;
    }
    
    .card-featured {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .card-small {
        grid-column: span 1;
    }
}

.article-card {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-hover);
}

.card-img-wrap {
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: var(--color-bg-secondary);
}

.card-featured .card-img-wrap {
    aspect-ratio: 16/9;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.card-body { 
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-featured .card-body {
    padding: 1.5rem;
}

.card-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-featured .card-title {
    font-size: 1.2rem;
}

.card-excerpt {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 300;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.8em;
}

.card-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 300;
}

/* RELATED ARTICLES */
.related-articles-section {
    padding: 3rem 0 5rem;
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- CONTACT SECTION --- */
.contact-section {
    padding: 3rem 0;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

/* --- CONTACT SECTION --- */
.contact-section {
    padding: 2rem 0;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.contact-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .contact-wrapper {
        flex-direction: row;
        gap: 3rem;
        align-items: flex-start;
    }
}

.contact-newsletter {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    order: -1;
}

@media (min-width: 768px) {
    .contact-newsletter {
        order: 0;
        flex: 1;
    }
}

.contact-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.contact-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
    margin: 0;
}

@media (max-width: 768px) {
    .contact-title {
        font-size: 1.3rem;
    }
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 1.5rem;
}

@media (max-width: 1024px) {
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 480px) {
    .contact-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem 0.8rem;
    }
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.info-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 0.2rem;
}

.info-value {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-primary);
    transition: var(--transition);
    line-height: 1.3;
}

.info-value:hover {
    color: var(--color-accent);
}

.contact-form-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.contact-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contact-form .form-group input {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    transition: var(--transition);
    font-weight: 300;
}

.contact-form .form-group input::placeholder {
    color: var(--color-text-muted);
}

.contact-form .form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.checkbox-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin: 0.2rem 0 0 0;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--color-accent);
    margin: 0;
}

.checkbox-label {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    font-weight: 300;
    cursor: pointer;
    margin: 0;
    white-space: normal;
}

.privacy-link {
    color: var(--color-accent);
    font-weight: 400;
    transition: var(--transition);
}

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

.contact-form .btn {
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.form-message {
    font-size: 0.85rem;
    padding: 0.8rem;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* --- FOOTER --- */
.site-footer {
    background-color: var(--color-bg-secondary);
    padding: 4rem 0 0;
    border-top: 1px solid var(--color-border);
}

/* FOOTER MAIN GRID */
.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 3rem 0 3rem;
    border-bottom: 1px solid var(--color-border);
}

@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        padding: 2rem 0 2rem;
    }
}

@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 2.5rem;
    }
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-about {
    padding-right: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .footer-about {
        grid-column: span 2;
        padding-right: 0;
    }
}

.footer-logo {
    height: 60px;
    width: auto;
    margin-bottom: 1.5rem;
    object-fit: contain;
    display: block;
}

[data-theme="dark"] .footer-logo {
    filter: brightness(0) invert(1);
}

.footer-tagline {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 1.2rem;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.footer-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-weight: 300;
    max-width: 280px;
}

.footer-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1.2rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    transition: var(--transition);
}

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

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-contact li {
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contact-label {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-contact a {
    color: var(--color-accent);
    font-weight: 400;
    transition: var(--transition);
}

.footer-contact a:hover {
    opacity: 0.8;
}

.footer-contact span {
    color: var(--color-text-secondary);
    font-weight: 300;
}

.footer-social {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    color: var(--color-text-primary);
    transition: var(--transition);
}

.social-link:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background-color: var(--color-accent-subtle);
}

/* FOOTER DISCLAIMER WRAPPER */
.footer-disclaimer-wrapper {
    margin-bottom: 2rem;
}

.footer-disclaimer-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg-tertiary);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 8px 8px 0 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.footer-disclaimer-toggle:hover {
    background-color: var(--color-bg-secondary);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.footer-disclaimer-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* FOOTER DISCLAIMER */
.footer-disclaimer {
    background-color: var(--color-bg-tertiary);
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    border: 1px solid var(--color-border);
    border-top: none;
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    position: relative;
}

.footer-disclaimer.expanded {
    max-height: 1000px;
}

.footer-disclaimer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--color-bg-tertiary));
    pointer-events: none;
}

.footer-disclaimer.expanded::after {
    display: none;
}



.footer-disclaimer p {
    font-size: 0.72rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin-bottom: 0.8rem;
    text-align: justify;
    font-weight: 300;
}

.footer-disclaimer p:last-child {
    margin-bottom: 0;
}

/* FOOTER BOTTOM */
.footer-bottom {
    text-align: center;
    padding: 2rem 0 2rem;
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 480px) {
    .footer-bottom-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        justify-items: center;
        gap: 0.8rem;
    }
    
    .footer-bottom-links a:nth-child(1),
    .footer-bottom-links a:nth-child(2) {
        grid-column: auto;
    }
    
    .footer-bottom-links a:nth-child(3),
    .footer-bottom-links a:nth-child(4) {
        grid-column: auto;
    }
    
    .divider {
        display: none;
    }
}

.footer-bottom-links a {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--color-accent);
}

.divider {
    color: var(--color-border);
    font-weight: 300;
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 300;
}

/* --- FORM MESSAGE --- */
.form-message {
    font-size: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    text-align: center;
    margin-top: 0.4rem;
    min-height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* --- PAYWALL & BLURRED CONTENT ENHANCED --- */

/* Il contenitore del testo che verrà sfocato */
.locked-content {
    position: relative;
    user-select: none; /* Impedisce la selezione del testo */
}

/* L'effetto sfocatura vero e proprio */
.is-blurred {
    filter: blur(5px);
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.5s ease;
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 90%);
}

/* Il contenitore che si sovrappone al testo sfocato */
.paywall-overlay {
    position: absolute;
    top: 50px; /* Inizia poco dopo l'inizio della sfocatura */
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 1rem;
}

/* La card di invito all'azione */
.paywall-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: slideUpFade 0.6s ease-out;
}

.paywall-icon {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.paywall-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.paywall-text {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.paywall-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Animazione per la card */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PAYWALL & BLURRED CONTENT REFINED --- */

.locked-content {
    position: relative;
    user-select: none;
}

/* Effetto sfocatura più intenso e con maschera sfumata */
.is-blurred {
    filter: blur(8px); /* Sfocatura aumentata */
    opacity: 0.6;
    pointer-events: none;
    transition: all 0.5s ease;
    /* Maschera che fa svanire il testo verso il basso */
    mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 80%);
}

/* Overlay posizionato più in alto */
.paywall-overlay {
    position: absolute;
    top: 0; 
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Allinea in alto */
    padding-top: 60px; /* Spazio dall'inizio del blur */
}

/* Card Premium con effetto Glassmorphism */
.paywall-card {
    background: rgba(255, 255, 255, 0.85); /* Sfondo semi-trasparente */
    backdrop-filter: blur(12px); /* Effetto vetro */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 20px 50px rgba(0, 40, 100, 0.1), /* Ombra profonda colorata */
        0 4px 10px rgba(0,0,0,0.05);
    animation: slideUpFade 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] .paywall-card {
    background: rgba(20, 25, 35, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.paywall-icon {
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    background: var(--color-accent-subtle);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.paywall-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    margin-bottom: 0.8rem;
    color: var(--color-text-primary);
    font-weight: 700;
}

.paywall-text {
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 300;
}

.paywall-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    justify-content: center;
    align-items: center;
}

@media (min-width: 480px) {
    .paywall-actions {
        flex-direction: row;
    }
}

/* Pulsanti della card specifici */
.paywall-btn-login {
    background-color: var(--color-accent);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 50px; /* Pill shape */
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px var(--color-accent-subtle);
}

.paywall-btn-login:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 68, 204, 0.25);
}

.paywall-btn-sub {
    color: var(--color-text-primary);
    background: transparent;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    border: 1px solid var(--color-border);
}

.paywall-btn-sub:hover {
    border-color: var(--color-text-primary);
    background: rgba(0,0,0,0.02);
}

.magazine-highlight {
    color: var(--color-accent); /* blu del sito */
}

/* --- COOKIE BAR BLOCKING STYLE --- */

/* 1. Overlay che blocca i clic sul sito */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Sfondo scuro */
    backdrop-filter: blur(2px);     /* Effetto sfocato elegante */
    z-index: 9998;                  /* Sotto la bar, sopra il sito */
    display: none;                  /* Nascosto di base */
}

/* 2. La Barra */
.cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    padding: 1.5rem 0;
    
    /* Animazione */
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Classi mostrate dallo script */
.cookie-bar.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.cookie-overlay.show {
    display: block;
}

/* Blocca lo scroll del sito quando il banner è attivo */
body.cookie-lock {
    overflow: hidden !important;
}

.cookie-bar-inner {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-bar-text {
    font-size: 0.88rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.cookie-bar-text strong {
    color: var(--color-text-primary);
    font-family: var(--font-serif);
}

.cookie-bar-text a {
    color: var(--color-accent);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-bar-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.7rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: var(--transition);
}

.cookie-btn.primary {
    background-color: var(--color-accent);
    color: var(--color-bg);
    border: 1px solid var(--color-accent);
    transition: filter 0.25s ease;
}

.cookie-btn.primary:hover {
    filter: brightness(0.92);
}

.cookie-btn.ghost {
    background-color: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-text-secondary);
    transition:
        color 0.25s ease,
        border-color 0.25s ease,
        background-color 0.25s ease;
}

.cookie-btn.ghost:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* Mobile */
@media (max-width: 768px) {
    .cookie-bar-inner { flex-direction: column; text-align: center; gap: 1.5rem; }
    .cookie-bar-actions { width: 100%; }
    .cookie-btn { flex: 1; }
}

/* --- CATEGORY FILTERS --- */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    padding: 2.5rem 0;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filter-btn {
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.filter-btn.active {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px var(--color-accent-subtle);
}

/* Gestione visibilità card filtrata */
.article-card {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.article-card.hidden {
    display: none; /* Rimuove lo spazio */
    opacity: 0;
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .filter-container {
        padding: 1.5rem 0;
        gap: 0.5rem;
    }
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }
}