/* === ESTILOS GLOBALES === */

/* Fonts */
/* Imported in base.html via <link> tags */

:root {
    --font-heading: 'Cambo', serif;
    --font-body: 'Cambo', serif;
}

body {
    min-height: auto;
    display: block;
    position: relative;
    padding-bottom: 0;
    font-family: var(--font-body);
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand {
    font-family: var(--font-heading);
}

/* Quitamos el margin-top: auto que empujaba el footer */
footer {
    margin-top: 0;
}

.border-transparent {
    border-color: transparent !important;
}

/* === EFECTO DE ELEVACION (LIFTED) === */
.card-lifted {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
    background-color: #fff !important;
    position: relative;
    z-index: 1;
}

.card-lifted:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18) !important;
    z-index: 10;
}

.card-lifted-strong {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22) !important;
    background-color: #fff !important;
    position: relative;
    z-index: 1;
}

.card-lifted-strong:hover {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.28) !important;
    z-index: 10;
}

.card-shadow-static {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
    background-color: #fff !important;
}

.card-shadow-strong {
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22) !important;
    background-color: #fff !important;
}

@media (max-width: 991.98px) {
    .card-shadow-strong {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
    }
}

/* === ESTILOS AUTOR BADGE (LIFTED) === */
.author-badge-lifted {
    background-color: transparent !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    color: #212529 !important;
    text-decoration: none !important;
    border: none !important;
}

.author-badge-lifted:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}

/* === ESTILOS DEL GRID (Necesarios aquí para herencia) === */
.card-custom-border {
    border-width: 2px !important;
}

.grid-img {
    width: 100%;
    object-fit: cover;
    display: block;
}

/* Alturas responsivas para el Grid */
.h-large {
    height: 250px !important;
    object-fit: cover;
    width: 100%;
}

.h-small {
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
}

@media (min-width: 992px) {
    .h-large {
        height: 500px !important;
    }

    .h-small {
        height: 242px !important;
        aspect-ratio: auto;
    }
}

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* === ESTILOS DEL HOME / ARTICULOS === */
.overlay-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
}

.overlay-gradient-lighter {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.text-shadow-strong {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.95);
}

.text-shadow-light {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

.title-truncate {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    line-height: 1.5;
    max-height: 1.5em;
}

.title-truncate-large {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    line-height: 1.5;
    max-height: 1.5em;
}

.title-truncate-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.3;
    max-height: 2.6em;
}

@media (min-width: 992px) {
    .title-truncate {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .title-truncate-large {
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }
}

/* Increase font size for titles in the grid */
.fw-bold.text-white {
    font-size: 1.5rem;
    line-height: 1.4;
}

/* Specific overwrite for articulos/perfil_autor lists if needed diff from home grid */
/* But generally consistent is better */

.card-fixed-height {
    height: auto;
}

.desc-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
}

@media (min-width: 768px) {
    .fw-bold.text-white {
        font-size: 1.75rem;
    }

    .card-fixed-height {
        height: 280px;
    }

    .desc-truncate {
        height: 125px;
    }
}

@media (max-width: 767.98px) {
    .card-fixed-height {
        height: auto !important;
        min-height: 450px !important;
    }

    .card-fixed-height .row>div:first-child {
        height: 200px !important;
        width: 100%;
    }

    .card-fixed-height .row>div:last-child {
        height: auto !important;
        padding-top: 1rem !important;
    }

    .desc-truncate {
        -webkit-line-clamp: 6 !important;
        line-clamp: 6 !important;
    }
}

.img-cover-fit {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Carousel Mobile Home */
.h-carousel-mobile {
    height: 400px;
    object-fit: cover;
    width: 100%;
}

/* Carousel Indicators as Dots */
.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 6px;
    margin-right: 6px;
    background-color: #fff;
    opacity: 0.7;
    border: none;
}

.carousel-indicators .active {
    opacity: 1;
    background-color: #fff;
}

/* Fix Carousel Controls Offsets for p-4 items */
#carouselDestacados .carousel-control-prev {
    left: 0.5rem;
}

#carouselDestacados .carousel-control-next {
    right: 0.5rem;
}

#carouselDestacados .carousel-indicators {
    bottom: 2rem;
}

/* === ESTILOS PERFIL AUTOR / AUTORES / QUIENES SOMOS === */

.profile-card-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.director-card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.profile-name,
.director-name {
    font-weight: bold !important;
    font-size: 1.5rem !important;
    margin-top: 0;
    margin-bottom: 0;
    white-space: normal;
}

.author-badge-name {
    font-weight: bold !important;
    font-size: 0.95rem !important;
}

.text-truncate-multiline {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-description-scroll {
    max-height: 7.5rem;
    overflow-y: auto;
    padding-right: 15px;
}

.profile-description-scroll::-webkit-scrollbar {
    width: 6px;
}

.profile-description-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.profile-description-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

.profile-description-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .director-img-container {
        width: 250px;
        min-height: 250px;
        position: relative;
    }

    .director-card-img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0;
        aspect-ratio: unset;
        object-fit: cover;
    }
}

@media (min-width: 992px) {
    .profile-img-container {
        width: 275px;
        height: 400px;
        position: relative;
    }

    .profile-card-img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: none;
        border-radius: 0;
        aspect-ratio: unset;
        object-fit: cover;
    }

    .profile-name,
    .director-name {
        font-size: 1.85rem !important;
    }

    .author-badge-name {
        font-size: 1.1rem !important;
    }
}

@media (max-width: 767.98px) {
    .profile-display-mobile {
        font-size: 1.4rem !important;
        line-height: 1.2;
    }

    .profile-display-mobile small {
        font-size: 0.85rem !important;
        display: inline-block;
        vertical-align: middle;
        margin-left: 0.25rem;
    }
}

/* === ESTILOS ARTICULO INDIVIDUAL === */

.article-header-bg {
    min-height: 100vh;
}

.article-alert-hover {
    transition: opacity 0.3s ease-in-out;
}

.article-alert-hover:hover {
    opacity: 0.1;
}

/* Force Cambo font on all injected article content */
.article-content {
    text-align: justify;
}

.article-content,
.article-content * {
    font-family: 'Cambo', serif !important;
}

/* Responsive styles for article */
@media (max-width: 991.98px) {
    .article-header-bg {
        min-height: 75vh !important;
        /* Cinematic height for mobile too */
        padding-top: 3rem;
        padding-bottom: 3rem;
    }

    .article-title {
        font-size: 1.5rem !important;
    }

    .article-date {
        font-size: 0.75rem !important;
    }

    .article-desc {
        font-size: 1rem !important;
    }

    .article-content {
        font-size: 1rem !important;
    }
}

@media (max-width: 768px) {

    /* Increase font size for Quienes Somos page on mobile */
    .container.py-5 .lead,
    .container.py-5 p,
    .container.py-5 h2 {
        font-size: 1.1em !important;
    }

    .container.py-5 h2 {
        font-size: 1.5em !important;
    }
}

@media (min-width: 992px) {

    /* Increase font sizes on desktop, excluding base */
    h1 {
        font-size: 2.75rem;
    }

    h2 {
        font-size: 2.25rem;
    }

    h3 {
        font-size: 2rem;
    }

    h4 {
        font-size: 1.75rem;
    }

    h5 {
        font-size: 1.5rem;
    }

    h6 {
        font-size: 1.25rem;
    }

    p,
    .lead,
    li {
        font-size: 1.1rem;
    }
}