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

body { 
    font-family: 'Georgia', serif; 
    background-color: #eae7e1; 
    color: #111; 
    line-height: 1.5; 
}

.site-wrapper {
    max-width: 1140px;
    margin: 20px auto;
    background: #fff; 
    padding: 25px 35px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #dcd8d0;
}

/* BANDA RULANTĂ */
.news-ticker-container { 
    display: flex; 
    background: #111; 
    color: #fff; 
    height: 36px; 
    align-items: center; 
    overflow: hidden; 
    margin-bottom: 20px; 
    font-family: system-ui, sans-serif; 
    font-size: 0.82rem; 
}
.ticker-label { 
    background: #c00; 
    color: #fff; 
    padding: 0 15px; 
    font-weight: 700; 
    line-height: 36px; 
    white-space: nowrap; 
}
.ticker-content { flex: 1; overflow: hidden; position: relative; }
.ticker-track { display: flex; gap: 40px; white-space: nowrap; animation: ticker-scroll 25s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
.ticker-item { color: #eee; text-decoration: none; }
.ticker-item:hover { color: #ffcc00; }
.ticker-time { color: #aaa; margin-right: 5px; }

@keyframes ticker-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* HEADER ZIAR */
.main-header { 
    text-align: center; 
    padding-bottom: 15px; 
}
.top-date { 
    font-family: system-ui, sans-serif; 
    font-size: 0.8rem; 
    color: #666; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 8px; 
}
.site-title { 
    font-size: 3.5rem; 
    font-weight: 900; 
    letter-spacing: -1.5px; 
    text-transform: uppercase; 
    margin: 5px 0; 
    font-family: 'Times New Roman', Times, serif;
}
.site-title a { color: #111; text-decoration: none; }
.site-title span { color: #c00; }
.site-tagline { font-style: italic; font-size: 0.95rem; color: #555; }

/* MENIU PRINCIPAL CATEGORII */
.main-nav {
    border-top: 3px double #111;
    border-bottom: 1px solid #111;
    margin: 15px 0 25px 0;
    background: #fdfdfd;
}
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.main-nav li a {
    display: block;
    padding: 10px 18px;
    color: #111;
    text-decoration: none;
    font-family: system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-right: 1px solid #eee;
}
.main-nav li:last-child a { border-right: none; }
.main-nav li a:hover, .main-nav li a.active {
    background: #111;
    color: #fff;
}

/* GRID ARTICOLE */
.news-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 30px; 
    margin-bottom: 40px; 
}
article { 
    border-bottom: 1px solid #eee; 
    padding-bottom: 20px; 
}
article h2 { font-size: 1.35rem; line-height: 1.25; margin-bottom: 8px; }
article h2 a { color: #111; text-decoration: none; }
article h2 a:hover { color: #c00; }
.article-meta { font-family: system-ui, sans-serif; font-size: 0.78rem; color: #777; margin-bottom: 10px; }
.article-body { font-size: 0.95rem; color: #333; margin-bottom: 12px; }

/* FOOTER */
footer { 
    text-align: center; 
    margin-top: 40px; 
    padding-top: 20px; 
    border-top: 1px solid #111; 
    font-family: system-ui, sans-serif; 
    font-size: 0.8rem; 
    color: #666; 
}

/* ===================================================
   LAYOUT NOU PENTRU ARTICOLE (MAX 7: MARE, 3 MICI, MARE, 2 MICI)
   =================================================== */

.news-layout-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Stil pentru articolele Mari (Hero 1 și Hero 2) */
.featured-hero-article {
    display: flex;
    gap: 25px;
    background: #fff;
    border: 1px solid #111;
    padding: 20px;
    margin-bottom: 30px;
    align-items: center;
}

.featured-hero-article.hero-secondary {
    border-top: 3px solid #c00;
}

.hero-image-link {
    flex: 1.2;
    min-width: 0;
}

.hero-image-link img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
    border: 1px solid #ddd;
}

.placeholder-img {
    width: 100%;
    height: 300px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-weight: bold;
}

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

.news-cat-badge {
    background: #c00;
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 3px 8px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 8px;
}

.news-date {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
}

.hero-content h2 {
    font-size: 1.8rem;
    line-height: 1.25;
    margin: 0 0 12px 0;
    font-family: 'Georgia', serif;
}

.hero-content h2 a {
    color: #111;
    text-decoration: none;
}

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

.hero-excerpt {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
    margin-bottom: 15px;
}

.read-more-btn {
    color: #c00;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* Grilă cu 3 Coloane (Articolele 2, 3, 4) */
.three-cols-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

/* Grilă cu 2 Coloane (Articolele 6, 7) */
.two-cols-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 35px;
}

/* Carduri Articole Sub-Mari */
.sub-article-card {
    background: #fff;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.sub-article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid #eee;
}

.sub-card-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sub-card-body h3 {
    font-size: 1.1rem;
    line-height: 1.3;
    margin: 8px 0;
    font-family: 'Georgia', serif;
}

.sub-card-body h3 a {
    color: #111;
    text-decoration: none;
}

.sub-card-body h3 a:hover {
    color: #c00;
}

.sub-card-body p {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
    margin: 0;
}

/* ===================================================
   ADAPTARE RESPONSIVE PENTRU TELEFOANE MOBILE & TABLETE
   =================================================== */

@media (max-width: 900px) {
    .featured-hero-article {
        flex-direction: column;
    }
    .hero-image-link img {
        height: 240px;
    }
    .hero-content h2 {
        font-size: 1.4rem;
    }
    .three-cols-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .news-layout-container {
        padding: 0 10px;
    }
    .featured-hero-article {
        padding: 12px;
    }
    .hero-image-link img {
        height: 200px;
    }
    .three-cols-grid,
    .two-cols-grid {
        grid-template-columns: 1fr; /* Toate pe 1 singur rând pe mobil */
    }
    .sub-article-card img {
        height: 200px;
    }
}

/* ===================================================
   AJUSTARE IMAGINI: CENTRATE ȘI COMPLETE (NO CROP)
   =================================================== */

/* Container container imagine pentru aliniere centrată */
.hero-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    overflow: hidden;
    height: 340px;
    border: 1px solid #eee;
}

.hero-image-link img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Arată poza completă fără tăiere */
    object-position: center !important; /* Centrare imagine */
    border: none !important;
}

/* Carduri mici/secundare */
.sub-article-card a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
    height: 200px;
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.sub-article-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Arată poza completă fără tăiere */
    object-position: center !important;
    border-bottom: none !important;
}

/* Adaptare pe ecrane de mobil */
@media (max-width: 900px) {
    .hero-image-link {
        height: 260px;
    }
}

@media (max-width: 600px) {
    .hero-image-link {
        height: 220px;
    }
    .sub-article-card a {
        height: 220px;
    }
}

/* ===================================================
   AJUSTARE IMAGINE PAGINĂ ARTICOL (ARTICLE.PHP)
   =================================================== */

.article-image-container {
    width: 100%;
    max-height: 500px;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    border: 1px solid #eee;
    overflow: hidden;
}

.article-image-container img {
    max-width: 100% !important;
    max-height: 500px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important; /* Arată imaginea completă fără tăiere */
    object-position: center !important; /* Centrată perfect */
    display: block;
}

/* ===================================================
   OPTIMIZARE AUTOMATĂ ȘI AFIȘARE COMPLETĂ IMAGINI (100% NATURAL)
   =================================================== */

/* Primul articol mare & Articolul mare secundar */
.hero-image-link {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
    display: block !important;
    overflow: visible !important;
}

.hero-image-link img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Cardurile de articole secundare (grila de 3 și 2 coloane) */
.sub-article-card a {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
    display: block !important;
}

.sub-article-card img {
    width: 100% !important;
    height: auto !important;
    max-height: 260px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Pagina individuală a articolului (article.php) */
.article-image-container {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
    display: block !important;
    margin-bottom: 25px !important;
}

.article-image-container img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* ===================================================
   REPARARE DEFINITIVĂ: IMAGINE ARTICOL COMPLETĂ (NO CROP)
   =================================================== */

.single-article-container .article-image-container,
.single-article-container article div {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

.single-article-container img,
.article-image-container img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: fill !important;
    object-position: top center !important;
    display: block !important;
}
