/* CSS per le sezioni News e Modulo Articolo Singolo */
/* Variabili ereditate dal sito principale:
   --navy: #0d1b2a; --navy-mid: #162032; --navy-light: #1e2f45;
   --gold: #c9a84c; --gold-light: #e8c97a; --gold-pale: #f5e9c8;
   --cream: #faf6ee; --white: #fff; --muted: #8a9baf; --text: #3a4a5c;
*/

/* ===========================
   HERO NEWS
   =========================== */
.news-hero {
    padding: 180px 60px 80px;
    background: linear-gradient(135deg, rgba(13,27,42,.98), rgba(13,27,42,.92));
    color: var(--white);
    text-align: center;
    position: relative;
}

.news-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 300;
    margin-bottom: 20px;
}

.news-hero p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: clamp(14px, 2vw, 18px);
    color: rgba(255,255,255,.7);
    max-width: 600px;
    margin: 0 auto;
}

/* ===========================
   FILTRI CATEGORIA
   =========================== */
.news-filters {
    padding: 40px 60px 0;
    text-align: center;
    background-color: var(--cream);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(13,27,42,.1);
    color: var(--navy);
    font-family: 'Montserrat', sans-serif;
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .3s;
    border-radius: 4px;
}

.filter-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.filter-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy);
    font-weight: 600;
}

/* ===========================
   GRIGLIA NEWS
   =========================== */
.news-grid-section {
    padding: 60px;
    background: var(--cream);
    min-height: 400px;
    position: relative;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    transition: opacity .3s;
}

/* ===========================
   CARD ARTICOLO
   =========================== */
.news-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.05);
    transition: transform .3s, box-shadow .3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,.1);
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--navy-light);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s;
}

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

.news-card-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-date {
    font-size: 11px;
    color: var(--gold);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: block;
}

.news-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--navy);
    transition: color .3s;
}

.news-card:hover .news-title {
    color: var(--gold);
}

.news-excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 24px;
    flex-grow: 1;
}

.read-more {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--navy);
    display: inline-flex;
    align-items: center;
    transition: color .3s;
    margin-top: auto;
}

.news-card:hover .read-more {
    color: var(--gold);
}

/* ===========================
   SPINNER E MESSAGGI
   =========================== */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.loading-spinner::after {
    content: "";
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border: 2px solid rgba(201,168,76,.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: newsSpinner .8s linear infinite;
}

@keyframes newsSpinner {
    to { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    color: #e74c3c;
    padding: 40px;
    font-weight: 500;
    grid-column: 1 / -1;
}

/* ===========================
   PAGINAZIONE
   =========================== */
.news-pagination {
    background: var(--cream);
    padding: 0 60px 80px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid rgba(13,27,42,.05);
    padding-top: 40px;
}

.pagination-controls button {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--navy);
    padding: 10px 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .3s;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--gold);
    color: var(--white);
}

.pagination-controls button:disabled {
    opacity: .3;
    cursor: not-allowed;
    border-color: rgba(13,27,42,.2);
    color: var(--navy);
}

#page-info {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

/* ===========================
   SINGOLO ARTICOLO
   =========================== */
.article-wrapper {
    background: var(--white);
    padding: 160px 60px 80px;
    min-height: 80vh;
}

#article-content {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
}

.article-category {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: inline-block;
}

.article-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(32px, 4vw, 56px);
    font-weight: 400;
    line-height: 1.2;
    color: var(--navy);
    margin-bottom: 24px;
}

.article-meta {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.article-featured-image {
    width: 100%;
    margin-bottom: 50px;
    border-radius: 12px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: 'Cormorant Garamond', serif;
    color: var(--navy);
    margin: 40px 0 20px;
    font-weight: 500;
}

.article-body p {
    margin-bottom: 24px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 30px 0;
}

.article-body a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
}

.article-body a:hover {
    border-bottom-color: var(--gold);
}

.article-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid rgba(13,27,42,.1);
    text-align: center;
}

.back-to-news {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border: 1px solid var(--navy);
    color: var(--navy);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all .3s;
}

.back-to-news:hover {
    background: var(--navy);
    color: var(--white);
}

/* Articolo: loading/error state */
#article-loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--gold);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#article-error {
    text-align: center;
    padding: 80px 20px;
}

#article-error p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    color: var(--navy);
    margin-bottom: 24px;
}

#article-error a {
    display: inline-block;
    border: 1px solid var(--gold);
    color: var(--navy);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 12px 30px;
    transition: all .3s;
}

#article-error a:hover {
    background: var(--gold);
    color: var(--navy);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    .news-hero {
        padding: 140px 20px 60px;
    }

    .news-filters,
    .news-grid-section,
    .news-pagination {
        padding-left: 20px;
        padding-right: 20px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .article-wrapper {
        padding: 120px 20px 60px;
    }

    .article-header h1 {
        font-size: 32px;
    }

    .pagination-controls {
        gap: 12px;
    }
}

/* ===========================
   SKIP LINK
   =========================== */
.skip-link{position:absolute;top:-60px;left:16px;background:var(--navy);color:var(--gold);padding:10px 18px;font-size:11px;font-weight:600;letter-spacing:2px;text-transform:uppercase;text-decoration:none;z-index:9999;border:1px solid var(--gold);}
.skip-link:focus{top:16px;outline:2px solid var(--gold);outline-offset:2px;}

/* ===========================
   FOCUS VISIBILE
   =========================== */
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--gold);outline-offset:3px;}

/* ===========================
   MOTION RIDOTTO
   =========================== */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;}
  html{scroll-behavior:auto;}
  .reveal{opacity:1;transform:none;}
}
