/* Encabezado */
.cg-intro {
    display: grid;
    grid-template-columns: 5fr 6fr;
    gap: 50px;
    align-items: center;
}

.cg-intro .sec-title {
    margin-bottom: 22px;
}

.cg-intro .lead {
    font-size: 18px;
    line-height: 31px;
    margin: 0;
}

.cg-lang {
    display: inline-flex;
    margin-top: 26px;
    border: 1px solid #8a1e41;
    border-radius: 20px;
    overflow: hidden;
}

.cg-lang a {
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #8a1e41;
}

.cg-lang a.active {
    background: #8a1e41;
    color: #fff;
}

/* 4 fotos iguales en cuadrícula de 2 x 2 */
.cg-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cg-mosaic a {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
}

.cg-mosaic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.cg-mosaic a:hover img {
    transform: scale(1.05);
}

/* Filtros */
.cg-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.cg-filters button {
    padding: 9px 20px;
    border: 1px solid #e0e0ea;
    border-radius: 30px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #8a1e41;
    cursor: pointer;
    transition: all 300ms ease;
}

.cg-filters button span {
    margin-left: 4px;
    font-weight: 400;
    color: #bc955c;
}

.cg-filters button:hover {
    border-color: #bc955c;
}

.cg-filters button.active {
    background: #8a1e41;
    border-color: #8a1e41;
    color: #fff;
}

.cg-filters button.active span {
    color: #ddc9a3;
}

/* Tarjetas de atractivos */
.cg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.cg-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    border: 1px solid #e0e0ea;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    transition: transform 350ms ease, box-shadow 350ms ease;
}

.cg-card[hidden] {
    display: none;
}

.cg-card:hover,
.cg-card:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgb(0 0 0 / 10%);
}

.cg-card .card-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee;
}

.cg-card .card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.cg-card:hover .card-photo img {
    transform: scale(1.06);
}

.cg-card .card-cat {
    position: absolute;
    left: 14px;
    top: 14px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgb(255 255 255 / 92%);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    color: #8a1e41;
}

.cg-card .card-count {
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgb(0 0 0 / 55%);
    font-size: 12px;
    color: #fff;
}

.cg-card .card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 20px 22px 22px;
}

.cg-card h4 {
    font-size: 19px;
    line-height: 26px;
    font-weight: 700;
    color: #8a1e41;
    margin: 0 0 8px;
}

.cg-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
    line-height: 24px;
    margin: 0 0 14px;
}

.cg-card .card-more {
    margin-top: auto;
    font-size: 14px;
    font-weight: 700;
    color: #bc955c;
}

.cg-card .card-more i {
    margin-left: 4px;
    transition: transform 300ms ease;
}

.cg-card:hover .card-more i {
    transform: translateX(4px);
}

/* Ventana de detalle */
.cg-modal {
    position: fixed;
    inset: 0;
    margin: auto; /* el tema pone margin: 0 a todo y eso descentra el <dialog> */
    height: fit-content;
    width: min(920px, calc(100% - 32px));
    max-height: calc(100% - 40px);
    padding: 0;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgb(0 0 0 / 30%);
}

.cg-modal::backdrop {
    background: rgb(30 10 18 / 70%);
}

.cg-modal .modal-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: calc(100vh - 40px);
}

.cg-modal .modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #f4f4f4;
    overflow-y: auto;
}

.cg-modal .modal-gallery a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.cg-modal .modal-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.cg-modal .modal-text {
    padding: 36px 34px;
    overflow-y: auto;
}

.cg-modal .modal-cat {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #bc955c;
}

.cg-modal h3 {
    font-size: 26px;
    line-height: 34px;
    font-weight: 700;
    color: #8a1e41;
    margin-bottom: 16px;
}

.cg-modal .modal-text p {
    font-size: 16px;
    line-height: 28px;
    margin-bottom: 14px;
}

.cg-modal .modal-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
    font-size: 18px;
    color: #8a1e41;
    cursor: pointer;
    z-index: 2;
}

/* Hospedaje y restaurantes */
.cg-places {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.cg-places li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e0e0ea;
    border-radius: 8px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

.cg-places li i {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    line-height: 34px;
    border-radius: 50%;
    background: rgb(188 149 92 / 15%);
    text-align: center;
    font-size: 15px;
    color: #bc955c;
}

.cg-places-block + .cg-places-block {
    margin-top: 60px;
}

.cg-places-block .sec-title {
    margin-bottom: 26px;
}

/* San Carlos */
.cg-sancarlos {
    margin-bottom: 70px;
    display: grid;
    grid-template-columns: 5fr 7fr;
    align-items: center;
    gap: 40px;
    padding: 20px 40px 20px 20px;
    border: 1px solid #e0e0ea;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgb(0 0 0 / 5%);
}

.cg-sancarlos .sc-image {
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.cg-sancarlos img {
    width: 100%;
    transition: transform 500ms ease;
}

.cg-sancarlos .sc-image:hover img {
    transform: scale(1.04);
}

.cg-sancarlos h6 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #bc955c;
    margin-bottom: 8px;
}

.cg-sancarlos h6 i {
    margin-right: 6px;
}

.cg-sancarlos h2 {
    font-size: 34px;
    line-height: 42px;
    color: #8a1e41;
    margin-bottom: 12px;
}

.cg-sancarlos p {
    font-size: 17px;
    margin-bottom: 24px;
}

@media (max-width: 991px) {
    .cg-intro {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .cg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .cg-places {
        grid-template-columns: repeat(3, 1fr);
    }

    .cg-sancarlos {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px 20px 28px;
    }
}

@media (max-width: 767px) {
    .cg-mosaic {
        gap: 8px;
    }

    .cg-grid {
        grid-template-columns: 1fr;
    }

    .cg-places {
        grid-template-columns: repeat(2, 1fr);
    }

    .cg-places li {
        padding: 10px 12px;
        font-size: 14px;
    }

    .cg-modal .modal-inner {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .cg-modal .modal-gallery {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
    }

    .cg-modal .modal-gallery a {
        flex: 0 0 80%;
    }

    .cg-modal .modal-text {
        padding: 24px 22px 28px;
        overflow: visible;
    }

    .cg-sancarlos {
        padding: 16px 16px 24px;
        margin-bottom: 44px;
    }

    .cg-sancarlos h2 {
        font-size: 28px;
        line-height: 36px;
    }
}

/* Celular: tarjeta horizontal compacta (foto a la izquierda) */
@media (max-width: 575px) {
    .cg-grid {
        gap: 12px;
    }

    .cg-card {
        flex-direction: row;
        align-items: stretch;
    }

    .cg-card:hover {
        transform: none;
    }

    .cg-card .card-photo {
        flex: 0 0 110px;
        aspect-ratio: auto;
        min-height: 120px;
    }

    .cg-card .card-cat,
    .cg-card .card-count {
        display: none;
    }

    .cg-card .card-body {
        padding: 12px 14px;
    }

    .cg-card h4 {
        font-size: 16px;
        line-height: 22px;
        margin-bottom: 4px;
    }

    .cg-card p {
        -webkit-line-clamp: 2;
        font-size: 14px;
        line-height: 20px;
        margin-bottom: 6px;
    }

    .cg-card .card-more {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .cg-places {
        grid-template-columns: 1fr;
    }
}
