/**
 * AMH Page Title — Stili parziale
 *
 * Usato da amh-page-title.php in tutti i template non-canvas (single, single-fw,
 * archive, archive-fw). Include: supertitolo, H1, breadcrumb, meta post, separatore,
 * descrizione archivio.
 *
 * Variabili CSS utilizzate (tutte con fallback sicuri):
 *   --pt-bg           sfondo del blocco titolo
 *   --pt-color        colore testo principale
 *   --pt-accent       colore accento (breadcrumb link, supertitolo)
 *   --pt-align        text-align (left | center | right)
 *   --pt-pad-v        padding verticale (es. 48px)
 *   --pt-pad-h        padding orizzontale (es. 0px)
 *   --pt-h1-size      font-size H1
 *   --pt-h1-weight    font-weight H1
 *   --pt-h1-family    font-family H1
 *   --pt-h1-lh        line-height H1
 *   --pt-h1-ls        letter-spacing H1
 *   --pt-sep-show     separatore visibile (1 = sì, 0 = no)
 *   --pt-sep-color    colore separatore
 *   --pt-sep-width    larghezza separatore (es. 60px)
 *   --pt-sep-h        altezza separatore (es. 2px)
 *
 * Queste variabili vengono iniettate via <style> inline da amh-page-title.php
 * in base alle impostazioni salvate (pt_* keys in animah_ultimate_vault_v20_2).
 *
 * @package  Impera Core / Animah ATL
 * @version  1.0.0
 */

/* ── Wrapper principale ───────────────────────────────────────────────────── */

.amh-page-title-wrap {
    background: var(--pt-bg, transparent);
    color: var(--pt-color, inherit);
    padding:
        var(--pt-pad-v, 48px)
        var(--pt-pad-h, 0px);
    text-align: var(--pt-align, left);
    width: 100%;
}

/* Versione fullwidth: si estende oltre .amh-container */
.amh-main-fw .amh-page-title-wrap {
    /* nel FW il container padre è già full-width: nessuna correzione necessaria */
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */

.amh-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    font-size: clamp(11px, 1.1vw, 13px);
    justify-content: var(--pt-align-flex, flex-start);
    opacity: 0.75;
}

.amh-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 6px;
}

.amh-breadcrumb li::after {
    content: var(--pt-bc-sep, '/');
    opacity: 0.5;
    font-size: 0.85em;
}

.amh-breadcrumb li:last-child::after {
    display: none;
}

.amh-breadcrumb a {
    color: var(--pt-accent, currentColor);
    text-decoration: none;
    transition: opacity 0.2s;
}

.amh-breadcrumb a:hover {
    opacity: 0.6;
    text-decoration: underline;
}

.amh-breadcrumb .amh-bc-current {
    font-weight: 600;
    opacity: 1;
}

/* ── Supertitolo (kicker/eyebrow text) ───────────────────────────────────── */

.amh-page-supertitle {
    display: block;
    font-size: clamp(11px, 1.2vw, 13px);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--pt-accent, currentColor);
    margin: 0 0 10px;
    opacity: 0.8;
}

/* ── H1 principale ───────────────────────────────────────────────────────── */

.amh-page-title-h1 {
    font-size:      var(--pt-h1-size,    clamp(28px, 4vw, 52px));
    font-weight:    var(--pt-h1-weight,  700);
    font-family:    var(--pt-h1-family,  inherit);
    line-height:    var(--pt-h1-lh,      1.15);
    letter-spacing: var(--pt-h1-ls,      -0.01em);
    color:          var(--pt-color,      inherit);
    margin: 0;
    padding: 0;
}

/* ── Separatore decorativo ────────────────────────────────────────────────── */

.amh-page-title-sep {
    display: block;
    width:  var(--pt-sep-width,  60px);
    height: var(--pt-sep-h,      2px);
    background: var(--pt-sep-color, currentColor);
    margin: 20px 0;
    opacity: 0.35;
    border: none;
}

/* Allineamento centrale */
[style*="--pt-align: center"] .amh-page-title-sep,
.amh-page-title-wrap[style*="text-align: center"] .amh-page-title-sep {
    margin-left:  auto;
    margin-right: auto;
}

/* Allineamento destra */
[style*="--pt-align: right"] .amh-page-title-sep,
.amh-page-title-wrap[style*="text-align: right"] .amh-page-title-sep {
    margin-left: auto;
}

/* Nascondo via CSS quando pt_sep = false (valore inline style) */
.amh-page-title-sep[hidden] {
    display: none;
}

/* ── Meta post (data, autore, categorie, tempo lettura) ──────────────────── */

.amh-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    font-size: clamp(11px, 1.1vw, 13px);
    opacity: 0.7;
    justify-content: var(--pt-align-flex, flex-start);
}

.amh-post-meta li {
    display: flex;
    align-items: center;
    gap: 5px;
}

.amh-post-meta a {
    color: var(--pt-accent, currentColor);
    text-decoration: none;
}

.amh-post-meta a:hover {
    text-decoration: underline;
}

.amh-meta-icon {
    width:  14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    fill: currentColor;
}

/* ── Descrizione archivio ─────────────────────────────────────────────────── */

.amh-archive-description-pt {
    margin: 14px 0 0;
    font-size: clamp(14px, 1.4vw, 16px);
    line-height: 1.6;
    opacity: 0.8;
    max-width: 70ch;
}

/* Allineamento centrale: centra anche il paragrafo */
[style*="--pt-align: center"] .amh-archive-description-pt,
.amh-page-title-wrap[style*="text-align: center"] .amh-archive-description-pt {
    margin-left:  auto;
    margin-right: auto;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .amh-page-title-wrap {
        padding:
            calc(var(--pt-pad-v, 48px) * 0.6)
            var(--pt-pad-h, 0px);
    }

    .amh-breadcrumb {
        margin-bottom: 8px;
    }

    .amh-post-meta {
        gap: 4px 12px;
    }

    .amh-page-title-sep {
        margin: 14px 0;
    }
}
