/*
Theme Name: OK News Style
Theme URI: https://example.com
Author: AI Assistant
Description: Tema WordPress leggero ed essenziale per quotidiani e blog di informazione locale, ottimizzato per dispositivi mobili.
Version: 1.2.0
Text Domain: ok-news-style
*/

:root {
    --primary-color: #1E73BE; /* Blu #1E73BE */
    --secondary-color: #1E73BE;
    --dark-neutral: #1a252f;
    --bg-light: #f8f9fa;
    --text-color: #2c3e50;
    --border-color: #e2e8f0;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    color: var(--text-color);
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a { color: var(--primary-color); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Top bar & Header */
.top-bar {
    background: var(--primary-color);
    color: #fff;
    font-size: 0.85rem;
    padding: 8px 0;
}
.top-bar .container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

@media (max-width: 768px) {
    .top-bar { font-size: 0.78rem; text-align: center; }
    .top-bar .container { flex-direction: column; gap: 4px; }
}

.site-header { 
    padding: 20px 0; 
    text-align: center; 
    background: #fff; 
}

/* Stile per il Logo Responsive */
.site-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.custom-logo {
    max-width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .site-header { padding: 15px 0; }
    .custom-logo { max-height: 65px; }
}

/* Navigazione e Hamburger Menu Mobile */
.main-navigation {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

/* Pulsante Hamburger per Mobile */
.menu-toggle {
    display: none;
    width: 100%;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 15px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
}

.menu-toggle .hamburger-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.main-navigation ul {
    list-style: none; 
    margin: 0; 
    padding: 0;
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap;
}

.main-navigation li a {
    display: block; 
    padding: 12px 18px;
    font-weight: 700; 
    color: var(--dark-neutral);
    text-transform: uppercase; 
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
}

.main-navigation li a:hover { 
    color: var(--primary-color); 
    background: var(--bg-light); 
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation ul.nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #ffffff;
        border-top: 1px solid var(--border-color);
    }

    .main-navigation ul.nav-menu.toggled {
        display: flex;
    }

    .main-navigation li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .main-navigation li a {
        padding: 12px 20px;
        text-align: left;
    }
}

/* Layout e Responsive Grid */
.layout-wrapper { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 30px; 
    margin-top: 30px; 
}

@media (min-width: 992px) {
    .layout-wrapper { grid-template-columns: 2.7fr 1fr; }
}

/* Articolo Hero */
.hero-article {
    position: relative; 
    margin-bottom: 25px;
    border-radius: 8px; 
    overflow: hidden; 
    background: #000;
}

.hero-article img {
    width: 100%; 
    height: 420px; 
    object-fit: cover;
    opacity: 0.85; 
    display: block; 
    transition: transform 0.3s ease;
}

.hero-article:hover img { transform: scale(1.02); }

.hero-content {
    position: absolute; 
    bottom: 0; 
    left: 0; 
    right: 0;
    padding: 30px; 
    background: linear-gradient(transparent, rgba(0,0,0,0.92)); 
    color: #fff;
}

.hero-content h2 { 
    margin: 10px 0 0; 
    font-size: 2rem; 
    line-height: 1.25; 
}

.hero-content h2 a { color: #fff; }

@media (max-width: 768px) {
    .hero-article img { height: 280px; }
    .hero-content { padding: 18px; }
    .hero-content h2 { font-size: 1.35rem; }
}

/* Cards Notizie Home */
.news-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 600px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }

.card-post {
    border: 1px solid var(--border-color);
    border-radius: 6px; 
    overflow: hidden; 
    background: #fff;
    display: flex; 
    flex-direction: column; 
    transition: box-shadow 0.2s;
}

.card-post:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-post img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 18px; flex-grow: 1; display: flex; flex-direction: column; }

.badge-cat {
    background: var(--primary-color); 
    color: #fff;
    font-size: 0.7rem; 
    padding: 3px 8px; 
    border-radius: 3px;
    font-weight: 800; 
    text-transform: uppercase; 
    align-self: flex-start; 
    margin-bottom: 10px;
}

.card-title { font-size: 1.2rem; margin: 0 0 10px; line-height: 1.35; }
.card-title a { color: var(--dark-neutral); }
.card-meta { font-size: 0.8rem; color: #888; margin-top: auto; }

/* Singolo Articolo (Single Post) */
.single-post-container {
    background: #fff;
    padding: 10px 0;
}

.single-post-header {
    margin-bottom: 25px;
}

.single-post-title {
    font-size: 2.2rem;
    line-height: 1.25;
    margin: 15px 0 10px;
    color: var(--dark-neutral);
}

.single-post-meta {
    font-size: 0.85rem;
    color: #7f8c8d;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.single-featured-image {
    margin-bottom: 25px;
    border-radius: 6px;
    overflow: hidden;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
}

.entry-content p {
    margin-bottom: 1.5em;
}

.entry-content img {
    max-width: 100%;
    height: auto;
}

/* Nasconde la prima immagine nel testo per evitare duplicati con l'immagine in evidenza */
.single-post-container .entry-content img:first-of-type {
    display: none !important;
}

@media (max-width: 768px) {
    .single-post-title { font-size: 1.55rem; }
    .entry-content { font-size: 1rem; line-height: 1.6; }
}

/* Sidebar */
.sidebar { 
    background: var(--bg-light); 
    padding: 20px; 
    border-radius: 6px; 
    border: 1px solid var(--border-color); 
}

.widget-title { 
    font-size: 1.1rem; 
    border-bottom: 2px solid var(--primary-color); 
    padding-bottom: 6px; 
    margin-top: 0; 
    margin-bottom: 15px; 
    text-transform: uppercase; 
}

/* Footer */
.site-footer { 
    background: var(--primary-color); 
    color: #fff; 
    margin-top: 50px; 
    padding: 35px 0 20px; 
}

.footer-credits { 
    text-align: center; 
    font-size: 0.82rem; 
    line-height: 1.6; 
    color: #ffffff; 
    max-width: 900px; 
    margin: 0 auto; 
    padding: 0 15px; 
}

@media (max-width: 768px) {
    .footer-credits { font-size: 0.76rem; }
}
