/*
 * AMH BASE CSS — Animah v21.3
 * Struttura base completa: container, layout, section, header, footer,
 * cols, card, btn, archive, single, 404, commenti, print.
 * Caricato una sola volta. Niente dipendenze tra file.
 */

/* ══════════════════════════════════════════════════════════════
   1. RESET SCOPED + STRUTTURA BASE
══════════════════════════════════════════════════════════════ */

.amh-page *, .amh-page *::before, .amh-page *::after,
.amh-block *, .amh-block *::before, .amh-block *::after,
.amh-header *, .amh-header *::before, .amh-header *::after {
    box-sizing: border-box;
}

.amh-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}
.amh-main    { flex: 1 1 auto; width: 100%; }
.amh-main-fw { flex: 1 1 auto; width: 100%; max-width: 100%; padding: 0; }

/* ── Container ── */
.amh-container {
    width: 100%;
    max-width: var(--a-bp-max, 1440px);
    margin-left: auto;
    margin-right: auto;
    padding-left:  clamp(16px, 3vw, 48px);
    padding-right: clamp(16px, 3vw, 48px);
}
.amh-container-fw { width: 100%; max-width: 100%; padding: 0; }

/* ── Content — wrapper pagine/post WordPress nativi (single, archive, no builder) ── */
.amh-content    { width: 100%; padding-top: clamp(32px,5vw,80px); padding-bottom: clamp(32px,5vw,80px); }
.amh-content-fw { width: 100%; }

/* ── Canvas (template a schermo pieno senza padding) ── */
.amh-canvas .amh-main,
.amh-canvas .amh-main-fw { padding: 0; margin: 0; }
.amh-canvas-content { width: 100%; }
.amh-canvas-fw      { width: 100%; max-width: 100%; }

/* ── Fullwidth: sfonda il container ── */
.amh-fullwidth {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Padding laterale su sezioni fullwidth */
.amh-section.amh-fullwidth {
    padding-left:  clamp(16px, 3vw, 48px);
    padding-right: clamp(16px, 3vw, 48px);
}

/* ── Fullscreen / FW page mode ── */
.amh-fullscreen .amh-container,
.amh-fw .amh-container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.amh-fullscreen .amh-main,
.amh-fw .amh-main { width: 100%; }

/* ── amh-boxed: restringe a bp-max il contenuto interno anche in fullscreen.
   Mettilo sul Row Inner in Builder Pro / Themify — la fascia esterna (background)
   rimane a tutta larghezza, il contenuto si ferma a 1440px. ── */
.amh-boxed {
    max-width: var(--a-bp-max, 1440px);
    margin-left: auto;
    margin-right: auto;
    padding-left:  clamp(16px, 3vw, 48px);
    padding-right: clamp(16px, 3vw, 48px);
    width: 100%;
    box-sizing: border-box;
}

/* Forza con !important dentro contesti fullscreen per battere Themify */
.amh-fullscreen .amh-boxed,
.amh-fw .amh-boxed,
.amh-fullscreen .tf_row_inner.amh-boxed,
.amh-fw .tf_row_inner.amh-boxed,
.amh-fullscreen .tbp_template .tf_row_inner.amh-boxed,
.amh-fw .tbp_template .tf_row_inner.amh-boxed {
    max-width: var(--a-bp-max, 1440px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left:  clamp(16px, 3vw, 48px) !important;
    padding-right: clamp(16px, 3vw, 48px) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Il footer gestisce sempre il proprio container a 1440px
   indipendentemente dalla modalità della pagina */
.amh-footer .amh-container,
.amh-footer .amh-header-inner {
    max-width: var(--a-bp-max, 1440px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left:  clamp(16px, 3vw, 48px) !important;
    padding-right: clamp(16px, 3vw, 48px) !important;
}

/* ── Section — blocchi AMH Section Builder (CPT amh_block, template builder) ── */
.amh-section { width: 100%; padding-top: clamp(32px,5vw,80px); padding-bottom: clamp(32px,5vw,80px); }


/* ══════════════════════════════════════════════════════════════
   2. COLONNE
══════════════════════════════════════════════════════════════ */

.amh-cols { display: flex; flex-wrap: wrap; gap: clamp(16px,2vw,32px); }
.amh-col  { flex: 1 1 0; min-width: 0; }


/* ══════════════════════════════════════════════════════════════
   3. CARD BASE
══════════════════════════════════════════════════════════════ */

.amh-card        { display: flex; flex-direction: column; }
.amh-card-img    { width: 100%; height: auto; display: block; }
.amh-card-body   { flex: 1 1 auto; display: flex; flex-direction: column; }
.amh-card-footer { margin-top: auto; }


/* ══════════════════════════════════════════════════════════════
   4. LOOP / ARCHIVE GRID
══════════════════════════════════════════════════════════════ */

.amh-loop { width: 100%; }

.amh-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: clamp(16px,2vw,32px);
}

.amh-archive-header      { margin-bottom: clamp(24px, 4vw, 56px); }
.amh-archive-title       { margin: 0 0 0.5em; }
.amh-archive-description { margin: 0; opacity: 0.75; }

.amh-no-results {
    text-align: center;
    padding: clamp(48px, 8vw, 120px) clamp(16px, 3vw, 48px);
    opacity: 0.6;
}


/* ══════════════════════════════════════════════════════════════
   5. SINGLE / ARTICLE
══════════════════════════════════════════════════════════════ */

.amh-article { width: 100%; }

.amh-page-links {
    margin-top: clamp(24px, 3vw, 48px);
    display: flex; gap: 8px; flex-wrap: wrap;
}

.amh-comments {
    margin-top: clamp(40px, 5vw, 80px);
    padding-top: clamp(32px, 4vw, 64px);
    border-top: 1px solid rgba(0,0,0,0.1);
}


/* ══════════════════════════════════════════════════════════════
   6. 404
══════════════════════════════════════════════════════════════ */

.amh-404-content {
    text-align: center;
    padding: clamp(48px, 8vw, 120px) 0;
}
.amh-404-title {
    font-size: clamp(4rem, 15vw, 10rem);
    line-height: 1;
    margin: 0 0 0.25em;
}


/* ══════════════════════════════════════════════════════════════
   7. HEADER / FOOTER STRUTTURA
══════════════════════════════════════════════════════════════ */

.amh-header, .amh-footer { width: 100%; }
.amh-header-fw, .amh-footer-fw { width: 100%; max-width: 100%; }

.amh-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top:    clamp(12px, 2vw, 24px);
    padding-bottom: clamp(12px, 2vw, 24px);
}

.amh-header-canvas { position: relative; z-index: 200; }


/* ══════════════════════════════════════════════════════════════
   8. SISTEMA HEADER FIXED
══════════════════════════════════════════════════════════════ */

body.amh-has-fixed-header:not(.amh-header-transparent) {
    padding-top: var(--amh-header-h, 0px);
}
body.amh-header-transparent {
    padding-top: 0 !important;
}


/* ══════════════════════════════════════════════════════════════
   9. PAGINATION
══════════════════════════════════════════════════════════════ */

.amh-pagination {
    margin-top: clamp(32px,4vw,64px);
    display: flex;
    justify-content: center;
    gap: 8px;
}


/* ══════════════════════════════════════════════════════════════
   10. PULSANTI BASE
   I colori vengono sempre da inline style PHP.
   Il padding è configurabile via --amh-btn-px / --amh-btn-py.
══════════════════════════════════════════════════════════════ */

.amh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--amh-btn-py, 0.7em) var(--amh-btn-px, 1.8em);
    border-radius: var(--amh-btn-radius, 4px);
    text-decoration: none;
    font-weight: 700;
    font-size: var(--amh-btn-size, 1rem);
    letter-spacing: 0.03em;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity 0.2s, transform 0.2s;
    line-height: 1.3;
}
.amh-btn:hover { opacity: 0.82; transform: translateY(-2px); }

.amh-btn--solid   { /* bg e color da inline style */ }
.amh-btn--outline { background: transparent !important; }
.amh-btn--ghost   {
    background: rgba(255,255,255,.12) !important;
    border-color: rgba(255,255,255,.3) !important;
    color: #fff !important;
    backdrop-filter: blur(6px);
}


/* ══════════════════════════════════════════════════════════════
   11. NAV — classi condivise walker
══════════════════════════════════════════════════════════════ */

.amh-nav-link     { text-decoration: none; color: inherit; }
.amh-nav-item     { list-style: none; }
.amh-fxm-nav-list { list-style: none; margin: 0; padding: 0; }


/* ══════════════════════════════════════════════════════════════
   12. RESPONSIVE GLOBALE
══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .amh-posts-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%,280px),1fr)); }
}

@media (max-width: 768px) {
    .amh-cols         { flex-direction: column; }
    .amh-col          { flex: 0 0 100%; }
    .amh-posts-grid   { grid-template-columns: 1fr; }
    .amh-content,
    .amh-section      { padding-top: clamp(24px,6vw,48px); padding-bottom: clamp(24px,6vw,48px); }
    .amh-header-inner { flex-wrap: wrap; gap: 12px; }
    .amh-footer .amh-container,
    .amh-footer .amh-header-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .amh-content,
    .amh-section      { padding-top: clamp(20px,5vw,32px); padding-bottom: clamp(20px,5vw,32px); }
    .amh-404-title    { font-size: clamp(3rem,18vw,5rem); }
}


/* ══════════════════════════════════════════════════════════════
   13. PRINT
══════════════════════════════════════════════════════════════ */

@media print {
    .amh-header, .amh-footer, .amh-pagination { display: none; }
    .amh-content { padding: 0; }
}
