/* =====================================================
   MICROATENA - Mobile Stylesheet
   Rispetta i colori e lo stile del sito desktop
   ===================================================== */

/* --- Reset & Base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: Verdana, Georgia, "Times New Roman", Times, serif;
    font-size: 13px;
    color: #323232;
    background-color: #b29269;
    line-height: 1.5em;
}

a {
    color: #CC2715;
    text-decoration: none;
    outline: none;
}

a:active, a:hover { color: #fd5c02; }

img { border: none; max-width: 100%; height: auto; }

.clear::after { content: ""; display: block; clear: both; }

/* --- Header --- */
#m-header {
    background-color: #df783e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

#m-logo {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    font-variant: small-caps;
    letter-spacing: 1px;
}

#m-logo span {
    font-size: 24px;
    margin: 0 -2px;
}

#m-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#m-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s;
}

/* --- Drawer Menu --- */
#m-drawer {
    position: fixed;
    top: 50px;
    left: -260px;
    width: 260px;
    height: calc(100vh - 50px);
    background-color: #5c3f1c;
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding-top: 10px;
}

#m-drawer.open { left: 0; }

#m-drawer-overlay {
    display: none;
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    height: calc(100vh - 50px);
    background: rgba(0,0,0,0.4);
    z-index: 998;
}

#m-drawer-overlay.open { display: block; }

#m-drawer nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#m-drawer nav ul li a {
    display: block;
    padding: 14px 20px;
    color: #DEDACB;
    font-size: 13px;
    font-weight: bold;
    border-bottom: 1px solid #7a5530;
    font-variant: small-caps;
}

#m-drawer nav ul li a:hover,
#m-drawer nav ul li a.active {
    color: #FFCC00;
    background-color: #7a5530;
}

/* Sottomenu Biblioteca: lista verticale indentata */
#m-drawer .m-drawer-sub {
    background-color: #4a3015;
    border-bottom: 1px solid #7a5530;
}

#m-drawer .m-drawer-sub a {
    display: block;
    padding: 10px 20px 10px 40px;
    font-size: 12px;
    color: #DEDACB;
    border-bottom: 1px solid #5c3f1c;
    font-variant: normal;
    font-weight: normal;
}

#m-drawer .m-drawer-sub a:hover {
    color: #FFCC00;
    background-color: #5c3f1c;
}

/* Barra ricerca nel drawer */
#m-drawer .m-search-drawer {
    padding: 12px 16px;
    border-bottom: 1px solid #7a5530;
}

#m-drawer .m-search-drawer input[type="text"] {
    width: calc(100% - 44px);
    padding: 7px 8px;
    border: none;
    font-size: 12px;
    color: #cc6600;
    background: #f9f9f9;
}

#m-drawer .m-search-drawer button {
    width: 36px;
    padding: 7px 6px;
    background-color: #df783e;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    vertical-align: top;
}

/* --- Barra ricerca in cima al contenuto (homepage) --- */
#m-searchbar {
    background-color: #eee2d6;
    padding: 10px 12px;
    display: flex;
    gap: 6px;
}

#m-searchbar input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    font-size: 13px;
    color: #cc6600;
    background: #f9f9f9;
}

#m-searchbar button {
    padding: 8px 12px;
    background-color: #df783e;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

/* --- Wrapper contenuto --- */
#m-content {
    background-color: #FCFCFC;
    min-height: calc(100vh - 120px);
    padding: 12px;
}

/* --- Titolo pagina --- */
.m-page-title {
    font-size: 14px;
    font-weight: bold;
    font-variant: small-caps;
    color: #323232;
    text-decoration: underline;
    margin-bottom: 14px;
    margin-top: 4px;
}

/* --- News card (homepage e archivio) --- */
a.m-news-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
a.m-news-link:hover .m-news-title {
    color: #df783e;
}

.m-news-title a {
    color: #CC2715;
    text-decoration: none;
}
.m-news-title a:hover {
    text-decoration: underline;
}

.m-news-item {
    border-bottom: 1px solid #AEAEAE;
    margin-bottom: 14px;
    padding-bottom: 14px;
}

/* Barra beige full-width che contiene checkmark + pillola data */
.m-news-header {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #eee2d6;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.m-news-check {
    font-size: 13px;
    color: #28a745;
    flex-shrink: 0;
}

/* Pillola arancione con la data - solo larghezza del testo */
.m-news-meta {
    display: inline-block;
    background-color: #df783e;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
}

.m-news-title {
    font-size: 13px;
    font-weight: bold;
    color: #323232;
    padding: 4px 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid #AEAEAE;
}

.m-news-body {
    font-size: 12px;
    color: #323232;
    line-height: 1.5em;
    text-align: justify;
}

.m-news-body img {
    display: inline !important;
    float: none !important;
    width: 16px !important;
    height: auto !important;
    vertical-align: middle !important;
    margin: 0 !important;
}

.m-news-readmore {
    text-align: right;
    font-size: 11px;
    margin-top: 6px;
    clear: both;
}

.m-news-readmore a { color: #CC2715; font-weight: bold; }

/* --- Biblioteca: griglia copertine --- */
.m-biblioteca-nav {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-bottom: 2px solid #df783e;
}

.m-biblioteca-nav a {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: bold;
    font-variant: small-caps;
    color: #CC2715;
    background-color: #f5f0ea;
    border-right: 1px solid #ccc;
}

.m-biblioteca-nav a:last-child { border-right: none; }
.m-biblioteca-nav a.active {
    background-color: #df783e;
    color: #fff;
}

.m-sort-bar {
    font-size: 11px;
    color: #666;
    margin-bottom: 10px;
}

.m-sort-bar select {
    font-size: 11px;
    color: #cc6600;
    border: 1px solid #ccc;
    padding: 2px 4px;
}

.m-copertine-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.m-copertine-grid a {
    display: block;
    text-align: center;
}

.m-copertine-grid img {
    width: 100%;
    height: auto;
    border: 1px solid #DEDACB;
}

/* --- Scheda libro / rivista --- */
.m-scheda-cover {
    text-align: center;
    margin-bottom: 14px;
}

.m-scheda-cover img {
    max-width: 160px;
    border: 1px solid #DEDACB;
    padding: 3px;
}

.m-scheda-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.m-scheda-table td {
    padding: 5px 6px;
    border-bottom: 1px dotted #ccc;
    vertical-align: top;
}

.m-scheda-table td:first-child {
    font-weight: bold;
    color: #5c3f1c;
    width: 38%;
    white-space: nowrap;
}

.m-scheda-desc {
    font-size: 12px;
    line-height: 1.6em;
    text-align: justify;
    margin-bottom: 14px;
    color: #323232;
}

.m-download-btn {
    display: block;
    background-color: #CC2715;
    color: #fff !important;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    font-variant: small-caps;
}

/* Uscite rivista: griglia */
.m-uscite-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.m-uscita-item {
    text-align: center;
    font-size: 10px;
    color: #323232;
    background-color: #cfbaa1;
    padding: 4px;
}

.m-uscita-item img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 3px;
}

/* Icone allegati (cd, zip ecc.) dentro il testo data_pubbl */
.m-uscita-item span img {
    width: 24px;
    height: auto;
    display: inline;
    vertical-align: middle;
    margin: 2px 0 0 0;
}

/* --- Ricerca risultati --- */
.m-result-item {
    border-bottom: 1px dotted #AEAEAE;
    padding: 10px 0;
    font-size: 16px;
}

.m-result-item .m-result-title {
    font-weight: bold;
    color: #CC2715;
    margin-bottom: 4px;
    font-size: 16px;
}

.m-result-item .m-result-title a {
    font-size: 16px;
    font-weight: bold;
    color: #CC2715;
}

.m-result-item .m-result-type {
    display: block;
    font-size: 13px;
    color: #888;
    font-variant: small-caps;
}

/* --- Contatti form --- */
.m-form-group {
    margin-bottom: 12px;
}

.m-form-group label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #5c3f1c;
    margin-bottom: 4px;
}

.m-form-group input[type="text"],
.m-form-group input[type="email"],
.m-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    font-size: 13px;
    font-family: Verdana, sans-serif;
    color: #323232;
    background: #f9f9f9;
}

.m-form-group textarea { height: 120px; resize: vertical; }

.m-form-captcha {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.m-form-captcha input[type="text"] {
    width: 70px;
    padding: 6px;
    border: 1px solid #ccc;
    font-size: 13px;
}

.m-submit-btn {
    background-color: #CC2715;
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 13px;
    font-variant: small-caps;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
}

.m-msg-ok {
    background-color: #e6ffe6;
    color: #006600;
    border: 1px solid #99cc99;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

.m-msg-err {
    background-color: #ffe6e6;
    color: #CC0000;
    border: 1px solid #cc9999;
    padding: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

/* --- Pannello servizio (in fondo) --- */
#m-pannello {
    background-color: #eee2d6;
    border-top: 2px solid #df783e;
    margin-top: 10px;
    padding: 12px;
}

#m-pannello h3 {
    font-size: 13px;
    font-variant: small-caps;
    border-bottom: 1px dotted #666;
    padding-bottom: 4px;
    margin-bottom: 8px;
    color: #5c3f1c;
}

/* Newsletter con riquadro in risalto */
.m-newsletter-box {
    border: 2px solid #df783e;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    background-color: #fff8f4;
}

.m-newsletter-box h3 {
    color: #df783e;
    font-size: 13px;
    font-variant: small-caps;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

/* Newsletter nel pannello */
#m-pannello .m-newsletter input[type="email"] {
    width: 100%;
    padding: 7px;
    border: 1px solid #ccc;
    font-size: 12px;
    margin-bottom: 6px;
}

#m-pannello .m-newsletter p.m-disclaimer {
    font-size: 10px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

#m-pannello .m-newsletter button {
    background-color: #CC2715;
    color: #fff;
    border: none;
    padding: 7px 18px;
    font-size: 12px;
    cursor: pointer;
}

#m-pannello .m-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

#m-pannello .m-link-row a {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
    background-color: #df783e;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    font-variant: small-caps;
}

#m-pannello .m-partners img {
    height: 36px;
    margin: 0 6px 6px 0;
    vertical-align: middle;
}

/* --- Pagination --- */
.m-pagination {
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
}

.m-pagination a {
    display: inline-block;
    margin: 0 3px;
    padding: 5px 9px;
    border: 1px solid #D8D9DE;
    color: #CC2715;
}

.m-pagination b {
    display: inline-block;
    margin: 0 3px;
    padding: 5px 9px;
    background-color: #df783e;
    color: #fff;
}

/* --- Link utili / Cerco items --- */
.m-list-item {
    border-bottom: 1px dotted #AEAEAE;
    padding: 10px 0;
}

.m-list-item h4 {
    font-size: 13px;
    font-weight: bold;
    color: #CC2715;
    margin-bottom: 4px;
}

.m-list-item p {
    font-size: 12px;
    color: #323232;
    line-height: 1.5em;
}

/* --- Footer --- */
#m-footer {
    background-color: #FCFCFC;
    border-top: 1px solid #DEDACB;
    padding: 12px;
    font-size: 10px;
    color: #555;
    text-align: justify;
    line-height: 1.5em;
}

#m-footer strong { color: #333; }

#m-footer a { color: #E08934; }

#m-copyright {
    background-color: #b29269;
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 10px;
}

/* --- Switch versione desktop --- */
.m-desktop-link {
    text-align: center;
    padding: 6px;
    background-color: #eee2d6;
    font-size: 10px;
    color: #666;
    border-top: 1px solid #ccc;
}

.m-desktop-link a { color: #CC2715; font-weight: bold; }

/* --- Utility --- */
.m-section-sep {
    border: none;
    border-top: 1px solid #DEDACB;
    margin: 14px 0;
}

.m-bold { font-weight: bold; }
.m-small { font-size: 11px; color: #666; }
.m-center { text-align: center; }
.m-red { color: #CC2715; }
