/* ============ ERMITAS ============ */

.ermitas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1160px;
    margin: 2.5rem auto 0;
    padding: 0 5vw;
}

.ermita-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--crema);
    border: 1px solid var(--linea);
    border-radius: 20px;
    box-shadow: 0 8px 24px -14px rgba(34, 31, 24, 0.2);
    transition:
        transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1),
        box-shadow 0.45s ease,
        border-color 0.35s ease;
}
.ermita-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 26px 48px -24px rgba(34, 31, 24, 0.32);
    border-color: var(--oro);
}

/* ----- Foto ----- */
.ermita-foto {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(150deg, var(--verde-claro), var(--verde-oscuro) 80%);
}
.ermita-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ermita-card:hover .ermita-foto img {
    transform: scale(1.06);
}
.ermita-foto::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(20, 14, 10, 0.35));
    pointer-events: none;
}
.ermita-foto-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, var(--verde-claro), var(--verde-oscuro) 75%);
}
.ermita-foto-fallback svg {
    width: 58px;
    height: 58px;
    stroke: var(--oro-suave);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.9;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

/* ----- Cuerpo ----- */
.ermita-cuerpo {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem 1.5rem 1.6rem;
}
.ermita-cuerpo h3 {
    margin: 0 0 0.3rem;
    color: var(--verde-oscuro);
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.2;
}
.ermita-location,
.ermita-contact {
    color: var(--tinta-sub);
    font-size: 0.9rem;
}
.ermita-location {
    margin-bottom: 0.35rem;
}
.ermita-map {
    color: var(--bronce);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    width: fit-content;
}
.ermita-map:hover {
    text-decoration: underline;
}
.ermita-contact {
    margin-top: 0.7rem;
    line-height: 1.6;
}
.ermita-contact a {
    color: var(--bronce);
    font-weight: 600;
    text-decoration: none;
}
.ermita-contact a:hover {
    text-decoration: underline;
}

/* ----- Horarios ----- */
.ermita-schedules {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.15rem;
}
.ermita-horario {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.85rem;
    border-left: 3px solid var(--oro);
    background: var(--oro-suave);
    border-radius: 0 10px 10px 0;
}
.ermita-horario strong {
    color: var(--verde-oscuro);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}
.ermita-horario span {
    color: var(--tinta-sub);
    font-size: 0.88rem;
    line-height: 1.5;
}
.ermita-empty {
    color: var(--tinta-sub);
    font-size: 0.9rem;
}

/* ----- Botón ver más ----- */
.ermitas-ver-mas {
    display: flex;
    justify-content: center;
    margin-top: 2.4rem;
}
.ermitas-ver-mas-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2.2rem;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--verde-oscuro);
    background: var(--crema);
    border: 1px solid var(--oro);
    box-shadow: 0 12px 24px -14px rgba(34, 31, 24, 0.3);
    text-decoration: none;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease,
        color 0.3s ease;
}
.ermitas-ver-mas-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 34px -16px rgba(34, 31, 24, 0.4);
    background: var(--verde-oscuro);
    color: var(--crema);
}

/* ----- Mapa ----- */
.ermitas-mapa-wrap {
    max-width: 1160px;
    margin: 0 auto 2.6rem;
}
.ermitas-mapa-titulo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--verde-oscuro);
    margin: 0 0 1rem;
}
.ermitas-mapa-titulo svg {
    width: 24px;
    height: 24px;
    stroke: var(--bronce);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ermitas-mapa {
    width: 100%;
    height: 420px;
    border-radius: 20px;
    border: 1px solid var(--linea);
    box-shadow: 0 16px 38px -22px rgba(34, 31, 24, 0.35);
    z-index: 0;
}
.ermitas-mapa-leyenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.2rem;
    margin: 0.9rem 0 0;
    font-size: 0.82rem;
    color: var(--tinta-sub);
}
.leyenda-punto {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}
.leyenda-parroquia {
    background: var(--rojo, #b3222b);
}
.leyenda-ermita {
    background: var(--verde, #1d6f4c);
}

/* Marcadores Leaflet */
.marcador-parroquia svg,
.marcador-ermita svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}
.marcador-parroquia svg path:first-child {
    fill: var(--rojo, #b3222b);
    stroke: #fff;
    stroke-width: 2;
}
.marcador-ermita svg path:first-child {
    fill: var(--verde, #1d6f4c);
    stroke: #fff;
    stroke-width: 2;
}
.marcador-parroquia svg path:nth-child(2),
.marcador-ermita svg path:nth-child(2) {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
}

/* ----- Página pública ----- */
.sub-body .ermitas-grid {
    margin-top: 0;
    padding: 0;
    max-width: 1160px;
}

/* ----- Móvil ----- */
@media (max-width: 640px) {
    .ermitas-grid {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }
    .ermita-foto {
        aspect-ratio: 16 / 9;
    }
}
