/* ============================================================
   mod_mostra_articoli — style.css  v1
   Prefisso: mma-
   ============================================================ */

/* ── Wrapper modulo ── */
.mma-wrap {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}
.mma-wrap.mma-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mma-wrap.mma-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mma-wrap.mma-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Item ── */
.mma-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    transition: box-shadow .2s;
    box-sizing: border-box;
}
.mma-item:hover { box-shadow: 0 3px 10px rgba(0,0,0,.08); }

/* posizioni immagine */
.mma-item.mma-img-top,
.mma-item.mma-img-bottom { flex-direction: column; }
.mma-item.mma-img-right  { flex-direction: row-reverse; }
.mma-item.mma-img-left   { flex-direction: row; }
.mma-item.mma-img-none   { flex-direction: row; }

/* ── Thumbnail ── */
.mma-thumb-wrap { flex-shrink: 0; }
.mma-thumb {
    display: block;
    object-fit: cover;
    max-width: 100%;
}

/* ── Contenuto testuale ── */
.mma-content { flex: 1; min-width: 0; }

.mma-title {
    margin: 0 0 8px;
    line-height: 1.3;
    word-break: break-word;
}

.mma-intro {
    margin: 0 0 10px;
    line-height: 1.6;
}

/* ── Bottone Read More ── */
.mma-btn {
    display: inline-block;
    padding: 6px 14px;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .2s, color .2s;
    text-decoration: none;
    line-height: 1.5;
}

/* ── Link Read More ── */
.mma-link {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    color: inherit;
}

.mma-empty { padding: 16px; color: #888; font-style: italic; }

/* ── Layout verticale articoli ── */
.mma-wrap.mma-layout-vertical { grid-template-columns: 1fr; }
.mma-wrap.mma-layout-vertical .mma-item {
    flex-direction: column !important;
    align-items: stretch;
}
.mma-wrap.mma-layout-vertical .mma-thumb-wrap {
    width: 100%;
}
.mma-wrap.mma-layout-vertical .mma-thumb {
    width: 100% !important;
    height: auto !important;
    max-height: 260px;
    object-fit: cover;
}

/* ── POPUP MODAL ── */
.mma-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.mma-modal.mma-modal-open {
    display: flex;
}

.mma-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    cursor: pointer;
}

.mma-modal-box {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 780px;
    width: 92%;
    height: 88vh;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    z-index: 1;
    animation: mmaSlideIn .22s ease;
    transition: max-width .2s ease, width .2s ease, height .2s ease, max-height .2s ease;
}
/* Modalità espansa al 90% schermo */
.mma-modal-box.mma-expanded {
    max-width: 90vw;
    width: 90vw;
    height: 90vh;
    max-height: 90vh;
}

@keyframes mmaSlideIn {
    from { transform: translateY(-24px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.mma-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
}
.mma-modal-close:hover,
.mma-modal-print:hover { background: #f0f0f0; }

.mma-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}
.mma-modal-title {
    margin: 0;
    font-size: 1.2rem;
    color: #252525;
    line-height: 1.35;
    flex: 1;
    padding-right: 12px;
}
.mma-modal-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.mma-modal-expand {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #555;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
    line-height: 1;
}
.mma-modal-expand:hover { background: #f0f0f0; }

.mma-modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* ── Iframe articolo ── */
.mma-iframe {
    width: 100%;
    flex: 1;
    border: none;
    min-height: 420px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .mma-wrap.mma-cols-2,
    .mma-wrap.mma-cols-3,
    .mma-wrap.mma-cols-4 { grid-template-columns: 1fr; }
    .mma-item.mma-img-right,
    .mma-item.mma-img-left { flex-direction: column; }
    .mma-thumb { width: 100% !important; height: auto !important; }
}
