/**
 * Pubblicità interna + banner cookie GDPR (z-index sotto le modali di personalizzazione)
 */

.ia-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ia-cookie-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(33, 37, 41, 0.97);
    color: #f8f9fa;
    padding:1.25rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.ia-cookie-bar-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.ia-cookie-text {
    flex: 1 1 280px;
}

.ia-cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ia-btn {
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    font-weight: 600;
}

.ia-btn-primary {
    background: #0d6efd;
    color: #fff;
}

.ia-btn-primary:hover,
.ia-btn-primary:focus {
    background: #0b5ed7;
}

.ia-btn-secondary {
    background: #6c757d;
    color: #fff;
}

.ia-btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(0, 0, 0, 1) !important;
}

.ia-btn-outline:hover,
.ia-btn-outline:focus {
    background: rgba(255, 255, 255, 0.1);
}

.ia-btn-reject:hover,
.ia-btn-reject:focus {
    background: rgba(220, 53, 69, 0.2) !important;
}

.ia-link {
    color: #86b7fe;
    text-decoration: underline;
}

.ia-link:hover,
.ia-link:focus {
    color: #b6d4fe;
}

/* Modale preferenze: sopra il cookie bar */
.ia-consent-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10600;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ia-consent-modal-overlay.ia-open {
    display: flex;
}

.ia-consent-modal {
    background: #fff;
    color: #212529;
    border-radius: 0.5rem;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.ia-consent-modal h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem;
}

.ia-switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.ia-switch-row:last-child {
    border-bottom: none;
}

.ia-switch-label {
    flex: 1;
    padding-right: 1rem;
}

.ia-switch-label small {
    display: block;
    color: #6c757d;
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Popup pubblicitario (sotto modale consenso se aperta) */
.ia-ad-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ia-ad-overlay.ia-open {
    display: flex;
}

.ia-ad-dialog {
    position: relative;
    background: #fff;
    border-radius: 0.5rem;
    max-width: min(560px, 100%);
    width: 100%;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.ia-ad-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.ia-ad-close:hover,
.ia-ad-close:focus {
    background: rgba(0, 0, 0, 0.75);
}

.ia-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ia-ad-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e9ecef;
    overflow: hidden;
}

.ia-ad-img {
    width: 100%;
    height: 100%;
    display: block;
    object-position: center;
}

.ia-ad-body {
    padding: 1rem 1.25rem;
}

.ia-ad-title {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
}

.ia-ad-desc {
    font-size: 0.875rem;
    color: #495057;
    margin: 0;
}

/* Banner in pagina */
.ia-campaign {
    display: block;
    width: 100%;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f8f9fa;
}

.ia-campaign-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ia-campaign-img {
    width: 100%;
    height: auto;
    max-height: 320px;
    display: block;
    object-position: center;
}

.ia-campaign-desc {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #495057;
    margin: 0;
}

.bloglist-banner.ia-filled {
    min-height: 0;
}
