/*
 * marionannischole_typography.css
 *
 * Tipografia e palette colore condivise Mario Nanni Scholé.
 *
 * IDENTICO tra i progetti:
 *   - www.marionannischole.com
 *   - www.fondazionemarionannischole.it
 *   - www.marionanni.com
 *
 * Modifiche: aggiornare in TUTTI E TRE i progetti.
 * Non divergere — qualsiasi differenza deve essere ricondotta a una singola sorgente.
 * Validazione: hash SHA256 dei tre file deve corrispondere.
 *
 * ============================================================================
 * REGOLE TIPOGRAFICHE (NON DEROGABILI)
 * ============================================================================
 *
 * 1. Esistono SOLO quattro font (Futura BT, peso + stile integrati nel file):
 *      - FuturaBT-Book          → testo normale
 *      - FuturaBT-Bold          → testo grassetto
 *      - FuturaBT-Book-Italic   → testo italico
 *      - FuturaBT-Bold-Italic   → testo grassetto + italico
 *
 *    Il peso e lo stile sono INTEGRATI nel file font.
 *    NON usare font-weight numerico, NON usare font-style: italic in CSS:
 *    basta cambiare font-family.
 *
 * 2. Esistono SOLO due classi tipografiche per il peso:
 *      - .fw-normal → forza FuturaBT-Book (o Book-Italic se in italic)
 *      - .fw-bold   → forza FuturaBT-Bold (o Bold-Italic se in italic)
 *
 *    Vietato usare: .fw-400, .fw-500, .fw-600, .fw-700, .fw-800, .fw-900,
 *                   .fw-bolder, .fw-semibold, .fw-light, .fw-lighter, .fw-medium
 *
 * 3. NON usare MAI font-weight personalizzato (né in CSS, né inline).
 *    Quindi NIENTE: font-weight: 500/600/700/800/900/bold/bolder
 *
 * ----------------------------------------------------------------------------
 * TRIGGER → BOLD (FuturaBT-Bold)
 * ----------------------------------------------------------------------------
 * Diventano automaticamente Bold:
 *      - <b>, <strong>
 *      - <h1>..<h6>, .h1..h6
 *      - .fw-bold
 *      - inline style="font-weight: bold|bolder"  (legacy, meglio .fw-bold)
 *
 * Esempi:
 *      <strong>testo</strong>             → FuturaBT-Bold
 *      <h1>titolo</h1>                    → FuturaBT-Bold
 *      <span class="fw-bold">testo</span> → FuturaBT-Bold
 *
 * ----------------------------------------------------------------------------
 * TRIGGER → ITALIC (FuturaBT-Book-Italic)
 * ----------------------------------------------------------------------------
 * Diventano automaticamente Italic:
 *      - <i>, <em>
 *      - .fst-italic (Bootstrap)
 *      - .abstract
 *      - inline style="font-style: italic"
 *
 * Esempi:
 *      <em>testo</em>                       → FuturaBT-Book-Italic
 *      <span class="fst-italic">testo</span> → FuturaBT-Book-Italic
 *      <p class="abstract">testo</p>        → FuturaBT-Book-Italic
 *
 * ----------------------------------------------------------------------------
 * TRIGGER → BOLD + ITALIC (FuturaBT-Bold-Italic)
 * ----------------------------------------------------------------------------
 * Qualunque COMBINAZIONE di trigger Bold + trigger Italic.
 *
 * Esempi (tutti producono FuturaBT-Bold-Italic):
 *      <strong><em>testo</em></strong>
 *      <b><i>testo</i></b>
 *      <span class="fw-bold fst-italic">testo</span>
 *      <span class="fst-italic fw-bold">testo</span>
 *      <h1><em>parola</em></h1>
 *      <h2 class="fst-italic">titolo</h2>
 *      <p class="abstract"><strong>testo</strong></p>
 *      <p class="abstract fw-bold">testo</p>
 *
 * ----------------------------------------------------------------------------
 * COMPENSAZIONE VISIVA BOLD
 * ----------------------------------------------------------------------------
 * FuturaBT-Bold ha glifi ~12% più larghi e stroke più pesante di FuturaBT-Book.
 * Senza compensazione, un <strong> dentro un paragrafo appare visibilmente
 * "più grande" del testo normale, rompendo l'allineamento ottico.
 *
 * Soluzione: tutti i bold inline ricevono font-size: 0.90em (riduzione 10%).
 *
 * Eccezioni (mantengono dimensione piena, il bold pieno è voluto):
 *      - <h1>..<h6> (anche se hanno classe .fw-bold direttamente)
 *      - .h1..h6 (anche se hanno classe .fw-bold direttamente)
 *      - bold annidati dentro un heading (<h1><strong>, <h1><span class="fw-bold">)
 *
 * Implementazione tecnica:
 *      - regola di riduzione usa :not(h1):not(h2)... per escludere heading
 *      - regola separata "h1 b, h1 strong, h1 .fw-bold { font-size: inherit }"
 *        garantisce che bold dentro heading erediti la dimensione del padre
 *
 * Se in futuro il font viene sostituito con uno avente metriche allineate,
 * questa compensazione può essere rimossa (font-size: 0.90em → 1em o regola eliminata).
 *
 * ----------------------------------------------------------------------------
 * DEFAULT E OVERRIDE
 * ----------------------------------------------------------------------------
 * Tutto il resto eredita FuturaBT-Book dal body.
 *
 * Override:
 *      - Forzare Book dentro contesto Bold (es. dentro <h1>) → .fw-normal
 *      - Forzare normal (non-italic) dentro italic            → .fst-normal (Bootstrap)
 *
 * ============================================================================
 * CONTIENE
 * ============================================================================
 *   - @font-face FuturaBT-Book / Bold / Book-Italic / Bold-Italic
 *   - :root con custom properties colore (--primary-*, --dark-grey, --light-grey)
 *   - *::selection
 *   - body tipografia base (FuturaBT-Book)
 *   - regola universale Bold → FuturaBT-Bold
 *   - regola universale Italic → FuturaBT-Book-Italic
 *   - regola universale Bold+Italic → FuturaBT-Bold-Italic
 *   - regola universale Normal → FuturaBT-Book (.fw-normal)
 *
 * NON contiene:
 *   - override specifici di componenti/blocchi (restano in style.css del progetto)
 *   - layout, background, dimensioni (restano in style.css del progetto)
 *   - custom properties non-colore (es. --header-height): restano nel progetto che le usa
 */

@font-face {
    font-family: 'FuturaBT-Book';
    src: url('../fonts/futura/FuturaBT-Book.eot');
    src: url('../fonts/futura/FuturaBT-Book.eot?#iefix') format('embedded-opentype'),
        url('../fonts/futura/FuturaBT-Book.woff2') format('woff2'),
        url('../fonts/futura/FuturaBT-Book.woff') format('woff'),
        url('../fonts/futura/FuturaBT-Book.ttf') format('truetype'),
        url('../fonts/futura/FuturaBT-Book.svg#FuturaBT-Book') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FuturaBT-Bold';
    src: url('../fonts/futura/FuturaBT-Bold.eot');
    src: url('../fonts/futura/FuturaBT-Bold.eot?#iefix') format('embedded-opentype'),
        url('../fonts/futura/FuturaBT-Bold.woff2') format('woff2'),
        url('../fonts/futura/FuturaBT-Bold.woff') format('woff'),
        url('../fonts/futura/FuturaBT-Bold.ttf') format('truetype'),
        url('../fonts/futura/FuturaBT-Bold.svg#FuturaBT-Bold') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FuturaBT-Book-Italic';
    src: url('../fonts/futura/FuturaBT-Book-Italic.eot');
    src: url('../fonts/futura/FuturaBT-Book-Italic.eot?#iefix') format('embedded-opentype'),
        url('../fonts/futura/FuturaBT-Book-Italic.woff2') format('woff2'),
        url('../fonts/futura/FuturaBT-Book-Italic.woff') format('woff'),
        url('../fonts/futura/FuturaBT-Book-Italic.ttf') format('truetype'),
        url('../fonts/futura/FuturaBT-Book-Italic.svg#FuturaBT-Book-Italic') format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FuturaBT-Bold-Italic';
    src: url('../fonts/futura/FuturaBT-Bold-Italic.eot');
    src: url('../fonts/futura/FuturaBT-Bold-Italic.eot?#iefix') format('embedded-opentype'),
        url('../fonts/futura/FuturaBT-Bold-Italic.woff2') format('woff2'),
        url('../fonts/futura/FuturaBT-Bold-Italic.woff') format('woff'),
        url('../fonts/futura/FuturaBT-Bold-Italic.ttf') format('truetype'),
        url('../fonts/futura/FuturaBT-Bold-Italic.svg#FuturaBT-Bold-Italic') format('svg');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-white: #ffffff;
    --primary-black: #000000;
    --dark-grey: #6c757d;
    --light-grey: #dee2e6;
}

*::selection {
    background: #808080;
    color: #ffffff;
}

body {
    font-family: 'FuturaBT-Book', Helvetica, Arial, sans-serif;
    color: #000000;
    line-height: 1.5em;
    font-weight: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

p {
    font-size: 16px;
}

h1,
.h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.5em;
}

h1,
.h1 {
    font-size: 35px;
    line-height: 1em;
}

h2,
h3 {
    font-size: 25px;
}

h4 {
    font-size: 1em;
}

h5,
.h5 {
    line-height: 1em;
}

h6 {
    font-size: 0.75rem;
    line-height: 1.5em;
}

/* ============================================================================
   BOLD universale → FuturaBT-Bold
   ============================================================================
   Tutti i selettori "bold" usano FuturaBT-Bold con font-weight: normal,
   perché il peso è già integrato nel file font. */
b,
strong,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.fw-bold,
[style*="font-weight:bold"],
[style*="font-weight: bold"],
[style*="font-weight:bolder"],
[style*="font-weight: bolder"] {
    font-family: 'FuturaBT-Bold' !important;
    font-weight: normal !important;
    font-style: normal !important;
}

/* Compensazione visiva: FuturaBT-Bold ha glifi ~12% più larghi e stroke più pesante
   di FuturaBT-Book. Per evitare che bold inline appaia "più grande" del testo normale,
   riduco font-size del 10% sui bold.
   Heading (h1-h6) e loro bold annidati NON vengono ridotti: il bold pieno è voluto. */
b:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
strong:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.fw-bold:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(.h1):not(.h2):not(.h3):not(.h4):not(.h5):not(.h6),
[style*="font-weight:bold"]:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
[style*="font-weight: bold"]:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
[style*="font-weight:bolder"]:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
[style*="font-weight: bolder"]:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) {
    font-size: 0.90em;
}

/* Bold annidati DENTRO heading: mantengono dimensione del heading padre (no riduzione). */
h1 b, h1 strong, h1 .fw-bold,
h2 b, h2 strong, h2 .fw-bold,
h3 b, h3 strong, h3 .fw-bold,
h4 b, h4 strong, h4 .fw-bold,
h5 b, h5 strong, h5 .fw-bold,
h6 b, h6 strong, h6 .fw-bold,
.h1 b, .h1 strong, .h1 .fw-bold,
.h2 b, .h2 strong, .h2 .fw-bold,
.h3 b, .h3 strong, .h3 .fw-bold,
.h4 b, .h4 strong, .h4 .fw-bold,
.h5 b, .h5 strong, .h5 .fw-bold,
.h6 b, .h6 strong, .h6 .fw-bold {
    font-size: inherit;
}

/* ============================================================================
   ITALIC universale → FuturaBT-Book-Italic
   ============================================================================
   Tutti i selettori "italic" usano FuturaBT-Book-Italic con font-style: normal,
   perché lo stile è già integrato nel file font. */
i,
em,
.fst-italic,
.abstract,
[style*="font-style:italic"],
[style*="font-style: italic"] {
    font-family: 'FuturaBT-Book-Italic' !important;
    font-weight: normal !important;
    font-style: normal !important;
}

/* ============================================================================
   BOLD + ITALIC universale → FuturaBT-Bold-Italic
   ============================================================================
   Combinazioni di tag/classi bold dentro contesti italic e viceversa. */
b i, b em, b .fst-italic, b .abstract,
strong i, strong em, strong .fst-italic, strong .abstract,
i b, i strong, em b, em strong,
.fw-bold i, .fw-bold em, .fw-bold .fst-italic, .fw-bold .abstract,
.fst-italic b, .fst-italic strong, .fst-italic .fw-bold,
.abstract b, .abstract strong, .abstract .fw-bold,
h1 i, h1 em, h2 i, h2 em, h3 i, h3 em, h4 i, h4 em, h5 i, h5 em, h6 i, h6 em,
h1 .fst-italic, h2 .fst-italic, h3 .fst-italic, h4 .fst-italic, h5 .fst-italic, h6 .fst-italic,
.fw-bold.fst-italic,
.fw-bold.abstract,
.fst-italic.fw-bold,
.abstract.fw-bold {
    font-family: 'FuturaBT-Bold-Italic' !important;
    font-weight: normal !important;
    font-style: normal !important;
}

/* ============================================================================
   NORMAL universale → FuturaBT-Book
   ============================================================================
   Da usare per forzare Book dentro un contesto Bold (es. dentro <h1>). */
.fw-normal {
    font-family: 'FuturaBT-Book' !important;
    font-weight: normal !important;
}
