/*
Theme Name: Ticketnews
Theme URI: https://tuosito.com/
Author: Federico
Description: Tema editoriale WordPress ispirato a Ticketnews.
Version: 1.7
License: GNU General Public License v2 or later
Text Domain: ticketnews
*/

/* ==========================================================================
   1. GLOBAL STYLES & TYPOGRAPHY
   ========================================================================== */
* { box-sizing: border-box; }
body { 
    line-height: 1.5; 
    font-family: 'PT Serif', serif; 
    color: #333; 
    background: #fff; 
    overflow-x: hidden; 
}
h1, h2, h3, h4, h5, h6 { 
    font-weight: 700; 
    color: #111827; 
    font-family: 'PT Serif', serif; 
    margin-top: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* Utility Classes */
.font-sans { font-family: 'Montserrat', sans-serif !important; }
.font-serif { font-family: 'PT Serif', serif !important; }
.desktop-only { display: none; }
@media (min-width: 1024px) {
    .desktop-only { display: flex; }
    .mobile-only { display: none; }
}

/* ==========================================================================
   2. DESKTOP NAVIGATION & MENUS
   ========================================================================== */
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2rem; align-items: center; }
.main-nav ul li { position: relative; }
.main-nav ul li a { 
    color: #111827; font-size: 0.8rem; text-transform: uppercase; 
    font-weight: 400; letter-spacing: 0.05em; transition: color 0.3s; 
    font-family: 'Montserrat', sans-serif;
}
.main-nav ul li a:hover, .top-bar a:hover { color: #18baad; }

/* Freccia solo per i menu desktop */
.main-nav .menu-item-has-children > a::after,
.top-bar .menu-item-has-children > a::after { 
    content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: contain; background-repeat: no-repeat; vertical-align: middle;
}

.main-nav ul ul.sub-menu {
    display: none; position: absolute; top: 100%; left: 0; background: #fff;
    min-width: 220px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); z-index: 50; padding: 0.5rem 0; margin: 0; list-style: none;
}
.main-nav ul li:hover > ul.sub-menu { display: block; }
.main-nav ul ul.sub-menu li { display: block; width: 100%; border-bottom: 1px solid #f3f4f6; }
.main-nav ul ul.sub-menu li:last-child { border-bottom: none; }
.main-nav ul ul.sub-menu a { display: block; padding: 0.75rem 1rem; color: #4b5563; text-transform: none; font-weight: 500;}

/* ==========================================================================
   3. MOBILE DRAWERS (MENU A COMPARSA)
   ========================================================================== */
.drawer {
    position: fixed; top: 0; left: -100%; width: 80%; max-width: 350px; height: 100%;
    background: #fff; z-index: 100; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 20px rgba(0,0,0,0.1); display: flex; flex-direction: column;
}
.drawer.is-open { left: 0; }

.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.drawer-overlay.is-visible { opacity: 1; pointer-events: auto; }

.drawer-header {
    padding: 20px; border-bottom: 1px solid #eee; display: flex;
    justify-content: space-between; align-items: center; min-height: 80px;
}
.drawer-logo img { max-height: 40px; width: auto; }
.drawer-close { font-size: 35px; line-height: 1; background: none; border: none; cursor: pointer; color: #111827; }

.drawer-nav { overflow-y: auto; flex: 1; padding-bottom: 2rem; }
.drawer-nav ul { list-style: none; padding: 0; margin: 0; }
.drawer-nav ul li { border-bottom: 1px solid #f9f9f9; }
.drawer-nav ul li a {
    display: block; padding: 15px 20px; font-family: 'Montserrat', sans-serif;
    text-transform: uppercase; font-size: 0.9rem; font-weight: 500;
}

/* --- STILI SPECIFICI SOTTOMENU MOBILE (ACCORDION) --- */
.drawer-nav .menu-item-has-children > a { 
    position: relative; 
    padding-right: 50px; /* Spazio per il bottone toggle a destra */
}

/* Bottone freccetta dinamico creato con JS */
.drawer-submenu-toggle {
    position: absolute; right: 0; top: 0; height: 100%; width: 50px;
    background: transparent; border: none; border-left: 1px solid #f3f4f6;
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: #111827;
}
.drawer-submenu-toggle svg { width: 16px; height: 16px; transition: transform 0.3s ease; }
.drawer-submenu-toggle.is-active svg { transform: rotate(180deg); color: #18baad; }

/* Stile del pannello sottomenu nascosto */
.drawer-nav ul.sub-menu { 
    display: none; 
    background: #f8fafc; 
    border-top: 1px solid #f1f5f9; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); 
}
.drawer-nav ul.sub-menu.is-open { display: block; }
.drawer-nav ul.sub-menu li { border-bottom: 1px solid #f1f5f9; }
.drawer-nav ul.sub-menu li:last-child { border-bottom: none; }
.drawer-nav ul.sub-menu li a { 
    padding: 12px 20px 12px 30px; /* Rientro a sinistra per far capire la gerarchia */
    font-size: 0.85rem; 
    color: #475569; 
    text-transform: none; /* Normale, non tutto maiuscolo come i genitori */
    font-weight: 400;
}

/* ==========================================================================
   4. SEARCH MODAL
   ========================================================================== */
.search-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(4px); z-index: 100; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.search-modal.is-open { opacity: 1; pointer-events: auto; }
.search-close { position: absolute; top: 2.5rem; right: 2.5rem; background: none; border: none; cursor: pointer; color: #111827; font-size: 2.5rem;}
.search-close:hover { color: #18baad; }
.search-modal-content { width: 100%; max-width: 42rem; padding: 0 1rem; }
.search-form { display: flex; border-bottom: 2px solid #d1d5db; transition: border-color 0.3s; }
.search-form:focus-within { border-color: #18baad; }
.search-form input { width: 100%; background: transparent; border: none; font-size: 1.5rem; padding: 1rem 0; outline: none; text-transform: uppercase; font-weight: 700; color: #1f2937; }
.search-form button { background: none; border: none; padding: 0 1.5rem; cursor: pointer; text-transform: uppercase; font-weight: 700; font-size: 0.875rem; color: #111827; transition: color 0.3s; }
.search-form button:hover { color: #18baad; }

/* ==========================================================================
   5. LAYOUT SECTIONS & HEADERS
   ========================================================================== */
.section-padding { padding-bottom: 5rem; }

.section-header { 
    display: flex; align-items: center; border-bottom: none; padding-bottom: 0; margin-bottom: 3.5rem; 
}
.section-title { 
    font-size: 2.4rem; letter-spacing: -0.025em; margin: 0; padding-right: 1.5rem; line-height: 1.2; font-family: 'PT Serif', serif;
}
.section-desc { 
    color: #4b5563; font-size: 1.05rem; margin: 0; padding-left: 1.5rem; border-left: 3px solid #18baad; line-height: 1.4; font-family: 'PT Serif', serif;
}

@media (max-width: 768px) {
    .section-header { flex-direction: column; align-items: flex-start; margin-bottom: 2.5rem;}
    .section-title { padding-right: 0; padding-bottom: 1rem; font-size: 2rem; }
    .section-desc { border-left: none; border-top: 3px solid #18baad; padding-left: 0; padding-top: 1rem; }
}

/* ==========================================================================
   6. HERO SECTION
   ========================================================================== */
.hero-section { margin: 2.5rem 0 5rem 0; }
.hero-container { position: relative; }

.hero-image img { width: 100%; height: 300px; object-fit: cover; }

/* MODIFICA APPLICATA: altezza 600px su desktop */
@media (min-width: 1024px) { 
    .hero-image img { 
        height: 600px; 
    } 
}

.hero-content { 
    background: #fff; padding: 2rem; border-left: 10px solid #18baad; 
    position: relative; z-index: 10; margin-top: -2rem; 
}
.hero-title { font-size: 2rem; line-height: 1.2; letter-spacing: -0.025em; transition: color 0.3s; margin-bottom: 1rem; }
.hero-title:hover { color: #18baad; }

@media (min-width: 768px) {
    .hero-container { display: flex; align-items: center; }
    .hero-image { width: 80%; margin-left: auto; }
    .hero-content { position: absolute; left: 0; width: 40%; padding: 5rem 3rem; margin-top: 0; }
    .hero-title { font-size: 2.4rem; }
}

@media (max-width: 767px) {
    .hero-content { 
        border-left: 6px solid #18baad; 
        padding: 1.5rem; 
        margin-top: -3rem;
        margin-right: 2rem;
    }
    .hero-title { font-size: 1.5rem; }
}

/* ==========================================================================
   7. POST GRIDS & LISTS (ARTICLES)
   ========================================================================== */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .post-grid { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }

.card-image img, .list-image img { width: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card-image, .list-image { overflow: hidden; display: block; margin-bottom: 1.5rem; }
.grid-card:hover .card-image img, .list-card:hover .list-image img { transform: scale(1.05); }
.card-image img { height: 380px; }

.card-title { font-size: 1.5rem; letter-spacing: -0.025em; margin-bottom: 0.75rem; transition: color 0.3s; line-height: 1.3; }
.card-title:hover { color: #18baad; }

/* Lists Layout */
.main-layout { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 1024px) { .main-layout { grid-template-columns: 2.5fr 1fr; } }
.list-layout { display: flex; flex-direction: column; gap: 2.5rem; }
.list-card { display: flex; flex-direction: column; gap: 2rem; }
.list-image { width: 100%; margin-bottom: 0; }
.list-image img { height: 256px; }

.list-content { min-width: 0; word-wrap: break-word; }

@media (min-width: 768px) {
    .list-card { flex-direction: row; }
    .list-image { width: 41.666%; flex-shrink: 0; }
    .list-image img { height: 220px; }
    .list-content { width: 58.333%; display: flex; flex-direction: column; justify-content: center; }
}
.card-excerpt { font-size: 0.95rem; color: #4b5563; margin-bottom: 1rem; line-height: 1.6; }
.placeholder-img { width: 100%; height: 100%; min-height: 220px; background: #e5e7eb; display: flex; align-items: center; justify-content: center; color: #9ca3af; }

.meta-info { font-family: 'Montserrat', sans-serif; font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #9ca3af; margin-bottom: 1rem; }
.meta-info .sep { margin: 0 0.5rem; }

.read-more { font-family: 'Montserrat', sans-serif; font-size: 0.8rem; font-weight: 400; text-decoration: underline; color: #6b7280; transition: color 0.3s; margin-top: auto; display: inline-block; padding-top: 0.5rem; text-transform: capitalize; }
.read-more:hover { color: #18baad; }

/* ==========================================================================
   PAGINATORE (Stile Minimal e Clean)
   ========================================================================== */
.pagination { 
    margin-top: 4rem; 
    display: flex; 
    justify-content: center; 
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem; 
    font-weight: 400;
}
.pagination .nav-links { 
    display: flex; 
    gap: 1.5rem; 
    flex-wrap: wrap; 
    justify-content: center; 
    align-items: center;
}
.pagination a, .pagination span { 
    background: transparent; 
    color: #6b7280; 
    padding: 0;
    transition: color 0.3s; 
}
.pagination a:hover { 
    background: transparent;
    color: #18baad; 
}
.pagination .current { 
    background: transparent; 
    color: #18baad; 
    font-weight: 600; 
}

/* ==========================================================================
   8. SIDEBAR & WIDGETS
   ========================================================================== */
.sidebar-area { margin-top: 2rem; }
@media (min-width: 1024px) { 
    .sidebar-area { margin-top: 0; padding-left: 2.5rem; border-left: 1px solid #e5e7eb; } 
}

.widget { margin-bottom: 3.5rem; }
.widget-title { 
    font-size: 2rem; font-family: 'PT Serif', serif; font-weight: 700;
    margin-bottom: 1.5rem; color: #111827; line-height: 1.1;
}

.sidebar-post-list { display: flex; flex-direction: column; }
.sidebar-post { display: flex; align-items: flex-start; gap: 1rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid #f3f4f6; }
.sidebar-post:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-post-img { width: 80px; height: 80px; flex-shrink: 0; overflow: hidden; }
.sidebar-post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.sidebar-post:hover .sidebar-post-img img { transform: scale(1.05); }
.sidebar-post-content { flex: 1; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.sidebar-post-title { font-size: 1.05rem; line-height: 1.3; font-family: 'PT Serif', serif; font-weight: 700; margin: 0; color: #111827; transition: color 0.3s; }
.sidebar-post-title:hover { color: #18baad; }
.sidebar-post-content .meta-info { font-size: 0.65rem; margin: 0; color: #9ca3af; }

.widget_categories ul, .wp-block-categories {
    list-style: none; padding: 0; margin: 0; border-top: 1px solid #e5e7eb;
}
.widget_categories ul li, .wp-block-categories li {
    border-bottom: 1px solid #e5e7eb; padding: 1rem 0;
}
.widget_categories ul li::after, .wp-block-categories li::after {
    content: ""; display: table; clear: both;
}
.widget_categories ul li a, .wp-block-categories li a {
    font-family: 'PT Serif', serif; font-size: 1.1rem; color: #111827; text-decoration: none; transition: color 0.3s; display: inline-block;
}
.widget_categories ul li a:hover, .wp-block-categories li a:hover { color: #18baad; }

.cat-count, .wp-block-categories .wp-block-categories__post-count {
    font-family: 'Montserrat', sans-serif; color: #6b7280; font-size: 0.9rem; float: right; line-height: 1.5;
}
.cat-toggle {
    float: right; background: none; border: none; cursor: pointer; padding: 0; margin-left: 10px; margin-top: 2px; color: #111827;
}
.cat-toggle svg { width: 16px; height: 16px; transition: transform 0.3s ease; }
.cat-toggle.is-active svg { transform: rotate(180deg); color: #18baad; }

.widget_categories ul.children {
    display: none; clear: both; padding-left: 1.5rem; margin-top: 1rem; border-top: 1px dashed #e5e7eb;
}
.widget_categories ul.children.is-open { display: block; }
.widget_categories ul.children li { border-bottom: 1px dashed #e5e7eb; padding: 0.75rem 0; }
.widget_categories ul.children li:last-child { border-bottom: none; padding-bottom: 0; }
.widget_categories ul.children li a { font-size: 1rem; color: #4b5563; }

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.site-footer { 
    background-color: #0f172a; color: #94a3b8; padding: 4rem 0 2rem 0; margin-top: 4rem; 
}
.footer-top { 
    display: grid; grid-template-columns: 1fr; gap: 3rem; margin-bottom: 3rem; text-align: center;
}
@media (min-width: 768px) { 
    .footer-top { grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: left;} 
}

.footer-col { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }

.footer-brand { 
    margin-bottom: 0.5rem;
    background-color: #fff;
    padding: .5rem;
    display: inline-block; 
    border-radius: 4px; 
}

.footer-logo { font-size: 1.8rem; font-weight: 700; color: #111827; text-transform: uppercase; font-family: 'Montserrat', sans-serif; transition: color 0.3s ease; }
.footer-logo:hover { color: #18baad; }
.footer-desc { font-size: 0.95rem; line-height: 1.6; color: #cbd5e1; margin: 0; font-family: 'PT Serif', serif; text-align: left;}
.footer-heading { color: #fff; font-size: 1.2rem; font-weight: 700; margin: 0; font-family: 'Montserrat', sans-serif; }

.footer-contact { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; font-size: 0.95rem; color: #cbd5e1; font-family: 'Montserrat', sans-serif; text-align: left;}
.footer-contact strong { color: #fff; font-weight: 600; }

.footer-nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.85rem; text-align: left;}
.footer-nav a { color: #cbd5e1; font-family: 'Montserrat', sans-serif; font-size: 0.95rem; font-weight: 500; transition: color 0.3s ease; text-decoration: none; }
.footer-nav a:hover { color: #18baad; }

.footer-bottom {
    margin-top: 3rem !important; border-top: 1px solid #1e293b; padding-top: 2.5rem !important; text-align: center;
}
.footer-copyright { color: #64748b; font-size: 0.85rem; line-height: 1.6; font-family: 'Montserrat', sans-serif;}
.footer-copyright p { margin: 0 0 0.5rem 0; }

.powered-by { margin-top: 1.5rem !important; font-size: 0.95rem; color: #94a3b8; }
.powered-by a { color: #18baad; font-weight: 700; text-decoration: none; transition: opacity 0.3s; }
.powered-by a:hover { opacity: 0.8; }