/* ── WP Journal — Notice Popup ──
 * Stili autonomi (nessuna utility del tema): il plugin deve reggersi anche se il tema
 * cambia o se il CSS di Tailwind non viene ricompilato. I font sono quelli caricati dal
 * tema, con i fallback di sistema quando non ci sono.
 */

.tpj-notice-lock {
    overflow: hidden;
}

.tpj-notice[hidden] {
    display: none;
}

.tpj-notice {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.72);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tpj-notice__panel {
    position: relative;
    width: 100%;
    max-width: 34rem;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.25rem 2rem;
    background: #ffffff;
    border-top: 3px solid #a21515;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #171717;
    animation: tpj-notice-in 0.24s ease-out both;
}

@keyframes tpj-notice-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .tpj-notice__panel { animation: none; }
}

.tpj-notice__head {
    margin-bottom: 1.25rem;
}

/* Notizia: si chiude cliccando sullo sfondo, che lo dice col cursore. Il riquadro torna
 * al cursore normale. */
.tpj-notice--news {
    cursor: pointer;
}

.tpj-notice--news .tpj-notice__panel {
    cursor: auto;
}

/* Spazio a destra per la X, così un titolo lungo non ci finisce sotto. */
.tpj-notice--news .tpj-notice__head {
    padding-right: 2rem;
}

.tpj-notice__dismiss {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #171717;
    cursor: pointer;
    transition: color 0.15s ease-in-out;
}

.tpj-notice__dismiss:hover {
    color: #a21515;
}

.tpj-notice__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #a21515;
}

.tpj-notice__title {
    margin: 0;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
    color: #000000;
}

.tpj-notice__body {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #3d3d3d;
}

.tpj-notice__body p {
    margin: 0 0 0.85rem;
}

.tpj-notice__body p:last-child {
    margin-bottom: 0;
}

.tpj-notice__body a {
    color: #a21515;
    text-decoration: underline;
}

.tpj-notice__more {
    margin: 1rem 0 0;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
}

.tpj-notice__more a {
    color: #a21515;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tpj-notice__more a:hover {
    color: #000000;
}

.tpj-notice__check {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 1.75rem 0 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid #e5e5e5;
    font-size: 0.875rem;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out;
}

.tpj-notice__check:hover {
    border-color: #a3a3a3;
}

.tpj-notice__check:has(input:checked) {
    border-color: #000000;
}

.tpj-notice__check input {
    flex: none;
    width: 1.0625rem;
    height: 1.0625rem;
    margin: 0.0625rem 0 0;
    accent-color: #a21515;
    cursor: pointer;
}

.tpj-notice__button {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    border: 0;
    background: #000000;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.tpj-notice__button:hover:not(:disabled) {
    background: #a21515;
}

.tpj-notice__button:disabled {
    background: #e5e5e5;
    color: #616161;
    cursor: not-allowed;
}

.tpj-notice :focus-visible {
    outline: 2px solid #a21515;
    outline-offset: 2px;
}

.tpj-notice__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .tpj-notice {
        padding: 0.75rem;
    }

    .tpj-notice__panel {
        padding: 1.75rem 1.25rem;
    }

    .tpj-notice__title {
        font-size: 1.5rem;
    }
}
