/*
Theme Name: ticketferries
Theme URI: http://example.com/ticketferries
Author: Gemini
Description: Un tema magazine elegante basato sul design richiesto, con layout a griglia. (Ottimizzato)
Version: 1.1
Text Domain: ticketferries
*/

/* ==========================================================================
   LAYOUT BASE & GRIGLIE
   ========================================================================== */
.content-area { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; margin-bottom: 60px; align-items: start; }
.main-content { display: block; }
.sidebar { display: flex; flex-direction: column; gap: 30px; }

/* REGOLE GLOBALI PER IMMAGINI E HOVER (Raggruppate per ottimizzazione) */
.main-post > a, .sidebar-post > a, .grid-post > a, .cat-main-post > a, .cat-list-post > a, 
.bottom-cat-img, .list-img-link, .popular-img-link {
    display: block; width: 100%; overflow: hidden;
}
.main-post img, .sidebar-post img, .grid-post img, .cat-main-post img, .cat-list-post img, 
.bottom-cat-img img, .list-img-link img, .popular-img-link img, .single-post-thumbnail img {
    width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease;
}
.main-post > a:hover img, .sidebar-post > a:hover img, .grid-post:hover img, .cat-main-post:hover img, 
.cat-list-post > a:hover img, .bottom-cat-img:hover img, .list-img-link:hover img, .popular-img-link:hover img {
    transform: scale(1.03);
}

/* ==========================================================================
   COMPOMENTI ARTICOLI
   ========================================================================== */
.post-meta { font-size: 11px; text-transform: uppercase; color: #888; margin: 20px 0 10px; font-weight: 700; letter-spacing: 0.5px; }
.post-meta span { margin-right: 15px; }

/* Main Post (Sinistra) */
.main-post > a { aspect-ratio: 16 / 9; }
.main-post h2 { font-family: 'Playfair Display', serif; font-size: 36px; font-weight: 700; line-height: 1.2; margin: 20px 0 15px; }
.main-post-text { padding-top: 15px; }
.main-post p { color: #555; line-height: 1.7; font-size: 15px; margin: 0; }
.main-post .post-meta { text-align: left; margin: 0 0 10px 0; }

/* Sidebar Post (Destra) */
.sidebar-post { display: flex; flex-direction: column; }
.sidebar-post > a { aspect-ratio: 16 / 9; }
.sidebar-post-content { display: flex; margin-top: 10px; align-items: flex-start; }
.post-info { display: flex; flex-direction: column; }
.sidebar-post h3 { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; margin: 0 0 5px 0; line-height: 1.2; }
.sidebar-post .post-meta { margin: 0; text-align: left; }

/* Etichetta IA */
.has-ai-label { position: relative; display: block; }
.ai-label { position: absolute; bottom: 8px; right: 8px; background-color: rgba(0, 0, 0, 0.6); color: #fff; font-size: 9px; font-family: 'Montserrat', sans-serif; font-weight: 600; padding: 4px 8px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.5px; z-index: 10; pointer-events: none; opacity: .6; }

/* ==========================================================================
   SEZIONI HOMEPAGE
   ========================================================================== */
.cat-section-title { font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 900; text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin-bottom: 25px; }
.cat-section-title span { display: inline-block; width: 10px; height: 10px; background-color: #18baad; }

/* Intro Section */
.home-intro-section { text-align: left; margin-bottom: 50px; background-color: #d2f5f3; padding: 1rem; }
.home-intro-title { font-family: 'Montserrat', sans-serif; font-size: 40px; font-weight: 900; text-transform: uppercase; display: flex; align-items: center; gap: 15px; margin-bottom: 15px; margin-top: 0; color: #111; }
.home-intro-title span { display: inline-block; width: 20px; height: 20px; background-color: #18baad; }
.home-intro-text { font-family: 'Montserrat', sans-serif; font-size: 16px; color: #555; line-height: 1.6; margin: 0; }

/* Ultime Notizie (Griglia a 4) */
.latest-news-section { border-top: 1px solid #f0f0f0; padding-top: 40px; margin-bottom: 60px; }
.latest-news-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.grid-post { display: flex; flex-direction: column; }
.grid-post > a { aspect-ratio: 4 / 3; margin-bottom: 15px; }
.grid-post h3 { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700; line-height: 1.3; margin: 0 0 10px 0; }
.grid-post .post-meta { text-align: left; margin: 0; }

/* 3 Colonne Categoria */
.category-columns-section { border-top: 1px solid #f0f0f0; padding-top: 40px; margin-bottom: 60px; }
.category-columns-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.cat-main-post { margin-bottom: 30px; }
.cat-main-post > a { aspect-ratio: 1 / 1; margin-bottom: 15px; }
.cat-main-post h3 { font-family: 'Playfair Display', serif; font-size: 22px; line-height: 1.2; margin: 10px 0; }
.cat-main-post .post-meta { margin-bottom: 5px; }
.cat-list-post { display: flex; gap: 15px; margin-bottom: 20px; align-items: center; }
.cat-list-post > a { flex: 0 0 100px; aspect-ratio: 4 / 3; }
.cat-list-post-content { flex: 1; }
.cat-list-post h4 { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 700; margin: 0 0 5px 0; line-height: 1.3; }
.cat-list-post .post-meta { margin: 0; text-align: left; }

/* 2 Colonne Fondo */
.bottom-categories-section { border-top: 1px solid #f0f0f0; padding-top: 40px; margin-bottom: 60px; }
.bottom-categories-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.bottom-cat-post { display: flex; flex-direction: column; }
.bottom-cat-img { aspect-ratio: 16 / 9; }
.bottom-cat-content { background-color: #d2f5f3; padding: 35px 30px; text-align: center; flex-grow: 1; }
.bottom-cat-content .post-meta { text-align: center; margin: 0 0 15px 0; }
.bottom-cat-content .post-meta span { margin-right: 0; }
.bottom-cat-content h3 { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; line-height: 1.3; margin: 0 0 15px 0; color: #111; }
.bottom-cat-content h3 + .post-meta { margin-bottom: 0; margin-top: 15px; }

/* Ultime Notizie + Più letti */
.bottom-news-sidebar-section { border-top: 1px solid #f0f0f0; padding-top: 40px; margin-bottom: 60px; }
.bottom-news-container { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.bottom-popular-news { border-left: 1px solid #f0f0f0; padding-left: 40px; }
.list-article-horizontal { display: flex; gap: 30px; margin-bottom: 35px; padding-bottom: 35px; border-bottom: 1px solid #f0f0f0; }
.list-article-horizontal:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.list-img-link { flex: 0 0 45%; aspect-ratio: 4 / 3; }
.list-article-text { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.list-article-text h3 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; line-height: 1.3; margin: 0 0 12px 0; }
.list-article-text .post-meta { margin: 0 0 15px 0; text-align: left; }
.list-article-text .entry-summary { font-size: 15px; color: #555; line-height: 1.6; }
.list-article-text .entry-summary p { margin: 0; }
.popular-articles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.popular-article-item { display: flex; flex-direction: column; }
.popular-img-link { aspect-ratio: 4 / 3; margin-bottom: 12px; }
.popular-article-item h4 { font-family: 'Playfair Display', serif; font-size: 14px; font-weight: 700; line-height: 1.4; margin: 0; }

/* ==========================================================================
   ARTICOLO SINGOLO (SINGLE)
   ========================================================================== */
.single-article-area { max-width: 900px; margin: 0 auto; margin-bottom: 60px; }
.single-post-header { text-align: center; margin-bottom: 30px; }
.single-title { font-family: 'Playfair Display', serif; font-size: 44px; font-weight: 700; line-height: 1.2; margin: 15px 0; color: #111; }
.single-post-thumbnail { margin-bottom: 40px; }
.single-post-thumbnail img { height: auto; }
.single-post-content { font-family: 'Montserrat', sans-serif; font-size: 17px; line-height: 1.8; color: #333; max-width: 800px; margin: 0 auto; text-align: left; }
.single-post-content p { margin-bottom: 25px; }
.single-post-content h2, .single-post-content h3, .single-post-content h4 { font-family: 'Playfair Display', serif; font-weight: 700; color: #111; margin-top: 40px; margin-bottom: 20px; }
.single-post-content h2 { font-size: 32px; } .single-post-content h3 { font-size: 26px; }
.single-post-content blockquote { border-left: 4px solid #18baad; padding-left: 20px; margin: 30px 0; font-family: 'Playfair Display', serif; font-size: 24px; font-style: italic; color: #555; line-height: 1.5; }
.single-post-content img { max-width: 100%; height: auto; margin: 20px 0; display: block; }

/* ==========================================================================
   ARCHIVIO CATEGORIA
   ========================================================================== */
.category-hero { position: relative; width: 100%; height: 450px; background-color: #222; background-size: cover; background-position: center; margin-bottom: 50px; display: flex; align-items: flex-end; }
.category-hero-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.8) 100%); z-index: 1; }
.category-hero-container { position: relative; z-index: 2; width: 100%; padding-bottom: 50px; }
.category-hero-content { max-width: 800px; color: #fff; }
.hero-cat-label { font-family: 'Playfair Display', serif; font-style: italic; font-size: 18px; display: block; margin-bottom: 10px; color: #d2f5f3; }
.category-hero-content h1 { font-family: 'Playfair Display', serif; font-size: 48px; font-weight: 700; line-height: 1.2; margin: 0; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); }
.category-intro-text { margin-bottom: 50px; }
.category-intro-text h2 { font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700; color: #111; margin-top: 0; margin-bottom: 20px; }
.category-intro-text p { font-size: 17px; line-height: 1.8; color: #444; margin: 0; }
.archive-pagination { margin-top: 50px; padding-top: 30px; border-top: 1px solid #f0f0f0; }
.archive-pagination .nav-links { display: flex; gap: 8px; }
.archive-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 35px; height: 35px; padding: 0 10px; background: #f5f5f5; color: #333; font-weight: 700; font-size: 13px; transition: all 0.3s ease; }
.archive-pagination .page-numbers:hover, .archive-pagination .page-numbers.current { background: #18baad; color: #fff; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { background-color: #0b131a; color: #b0b5b9; padding: 60px 0 30px; font-family: 'Montserrat', sans-serif; font-size: 14px; margin-top: 50px; }
.site-footer a { color: #b0b5b9; transition: color 0.3s ease; }
.site-footer a:hover { color: #fff; }
.footer-top-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 50px; }
.footer-logo { margin-bottom: 25px; display: inline-block; }
.footer-logo .logo, .footer-logo .logo-sub { color: #fff; }
.footer-logo .logo span { color: #18baad; }
.footer-logo img.custom-logo { background-color: #fff; padding: 10px; border-radius: 4px; margin: 0; }
.footer-desc { line-height: 1.6; margin: 0; color: #c9ced2; }
.footer-heading { font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 700; color: #fff; margin-top: 0; margin-bottom: 25px; }
.footer-nav ul, .footer-contacts { list-style: none; padding: 0; margin: 0; }
.footer-nav li, .footer-contacts li { margin-bottom: 15px; }
.footer-nav a { font-weight: 600; }
.footer-contacts li { line-height: 1.5; }
.footer-contacts strong { color: #fff; font-weight: 700; }
.footer-social .social-menu-container ul { justify-content: flex-start; }
.footer-social .social-menu-container a { color: #fff; }
.footer-social .social-menu-container a:hover { color: #18baad; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 30px; text-align: center; font-size: 12px; color: #7b858c; line-height: 1.8; }
.footer-bottom p { margin: 0 0 20px 0; }
.powered-by a { color: #fff; font-weight: 700; }

/* ==========================================================================
   VERSIONE MOBILE
   ========================================================================== */
@media (max-width: 900px) {
    /* Griglie a 1 colonna base */
    .content-area, .category-columns-grid, .bottom-categories-grid, .bottom-news-container, .footer-top-grid {
        grid-template-columns: 1fr; gap: 40px;
    }
    
    /* 1. SLIDER ORIZZONTALE MOBILE PER LATEST NEWS */
    .latest-news-grid, .cat-list-scroll-mobile, .popular-articles-grid {
        display: flex !important; overflow-x: auto !important; scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; gap: 15px !important; padding-bottom: 15px;
        margin-right: -15px; margin-left: -15px; padding-left: 15px; padding-right: 15px;
        -ms-overflow-style: none; scrollbar-width: none;
    }
    .latest-news-grid::-webkit-scrollbar, .cat-list-scroll-mobile::-webkit-scrollbar, .popular-articles-grid::-webkit-scrollbar { display: none; }
    
    .latest-news-grid .grid-post { flex: 0 0 75%; max-width: 280px; scroll-snap-align: start; }
    .latest-news-grid .grid-post > a { margin-bottom: 10px; }

    /* 2. SLIDER ORIZZONTALE MOBILE PER POST SECONDARI DI CATEGORIA */
    .cat-main-post { margin-bottom: 25px !important; }
    .cat-list-scroll-mobile .cat-list-post { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; flex: 0 0 75% !important; max-width: 250px !important; margin-bottom: 0 !important; scroll-snap-align: start; }
    .cat-list-scroll-mobile .cat-list-post > a { flex: none !important; width: 100% !important; aspect-ratio: 4 / 3 !important; margin-bottom: 5px !important; }
    .cat-list-scroll-mobile .cat-list-post-content { width: 100% !important; }
    .cat-list-scroll-mobile .cat-list-post h4 { font-size: 15px !important; line-height: 1.3 !important; margin: 0 0 5px 0 !important; }

    /* 3. SLIDER ORIZZONTALE MOBILE PER I PIÙ LETTI */
    .popular-articles-grid .popular-article-item { flex: 0 0 65% !important; max-width: 240px !important; scroll-snap-align: start; }
    .popular-articles-grid .popular-article-item h4 { font-size: 14px !important; line-height: 1.3 !important; white-space: normal; }

    /* Sezioni modificate su Mobile */
    .bottom-popular-news { border-left: none; padding-left: 0; border-top: 1px solid #f0f0f0; padding-top: 40px; min-width: 0; }
    .list-article-horizontal { flex-direction: column; gap: 15px; }
    .list-img-link { flex: none; width: 100%; }
    
    /* Tipografia scalata per Mobile */
    .home-intro-title { font-size: 28px; }
    .single-title { font-size: 32px; }
    .category-hero-content h1 { font-size: 36px; }
}