/* Popup "Condividi" (partials/gs-share.php + js/gs-share.js + plg_ajax_gsshare) */

.gs-share-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.5rem 1rem;
    color: #0345bf;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    background: transparent;
    border: 1px solid #0345bf;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gs-share-trigger:hover,
.gs-share-trigger:focus {
    background: rgba(3, 69, 191, 0.08);
    transform: translateY(-1px);
}

.gs-share-trigger svg {
    flex: none;
}

html.gs-share-open {
    overflow: hidden;
}

.gs-share {
    --gs-share-ink: #171513;
    --gs-share-muted: #5a554e;
    --gs-share-line: rgba(23, 21, 19, 0.16);
    width: min(440px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    color: var(--gs-share-ink);
    font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
    text-align: left;
    background: #fbf9f6;
    border: 1px solid var(--gs-share-line);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(23, 21, 19, 0.3);
    overflow: auto;
}

.gs-share,
.gs-share *,
.gs-share *::before,
.gs-share *::after {
    box-sizing: border-box;
}

.gs-share[open] {
    animation: gsShareIn 0.25s ease both;
}

.gs-share::backdrop {
    background: rgba(23, 21, 19, 0.55);
    backdrop-filter: blur(2px);
}

@keyframes gsShareIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gs-share__form {
    position: relative;
    margin: 0;
    padding: 1.6rem 1.5rem 1.4rem;
}

.gs-share__close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--gs-share-muted);
    font-size: 1.6rem;
    line-height: 1;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.gs-share__close:hover,
.gs-share__close:focus-visible {
    color: var(--gs-share-ink);
    background: rgba(23, 21, 19, 0.07);
}

.gs-share__title {
    margin: 0 2rem 0.4rem 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: normal;
    text-transform: none;
    color: var(--gs-share-ink);
}

.gs-share__intro,
.gs-share__note {
    margin: 0 0 1.1rem;
    color: var(--gs-share-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.gs-share__note {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
}

.gs-share__note a {
    color: inherit;
    text-decoration: underline;
}

.gs-share__label {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.gs-share__optional {
    color: var(--gs-share-muted);
    font-weight: 400;
}

.gs-share__input {
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 0 0 1rem;
    padding: 0.6rem 0.8rem;
    color: var(--gs-share-ink);
    font: inherit;
    font-size: 1rem;
    background: #fff;
    border: 1px solid rgba(23, 21, 19, 0.28);
    border-radius: 10px;
}

.gs-share__input:focus {
    outline: none;
    border-color: #0345bf;
    box-shadow: 0 0 0 3px rgba(3, 69, 191, 0.18);
}

.gs-share__hp {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.gs-share__status {
    min-height: 1.4em;
    margin: 0.6rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.gs-share__status.is-error {
    color: #b42318;
}

.gs-share__status.is-busy {
    color: var(--gs-share-muted);
}

.gs-share__done {
    padding: 0.5rem 0 0.25rem;
    text-align: center;
}

.gs-share__done-title {
    margin: 0 0 0.3rem;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
}

.gs-share__done-text {
    margin: 0;
    color: var(--gs-share-muted);
}

.gs-share__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.gs-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1.15rem;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    background: #0345bf;
    border: 1px solid #0345bf;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.gs-share__btn:hover,
.gs-share__btn:focus {
    color: #fff;
    background: #044cd0;
}

.gs-share__btn--ghost,
.gs-share__btn--ghost:hover,
.gs-share__btn--ghost:focus {
    color: var(--gs-share-ink);
    font-weight: 600;
    background: transparent;
    border-color: rgba(23, 21, 19, 0.35);
}

.gs-share__btn--ghost:hover,
.gs-share__btn--ghost:focus {
    background: rgba(23, 21, 19, 0.05);
}

.gs-share__btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.gs-share [hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .gs-share__actions {
        flex-direction: column-reverse;
    }

    .gs-share__btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gs-share[open],
    .gs-share-trigger {
        animation: none;
        transition: none;
        transform: none !important;
    }
}

body.dark-mode .gs-share-trigger {
    color: #b9cdff;
    border-color: #8fb0ff;
}

body.dark-mode .gs-share-trigger:hover,
body.dark-mode .gs-share-trigger:focus {
    background: rgba(143, 176, 255, 0.12);
}

body.dark-mode .gs-share {
    --gs-share-ink: #f2efe9;
    --gs-share-muted: #b7b0a6;
    --gs-share-line: rgba(242, 239, 233, 0.16);
    background: #1f1c18;
}

body.dark-mode .gs-share__input {
    color: #f2efe9;
    background: #181612;
    border-color: rgba(242, 239, 233, 0.3);
}

body.dark-mode .gs-share__close:hover,
body.dark-mode .gs-share__close:focus-visible {
    background: rgba(242, 239, 233, 0.08);
}

body.dark-mode .gs-share__btn--ghost {
    border-color: rgba(242, 239, 233, 0.35);
}

body.dark-mode .gs-share__btn--ghost:hover,
body.dark-mode .gs-share__btn--ghost:focus {
    background: rgba(242, 239, 233, 0.06);
}

body.dark-mode .gs-share__status.is-error {
    color: #ff8a80;
}

/* Posizione nella Community K-Drama (com_kdrama/tmpl/community/default.php) */
.kdrama-community__share {
    margin-top: 0.75rem;
}

.kdrama-community--guest .kdrama-community__share {
    text-align: center;
}

/* Mercatino (html/com_content/article/mercatino.php): stesse dimensioni di COMPRA/VENDI */
.btn.gs-share-mk {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 10px;
    padding: 14px 28px;
    font-size: 20px;
    vertical-align: middle;
    border-width: 2px;
    border-radius: 8px;
}

.btn.gs-share-mk svg {
    width: 22px;
    height: 22px;
    flex: none;
}

/* Downloads (appsdownloads.php, convertersdownloads.php): sotto il titolo della pagina e tra Prec/Avanti */
.gs-apps__share--top {
    margin: 0 0 1.25rem;
    text-align: center;
}

/* .pagenavigation .pagination e' display:block con Prec/Avanti in float: blocco centrato nello spazio tra i due */
.gs-apps__share--nav {
    display: block;
    margin: 0;
    padding: 0 0.5rem;
    text-align: center;
}

.gs-apps__share--nav .gs-share-trigger {
    min-height: 31px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
}

.gs-apps__share--nav .gs-share-trigger svg {
    width: 16px;
    height: 16px;
}

/* Hub informativi (html/com_content/article/gshub.php): sotto il titolo e in fondo alla pagina */
.gs-share-row {
    margin: 0 0 1.25rem;
    text-align: center;
}

.gs-share-row--bottom {
    margin: 2rem 0 0.5rem;
}

/* AI pratica (aipratica.php): sotto il link "Scarica le app ufficiali" nel footer della guida */
.gs-share-row--after {
    margin: 0.75rem 0 0;
    text-align: center;
}

/* Archivio UAP (uap.php, solo /it/uap): nel riquadro sotto la descrizione e in fondo ai contenuti */
.gs-uap__share {
    margin: 1.1rem 0 0;
}

.gs-uap__share-bottom {
    margin: 0.5rem 0 2rem;
}

.gs-uap .gs-share-trigger {
    font-family: var(--gs-uap-ui, "DM Sans", "Segoe UI", sans-serif);
}

/* Giardino dei Ricordi (com_giardino/tmpl/giardino/default.php): sotto l'intestazione */
.gdr__share {
    margin-top: 0.9rem;
}
