/* Root Variables */
:root {
    --primary-color: #1a365d; /* Deep Institutional Blue */
    --accent-color: #3182ce;  /* Lighter Blue for buttons */
    --bg-light: #f7fafc;      /* Soft Grey background */
    --white: #ffffff;         /* Pure White */
    --text-dark: #2d3748;     /* Darker grey for text */
    --text-light: #718096;    /* Lighter grey for secondary text */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition-fast: all 0.3s ease;
    --container-width: 1200px;
    --header-height: 80px;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

.section-tag {
    display: inline-block;
    color: var(--accent-color);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.section-header p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 50px;
}

/* Grids */
.grid {
    display: grid;
    gap: 30px;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: #2b6cb0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

/* Header & Nav */
header {
    background-color: var(--white);
    height: var(--header-height);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    font-weight: 500;
    color: var(--text-dark);
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link.active {
    color: var(--accent-color);
    font-weight: 700;
}

.no-scroll {
    overflow: hidden;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: var(--transition-fast);
}

/* Mobile Nav Styles */
@media (max-width: 991px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--white);
        flex-direction: column;
        justify-content: center;
        transition: 0.4s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .cta-mobile {
        margin-top: 20px;
    }
}

/* Hero Section */
.hero {
    height: calc(100vh - var(--header-height));
    min-height: 500px;
    background: linear-gradient(rgba(26, 54, 93, 0.85), rgba(26, 54, 93, 0.85)), 
                url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0.9;
}

.hero-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero-btns { flex-direction: column; align-items: center; }
}

/* Noticias / Carousel Section */
.news-section {
    overflow: hidden;
}

.carousel-container {
    position: relative;
    padding: 0 40px;
}

.carousel-track {
    display: flex;
    gap: 25px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    padding: 20px 0;
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.news-card {
    flex: 0 0 calc(25% - 20px); /* Desktop: 4 items */
    scroll-snap-align: start;
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.news-img {
    position: relative;
    height: 200px;
}

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

.news-category {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.news-body {
    padding: 20px;
    flex-grow: 1;
}

.news-date {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.news-body h3 {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-body p {
    font-size: 0.95rem;
    color: var(--text-light);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background-color: var(--white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.carousel-btn.prev { left: -10px; }
.carousel-btn.next { right: -10px; }

@media (max-width: 1100px) {
    .news-card { flex: 0 0 calc(33.33% - 17px); } /* Tablets large: 3 items */
}

@media (max-width: 900px) {
    .news-card { flex: 0 0 calc(50% - 13px); } /* Tablets: 2 items */
}

@media (max-width: 600px) {
    .news-card { flex: 0 0 100%; } /* Mobile: 1 item */
    .carousel-container { padding: 0 10px; }
    .carousel-btn { display: none; } /* Hide buttons on mobile for better UX with touch */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: var(--transition-fast);
}

.modal.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    color: var(--white);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: var(--transition-fast);
}

.close-modal:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

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

.modal-body-content {
    padding: 40px;
}

.modal-header {
    margin-bottom: 25px;
}

.modal-tag {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.modal-date {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.modal-title {
    font-size: 2rem;
    color: var(--primary-color);
    line-height: 1.3;
}

.modal-text {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    .modal-body-content {
        padding: 25px;
    }
    .modal-title {
        font-size: 1.5rem;
    }
    .modal-img {
        height: 250px;
    }
}

/* About Section */
.about-text h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.about-features {
    margin-top: 30px;
}

.about-features li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.about-features i {
    color: var(--accent-color);
}

.about-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-placeholder {
    width: 100%;
    height: 400px;
    background-color: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    opacity: 0.3;
}

/* Documentation Section */
.doc-grid {
    max-width: 900px;
    margin: 0 auto;
}

.doc-card {
    display: flex;
    gap: 25px;
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    transition: var(--transition-fast);
}

.doc-card:hover {
    box-shadow: var(--shadow-md);
}

.doc-icon {
    font-size: 3rem;
    color: var(--accent-color);
}

.doc-info h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.doc-info p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.doc-actions {
    display: flex;
    gap: 15px;
}

@media (max-width: 576px) {
    .doc-card { flex-direction: column; align-items: center; text-align: center; }
    .doc-actions { justify-content: center; }
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 80px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 50px;
    padding-bottom: 60px;
}

.footer-brand p {
    margin: 20px 0;
    opacity: 0.8;
    max-width: 300px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
    color: var(--white);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.social-links a:hover {
    background-color: var(--accent-color);
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    opacity: 0.8;
}

.footer-links a:hover {
    opacity: 1;
    padding-left: 5px;
}

.footer-contact p {
    margin-bottom: 15px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 25px 0;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Hamburger Animation */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}
