/*
 * Main CSS file for Treccanix Custom Theme
 * Author: Federico Tassara
 * Version: 1.0
 */

/* Reset e Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.home-page, #masthead {
    max-width: 1350px;
    margin: 0 auto;
}

.treccani-max-auth, .treccani-max-width {
    max-width: 1350px;
    margin: 0 auto;
}

.blue-text {
    color:  #3111EE;
}

.pink-text {
    color:  #F32EA1;
}

.orange-text {
    color:  #FA3C37;
}

.ciano-text {
    color: #96F1E2;
}

.fucsia-text {
    color: #F32EA1;
}

.yellow-text {
    color: #FBFE57;
}

.purple-text {
    color: #6733F7;
}

/* FAQ Styles */
.faq-item.active {
    background-color: #96F1E2; /* Colore ciano quando attiva */
}

.faq-button:hover {
    background-color: #f5f5f5;
}

.faq-item.active .faq-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.faq-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
}

.faq-content.show {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
}

/* Login Form Styles */
.login-form input[type="email"],
.login-form input[type="password"] {
    background-color: #ffffff;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
    border-color: #3111EE;
    box-shadow: 0 0 0 3px rgba(49, 17, 238, 0.1);
}

.login-form input[type="checkbox"] {
    accent-color: #3111EE;
}

.login-form button[type="submit"]:hover {
    background-color: #2910CC;
}

/* Login Messages */
.login-error {
    background-color: #fee2e2;
    border: 1px solid #f87171;
}

/* Convenzioni Filter Styles */
.filter-category {
    background-color: #ffffff;
    color: #000;
    font-weight: bold;
    font-size: 1.3rem;
}

.filter-category:hover {
    background-color: #3111EE;
    color: #ffffff;
}

.filter-category.active {
    background-color: #3111EE; /* Blue Treccani */
    color: #ffffff;
    border-color: #3111EE;
}

.filter-category.active:hover {
    background-color: #2910CC;
    border-color: #2910CC;
}

#convenzioni-results .slider-card {
    min-height: 400px !important;
    height: auto !important;
}

#convenzioni-results .slider-card {
    align-items: flex-start;
}

#convenzioni-results .slider-card p.vantaggi {
    color: #2910CC;
}

#convenzioni-results .slider-card svg path {
    stroke: #3111EE;
}

#editoriali-results .slider-card {
    min-height: 400px !important;
    height: auto !important;
}

/* Convenzioni Card Styles */
.convenzione-card {
    transition: all 0.3s ease;
    border-radius: 0;
}

.convenzione-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.convenzione-card img {
    transition: transform 0.3s ease;
}

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

/* Line clamp utilities */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Filter Sidebar Sticky */
.sticky {
    position: sticky;
}

/* Mobile Responsive adjustments for filters */
@media (max-width: 1024px) {
    .filter-category {
        margin-bottom: 0.5rem;
    }
    
    .convenzione-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .filter-category {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Background fluo for hover states */
.fluo-background {
    background-color: #FBFE57 !important;
}

.green-fluo-background {
    background-color: #CFF574;
}

/* Additional login styles */
.login-error-text {
    color: #dc2626;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.login-success {
    background-color: #dcfce7;
    border: 1px solid #4ade80;
    color: #16a34a;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.fluo-text {
    color: #CFF574;
}

.purple-text {
    color: #5D3AC3;
}

.purple-blue-text {
    color: #4100F5;
}

.blue-background {
    background-color:  #3111EE;
}

.orange-background {
    background-color:  #FA3C37;
}

.fluo-background {
    background-color:  #CFF574;
}

.fluo-button {
    background-color: #CFF574;
    color: #5D3AC3;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}

/* Club benefit boxes styles */
.club-benefit-box {
    transition: all 0.3s ease;
    border-width: 1px;
}

.club-benefit-box:hover {
    background-color: #CFF574 !important;
    border-width: 2px;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.club-benefit-box:active {
    background-color: #CFF574 !important;
    transform: translateY(0);
}

.club-benefit-button {
    transition: all 0.3s ease;
    font-weight: normal;
    border-width: 1px;
}

.club-benefit-box:hover .club-benefit-button {
    border-width: 2px;
    font-weight: bold;
}
.fluo-button:hover {
    background-color: #c4fa47;
}

.blue-button {
    background-color: #3111EE;
    color: #fff;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.blue-button:hover {
    background-color: #1a0f7d;
}

.pink-button {
    background-color: #F32EA1;
    color: #fff;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.pink-button:hover, .pink-button-big:hover {
    background-color: #c6286b;
}

.pink-button-big {
    background-color: #F32EA1;
    color: #fff;
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1rem;
    width: 100%;
    display: block;
    margin-top: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    .pink-button-big {
    font-size: 0.8rem;
}
}

.orange-button {
    background-color: #FA3C37;
    color: #fff;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.orange-button:hover {
    background-color: #b71c1c;
}

.ciano-button {
    background-color: #96F1E2;
    color: #000;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.ciano-button:hover {
    background-color: #96F1E2;
}

.fucsia-button {
    background-color: #F32EA1;
    color: #fff;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.fucsia-button:hover {
    background-color: #F32EA1;
}

.yellow-button {
    background-color: #FBFE57;
    color: #000;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.yellow-button:hover {
    background-color: #FBFE57;
}

.purple-blue-button {
    background-color: #4100F5;
    color: #fff;
    padding: 6px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    font-size: .8rem;
    width: fit-content;
}
.purple-blue-button:hover {
    background-color: #3600c9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.site-title a {
    text-decoration: none;
    color: #333;
}

div#menu-principale ul li a {
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Full width text distribution */
  .full-width-text {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  
  .full-width-text span {
    flex: 1;
    text-align: center;
  }

/* Navigation Menu */
.main-navigation {
    flex-grow: 1;
    margin: 0 40px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    transition: color 0.3s ease;
    display: block;
}

.nav-menu a:hover {
    color: #007cba;
}

/* Submenu */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-menu li:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li {
    width: 100%;
}

.nav-menu .sub-menu a {
    padding: 12px 20px;
    border-bottom: 1px solid #f5f5f5;
}

.nav-menu .sub-menu a:hover {
    background-color: #f8f9fa;
}

/* Header Actions */
.header-actions {
    flex-shrink: 0;
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 8px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #007cba;
    color: #fff;
    border-color: #007cba;
}

.btn-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
}

.btn-outline {
    background-color: transparent;
    color: #007cba;
    border-color: #007cba;
}

.btn-outline:hover {
    background-color: #007cba;
    color: #fff;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

/* Main Content */
.site-main {
    padding: 40px 0;
    min-height: 60vh;
}

/* Footer */
.site-footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}

/* Newsletter Section */
.newsletter-section {
    background-color: #96F1E2;
    text-align: center;
    margin-bottom: 40px;
}

.slider-card {
    height: 400px;
}

.slider-card h3 {
    line-height: 1.3rem;
}

.slider-card p {
    color: black;
    line-height: 1.3rem;
}

#parentesi-prev svg path, #parentesi-next svg path, #accademia-prev svg path, #accademia-next svg path, #edulia-next svg path, #edulia-prev svg path {
    fill: white;
}

.sconti-svg svg path {
    fill: #FA3C37;
}

.sconto-label .sconti-svg svg path, .slider-card .sconto-label p, .slider-card p.where-when {
    fill: #3111EE;
    color: #3111EE!important;
}

.fluo-button svg path {
    stroke: #5D3AC3;
}

/* Anonymous user convenzioni */
.anonymous-user {
    background: #DEF86A;
    background: linear-gradient(90deg,rgba(222, 248, 106, 1) 50%, rgba(208, 245, 115, 1) 100%);
}

.anonymous-user svg path {
    stroke: #3111EE;
    fill: transparent;
}

.anonymous-user .sconti-svg svg path {
    fill: #3111EE;
}

.anonymous-user .register-button svg path {
    stroke: #fff;
}

.parentesi-anonymous-user .register-button svg path, .edulia-anonymous-user .register-button svg path {
    stroke: black;
}

/* discussi */
.discussi-form {
    background-color: #96F1E2;
}

/* fOOTER */
.footer-social svg path {
    fill: white;
}

.hero-icons svg path {
    fill: transparent;
    stroke: white!important;
}

.il-club-benefits svg path {
    fill: transparent;
    stroke: black!important;
}

.settimanale-section .orange-background svg path, .why-registration-box svg path {
    fill: transparent;
    stroke: white!important;
}

.ciano-button svg path, .yellow-button svg path {
    fill: transparent;
    stroke: black!important;
}

.orange-button svg path, .fucsia-button svg path, .blue-button svg path, .pink-button svg path {
    fill: transparent;
    stroke: white!important;
}

.blue-button.comment-button svg path {
    fill: white!important;
    stroke: transparent!important;
}

.quiz-container svg path {
    stroke: white!important;
    fill: transparent;
}

.navigation-button {
    background-color: #fff;
    border: 1px solid #000;
    padding: 15px 30px;
}

#convenzioni-page-slider p.vantaggi, #convenzioni-page-slider ul li.vantaggi {
    color: #3111EE;
    text-transform: uppercase;
}

#convenzioni-page-slider ul li.vantaggi {
    color: #3111EE;
    text-transform: uppercase;
    list-style-type: disc;
    margin-left: 20px;
}

#convenzioni-page-slider svg path {
    stroke: #3111EE;
}

#convenzioni-page-slider .slider-card, #editoriali-page-slider .slider-card {
    min-height: 70vh;
    align-items: flex-start;
    height: auto;
}

#convenzioni-page-slider a.pink-button {
    font-size: 1rem;
    padding: 12px 42px;
}

 #convenzioni-results a.pink-button {
    font-size: 1rem;
    padding: 12px 24px;
 }

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 15px;
        position: relative;
    }
    
    .site-header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 3;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        padding: 20px;
        margin: 0;
        order: 4;
        width: 100%;
    }
    
    .main-navigation.menu-open {
        display: block;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .nav-menu a {
        padding: 15px 0;
        display: block;
    }
    
    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: #f8f9fa;
        margin-left: 20px;
    }
    
    .header-actions {
        order: 2;
        gap: 10px;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    .site-title {
        font-size: 1.5rem;
        order: 1;
    }
}

/* Login Tooltips for Non-Logged Users */
.login-tooltip {
    min-width: 400px;
    max-width: 500px;
    z-index: 1000;
}

.login-tooltip h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.login-tooltip p {
    color: white;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 1rem;
}

/* Tooltip arrow */
.login-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 16px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid black;
}

/* Hover trigger button styling */
.hover-trigger {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hover-trigger:hover {
    transform: translateY(-1px);
}

/* Responsive tooltip positioning */
@media (max-width: 768px) {
    .login-tooltip {
        min-width: 260px;
        max-width: 280px;
        left: -50px !important;
    }
    
    .login-tooltip::before {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Discussi Overlays for Non-Logged Users */
.discussi-overlay {
    background-color: #FA3C37; /* Orange background come da brand */
    z-index: 100;
    border: 2px solid #000;
}

.discussi-overlay span {
    color: white;
    line-height: 1.2;
}

/* Discussi item positioning */
.discussi-item {
    position: relative;
    overflow: hidden;
}

.discussi-form {
    position: relative;
    overflow: hidden;
}

/* Trigger buttons for mobile/touch devices */
.discussi-trigger {
    cursor: pointer;
    transition: all 0.2s ease;
}

.discussi-trigger:hover {
    transform: translateY(-1px);
}

.convenzioni-category-evidence svg path, .convenzioni-category-evidence svg circle {
    stroke: #6733F7;
}

.convenzione-vantaggi svg path {
    stroke: black;
}

.editoriali-meta-date svg path {
    stroke: black;
}

.editoriali-meta-tag svg path {
    stroke: #6733F7;
}

/* Responsive overlay sizing */
@media (max-width: 768px) {
    .discussi-overlay {
        padding: 1rem !important;
    }
    
    .discussi-overlay h3 {
        font-size: 1.125rem;
    }
    
    .discussi-overlay p {
        font-size: 0.8rem;
    }
    
    .discussi-overlay a {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

/* Contenuti Grid for Single Convenzioni */
.contenuto-item {
    transition: all 0.3s ease;
    overflow: hidden;
}

.contenuto-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.contenuto-image {
    overflow: hidden;
}

.contenuto-image img {
    transition: transform 0.3s ease;
    display: block;
    width: 100%;
    height: auto;
}

.contenuto-item:hover .contenuto-image img {
    transform: scale(1.02);
}

.contenuto-text {
    color: black;
    min-height: 4rem;
    align-items: flex-start;
}

.contenuto-text p {
    line-height: 1.5;
    font-size: 1.2rem;
}

.actions-bar svg path {
    stroke: black;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .contenuto-text {
        min-height: auto;
        padding: 1rem;
    }
    
    .contenuto-text p {
        font-size: 0.875rem;
    }
}

/* Ensure consistent spacing */
.contenuto-item:last-child {
    margin-bottom: 0;
}

/* CARD */
.card {
    width: 800px;
    min-height:250px;
    background-color: black;
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .card {
        width: 100%;
        min-height:150px;
        background-color: black;
    }
}

.profile-choose-button {
    background-color: white;
    color: black;
    border: 2px solid black;
    padding: 10px 15px;
    width: 100%;
    transition: all 0.3s ease;
}

.profile-choose-button.selected,
.profile-choose-button:hover {
    background-color: #CFF574;
}

/* Treccanix Custom Favorites System */
.treccanix-favorites-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: transparent;
    border: 2px solid #6b7280;
    border-radius: 8px;
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.treccanix-favorites-btn:hover {
    border-color: #F32EA1;
    color: #F32EA1;
    background-color: rgba(243, 46, 161, 0.05);
}

.treccanix-favorites-btn.favorited {
    border-color: #F32EA1;
    color: #F32EA1;
    background-color: rgba(243, 46, 161, 0.1);
}

.treccanix-favorites-btn.favorited .heart-icon {
    fill: #F32EA1;
    stroke: #F32EA1;
}

.treccanix-favorites-btn .heart-icon {
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.treccanix-favorites-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Favorites Filter Buttons */
.favorites-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.favorites-filter-btn {
    padding: 8px 16px;
    background-color: transparent;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.favorites-filter-btn:hover,
.favorites-filter-btn.active {
    border-color: #F32EA1;
    color: #F32EA1;
    background-color: rgba(243, 46, 161, 0.1);
}

/* Favorites Grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.favorite-item {
    transition: transform 0.2s ease;
}

.favorite-item:hover {
    transform: translateY(-2px);
}

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

.favorite-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.favorite-actions {
    margin-top: auto;
}

.remove-favorite-btn {
    transition: color 0.3s ease;
}

.remove-favorite-btn:hover {
    color: #ef4444 !important;
}

/* No favorites message */
.no-favorites-message {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
    font-size: 18px;
}

.no-favorites-empty-state {
    text-align: center;
    padding: 64px 24px;
}

.no-favorites-empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: #d1d5db;
}

/* Clear favorites button */
.clear-favorites-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-favorites-btn:hover {
    background-color: #dc2626;
}

.clear-favorites-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading states */
.favorites-loading {
    text-align: center;
    padding: 24px;
    color: #6b7280;
}

.favorites-loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .favorites-grid {
        grid-template-columns: 1fr;
    }
    
    .favorites-filters {
        justify-content: center;
    }
    
    .treccanix-favorites-btn .favorites-text {
        display: none;
    }
}

/* NEW Profile Page Favorites Styles */
.favorites-controls {
    margin-bottom: 32px;
}

/* Dropdown Filter Styles */
.favorites-filter-dropdown {
    position: relative;
}

.favorites-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 200px;
    padding: 15px 30px;
    background: white;
    border: 1px solid #000;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.favorites-dropdown-toggle:hover {
    border-color: #ec4899;
    color: #ec4899;
}

.favorites-dropdown-toggle.open svg {
    transform: rotate(180deg);
}

.favorites-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto;
}

.favorites-dropdown-menu.show {
    display: block;
}

.favorites-filter-option {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f3f4f6;
}

.favorites-filter-option:last-child {
    border-bottom: none;
}

.favorites-filter-option:hover {
    background: #f9fafb;
    color: #ec4899;
}

.favorites-filter-option.active {
    background: #fce7f3;
    color: #ec4899;
    font-weight: 600;
}

/* Load More Button */
.load-more-favorites-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    background: #ec4899;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.load-more-favorites-btn:hover {
    background: #be185d;
    transform: translateY(-2px);
}

.load-more-favorites-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-favorites-btn.loading .btn-text,
.load-more-favorites-btn.loading .btn-icon {
    opacity: 0;
}

.load-more-favorites-btn.loading .btn-loading {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-loading {
    display: none;
}

/* Override grid to be fixed 3 columns */
@media (min-width: 1024px) {
    .favorites-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Favorites Plugin Styling */
.favorites-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.favorites-button:hover {
    background-color: #f3f4f6;
}

.favorites-button.favorited {
    color: #F32EA1;
}

.favorites-button:not(.favorited) {
    color: #6b7280;
}

.favorites-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Favorite Items Grid */
.favorite-item {
    transition: transform 0.2s ease;
}

.favorite-item:hover {
    transform: translateY(-2px);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Clear Favorites Button */
.clear-favorites-wrapper .favorites-clear {
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-favorites-wrapper .favorites-clear:hover {
    background-color: #dc2626;
}

/* Override plugin default styles */
.favorites-button.before:before,
.favorites-button.after:after {
    display: none;
}

.favorites-button .favorites-text {
    display: none;
}

.simplefavorite-button.preset {
  padding: 15px 1em 15px 2em!important;
}

.btn-treccanix-favorites {
    background-color: #fff;
    border: 1px solid #000;
    padding: 15px 30px;
    text-transform: uppercase;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
}

.btn-treccanix-favorites.favorited, .btn-treccanix-favorites:hover {
    background-color: #CFF574;
}

.remove-favorite-btn {
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 100%;
    padding: 8px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Print Styles */
@media print {
    /* Hide elements that shouldn't be printed */
    .actions-bar,
    .breadcrumb,
    #masthead,
    footer,
    .navigation-button,
    .btn-treccanix-favorites,
    .social-share-overlay,
    button {
        display: none !important;
    }
    
    /* Optimize layout for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .single-post {
        max-width: none;
        padding: 0;
    }
    
    .single-post-content {
        padding: 0 !important;
    }
    
    /* Ensure images fit properly */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    /* Handle page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    p, li {
        page-break-inside: avoid;
        orphans: 3;
        widows: 3;
    }
    
    /* Typography adjustments for print */
    h1 {
        font-size: 24pt;
        margin-bottom: 12pt;
    }
    
    h2 {
        font-size: 18pt;
        margin-bottom: 10pt;
    }
    
    h3 {
        font-size: 16pt;
        margin-bottom: 8pt;
    }
    
    /* Ensure content is readable */
    .treccani-max-width {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Meta information styling for print */
    .editoriali-meta {
        border-bottom: 1pt solid #000;
        padding-bottom: 12pt;
        margin-bottom: 12pt;
    }
    
    .editoriali-meta div {
        margin-bottom: 4pt;
    }
}

.related-item {
    height: 700px;
}

@media (max-width: 768px) {
    .related-item {
        height: auto !important;
    }
}

.related-item svg path {
    stroke: #3111EE;
}

/* ================================
   TRECCANI CALENDAR STYLES
   ================================ */

/* Calendar Wrapper */
.treccani-calendar-wrapper {
    font-family: inherit;
}

/* Calendar Navigation */
.calendar-navigation .nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

/* View Toggle */
#month-selector {
    transition: all 0.2s ease;
}

#month-selector:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Calendar Grid */
.calendar-days-header .day-header {
    font-weight: 100;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: black;
    text-align: left;
    font-size: 1.5rem;
}

.calendar-day {
    min-height: 120px;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.calendar-day:hover {
    background-color: #ebebeb;
}

.calendar-day.other-month {
    color: #9ca3af;
    background-color: #f9fafb;
}

.calendar-day.other-month:hover {
    background-color: #f3f4f6;
}

.calendar-day.today {
    background-color: #dbeafe;
    font-weight: 600;
}

.calendar-day.has-events:hover {
    background-color: #f9fafb;
}

.calendar-day .day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.calendar-day .day-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

/* Stile per gli eventi individuali */
.calendar-day .event-pill {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.calendar-day .event-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.calendar-day .event-pill.more-events {
    background-color: #6b7280;
    text-align: center;
    font-style: italic;
}

.calendar-day .event-pill.more-events:hover {
    background-color: #4b5563;
}

/* Event Detail Dropdown */
.event-detail-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-width: 320px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: end;
}

.event-detail-dropdown .event-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.event-detail-dropdown .event-content {
    padding: 1rem;
    background: white;
    border: 1px solid black;
    margin-top: 0.5rem;
    max-width: 320px;
    min-width: 280px;
    overflow: hidden;
    padding: 1rem;
}

.event-detail-dropdown .event-header {
    margin-bottom: 0.75rem;
}

.event-detail-dropdown .event-title {
    font-size: 1rem;
    font-weight: 200;
    color: black;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.event-detail-dropdown .event-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #000;
}

.event-detail-dropdown .event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-detail-dropdown .event-meta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.event-detail-dropdown .event-description {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

.event-detail-dropdown .event-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.event-detail-dropdown .event-button {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.event-detail-dropdown .event-button.primary {
    background-color: #3b82f6;
    color: white;
}

.event-detail-dropdown .event-button.primary:hover {
    background-color: #2563eb;
}

.event-detail-dropdown .event-button.secondary {
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.event-detail-dropdown .event-button.secondary:hover {
    background-color: #e5e7eb;
}

.event-detail-dropdown .close-button {
    background: rgba(0, 0, 0, 0.5);
    color: black;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    cursor: pointer;
    border: 1px solid black;
}

.event-detail-dropdown .close-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.calendar-day .event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.25rem;
    background-color: #3b82f6;
}

.calendar-day .event-title {
    display: block;
    margin: 0.5rem 0;
    color: #000;
    font-weight: 800;
}

/* New Event Display Styles */
.calendar-day .event-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.2;
}

.calendar-day .event-item .event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #3b82f6;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.calendar-day .event-item .event-title {
    margin: 0;
    font-weight: 200;
    color: #000;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Day Events Dropdown */
.day-events-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
}

.day-events-dropdown .dropdown-content {
    padding: 1rem;
}

.day-events-dropdown .dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.day-events-dropdown .close-dropdown {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-events-dropdown .close-dropdown:hover {
    color: #374151;
}

.day-events-dropdown .dropdown-event-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.day-events-dropdown .dropdown-event-item:last-child {
    border-bottom: none;
}

.day-events-dropdown .event-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.day-events-dropdown .event-time {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.day-events-dropdown .event-name {
    font-weight: 600;
    color: #111827;
    margin: 0;
    font-size: 0.875rem;
}

.day-events-dropdown .event-location {
    color: #6b7280;
    font-size: 0.75rem;
    margin: 0.25rem 0;
    font-style: italic;
}

.day-events-dropdown .event-description {
    color: #4b5563;
    font-size: 0.75rem;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.day-events-dropdown .event-link {
    color: #3b82f6;
    font-size: 0.75rem;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 0.5rem;
}

.day-events-dropdown .event-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Make sure calendar day is positioned relative for dropdown positioning */
.calendar-day {
    position: relative;
}

/* Event Modal */
#event-modal {
    backdrop-filter: blur(4px);
}

#event-modal .bg-white {
    max-width: 90vw;
    max-height: 90vh;
}

#event-modal #modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#event-modal #modal-close:hover {
    background-color: #f3f4f6;
}

/* Loading State */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .calendar-navigation {
        justify-content: center;
        order: 1;
    }
    
    #calendar-month-year {
        order: 0;
        text-align: center;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 0.5rem;
    }
    
    .calendar-day .day-number {
        font-size: 0.875rem;
    }
    
    .calendar-day .event-title {
        font-size: 0.625rem;
    }
    
    #month-selector {
        min-width: 100px;
    }
}

/* Print Styles for Calendar */
@media print {
    .calendar-header,
    .calendar-navigation {
        display: none;
    }
    
    .calendar-day {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    #event-modal {
        display: none;
    }
}

.custom-treccanix-button {
    background-color: #fff;
    border: 1px solid #000;
    padding: 15px 30px;
    text-transform: uppercase;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    margin-top: 1rem!important;
}
.wp-block-button__link {
    padding: 0!important;
    color: #000!important;
    background-color: transparent!important;
    border: none!important;
    border-radius: 0!important;
}

.wp-block-button__link::after {
    content: '';
    display: inline-block;
    width: 16px;    
    height: 16px;
    margin-left: 8px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-105.4 105.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    vertical-align: middle;
}