/* =================================
   ESTILOS GENERALES
   ================================= */
body {
    padding-top: 75px; /* Compensación para el header fijo */
}
.header-azul-marino {
    background-color: #001f3f;
}

/* =================================
   TARJETAS DE LISTADO (Necrológicas y Obituarios)
   ================================= */
.card-obituario {
    border: 2px solid #d4caca;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.card-obituario .card-title {
    font-family: 'Georgia', serif;
    font-size: 1.5rem;
    color: #555;
}
.card-obituario .col-4 img {
    border-radius: 8px 0 0 8px;
    object-fit: cover;
    height: 100%;
}
.card-obituario .col-8 {
    padding: 1.5rem;
}
.card-obituario .btn-primary {
    background-color: #a89999;
    border-color: #a89999;
}
.card-obituario .btn-primary:hover {
    background-color: #8c7d7d;
    border-color: #8c7d7d;
}

/* =================================
   PÁGINAS DE DETALLE (Necrológicas y Obituarios)
   ================================= */
.nombre-fallecido-detalle {
    font-family: "Garamond", "Times New Roman", serif;
}
.detalles-servicio-lista .list-group-item {
    border: none;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

#foto-difunto {
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 65%;
    max-width: 450px;
    height: auto;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
}

    /* Estilo para la galería con aspect-ratio definido */
    #galeria-obituario {
    max-width: 450px;
    margin: 0 auto;
}

    #galeria-obituario .carousel-item {
    /* Forzamos al contenedor de la diapositiva a tener la proporción de nuestras imágenes */
    aspect-ratio: 450 / 650; 
}

    #galeria-obituario .carousel-item img {
    width: 100%;
    height: 100%; /* Forzamos a la imagen a llenar el 100% de la altura de su contenedor */
    object-fit: cover; /* Ahora sí, esta propiedad funcionará */
}

/* =================================
   PLANTILLAS Y SELECTOR
   ================================= */
.plantilla-0001 {
    background-image: url('../img/plantilla-0001.jpg');
    background-size: cover;
    background-position: center center;
    padding: 3rem;
    border-radius: 0.5rem;
}
.selector-plantilla {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.opcion-plantilla label {
    display: block;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 5px;
    padding: 5px;
    transition: border-color 0.2s ease-in-out;
    position: relative;
}
.opcion-plantilla input[type="radio"] {
    display: none;
}
.opcion-plantilla img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
}
.opcion-plantilla input[type="radio"]:checked + label {
    border-color: #0d6efd;
}
.opcion-plantilla input[type="radio"]:checked + label::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #0d6efd;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid white;
}

/* =================================
   REGLAS PARA MÓVILES (PANTALLAS PEQUEÑAS)
   ================================= */
@media (max-width: 767px) {

    /* Ajustamos el padding del body para un header más pequeño */
    body {
        padding-top: 60px; 
    }

    /* Reducimos el tamaño de la foto en la página de detalle */
    .foto-detalle-final {
        width: 90% !important; /* Hacemos la foto más ancha en móviles */
    }

    /* Reducimos el tamaño de los títulos principales */
    .display-4 {
        font-size: 2.5rem;
    }

    /* Ajustamos el padding de las plantillas */
    .plantilla-0001 {
        padding: 1.5rem;
    }

    /* Hacemos que la galería de obituarios sea más pequeña en móviles */
    #galeria-obituario .carousel-item img {
        height: 400px;
    }
}