/* css/style.css - Da cosa nasce casa (Ispirato a Cose di Casa) */

:root {
    --brand-red: #D32F2F; /* Rosso Cose di Casa */
    --text-main: #212121; /* Grigio molto scuro */
    --text-muted: #666666;
    --bg-page: #F5F5F5; /* Grigio chiarissimo di sfondo per staccare le card */
    --bg-content: #FFFFFF;
    --border-color: #E0E0E0;
    --border-hover: #BDBDBD;
    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-reading: 'Georgia', serif;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--brand-red);
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: #1a1a1a;
    border-bottom: 3px solid var(--brand-red);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-area {
    display: flex;
    flex-direction: column;
}

/* Cose di Casa Inspired Logo Box */
.logo-box {
    display: inline-flex;
    flex-direction: column;
    background-color: var(--brand-red);
    color: #ffffff;
    padding: 8px 15px;
    font-family: var(--font-heading);
    text-align: center;
    text-transform: uppercase;
    font-weight: 900;
    border-radius: 2px;
    width: fit-content;
    line-height: 1;
}

.logo-box:hover {
    color: #ffffff;
    opacity: 0.95;
}

.logo-image-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.logo-image-link:hover {
    opacity: 0.85;
}

.header-logo-img {
    height: 110px;
    width: auto;
    display: block;
    max-height: 100%;
}

@media (max-width: 768px) {
    .header-logo-img {
        height: 65px;
    }
}

.logo-sub {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.logo-main {
    font-size: 2.2rem;
    letter-spacing: -0.5px;
    margin-top: 2px;
}

.tagline {
    font-size: 0.8rem;
    color: #bbbbbb;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    font-weight: 600;
}

/* Partners Area */
.partners-logos {
    display: flex;
    gap: 20px;
    align-items: center;
}

.partner-link {
    display: flex;
    flex-direction: column;
    border-left: 2px solid #333333;
    padding-left: 15px;
}

.partner-label {
    font-size: 0.7rem;
    color: #bbbbbb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.partner-name {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.1rem;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.partner-link:hover .partner-name {
    color: var(--brand-red);
}

/* Header Utilities (Socials, Login, Search) */
.header-utilities {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

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

.header-social-icons a {
    color: #bbbbbb;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.header-social-icons a:hover {
    color: var(--brand-red);
}

.header-search {
    display: flex;
    align-items: center;
}

.user-menu-area {
    display: flex;
    align-items: center;
}

.btn-user-login {
    color: #ffffff !important;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.btn-user-login:hover {
    color: var(--brand-red) !important;
}

.user-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.8rem;
    white-space: nowrap;
}

.user-name-label {
    color: #bbbbbb;
}

.user-name-label strong {
    color: #ffffff;
}

.btn-user-action {
    color: var(--brand-red) !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
}

.btn-user-action:hover {
    opacity: 0.8;
}

.search-form {
    display: flex;
    position: relative;
    border: 1px solid #444444;
    border-radius: 4px;
    overflow: hidden;
}

.search-form input {
    padding: 10px 40px 10px 15px;
    border: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    width: 250px;
}

.btn-search-icon {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-search-icon:hover {
    color: var(--brand-red);
}

/* Navigation Menu */
.main-nav {
    background-color: #fafafa;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    display: block;
    padding: 14px 14px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
    transition: color 0.2s ease;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--brand-red);
}

/* Dropdown Submenus (SEO subcategories) */
.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    min-width: 240px;
    padding: 5px 0;
    border-radius: 0 0 4px 4px;
}

.dropdown-menu ul {
    display: flex;
    flex-direction: column;
}

.dropdown-menu li {
    width: 100%;
    margin: 0;
}

.dropdown-menu li a {
    padding: 10px 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-main);
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.dropdown-menu li a:hover {
    background-color: #f9f9f9;
    color: var(--brand-red);
    padding-left: 25px;
}

/* Hero Magazine Section */
.hero-magazine {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin: 30px 0;
}

/* Card Elements */
.card-hover {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.card-hover:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
}

/* Featured Card (Large) */
.featured-card {
    display: flex;
    flex-direction: column;
}

.card-img-wrap {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
}

.card-img-wrap img, .side-card-img img, .grid-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-hover:hover img {
    transform: scale(1.04);
}

.cat-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background-color: var(--brand-red);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 4px 8px;
    letter-spacing: 1px;
}

.cat-badge-small {
    background-color: var(--brand-red);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    padding: 2px 6px;
    letter-spacing: 0.5px;
    border-radius: 2px;
    width: fit-content;
}

.featured-card .card-body {
    padding: 25px;
    flex-grow: 1;
}

.featured-card h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.article-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Trending Sidebar Stack (AD Style) */
.trending-sidebar {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 4px;
}

.sidebar-header {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.sidebar-header h3 {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trending-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    border-bottom: 1px solid var(--bg-page);
    padding-bottom: 15px;
}

.trending-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trending-num {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--border-color);
    line-height: 0.8;
}

.trending-item:hover .trending-num {
    color: var(--brand-red);
}

.trending-content h4 {
    font-size: 0.95rem;
    margin-top: 5px;
    font-family: var(--font-body);
    font-weight: 600;
}

/* Newsletter Bar */
.newsletter-bar {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--brand-red);
    padding: 30px;
    margin: 40px 0;
}

.newsletter-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.newsletter-text h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.newsletter-text p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.newsletter-form {
    display: flex;
    width: 100%;
    max-width: 500px;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-right: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    border-radius: 4px 0 0 4px;
}

.newsletter-form input:focus {
    border-color: var(--brand-red);
}

.btn-submit {
    background-color: var(--brand-red);
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background-color 0.2s ease;
}

.btn-submit:hover {
    background-color: #b71c1c;
}

/* Grid layout for categories and archives */
.category-block {
    margin: 40px 0 60px;
}

.block-header {
    border-bottom: 2px solid var(--brand-red);
    padding-bottom: 8px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.block-header h2 {
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.view-more {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-red);
}

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

.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

@media (max-width: 768px) {
    .grid-2-cols {
        grid-template-columns: 1fr;
    }
}

.grid-card-style {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.grid-img-wrap {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.grid-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.grid-card-body h3 {
    font-size: 1.25rem;
    line-height: 1.35;
    margin-bottom: 10px;
}

.grid-card-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.grid-card-body .read-more {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--brand-red);
    text-transform: uppercase;
}

/* Tool Cards */
.tool-card {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 30px;
    display: flex;
    gap: 20px;
}

.tool-icon-wrap {
    background-color: #fff8f8;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tool-body h3 {
    font-size: 1.3rem;
    margin: 10px 0 8px;
}

.tool-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.btn-tool-link {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--brand-red);
    text-transform: uppercase;
}

/* Archive Filter Bar */
.archive-filter-bar {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    padding: 15px 25px;
    margin-bottom: 30px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    list-style: none;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--brand-red);
    color: white;
    border-color: var(--brand-red);
}

.filter-status-msg {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Sponsor CTA Banner */
.sponsor-cta-banner {
    background-color: #2f302b;
    color: #ffffff;
    background-image: linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0,0.85)), url('https://images.unsplash.com/photo-1600607687920-4e2a09cf159d?auto=format&fit=crop&q=80&w=1000');
    background-size: cover;
    background-position: center;
    padding: 50px 40px;
    margin: 60px 0;
    border-radius: 4px;
}

.sponsor-banner-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.sponsor-text {
    max-width: 600px;
}

.sponsor-badge {
    display: inline-block;
    color: var(--brand-red);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.sponsor-text h2 {
    color: #ffffff;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.sponsor-text p {
    color: #cccccc;
    font-size: 1.05rem;
    line-height: 1.5;
}

.sponsor-buttons {
    display: flex;
    gap: 15px;
}

.btn-sponsor {
    display: inline-block;
    padding: 14px 28px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-sponsor.bergo {
    background-color: var(--brand-red);
    color: #ffffff;
}

.btn-sponsor.bergo:hover {
    background-color: #b71c1c;
}

.btn-sponsor.monolitika {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-sponsor.monolitika:hover {
    background-color: #ffffff;
    color: #000000;
}

/* Footer */
.main-footer {
    background-color: #212121;
    color: #ffffff;
    padding: 50px 0 0 0;
    font-size: 0.95rem;
}

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

.brand-col .logo-box {
    margin-bottom: 15px;
}

.footer-desc {
    color: #bbbbbb;
    line-height: 1.5;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-family: var(--font-heading);
}

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

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #bbbbbb;
}

.footer-col a:hover {
    color: var(--brand-red);
    padding-left: 4px;
}

.footer-bottom {
    background-color: #151515;
    padding: 20px 0;
    text-align: center;
    color: #888888;
    font-size: 0.85rem;
    border-top: 1px solid #2d2d2d;
}

/* Archive CSS custom */
.archive-section {
    margin: 40px 0 80px;
}

.excerpt-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 960px) {
    .hero-magazine {
        grid-template-columns: 1fr;
    }
    .trending-sidebar {
        margin-top: 20px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    .partners-logos {
        justify-content: center;
        width: 100%;
    }
    .grid-3-cols {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .newsletter-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .newsletter-text {
        text-align: center;
    }
    .sponsor-banner-inner {
        flex-direction: column;
        text-align: center;
    }
    .sponsor-buttons {
        flex-direction: column;
        width: 100%;
    }
    .btn-sponsor {
        width: 100%;
    }
    .tool-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .archive-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* User Badge Header Styles */
#user-menu-area {
    display: flex;
    align-items: center;
}
.user-badge-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    background-color: #fcfcfc;
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
}
.btn-user-action {
    color: var(--brand-red);
    font-weight: 700;
}
.btn-user-login {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--brand-red);
    color: white !important;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}
.btn-user-login:hover {
    background-color: #b71c1c;
}

/* Tools Access Wall Lock Overlay */
.tools-lock-overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
}
.lock-card {
    background-color: white;
    border: 2px solid var(--brand-red);
    padding: 30px;
    border-radius: 4px;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.lock-card svg {
    margin-bottom: 5px;
}
.lock-card h3 {
    font-size: 1.4rem;
    font-family: var(--font-heading);
}
.lock-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Search Suggestions Dropdown Styles */
.search-suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 99;
    max-height: 300px;
    overflow-y: auto;
    font-family: var(--font-body);
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #fafafa;
    color: var(--brand-red);
}

.suggestion-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: #e0e0e0;
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.suggestion-item:hover .suggestion-type {
    background-color: var(--brand-red);
    color: white;
}

.suggestion-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Personalized Book Promotion Card Styles */
.book-promo-card {
    background-color: #fff8f8;
    border: 1px solid var(--brand-red);
    border-left: 5px solid var(--brand-red);
    border-radius: 4px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.05);
}

.book-promo-badge {
    display: inline-block;
    color: var(--brand-red);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.book-promo-card h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.book-promo-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.book-promo-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-promo-preview-link {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    text-transform: uppercase;
}

.btn-promo-preview-link:hover {
    color: var(--brand-red);
}

/* Premium 3D Book Mockup Styles */
.book-3d-container {
    perspective: 1200px;
    width: 240px;
    height: 340px;
    margin: 20px auto;
}

.book-3d-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.book-3d-container:hover .book-3d-wrapper {
    transform: rotateY(-30deg) rotateX(10deg) translateZ(10px);
    box-shadow: -15px 15px 35px rgba(0,0,0,0.18);
}

.book-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #212121;
    color: white;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 2px 5px 5px 2px;
    border-left: 2px solid rgba(255,255,255,0.1);
    z-index: 2;
    backface-visibility: hidden;
    transform: translateZ(15px); /* Half of spine width */
}

.book-front.gold {
    background: linear-gradient(135deg, #1C1C1C, #2D2D2D);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
}

.book-front.red-book {
    background: linear-gradient(135deg, #4A1212, #2B0505);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
}

.book-spine {
    position: absolute;
    width: 30px; /* Spine width */
    height: 100%;
    left: 0;
    top: 0;
    background-color: #111;
    transform: rotateY(-90deg) translateZ(15px); /* Rotated and shifted by half of spine width */
    transform-origin: left center;
    z-index: 1;
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.5);
}

.book-front.gold + .book-spine {
    background: linear-gradient(to bottom, #bfa15f, #7a6332);
}

.book-front.red-book + .book-spine {
    background: linear-gradient(to bottom, #8c2323, #4a1212);
}

.book-cover-brand {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--brand-red);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.book-front.gold .book-cover-brand {
    color: #C5A880;
}

.book-front.red-book .book-cover-brand {
    color: #ff8a80;
}

.book-cover-title {
    font-family: var(--font-reading);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 15px 0;
}

.book-cover-subtitle {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
}

.book-front.gold .book-cover-subtitle {
    color: #C5A880;
}

.book-front.red-book .book-cover-subtitle {
    color: #ff8a80;
}

/* Page details for libri.html */
.book-showcase-row {
    background-color: var(--bg-content) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-showcase-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05) !important;
}

.author-name {
    color: var(--brand-red) !important;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.book-info-area h2 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.9rem;
    margin-bottom: 5px;
}

.book-info-area p {
    font-family: var(--font-body);
    font-size: 0.95rem !important;
    color: #444 !important;
    line-height: 1.6 !important;
}

.book-info-area li {
    font-family: var(--font-body);
    font-size: 0.9rem !important;
    color: #555;
}

.private-client-banner {
    background-color: #fff8f8 !important;
    border: 1px solid var(--brand-red) !important;
    border-left: 5px solid var(--brand-red) !important;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.04);
}

.private-banner-text h3 {
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--text-main);
}

/* Dynamic Ads Style */
.dynamic-ad-container {
    margin: 40px auto;
    max-width: 800px;
    width: 100%;
}

.ad-card-inner {
    background-color: #fff9f9;
    border: 1px solid rgba(211, 47, 47, 0.15);
    border-left: 5px solid var(--brand-red);
    padding: 30px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.03);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ad-card-inner:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.06);
}

.ad-tag {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--brand-red);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 10px;
}

.ad-body h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-main);
    margin-bottom: 8px;
}

.ad-body p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-ad-cta {
    display: inline-block;
    background-color: var(--brand-red);
    color: white;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.btn-ad-cta:hover {
    background-color: #b71c1c;
    color: white;
}

/* Tools Page Styles */
.tools-header {
    text-align: center;
    margin: 40px 0;
}

.tools-header h1 {
    font-size: 2.8rem;
    font-weight: 900;
}

.tools-header p {
    color: var(--text-muted);
    font-size: 1.15rem;
}

.tool-section {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 40px;
    margin-bottom: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.tool-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--brand-red);
    display: inline-block;
    padding-bottom: 4px;
    font-family: var(--font-heading);
}

.tool-section > p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1.05rem;
    font-family: var(--font-body);
}

.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .calculator-container {
        grid-template-columns: 1fr;
    }
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.form-group input[type="number"], .form-group select {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    background-color: var(--bg-content);
}

.form-group input[type="number"]:focus, .form-group select:focus {
    border-color: var(--brand-red);
}

.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-top: 5px;
    font-family: var(--font-body);
}

.form-checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-red);
}

.btn-calc {
    background-color: var(--brand-red);
    color: white;
    border: none;
    padding: 14px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    text-align: center;
}

.btn-calc:hover {
    background-color: #b71c1c;
}

.calc-results {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.results-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 1.05rem;
    font-family: var(--font-body);
}

.result-row.total {
    border-bottom: none;
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--brand-red);
    padding-top: 20px;
}

.results-cta {
    margin-top: 30px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    padding: 20px;
    text-align: center;
}

.results-cta p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-family: var(--font-body);
}

.config-checklist {
    margin-top: 20px;
    list-style: none;
    padding-left: 0;
}

.config-checklist li {
    padding: 8px 0;
    padding-left: 28px;
    position: relative;
    font-size: 0.95rem;
    font-family: var(--font-body);
}

.config-checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2E7D32;
    font-weight: 900;
}

.config-checklist li.warning::before {
    content: '⚠';
    color: #C62828;
}

.placeholder-tool-content {
    background-color: #fafafa;
    border: 2px dashed var(--border-color);
    padding: 40px;
    text-align: center;
    border-radius: 4px;
}

.placeholder-tool-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-family: var(--font-body);
}

/* ==========================================================================
   Responsive Sidebar Layout (Cose di Casa style) & Legal/SEO compliance
   ========================================================================== */

.magazine-layout-wrapper {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 40px;
    margin: 40px auto;
    align-items: start;
}

.magazine-main-col {
    min-width: 0; /* Prevents flexbox/grid layout overflow */
}

.magazine-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 20px;
}

.sidebar-widget {
    background-color: var(--bg-content);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 4px;
}

.sidebar-widget h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-main);
    border-bottom: 2px solid var(--brand-red);
    display: inline-block;
    padding-bottom: 4px;
}

.sidebar-ad-box {
    background-color: #fafafa;
    border: 1px dashed var(--border-color);
    padding: 15px;
    text-align: center;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

.sidebar-ad-box:hover {
    border-color: var(--brand-red);
}

/* Floating Cookie Consent Banner (GDPR Compliance) */
.cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px;
    background-color: #212121;
    color: #ffffff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.5;
    border-left: 4px solid var(--brand-red);
    transform: translateY(150%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-cookie {
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cookie.accept {
    background-color: var(--brand-red);
    color: #ffffff;
}

.btn-cookie.accept:hover {
    background-color: #b71c1c;
}

.btn-cookie.refuse {
    background-color: transparent;
    color: #bbbbbb;
    border: 1px solid #444;
}

.btn-cookie.refuse:hover {
    color: #ffffff;
    border-color: #ffffff;
}

/* AI Act Disclosure Badge */
.ai-disclosure-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
    background-color: #f5f5f5;
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 15px;
    font-family: var(--font-body);
}

/* Responsive adjustment for Sidebar */
@media (max-width: 1024px) {
    .magazine-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .magazine-sidebar-col {
        position: static;
    }
}

/* Mobile Hamburger Menu & Expandable Navigation */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .logo-area {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 5px 0;
    }

    .header-container {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .main-nav {
        display: none;
        width: 100%;
        background-color: var(--bg-content);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .main-nav li {
        width: 100%;
        margin: 0;
    }

    .main-nav a {
        padding: 14px 20px;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        box-sizing: border-box;
    }

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

    /* Mobile Accordion Dropdowns */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--brand-red);
        background-color: #fafafa;
        transform: none;
        transition: none;
        padding: 5px 0;
        width: 100%;
        display: none;
    }

    .nav-dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu li a {
        padding: 10px 30px;
    }
}



