/* =========================
   PALETTE
   #1a3870  navy primario
   #4878b0  blu medio
   #c5d8ea  blu chiaro / separatori
   #e8f0f8  tinta sfondo
   #c8800a  arancio accent
========================= */

/* =========================
   TITOLI / LINK
========================= */

.homepage-title-link {
    text-decoration: none;
    color: #1a3870;
    transition: color .2s ease;
}

.homepage-title-link h5 {
    color: inherit;
}

.homepage-title-link:hover {
    color: #4878b0;
}

.homepage-section-title h2,
.homepage-content h5 {
    font-family: 'Playfair Display', serif;
}

.homepage-section-title h2 {
    border-bottom: 1px solid #1a3870;
    padding-bottom: .45rem;
    margin-bottom: 0;
}

.homepage-section-title hr {
    margin-top: .35rem;
    border-color: #c5d8ea;
    opacity: 1;
}

.homepage-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4878b0;
    margin-top: 10px;
    text-align: center;
}

/* =========================
   TAGS
========================= */

.homepage-tags-top {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.homepage-tags-top .tag-primo {
    color: #c8800a;
    font-weight: 700;
}

.homepage-tags-top .tag-secondario {
    color: #4878b0;
    font-weight: 600;
}

.homepage-tags {
    margin-top: 6px;
}

.homepage-tag {
    display: inline-block;
    background: #e8f0f8;
    color: #1a3870;
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 3px;
    margin-right: 4px;
}

.copertina {
    font-size: 1.6rem;
}

/* =========================
   ARTICLE BASE
========================= */

.homepage-article {
    display: block;
    margin-bottom: 16px;
    border-bottom: 1px solid #c5d8ea;
}

.homepage-article:last-child {
    border-bottom: none;
}

a {
    color: #1a3870 !important;
}

/* =========================
   LAYOUT TOP
========================= */

.layout-top:not(.compact-mode) .homepage-media img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    border-radius: 3px;
}

.layout-top:not(.compact-mode) .homepage-content h5 {
    line-height: 1.2;
    margin-top: 15px;
}

.layout-top.compact-mode .homepage-media img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 3px;
}

.layout-top.compact-mode .homepage-content h5 {
    font-size: 1.2rem;
    margin-top: 15px;
}

.h2, h2 {
    font-size: 1.6rem !important;
    color: #1a3870;
}

/* =========================
   LAYOUT BOTTOM
========================= */

.layout-bottom .homepage-content {
    text-align: center;
}

.layout-bottom .homepage-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 3px;
}

.layout-bottom.compact-mode .homepage-content h5 {
    font-size: 1.15rem;
}

/* =========================
   LEFT / RIGHT (FIX TAGS)
========================= */

.layout-left,
.layout-right {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.layout-left .homepage-tags-top,
.layout-right .homepage-tags-top {
    flex: 0 0 100%;
    width: 100%;
    display: block;
}

.layout-left .homepage-media,
.layout-right .homepage-media {
    flex: 0 0 130px;
}

.layout-left .homepage-media img,
.layout-right .homepage-media img {
    width: 130px;
    height: 85px;
    object-fit: cover;
    border-radius: 3px;
}

.layout-left .homepage-content,
.layout-right .homepage-content {
    flex: 1;
}

.layout-left .homepage-content h5,
.layout-right .homepage-content h5 {
    font-size: 0.9rem;
    line-height: 1.25;
    margin: 0;
}

.layout-left .homepage-excerpt,
.layout-right .homepage-excerpt {
    display: none;
}

.bodyclass {
    margin-top: 160px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .bodyclass {
        margin-top: 70px;
    }

    .layout-left,
    .layout-right,
    .layout-bottom {
        flex-direction: column;
    }

    .layout-left .homepage-media,
    .layout-right .homepage-media,
    .layout-bottom .homepage-media {
        width: 100%;
    }

    .layout-left .homepage-media img,
    .layout-right .homepage-media img,
    .layout-bottom .homepage-media img {
        width: 100%;
        height: auto;
        max-height: 220px;
    }
}

/* =========================
   AUDIO PLAYER (HIDDEN)
========================= */

.homepage-audio-player {
    display: none;
}

/* =========================
   AUDIO BADGE WRAPPER
========================= */

.homepage-audio-badge {
    cursor: pointer;
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* =========================
   PODCAST COVER
========================= */

.podcast-cover {
    position: relative;
    width: 100%;
    max-width: 420px;
    border-radius: 8px;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.podcast-cover img {
    width: 100%;
    display: block;
    height: auto;
    transition: transform .25s ease;
}

.podcast-cover:hover img {
    transform: scale(1.01);
}

/* =========================
   PLAY BUTTON
========================= */

.podcast-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    background: rgba(26, 56, 112, 0.65);
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .podcast-cover:hover .podcast-play-btn {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: auto;
    }
}

.homepage-article.playing .podcast-play-btn {
    background: rgba(0,0,0,0.65);
}

@media (max-width: 768px) {
    .podcast-play-btn {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: auto;
        background: rgba(26, 56, 112, 0.75);
    }

    .podcast-cover:active .podcast-play-btn {
        transform: translate(-50%, -50%) scale(0.95);
    }
}

/* =========================
   WIDGET METEO
========================= */

.meteo-widget {
    font-family: inherit;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a3870 0%, #2e6da4 60%, #4878b0 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}

.meteo-widget.meteo-error {
    background: #f8d7da;
    color: #842029;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #f5c2c7;
}

.meteo-head {
    padding: 1.2rem 1.4rem 1rem;
    text-align: center;
}

.meteo-city {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .06em;
    opacity: .85;
    margin-bottom: .5rem;
}

.meteo-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    line-height: 1;
}

.meteo-icon-big {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

.meteo-temp-big {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.meteo-label {
    font-size: .95rem;
    margin-top: .35rem;
    opacity: .9;
}

.meteo-details-row {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    font-size: .82rem;
    margin-top: .75rem;
    opacity: .85;
}

.meteo-forecast {
    display: flex;
    background: rgba(0,0,0,.18);
    padding: .6rem .5rem;
    gap: 0;
}

.meteo-day {
    flex: 1;
    text-align: center;
    padding: .4rem .2rem;
    border-right: 1px solid rgba(255,255,255,.12);
}

.meteo-day:last-child {
    border-right: none;
}

.meteo-day-name {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    opacity: .75;
}

.meteo-day-icon {
    font-size: 1.5rem;
    margin: .25rem 0;
    line-height: 1;
}

.meteo-day-temps {
    font-size: .8rem;
    display: flex;
    justify-content: center;
    gap: .35rem;
}

.t-max { font-weight: 700; }
.t-min { opacity: .65; }

.meteo-day-prec {
    font-size: .7rem;
    opacity: .7;
    margin-top: .2rem;
}

.meteo-footer {
    font-size: .7rem;
    opacity: .55;
    text-align: right;
    padding: .3rem .8rem;
    background: rgba(0,0,0,.1);
}

/* ===== IMMAGINI INSERITE NEL CORPO ARTICOLO (CKEditor) ===== */
/* contenitore figura immagine */
.article-content .image {
    display: table;
    clear: both;
    text-align: center;
    margin: 1.2em auto;
    min-width: 50px;
}
.article-content .image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    min-width: 100%;
    height: auto;
    border-radius: 3px;
}
/* immagine ridimensionata: la larghezza in % è applicata inline da CKEditor */
.article-content .image.image_resized {
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}
.article-content .image.image_resized img {
    width: 100%;
    min-width: 0;
}
.article-content .image.image_resized > figcaption {
    display: block;
}
/* didascalia */
.article-content .image > figcaption {
    display: table-caption;
    caption-side: bottom;
    word-break: break-word;
    color: #4a4a4a;
    background-color: #f3f6fa;
    padding: .6em;
    font-size: .82rem;
    line-height: 1.4;
    outline-offset: -1px;
}
/* immagine inline (dentro il testo) */
.article-content .image-inline {
    display: inline-flex;
    max-width: 100%;
    align-items: flex-start;
}
.article-content .image-inline img {
    flex-grow: 1;
    flex-shrink: 1;
    max-width: 100%;
    min-width: 0;
}
/* --- allineamento "a lato del testo" (il testo scorre intorno) --- */
.article-content .image-style-align-left {
    float: left;
    margin: .4em 1.5em .8em 0;
    max-width: 50%;
}
.article-content .image-style-align-right,
.article-content .image-style-side {
    float: right;
    margin: .4em 0 .8em 1.5em;
    max-width: 50%;
}
/* --- allineamento "su riga propria" --- */
.article-content .image-style-align-center {
    margin-left: auto;
    margin-right: auto;
}
.article-content .image-style-block-align-left {
    margin-left: 0;
    margin-right: auto;
}
.article-content .image-style-block-align-right {
    margin-left: auto;
    margin-right: 0;
}
/* impedisce che le immagini float sbordino dal contenitore dell'articolo */
.article-content::after {
    content: "";
    display: block;
    clear: both;
}
