/* Basic styles for the calendar */
#calendar {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    min-height: 400px;
}

.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.4); 
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    position: relative;
}

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal .close:hover,
.modal .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
}

/* LOGIN BACKGROUND */
#login-view {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    background:
        linear-gradient(rgba(0,0,0,0.35), rgba(0,0,0,0.35)),
        url("images/06-Home/06-LoginBackground.jpg") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.login-container {
    text-align: center;
    padding: 50px;
    border-radius: 20px;
    background-color: rgba(255,255,255,0.10);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.login-container h1,
.login-container h2,
.login-container p {
    color: #fff !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}

.google-login-btn,
.firebase-login-btn {
    background-color: rgba(255,255,255,0.92);
    color: #333;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.google-login-btn:hover,
.firebase-login-btn:hover {
    background-color: #fff;
}

header {
    background: #333;
    color: #fff;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

nav {
    grid-column: 2;
    justify-self: center;
}

.user-area {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
}

#user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    transition: background-color 0.2s ease;
    white-space: nowrap;
    font-size: 13px;
}

#user-profile:hover {
    background: rgba(255,255,255,0.14);
}

#user-profile p {
    margin: 0;
    color: #fff;
    font-size: 14px;
}

#user-profile img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #0078D4;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    padding: 10px 0;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

.signout-button {
    background-color: transparent;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: left;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
}

.signout-button:hover {
    background-color: #555;
}

nav ul {
    padding: 0;
    margin: 0;
    list-style: none;
    white-space: nowrap; 
}

nav ul li {
    display: inline-block;
    margin-right: 15px;
    vertical-align: middle;
}

nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

nav a.active {
    border-bottom: 2px solid #fff;
}

.hero {
    position: relative;
    height: 30vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 15px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.5); 
}

.hero .hero-text h1 {
    margin: 0;
    font-size: 3rem; 
    color: white; 
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    position: relative; 
}

#antecedentes {
    padding: 20px; 
}

.section-title {
    text-align: center;
    margin-top: 10px; 
    margin-bottom: 10px; 
    position: relative;
}

.section-title h2 {
    font-size: 2rem;
    color: #333;
    display: inline-block;
    background-color: #fff;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px solid #ccc;
}

#dynamic-intro-text p {
    margin-bottom: 0;
}

.section-divider {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 20px 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #fff;
}

.card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
    z-index: 0; 
    transition: transform 0.3s ease;
}

.card:hover img {
    transform: scale(1.05); 
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 60%);
    z-index: 1;
    transition: background 0.3s ease;
}

.card:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.1) 60%);
}

.card h3,
.card p {
    position: relative;
    z-index: 2;
    margin: 0;
    color: #fff !important; 
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

.card h3 {
    font-size: 1.6rem;
    margin-bottom: 5px;
}

.card p {
    font-size: 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.4s ease-in-out;
    opacity: 0;
}

.card:hover p {
    max-height: 100px;
    opacity: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
}

.content {
    max-width: 900px;
    margin: 20px auto;
    padding: 20px 40px 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 40px;
    margin: 20px auto;
    max-width: 900px;
}

.content h1,
.content h2,
.content h3 {
    color: #333;
}

.text-container {
    text-align: justify;
}

.text-container::after {
    content: "";
    display: inline-block;
    width: 100%;
}

.post-content ul {
    padding-left: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #ccc;
}

.photo-gallery {
    margin-top: 30px;
}

.month-section {
    margin-bottom: 40px;
}

.month-title {
    font-size: 1.5em; 
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 0;
    border-bottom: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.gallery-item {
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.photo-date {
    position: absolute;
    bottom: 8px;
    left: 8px;
    color: white;
    background-color: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.lightbox {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain; 
    display: block;
    margin: auto;
    border-radius: 8px;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-lightbox:hover {
    color: #bbb;
}

.progress-bar-container {
    height: 5px;
    width: 100%;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin: 0 0 50px;
    overflow: hidden; 
}

.progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #e4c45c, #d9a442, #e4c45c);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.call-log {
    width: 100%;
    max-width: 700px;
    margin: 20px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.month-container {
    margin-bottom: 40px;
}

.month-container h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.calendar-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-grid li {
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-grid a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 50px;
    text-decoration: none;
    color: #555;
    background-color: #f0f0f0;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    border: 2px solid transparent;
    position: relative;
}

.weekday-header {
    font-weight: bold;
    color: #777;
    background-color: transparent;
    font-size: 0.9em;
}

.calendar-grid a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

a.today {
    background-color: #ffc400;
    color: #333;
    border-color: transparent;
    font-weight: bold;
}

a.with-call {
    background-color: #e8f5e9;
    color: #2e7d32;
}

a.with-call:hover {
    cursor: pointer;
}

a.no-call {
    background-color: #ffebee;
    color: #c62828;
    background-image: linear-gradient(
        to top right,
        transparent 49.5%,
        rgba(198,40,40,0.3) 49.5%,
        rgba(198,40,40,0.3) 50.5%,
        transparent 50.5%
    );
}

a.no-call:not([title]):hover {
    transform: none;
    box-shadow: none;
    cursor: default;
}

a.country-chile {
    border: 3px solid #0033a0;
}

a.country-chile:hover {
    box-shadow: 0 0 0 3px #d52b1e;
}

a.country-espana {
    border: 3px solid #c60b1e;
}

a.country-espana:hover {
    box-shadow: 0 0 0 3px #ffc400;
}

.video-lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    align-items: center;
    justify-content: center;
}

.video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 960px;
    background: #000;
    padding: 10px;
    border-radius: 10px;
}

.close-video-lightbox {
    position: absolute;
    top: -35px;
    right: -15px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    height: 0;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.video-container.loaded {
    opacity: 1;
}

.video-container iframe,
#player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none !important;
    z-index: 1;
}

#video-shield {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background-color: rgba(0,0,0,0.001);
}

.publication-date {
    display: inline-block;
    padding: 5px 15px;
    background-color: #333;
    color: #fff;
    border-radius: 20px;
    font-size: 0.8em;
    margin-bottom: 15px;
}

.calendar-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 65%; 
    border: 1px solid #ddd; 
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.05); 
    margin-bottom: 40px;
}

.calendar-container iframe {
    position: absolute;
    top: -1px; 
    left: -1px; 
    width: calc(100% + 2px); 
    height: calc(100% + 72px); 
    border: none;
}

.hero-secondary {
    position: relative;
    padding: 80px 20px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    background-size: cover;
    background-position: center;
    color: white;
    border-radius: 15px;
    overflow: hidden;
}

.hero-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.4);
    z-index: 1;
}

.hero-secondary h1 {
    font-size: 3rem;
    color: #fff;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
    position: relative;
    z-index: 2;
}

.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    text-decoration: none;
    background-color: rgba(0,0,0,0.2);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
    z-index: 2;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
}

.btn-back:hover {
    background-color: rgba(0,0,0,0.4);
}

.hero-home,
.hero-videollamadas,
.hero-fotografias,
.hero-calendario,
.hero-blog {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#inicio-content p,
#inicio-content strong,
#historia-content p,
#historia-content strong {
    font-weight: normal !important;
}

/* Custom video controls */
.custom-controls {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 10px 16px;

    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);

    border-radius: 14px;

    z-index: 999999 !important;

    opacity: 1 !important;
    visibility: visible !important;

    pointer-events: auto !important;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;

    pointer-events: auto !important;
}

.progress-bar-custom-container {
    width: 360px;
    height: 10px;

    background-color: rgba(255,255,255,0.28);

    border-radius: 999px;

    overflow: hidden;
    cursor: pointer;

    pointer-events: auto !important;

    position: relative;
}

.progress-bar-custom {
    height: 100%;
    width: 0%;

    background-color: #ffc400;

    border-radius: 999px;

    transition: width 0.08s linear;

    pointer-events: none;
}

.time-display {
    color: white;
    font-size: 14px;
    min-width: 80px;
    text-align: center;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;

    width: 80px;
    height: 5px;

    background: rgba(255,255,255,0.3);

    border-radius: 999px;

    outline: none;
    cursor: pointer;

    pointer-events: auto !important;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: #ffc400;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #ffc400;
    border-radius: 50%;
    cursor: pointer;
}

img[data-blob-path]:not([src]) {
    opacity: 0;
}

img[data-blob-path][src] {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}

/* ===== INICIO — BLOQUE NUESTRA HISTORIA ===== */

#inicio-content {
    position: relative;
    max-width: 760px;
    margin: 8px auto 14px;
    padding: 28px 36px 30px 56px;
    line-height: 1.58;
    text-align: justify;
    font-size: 16.5px;
    color: #2f2f2f;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,0.04);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

#inicio-content::before {
    content: "";
    position: absolute;
    left: 22px;
    top: 24px;
    bottom: 24px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(
        to bottom,
        rgba(217,164,66,0) 0%,
        rgba(217,164,66,0.95) 12%,
        rgba(217,164,66,1) 50%,
        rgba(217,164,66,0.95) 88%,
        rgba(217,164,66,0) 100%
    );
}

#inicio-content p {
    margin: 0 0 9px 0;
    text-align: justify;
    hyphens: auto;
}

#inicio-content p + p {
    margin-top: 6px;
}

#inicio-content p:first-of-type::first-letter {
    float: left;
    font-size: 3rem;
    line-height: 0.9;
    padding-right: 8px;
    font-weight: 700;
    color: #333;
}

#inicio {
    margin-top: 8px;
}

.fecha-clave {
    font-weight: 700;
    color: #222;
    background: linear-gradient(to top, rgba(228,196,92,0.35) 35%, transparent 35%);
}

/* CASOS JUDICIALES */

.caso-card {
    background: #fff;
    border-left: 4px solid #d9a442;
    padding: 16px 20px;
    margin-bottom: 15px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.caso-card h3 {
    margin-top: 0;
}

/* BLOG — ajuste final de lectura y barra dorada difuminada */

.blog-post {
    position: relative;
    max-width: 820px;
    margin: 34px auto 42px;
    padding: 30px 42px 34px 48px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(0,0,0,0.04);
    line-height: 1.62;
    font-size: 16.5px;
    color: #2f2f2f;
    text-align: justify;
    box-sizing: border-box;
}

.blog-post::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 28px;
    bottom: 28px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(
        to bottom,
        rgba(217,164,66,0) 0%,
        rgba(217,164,66,0.95) 12%,
        rgba(217,164,66,1) 50%,
        rgba(217,164,66,0.95) 88%,
        rgba(217,164,66,0) 100%
    );
}

.blog-post:last-child {
    border-image: none;
    margin-bottom: 0;
}

.blog-post-content {
    overflow: visible;
}

.blog-post-content h3 {
    margin: 0 0 16px;
}

.blog-post-content p {
    margin: 0 0 13px;
    text-align: justify;
    hyphens: auto;
}

.blog-post-content p:last-child {
    margin-bottom: 0;
}

.blog-post-image {
    float: left;
    width: 290px;
    max-width: 40%;
    max-height: 460px;
    height: auto;
    object-fit: contain;
    background: #f7f7f7;
    padding: 6px;
    margin: 0 34px 20px 0;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
}

/* RESPONSIVE */

@media (max-width: 1200px) {
    .nav-container,
    .content,
    .timeline-section {
        max-width: 960px;
    }

    .hero .hero-text h1,
    .hero-secondary h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .nav-container,
    .content,
    .timeline-section {
        max-width: 720px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .blog-post-image {
        float: none;
        display: block;
        margin: 0 auto 20px;
        max-width: 100%;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .nav-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    nav {
        width: 100%;
    }

    nav ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        white-space: normal;
        padding: 0;
    }

    nav ul li {
        margin-bottom: 10px;
        margin-right: 0;
    }

    .user-area {
        margin-bottom: 15px;
    }

    #user-profile {
        margin-top: 10px;
        justify-content: center;
    }

    .hero .hero-text h1,
    .hero-secondary h1 {
        font-size: 2rem;
    }

    .content {
        padding: 20px;
    }

    .calendar-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 5px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    #inicio-content {
        padding: 24px 22px 26px 42px;
        font-size: 15.5px;
        line-height: 1.55;
    }

    #inicio-content::before {
        left: 18px;
        top: 22px;
        bottom: 22px;
        width: 3px;
    }

    #inicio-content p:first-of-type::first-letter {
        font-size: 2.5rem;
    }

    .blog-post {
        padding: 22px 22px 26px 42px;
    }

    .blog-post::before {
        left: 18px;
        top: 24px;
        bottom: 24px;
        width: 3px;
    }

    .blog-post-image {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0 0 18px;
    }
}