:root {
    --primary-color: #981A32;
    /* Rojo Carmesí Corporativo de Vera */
    --accent-color: #c42646;
    /* Versión más clara para contrastes */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-color);
    font-family: 'Inter', 'Open Sans', sans-serif;
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
}

/* Header */
.site-header {
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 0;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-link {
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1 !important;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.site-title span {
    color: rgba(255, 255, 255, 0.7);
    /* Blanco semitransparente para diferenciarlo de "Archivo Municipal" */
    font-weight: 300;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6b1223 100%);
    color: white;
    padding: 3rem 2rem;
    /* Reducido de 6rem a 3rem */
    text-align: center;
    margin-bottom: 2rem;
}

.search-container {
    max-width: 700px;
    margin: 2rem auto 0;
    position: relative;
}

.search-container form {
    position: relative;
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3.5rem;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.search-container input:focus {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.search-container i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.2rem;
    z-index: 10;
}

.header-search input:focus {
    width: 250px !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.search-results-title {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-results-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.hero h2 {
    font-size: 2.5rem;
    /* Reducido de 3.5rem a 2.5rem */
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Grid Layout */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Reducido de 350px a 280px */
    gap: 1.5rem;
    /* Reducido de 2rem a 1.5rem */
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.doc-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    /* Reducido de 2.5rem a 1.5rem */
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.doc-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: var(--transition);
    transform-origin: left;
}

.doc-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.doc-card:hover::before {
    transform: scaleX(1);
}

.doc-icon {
    font-size: 2rem;
    /* Reducido de 3rem a 2rem */
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.doc-card h3 {
    font-size: 1.2rem;
    /* Reducido de 1.4rem a 1.2rem */
    margin: 0 0 0.5rem;
    color: var(--primary-color);
}

.doc-card p {
    font-size: 0.85rem;
    /* Reducido de 0.95rem a 0.85rem */
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.doc-link {
    margin-top: auto;
    font-weight: 700;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* File Browser */
.browser-view {
    max-width: 1000px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.breadcrumb {
    padding: 1rem 0;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.file-list {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.file-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f1f1;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.file-row:last-child {
    border-bottom: none;
}

.file-row:hover {
    background: #fdfdfd;
    padding-left: 2rem;
}

.file-row i {
    width: 40px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.file-row .name {
    flex-grow: 1;
    font-weight: 500;
}

.file-row .meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    margin-bottom: 2rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-back:hover {
    transform: translateX(-5px);
    background: var(--accent-color);
}

/* Footer */
.site-footer {
    background: #1a1a1a;
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    margin-top: 4rem;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.2rem;
    }

    .doc-grid {
        grid-template-columns: 1fr;
    }
}