/* ==========================================================================
   GG 5×1000 — Stili (redesign 29/07/2026)
   ==========================================================================
   I nomi delle classi sono invariati: il JS si aggancia a .gg-5x1000-cf,
   [data-gg-copy], .is-copied, .gg-5x1000-banner, [data-gg-close] e
   body.has-gg-banner. Cambia solo la presentazione.
   ========================================================================== */

:root {
    --gg5-color-primary:    #c0392b;   /* rosso istituzionale */
    --gg5-color-primary-dk: #96281b;
    --gg5-color-bg:         #fff8f7;
    --gg5-color-text:       #1a1a1a;
    --gg5-color-border:     #f0dad7;
    --gg5-color-success:    #2e9e5b;
    --gg5-radius:           16px;
    --gg5-banner-h:         60px;
}

/* --------------------------------------------------------------------------
   Box shortcode [gg_5x1000] — CTA donazione
   -------------------------------------------------------------------------- */
.gg-5x1000-box {
    position:      relative;
    display:       grid;
    grid-template-columns: auto 1fr;
    align-items:   center;
    gap:           1.5rem;
    max-width:     720px;
    margin:        2rem auto;
    padding:       1.75rem 2rem;
    background:
        radial-gradient(120% 140% at 0% 0%, #fff 0%, var(--gg5-color-bg) 60%, #fdeeec 100%);
    border:        1px solid var(--gg5-color-border);
    border-radius: var(--gg5-radius);
    box-shadow:    0 10px 30px -12px rgba(192, 57, 43, .28);
    overflow:      hidden;
}

/* barra d'accento a sinistra */
.gg-5x1000-box::before {
    content:    "";
    position:   absolute;
    inset:      0 auto 0 0;
    width:      6px;
    background: linear-gradient(180deg, var(--gg5-color-primary), var(--gg5-color-primary-dk));
}

.gg-5x1000-box__icon {
    display:         grid;
    place-items:     center;
    width:           64px;
    height:          64px;
    border-radius:   50%;
    color:           #fff;
    background:      linear-gradient(135deg, var(--gg5-color-primary), var(--gg5-color-primary-dk));
    box-shadow:      0 6px 16px -4px rgba(192, 57, 43, .55);
    flex-shrink:     0;
}

.gg-5x1000-box__body {
    min-width: 0;
}

.gg-5x1000-box__title {
    color:       var(--gg5-color-primary-dk);
    font-size:   1.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin:      0 0 .35rem;
}

.gg-5x1000-box__text {
    color:       #4a3f3e;
    font-size:   1rem;
    line-height: 1.55;
    margin:      0 0 1.1rem;
}

.gg-5x1000-box__cf-wrap {
    display:     flex;
    align-items: center;
    gap:         .6rem;
    flex-wrap:   wrap;
}

.gg-5x1000-box__cf-label {
    font-size:      .72rem;
    font-weight:    700;
    color:          #9a8582;
    text-transform: uppercase;
    letter-spacing: .08em;
    width:          100%;
    margin-bottom:  -.15rem;
}

/* chip contenente il CF */
.gg-5x1000-box__cf-wrap .gg-5x1000-cf {
    background:    #fff;
    border:        1px dashed var(--gg5-color-primary);
    border-radius: 10px;
    padding:       .5rem .9rem;
}

/* --------------------------------------------------------------------------
   CF (usato in box, banner, inline)
   -------------------------------------------------------------------------- */
.gg-5x1000-cf {
    font-family:    ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
    font-size:      1.15rem;
    font-weight:    700;
    letter-spacing: .1em;
    color:          var(--gg5-color-primary);
    user-select:    all;   /* clic singolo seleziona tutto */
}

/* --------------------------------------------------------------------------
   Pulsante copia
   -------------------------------------------------------------------------- */
.gg-5x1000-copy-btn {
    display:         inline-flex;
    align-items:     center;
    gap:             .4rem;
    background:       var(--gg5-color-primary);
    color:           #fff;
    border:          none;
    border-radius:   10px;
    padding:         .55rem 1rem;
    font-size:       .9rem;
    font-weight:     700;
    cursor:          pointer;
    transition:      background .2s, transform .08s, box-shadow .2s;
    box-shadow:      0 4px 12px -4px rgba(192, 57, 43, .6);
    white-space:     nowrap;
}

.gg-5x1000-copy-btn:hover {
    background: var(--gg5-color-primary-dk);
    box-shadow: 0 6px 16px -4px rgba(192, 57, 43, .7);
}

.gg-5x1000-copy-btn:active {
    transform: scale(.96);
}

.gg-5x1000-copy-btn.is-copied {
    background: var(--gg5-color-success);
    box-shadow: 0 4px 12px -4px rgba(46, 158, 91, .6);
}

/* Variante solo icona (per shortcode inline) */
.gg-5x1000-copy-btn--icon-only {
    padding:       .35rem .45rem;
    border-radius: 8px;
    box-shadow:    none;
}

.gg-5x1000-copy-btn--icon-only .gg-5x1000-copy-btn__label {
    display: none;
}

/* --------------------------------------------------------------------------
   Inline [gg_cf]
   -------------------------------------------------------------------------- */
.gg-5x1000-inline {
    display:       inline-flex;
    align-items:   center;
    gap:           .35rem;
    vertical-align: middle;
}

.gg-5x1000-inline .gg-5x1000-cf {
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Banner sticky
   -------------------------------------------------------------------------- */
.gg-5x1000-banner {
    position:   fixed;
    bottom:     0;
    left:       0;
    right:      0;
    z-index:    9999;
    background: linear-gradient(100deg, var(--gg5-color-primary-dk), var(--gg5-color-primary));
    color:      #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .22);
    border-top-left-radius:  14px;
    border-top-right-radius: 14px;

    /* slide-in dal basso */
    transform:  translateY(100%);
    animation:  gg-banner-in .45s .8s cubic-bezier(.16, 1, .3, 1) forwards;
}

@keyframes gg-banner-in {
    to { transform: translateY(0); }
}

.gg-5x1000-banner.is-hidden {
    display: none;
}

.gg-5x1000-banner__inner {
    display:      flex;
    align-items:  center;
    gap:          .9rem;
    max-width:    1100px;
    margin:       0 auto;
    padding:      0 1.25rem;
    min-height:   var(--gg5-banner-h);
    flex-wrap:    wrap;
}

.gg-5x1000-banner__icon {
    display:     grid;
    place-items: center;
    flex-shrink: 0;
    opacity:     .95;
}

.gg-5x1000-banner__text {
    flex:        1;
    font-size:   .95rem;
    line-height: 1.35;
    min-width:   180px;
}

.gg-5x1000-banner__text .gg-5x1000-cf {
    color:          #fff;
    font-size:      1.05rem;
    letter-spacing: .08em;
}

.gg-5x1000-banner .gg-5x1000-copy-btn {
    background:  rgba(255, 255, 255, .16);
    border:      1px solid rgba(255, 255, 255, .45);
    box-shadow:  none;
    flex-shrink: 0;
}

.gg-5x1000-banner .gg-5x1000-copy-btn:hover {
    background: rgba(255, 255, 255, .3);
}

.gg-5x1000-banner .gg-5x1000-copy-btn.is-copied {
    background:    var(--gg5-color-success);
    border-color: var(--gg5-color-success);
}

.gg-5x1000-banner__close {
    display:       grid;
    place-items:   center;
    background:    transparent;
    border:        none;
    color:         #fff;
    cursor:        pointer;
    padding:       .4rem;
    border-radius: 8px;
    flex-shrink:   0;
    opacity:       .8;
    transition:    opacity .15s, background .15s;
}

.gg-5x1000-banner__close:hover {
    opacity:    1;
    background: rgba(255, 255, 255, .15);
}

/* Compensa l'altezza del banner sul body per non coprire contenuto */
body.has-gg-banner {
    padding-bottom: var(--gg5-banner-h);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .gg-5x1000-box {
        grid-template-columns: 1fr;
        text-align: center;
        gap:        1rem;
        padding:    1.5rem 1.25rem;
    }

    .gg-5x1000-box__icon {
        margin: 0 auto;
    }

    .gg-5x1000-box__cf-wrap {
        justify-content: center;
    }

    .gg-5x1000-box__cf-label {
        text-align: center;
    }
}

@media (max-width: 560px) {
    .gg-5x1000-banner__text {
        font-size: .85rem;
    }

    .gg-5x1000-banner__icon {
        display: none;
    }

    .gg-5x1000-copy-btn__label {
        display: none;
    }

    .gg-5x1000-banner .gg-5x1000-copy-btn {
        padding: .45rem .55rem;
    }
}

/* ==========================================================================
   [gg_5x1000_guida] — come destinare il 5x1000 + facsimile in popup
   ========================================================================== */
.gg-5x1000-guida {
    display:               grid;
    grid-template-columns: repeat(2, 1fr);
    gap:                   1.5rem;
    margin:                1.5rem 0 2rem;
}

.gg-5x1000-guida__caso {
    display:        flex;
    flex-direction: column;
    padding:        1.5rem;
    background:     #fff;
    border:         1px solid #ececec;
    border-top:     4px solid var(--gg5-color-primary);
    border-radius:  14px;
    box-shadow:     0 6px 20px -16px rgba(0, 0, 0, .5);
}

.gg-5x1000-guida__titolo {
    font-size:   1.1rem;
    line-height: 1.35;
    margin:      0 0 .75rem;
}

.gg-5x1000-guida__apri {
    margin-top:     auto;
    display:        flex;
    flex-direction: column;
    gap:            .6rem;
    padding:        .75rem;
    background:     #f7f7f7;
    border:         1px solid #e4e4e4;
    border-radius:  10px;
    cursor:         zoom-in;
    color:          var(--gg5-color-primary);
    font-weight:    700;
    font-size:      .95rem;
    text-align:     center;
    transition:     transform .18s ease, box-shadow .18s ease;
}

.gg-5x1000-guida__apri img {
    width:           100%;
    height:          180px;
    object-fit:      cover;
    object-position: top center;
    border-radius:   6px;
    background:      #fff;
}

.gg-5x1000-guida__apri:hover,
.gg-5x1000-guida__apri:focus-visible {
    transform:  translateY(-2px);
    box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .6);
}

.gg-5x1000-guida__apri:focus-visible {
    outline:        3px solid var(--gg5-color-primary);
    outline-offset: 3px;
}

.gg-5x1000-dialog {
    width:         min(92vw, 900px);
    max-height:    92vh;
    padding:       0;
    border:        0;
    border-radius: 12px;
    background:    #fff;
    overflow:      auto;
}

.gg-5x1000-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
}

.gg-5x1000-dialog img {
    display: block;
    width:   100%;
    height:  auto;
}

.gg-5x1000-dialog__chiudi-wrap {
    position:        sticky;
    top:             0;
    height:          0;
    display:         flex;
    justify-content: flex-end;
    z-index:         1;
}

.gg-5x1000-dialog__chiudi {
    margin:        .6rem;
    width:         40px;
    height:        40px;
    display:       grid;
    place-items:   center;
    padding:       0;
    border:        0;
    border-radius: 50%;
    background:    rgba(0, 0, 0, .75);
    color:         #fff;
    cursor:        pointer;
}

.gg-5x1000-dialog__chiudi svg {
    width:  18px;
    height: 18px;
}

@media (max-width: 720px) {
    .gg-5x1000-guida {
        grid-template-columns: 1fr;
    }
}
