/* ==========================================================================
   San Isidro Labrador Mty — Reglas Anti-Descuadre, Medidas Exactas y Responsive
   Protege index.html contra imágenes de distintas medidas y textos muy largos
   en todos los dispositivos (Desktop, Laptop, Tablet y Móvil).
   ========================================================================== */

/* 1. Protección global contra desbordamiento de texto largo */
.banner-section .content-box h2,
.banner-section .content-box span,
.banner-section .content-box p,
.banner-thumbs-carousel .single-item .text .top-text,
.banner-thumbs-carousel .single-item .text h3,
.about-section .sec-title h2,
.about-section .sec-title .top-text,
.about-section .content_block_1 .text p,
.news-block-one .content-box h3,
.news-block-one .content-box p,
.header-top .update-news p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Cintillo superior: evita que un texto largo rompa la barra superior */
.header-top .update-news p {
    max-width: 480px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2. Banner Principal: Medida exacta base 1920 x 746 px */
.banner-section .banner-carousel .swiper-slide .image-layer {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

.banner-section .banner-carousel .content-box h2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-section .banner-carousel .content-box p {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 3. Mini-Banners Inferiores: Medida exacta 257 x 253 px */
.banner-section .banner-thumbs-carousel .single-item {
    height: 253px;
    min-height: 253px;
    max-height: 253px;
    padding: 33px 205px 32px 150px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.banner-section .banner-thumbs-carousel .single-item .image-box {
    width: 195px;
    height: 253px;
    overflow: hidden;
    top: 0;
    right: 0;
    margin: 0;
}

.banner-section .banner-thumbs-carousel .single-item .image-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
}

/* Cuando se quita la imagen desde la app, no se descuadra la tarjeta */
.banner-section .banner-thumbs-carousel .single-item.no-thumb-image {
    padding-right: 35px;
}

.banner-section .banner-thumbs-carousel .single-item.no-thumb-image .image-box {
    display: none !important;
}

.banner-section .banner-thumbs-carousel .single-item .text .top-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-section .banner-thumbs-carousel .single-item .text h3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
    max-height: 108px;
}

/* 4. Sección Acerca de Nosotros: Círculo principal 470x470 px y secundario 170x170 px */
.image_block_1 .image-box .image-1 {
    width: 470px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
}

.image_block_1 .image-box .image-1 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 50%;
    display: block;
}

.image_block_1 .image-box .image-2 {
    width: 170px !important;
    height: 170px !important;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
}

.image_block_1 .image-box .image-2 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: 50%;
    display: block;
}

.image_block_1 .image-box .image-2.is-hidden {
    display: none !important;
}

/* 5. Sección de Publicaciones / Noticias (Tarjeta exacta 370 x 500 px) */
.dynamic-publications-section {
    position: relative;
    padding: 90px 0 70px;
    background-color: #faf8f7;
}

.dynamic-publications-section .news-block {
    margin-bottom: 30px;
    display: flex;
}

.dynamic-publications-section .news-block-one {
    width: 100%;
    display: flex;
}

.dynamic-publications-section .news-block-one .inner-box {
    width: 100%;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    background: #232323;
}

.dynamic-publications-section .news-block-one .inner-box .image-box {
    width: 100%;
    aspect-ratio: 370 / 500;
    max-height: 500px;
    overflow: hidden;
    border-radius: 15px;
    background-color: #232323;
    margin: 0;
}

.dynamic-publications-section .news-block-one .inner-box .image-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
}

/* Títulos y resúmenes en tarjetas de publicación con altura controlada */
.dynamic-publications-section .news-block-one .inner-box .content-box .text h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 64px;
    max-height: 64px;
    line-height: 32px;
    font-size: 21px;
    margin-bottom: 0;
}

.dynamic-publications-section .news-block-one .inner-box .content-box .text p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
    max-height: 68px;
    line-height: 24px;
}

/* 6. Modal de Lectura Completa (para publicaciones con texto muy largo) */
.pub-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 18, 24, 0.78);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.pub-modal-backdrop.open {
    display: flex;
}

.pub-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    position: relative;
}

.pub-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    border: none;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s ease;
}

.pub-modal-close:hover {
    background: #cc0000;
}

.pub-modal-body {
    overflow-y: auto;
    padding: 0;
}

/* Imagen detalle de publicación: proporción exacta 770 x 500 px */
.pub-modal-image-wrap {
    width: 100%;
    aspect-ratio: 770 / 500;
    max-height: 420px;
    overflow: hidden;
    background: #1f1f1f;
}

.pub-modal-image-wrap.is-hidden {
    display: none;
}

.pub-modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.pub-modal-content {
    padding: 28px 32px 34px;
}

.pub-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #777;
}

.pub-modal-category {
    background: #f4f1f0;
    color: #232323;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: 700;
}

.pub-modal-title {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 700;
    color: #232323;
    margin-bottom: 16px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.pub-modal-text {
    font-size: 16px;
    line-height: 1.75;
    color: #4a4a4a;
    white-space: pre-line;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ==========================================================================
   7. Adaptación Responsive por Dispositivo (Sizes)
   ========================================================================== */

/* Laptops y Tablets Horizontales (max 1199px) */
@media only screen and (max-width: 1199px) {
    .banner-section .banner-thumbs-carousel .single-item {
        padding: 28px 175px 28px 135px;
    }
    .banner-section .banner-thumbs-carousel .single-item .image-box {
        width: 165px;
    }
    .header-top .update-news p {
        max-width: 340px;
    }
}

/* Tablets Verticales (max 991px) */
@media only screen and (max-width: 991px) {
    .header-top .update-news p {
        max-width: 100%;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .image_block_1 .image-box .image-1 {
        width: 380px;
    }
    .image_block_1 .image-box .image-2 {
        width: 140px !important;
        height: 140px !important;
    }
    .dynamic-publications-section {
        padding: 70px 0 50px;
    }
}

/* Dispositivos Móviles Estándar (max 767px) */
@media only screen and (max-width: 767px) {
    .banner-section .banner-thumbs-carousel .single-item {
        height: auto;
        min-height: 220px;
        max-height: none;
        padding: 25px 140px 25px 25px;
    }
    .banner-section .banner-thumbs-carousel .single-item .icon-box {
        display: none;
    }
    .banner-section .banner-thumbs-carousel .single-item .image-box {
        width: 130px;
        height: 100%;
    }
    .image_block_1 .image-box {
        padding-right: 0 !important;
        margin-right: 0 !important;
    }
    .image_block_1 .image-box .image-1 {
        width: 300px;
    }
    .image_block_1 .image-box .image-2 {
        width: 110px !important;
        height: 110px !important;
    }
    .pub-modal-content {
        padding: 20px 18px 26px;
    }
    .pub-modal-title {
        font-size: 22px;
    }
}

/* Dispositivos Móviles Pequeños (max 480px) */
@media only screen and (max-width: 480px) {
    .banner-section .banner-thumbs-carousel .single-item {
        padding: 22px 115px 22px 20px;
        min-height: 195px;
    }
    .banner-section .banner-thumbs-carousel .single-item .image-box {
        width: 105px;
    }
    .banner-section .banner-thumbs-carousel .single-item .text h3 {
        font-size: 20px;
        line-height: 26px;
    }
    .image_block_1 .image-box .image-1 {
        width: 250px;
    }
    .image_block_1 .image-box .image-2 {
        width: 95px !important;
        height: 95px !important;
    }
}

/* ==========================================================================
   8. Módulo Reproductor de Oraciones y Audios Parroquiales (#audios-section)
   ========================================================================== */
.audio-prayers-section {
    position: relative;
    padding: 85px 0 75px;
    background: linear-gradient(180deg, #ffffff 0%, #f7f4f1 100%);
    border-top: 1px solid #ece7e2;
}

.parish-audio-master {
    background: #232323;
    color: #ffffff;
    border-radius: 18px;
    padding: 24px 28px;
    margin-bottom: 30px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.audio-master-info {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 240px;
    flex: 1 1 280px;
}

.audio-master-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 14px;
    background: #e53c38;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(229, 60, 56, 0.35);
}

.audio-master-icon.is-playing {
    animation: pulseAudioIcon 1.6s infinite ease-in-out;
}

@keyframes pulseAudioIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

.audio-master-meta {
    overflow: hidden;
}

.audio-master-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #ffb8b5;
    margin-bottom: 4px;
}

.audio-master-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-master-controls-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 2 1 460px;
    flex-wrap: wrap;
}

.audio-transport-btns {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-ctrl-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.audio-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.audio-ctrl-btn.audio-play-main {
    width: 52px;
    height: 52px;
    background: #e53c38;
    border-color: #e53c38;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(229, 60, 56, 0.4);
}

.audio-ctrl-btn.audio-play-main:hover {
    background: #ff4c47;
}

.audio-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 200px;
}

.audio-time {
    font-size: 13px;
    font-weight: 600;
    color: #d2d2d2;
    min-width: 38px;
    text-align: center;
}

.audio-seek-bar {
    flex: 1;
    height: 6px;
    border-radius: 6px;
    accent-color: #e53c38;
    cursor: pointer;
}

.audio-extra-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.audio-autoplay-toggle {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #cccccc;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-autoplay-toggle.active {
    background: rgba(229, 60, 56, 0.22);
    border-color: #e53c38;
    color: #ffffff;
}

.audio-download-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.audio-download-btn:hover {
    background: #e53c38;
}

.audio-category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.audio-filter-pill {
    background: #ffffff;
    border: 1px solid #e0dad5;
    color: #4a4a4a;
    padding: 8px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audio-filter-pill:hover,
.audio-filter-pill.active {
    background: #e53c38;
    border-color: #e53c38;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(229, 60, 56, 0.25);
}

.audio-card-col {
    margin-bottom: 18px;
}

.audio-track-card {
    background: #ffffff;
    border: 1px solid #ebe5e0;
    border-radius: 14px;
    padding: 16px 18px;
    height: 88px;
    min-height: 88px;
    max-height: 88px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.audio-track-card:hover {
    transform: translateY(-2px);
    border-color: #e53c38;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.audio-track-card.active {
    border-color: #e53c38;
    background: #fff9f8;
    box-shadow: 0 8px 22px rgba(229, 60, 56, 0.14);
}

.audio-track-num {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    background: #f4efec;
    color: #232323;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-track-card.active .audio-track-num {
    background: #e53c38;
    color: #ffffff;
}

.audio-track-body {
    flex: 1;
    overflow: hidden;
}

.audio-track-cat {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #8a817c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-track-name {
    font-size: 16px;
    font-weight: 700;
    color: #232323;
    margin: 2px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-track-play {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    border: none;
    background: #f4efec;
    color: #232323;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
}

.audio-track-card.active .audio-track-play,
.audio-track-card:hover .audio-track-play {
    background: #e53c38;
    color: #ffffff;
}

@media only screen and (max-width: 767px) {
    .parish-audio-master {
        padding: 18px 16px;
    }
    .audio-master-title {
        font-size: 18px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .audio-master-controls-wrap {
        width: 100%;
        justify-content: space-between;
    }
    .audio-progress-container {
        width: 100%;
        flex: 1 1 100%;
        order: 3;
    }
}

/* ==========================================================================
   9. Actividades / Eventos en activities.html (Medida exacta 770 x 500 px)
   ========================================================================== */
#activities-list-container .news-block-two .inner-box .image-box {
    width: 100%;
    max-width: 770px;
    aspect-ratio: 770 / 500;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px;
    background: #232323;
}

#activities-list-container .news-block-two .inner-box .image-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block;
}

#activities-list-container .news-block-two.no-activity-image .inner-box .image-box {
    display: none !important;
}

#activities-list-container .news-block-two .inner-box .content-box .text h3,
#activities-list-container .news-block-two .inner-box .content-box .text p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}
