:root {
    --naranjaUEP: #ff8000;
    --fondoAzulBlanco: rgb(22 20 63);
    --body-color: #dee2e6;
}

body {
    color-scheme: dark;
    box-sizing: inherit;
    -webkit-tap-highlight-color: transparent;
    word-wrap: break-word;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: none;
    -webkit-font-smoothing: antialiased;
    height: 100%;
    background: var(--body-color);
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-style: normal;
    font-weight: normal;
    margin: 0;
    padding: 0;
}

/* Hero Section */
.hero {
    scroll-margin-top: 180px;
    background-position: center;
    aspect-ratio: 16 / 9;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    /* margin-top: 90px;
    min-height: 280px; */
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #FF8000;
    color: #002F5E;
}

.btn-secondary {
    background: white;
    color: #002F5E;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Carousel container */
.carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Carousel items */
.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.item.active {
    opacity: 1;
}

/* Quick Access Section */
.quick-access {
    padding: 60px 0;
    background-color: var(--fondoAzulBlanco);
    background-size: cover;
    scroll-margin-top: 110px;
}

.quick-access a {
    text-decoration: none;
    color: transparent;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    background: white;
    color: #FF8000;
    border: 2px solid #FF8000;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.filter-btn:hover {
    background: #FF8000;
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #FF8000;
    color: white;
    border-color: black;
}

.section-title-orange {
    text-align: center;
    font-size: clamp(22px, 4vw, 36px);
    color: #FF8000;
    margin-bottom: 50px;
}

.section-title-blue {
    text-align: center;
    font-size: clamp(22px, 4vw, 36px);
    color: #002F5E;
    margin-bottom: 50px;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,
            minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.program-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    border-color: #FF8000;
    border-style: solid;
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.program-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.program-category {
    color: #FF8000;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin: auto auto auto 0;
}

.program-title {
    color: #002F5E;
    font-size: 22px;
    margin-bottom: 15px;
}

.program-description {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-bottom {
    margin-top: auto;
}

.program-details {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.program-card .program-details {
    display: block;
}

.detail-item {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.detail-item::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #FF8000;
}

.seccion-campus {
    background-color: var(--fondoAzulBlanco);
    color: var(--bs-gray-300);
    scroll-margin-top: 125px;
}

.text-naranja {
    color: var(--naranjaUEP);
}

.text-blanco {
    color: #dee2e6;
}

.row {
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
}

.row:after {
    content: "";
    display: table;
    clear: both;
}

/* Common styles for columns like col-4 */
[class*="col-"] {
    padding: 0 20px;
}

/* The header container */
.col-full {
    width: 100%;
    margin-bottom: 100px;
}

/* Base font settings */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* Smooth text rendering */
h1,
h2,
h3,
h4,
h5,
h6 {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    margin: 0;
    padding: 0;
}

/* Standardizing bold text */
strong,
b {
    font-weight: bold;
    line-height: inherit;
}

/* Responsive image behavior */
img,
video {
    max-width: 100%;
    height: auto;
}

/* Removes default borders */
img {
    border-style: none;
}

/* Adjustments for tablets/small desktops */
@media only screen and (max-width: 1200px) {
    [class*="col-"] {
        padding: 0 15px;
    }
}

/* Forces columns to stack vertically on mobile */
@media only screen and (max-width: 400px) {
    [class*="col-"] {
        width: 100% !important;
        float: none !important;
        padding: 0;
    }
}

.col-4 {
    flex-basis: 33.3333%;
    flex-shrink: 0;
}

/* Line */
.line {
    width: 100%;
}

/* Mision y Vision Section */
.about {
    scroll-margin-top: 140px;
    background-color: #16143f;
}

.about .container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-content: center;
}

.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
    width: 100%;
}

.about-text {
    flex: 1 1;
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.about-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: #ffffff;
    color: #111;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.about-card .about-icon {
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-card-body h3 {
    margin: 0 0 8px 0;
    color: #FF8000;
    font-size: 1.5rem;
}

.about-card-body p {
    margin: 0;
    color: #333;
    line-height: 1.5;
}

/* Responsive adjustments for Vision/Misión section */
@media (max-width: 800px) {
    .about .container,
    .about-content {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .about-text {
        flex-direction: column;
        margin: 20px 0;
        gap: 16px;
    }

    .about-card {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 16px;
        width: 100%;
    }

    .about-card .about-icon {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
    }

    .about-card-body h3 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .about-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .about-card .about-icon {
        margin-bottom: 8px;
    }

    .about-card-body h3 {
        font-size: 1.6rem;
    }

    .about-card-body p {
        font-size: 1.4rem;
    }
}

/* Buttons in about should follow existing .btn styles but ensure visibility on dark background */
.about .btn {
    padding: 10px 18px;
    font-size: 1.4rem;
}

@media (max-width: 1000px) {
    .about .container {
        padding: 30px 20px;
    }

    .about-content {
        flex-direction: column-reverse;
    }
}

@media (max-width: 480px) {
    .about-card {
        flex-direction: row;
        gap: 12px;
        padding: 14px;
    }

    .about-card-body h3 {
        font-size: 1.6rem;
    }

    .about .btn {
        font-size: 1.2rem;
        padding: 8px 12px;
    }
}

/* Facilities */
.facilities {
    padding: 80px 0;
    background-size: cover;
    scroll-margin-top: 110px;
    border-top-color: #333;
    border-width: 40px;
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,
            minmax(250px, 1fr));
    gap: 30px;
}

.facility-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.facility-card:hover {
    transform: scale(1.05);
}

.facility-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    object-fit: cover;
}

button.facility-image-zoomable {
    width: 100%;
    border: none;
    padding: 0;
    cursor: zoom-in;
}

.facility-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
    padding: 24px;
}

.facility-lightbox[hidden] {
    display: none;
}

.facility-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.facility-lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
}

.facility-info {
    padding: 20px;
}

.facility-info h3 {
    color: #002F5E;
    margin-bottom: 10px;
}

/* News Section */
.news h2 {
    margin-top: 50px;
}

.news {
    padding: 40px 0;
    background-color: transparent;
    scroll-margin-top: 110px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,
            minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    border: 1px solid #002F5E;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.news-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.news-date {
    background: #FF8000;
    color: white;
    padding: 10px 20px;
    font-weight: bold;
}

.news-content {
    padding: 20px;
}

.news-content h3 {
    color: #002F5E;
    margin-bottom: 10px;
}

.news-content p {
    color: black;
}

/*Blog Section */
.blog h2 {
    margin-top: 50px;
    color: #002F5E;
}

.redirect-a {
    text-decoration: none;
    color: #002F5E;
    
}

.redirect-a:hover {
    text-decoration: underline;
}

.blog {
    padding: 40px 0;
    background-color: transparent;
    scroll-margin-top: 110px;
}

.blog-category {
    position: absolute;
    top: 20px;
    left: 20px;
    width: fit-content;
    max-width: calc(100% - 40px);
    background: linear-gradient(135deg, #FF8000 0%, #FF6000 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 10;
}

.blog-summary {
    font-size: 1.3rem;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

.author-info:hover {
    transform: translateX(3px);
}

.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #FF8000;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: #002F5E;
    font-size: 14px;
}

.author-role {
    font-size: 12px;
    color: #999;
}

.article-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    color: #777;
    font-size: 14px;
}

/* Contact Section */
.contact {
    padding: 80px 0;
    background: #002F5E;
    color: white;
    scroll-margin-top: 110px;
}

.contact-content {
    display: grid;
    grid-template-columns: minmax(0, 380px) 1fr;
    gap: 50px;
}

.contact h2 {
    color: white;
    margin-bottom: 30px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (max-width: 1199px) {
    .nav-menu {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    .logo-text .university {
        font-size: 14px;
    }

    .logo-text .campus {
        font-size: 12px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }

    .programs-grid {
        grid-template-columns: 1fr;
    }

    .filter-buttons {
        gap: 10px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* Mobile adjustments for autoridades section */
@media (max-width: 768px) {
    .foto-autoridad {
        width: 140px !important;
        height: auto;
    }

    .col-4 h3 {
        font-size: 16px;
    }

    .col-4 h4 {
        font-size: 14px;
    }

    .col-4 h5 {
        font-size: 12px;
    }

    .col-4 {
        flex-basis: 100%;
    }
}

/* Wagtail homepage additions */
.homepage-shell .header-logo {
    width: 60px;
    height: 60px;
    margin: auto;
    object-fit: contain;
}

.homepage-shell .program-card .btn,
.homepage-shell .program-card button.btn {
    width: fit-content;
}

.homepage-shell .facility-anchor,
.homepage-shell .news-card-link,
.homepage-shell .blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.homepage-shell .quick-access .btn {
    color: #002f5e;
}

.homepage-shell .facilities {
    background-image: none;
    background-color: #f5f2eb;
}

.homepage-shell .blog-teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.homepage-shell .blog-card {
    background: whitesmoke;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.homepage-shell .blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.homepage-shell .blog-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.homepage-shell .blog-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-placeholder {
    background-color: #eee;
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    margin-top: auto;
}

.homepage-shell .blog-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    /* margin-top: auto; */
    flex: 1;
}

.homepage-shell .blog-title {
    color: #002f5e;
    font-size: 1.5rem;
    margin-top: auto;
    padding-bottom: 12px;
}

.homepage-shell .blog-summary {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 0;
    margin-bottom: 20px;
}

.homepage-shell .blog-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: #666;
    font-size: 0.8rem;
}

.homepage-shell .blog-author {
    font-weight: 600;
    color: #002f5e;
}

.homepage-shell .copyable {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.homepage-shell .copy-tooltip {
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 100;
}

.homepage-shell .home-richtext {
    padding: 60px 0;
    background: #fff;
    color: #111;
}

.homepage-shell .home-richtext a {
    color: #002f5e;
}

@media (max-width: 768px) {
    .homepage-shell .header-logo {
        width: 48px;
        height: 48px;
    }

    .image-placeholder {
        height: 0;
        background: transparent;
        color: transparent;
    }

    .homepage-shell .blog-content {
        height: auto;
    }

    .homepage-shell .blog-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Map iframe */
.map-iframe {
    width: 100%;
    height: 450px;
    min-height: 300px;
    border: 0;
    display: block;
}

/* Contact emoji icons */
.contact-emoji-icon {
    font-size: 24px;
    flex-shrink: 0;
}

/* Programs CTA buttons */
.programs-cta-buttons {
    text-align: center;
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Mobile: small phones */
@media (max-width: 480px) {
    .hero {
        margin-top: 90px;
    }

    .map-iframe {
        height: 280px;
        min-height: 220px;
    }

    .quick-access,
    .facilities,
    .news,
    .blog,
    .contact {
        padding: 40px 0;
    }

    .programs-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}