/* ==================== LIGHTBOX ==================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    cursor: default;
}
.lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

/* ==================== AUTORE CARD ==================== */
.annuncio-card__author {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    color: var(--black);
    opacity: 0.7;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== MEDIA CARD (mappa / immagini) ==================== */
.annuncio-card__media-duo {
    display: flex;
    gap: 8px;
}
.annuncio-card__media-duo .annuncio-card__media {
    flex: 1;
    min-width: 0;
}
.annuncio-card__media {
    border: 3px solid var(--black);
    border-radius: 8px;
    overflow: hidden;
    height: 180px;
    background: #f0f0f0;
}

.annuncio-card__media-grid {
    display: grid;
    height: 100%;
}

.annuncio-card__media-item {
    overflow: hidden;
}

.annuncio-card__media-item:not(:last-child) {
    border-right: 2px solid var(--black);
}

.annuncio-card__media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.annuncio-card__media-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    font-weight: 600;
}

/* ==================== GRIGLIA BACHECA ==================== */
.bacheca__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ==================== MODALE — Backdrop ==================== */
.annuncio-modal__backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9998;
}

/* ==================== MODALE — Pannello ==================== */
.annuncio-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-verde);
    border: 3px solid var(--black);
    border-radius: 16px;
    box-shadow: 5px 5px 0 0 var(--black);
    padding: 3rem;
    z-index: 9999;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.annuncio-modal::-webkit-scrollbar { display: none; }

.annuncio-modal__close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 36px; height: 36px;
    background: #fff;
    border: 2px solid var(--black);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    color: var(--black);
    z-index: 10;
}
.annuncio-modal__close:hover { opacity: 0.7; }

/* Tipo badge (nero, testo bianco) */
.annuncio-modal__tipo {
    background: var(--black);
    color: #fff;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 1rem;
}

.annuncio-modal__title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin: 0 0 1rem;
    color: var(--black);
    line-height: 1.2;
    padding-right: 50px;
}

.annuncio-modal__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}


.annuncio-modal__badge {
    padding: 0.5rem 1rem;
    border: 2px solid var(--black);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--black);
}

.annuncio-modal__badge--categoria {
    background: #D4E7FF;
}

/* Info rows */
.annuncio-modal__info {
    margin-bottom: 2rem;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 2;
}

.annuncio-modal__info-row {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.annuncio-modal__info-row svg {
    width: 20px; height: 20px;
    vertical-align: middle;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* Sezioni */
.annuncio-modal__section {
    margin-bottom: 2rem;
}

.annuncio-modal__section-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
}

.annuncio-modal__desc {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.7;
    color: var(--black);
    white-space: pre-line;
}

/* Mappa */
.annuncio-modal__map {
    border: 3px solid var(--black);
    border-radius: 8px;
    overflow: hidden;
    height: 250px;
    background: #f0f0f0;
}
.annuncio-modal__map iframe {
    border: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* Immagini */
.annuncio-modal__images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.annuncio-modal__image {
    border: 3px solid var(--black);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: #f5f5f5;
    display: block;
}

.annuncio-modal__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Box contatto */
.annuncio-modal__contact {
    background: #fff;
    border: 3px solid var(--black);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 5px 5px 0 0 var(--black);
    text-align: center;
}

.annuncio-modal__contact-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin: 0 0 0.75rem;
    color: var(--black);
}

.annuncio-modal__contact-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--black);
    margin: 0 0 0.5rem;
    font-weight: 500;
}

.annuncio-modal__contact-note {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-muted);
    margin: 0 0 1.5rem;
    font-style: italic;
}

.annuncio-modal__contact-btn {
    padding: 1rem 2.5rem;
    background: var(--color-verde);
    border: 3px solid var(--black);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--black);
    box-shadow: 5px 5px 0 0 var(--black);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

@media (hover: hover) {
    .annuncio-modal__contact-btn:hover {
        transform: translate(-2px, -2px);
        box-shadow: 7px 7px 0 0 var(--black);
    }
}

.annuncio-modal__contact--disabled {
    opacity: 0.6;
}

.annuncio-modal__restricted {
    background: #f5f5f5;
    border: 2px solid var(--black);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.annuncio-modal__already-sent {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--color-verde);
    border: 2px solid var(--black);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.annuncio-modal__form {
    text-align: left;
    margin-top: 1rem;
}

.annuncio-modal__form-group {
    margin-bottom: 1rem;
}

.annuncio-modal__form-label {
    display: block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 0.25rem;
    color: var(--black);
}

.annuncio-modal__form-input,
.annuncio-modal__form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 3px solid var(--black);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 15px;
    background: #fff;
    box-sizing: border-box;
}

.annuncio-modal__form-input:focus,
.annuncio-modal__form-textarea:focus {
    outline: none;
    border-color: var(--black);
}

.annuncio-modal__form-textarea {
    resize: vertical;
    min-height: 120px;
}

.annuncio-modal__form-counter {
    text-align: right;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.annuncio-modal__form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.annuncio-modal__form-btn {
    padding: 0.75rem 2rem;
    border: 3px solid var(--black);
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: all 0.2s;
}

.annuncio-modal__form-btn--primary {
    background: var(--color-verde);
    color: var(--black);
    box-shadow: 5px 5px 0 0 var(--black);
}

@media (hover: hover) {
    .annuncio-modal__form-btn--primary:hover {
        transform: translate(-2px, -2px);
        box-shadow: 7px 7px 0 0 var(--black);
    }
}

.annuncio-modal__form-btn--secondary {
    background: #fff;
    color: var(--black);
    box-shadow: 5px 5px 0 0 var(--black);
}

@media (hover: hover) {
    .annuncio-modal__form-btn--secondary:hover {
        transform: translate(-2px, -2px);
        box-shadow: 7px 7px 0 0 var(--black);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .bacheca__grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 1.25rem;
    }

    .annuncio-card {
        box-shadow: 3px 3px 0 0 var(--black);
    }

    .annuncio-card__header {
        font-size: 16px;
        padding: 10px 16px;
    }

    .annuncio-card__body {
        padding: 16px;
    }

    .annuncio-card__media {
        height: 140px;
    }

    .annuncio-modal {
        width: 95%;
        padding: 24px 16px;
        max-height: 85dvh;
    }

    .annuncio-modal__title {
        font-size: 22px;
        padding-right: 40px;
    }

    .annuncio-modal__close {
        top: 12px;
        right: 12px;
    }

    .annuncio-modal__info-row {
        font-size: 14px;
    }

    .annuncio-modal__desc {
        font-size: 14px;
    }

    .annuncio-modal__section-title {
        font-size: 16px;
    }

    .annuncio-modal__badge {
        font-size: 11px;
        padding: 0.35rem 0.75rem;
    }

    .annuncio-modal__contact {
        padding: 20px 16px;
    }

    .annuncio-modal__contact-title {
        font-size: 18px;
    }

    .annuncio-modal__contact-text {
        font-size: 14px;
    }

    .annuncio-modal__contact-btn {
        padding: 0.75rem 1.5rem;
        font-size: 14px;
    }

    .annuncio-modal__form-btn {
        padding: 0.6rem 1.25rem;
        font-size: 13px;
    }

}

.annuncio-modal--page {
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0 0 3rem;
    overflow: visible;
    z-index: auto;
}

.annuncio-card__title a {
    color: inherit;
    text-decoration: none;
}
