@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    /* Premium Nautical Palette */
    --primary-navy: #002B5C;
    --secondary-blue: #004481;
    --accent-gold: #C5A059;
    --accent-red: #D32F2F;
    --text-dark: #1A1A1A;
    --text-light: #555555;
    --bg-light: #F9F9F9;
    --white: #FFFFFF;

    /* Spacing */
    --container-width: 1200px;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-navy);
    margin-bottom: 0.5em;
    font-weight: 700;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Premium Header --- */
header {
    background-color: var(--white);
    border-bottom: 1px solid #e0e0e0;
    position: relative;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.logo h1 {
    font-size: 2.8rem;
    /* Increased from 2.2rem */
    margin: 0;
    letter-spacing: -1px;
    color: var(--primary-navy);
    line-height: 1;
}

.logo span {
    color: var(--accent-gold);
    font-style: italic;
}

/* Nav */
nav {
    background-color: var(--primary-navy);
    padding: 0;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

nav ul li a {
    display: block;
    padding: 15px 10px;
    color: var(--white);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    position: relative;
    text-decoration: none;
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--accent-gold);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--accent-gold);
    transition: width 0.3s;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

.lang-selector a {
    color: var(--text-light);
    font-weight: 500;
    margin-left: 10px;
    font-size: 0.9rem;
    text-decoration: none;
}

.lang-selector a.active {
    color: var(--primary-navy);
    font-weight: 700;
    border-bottom: 2px solid var(--accent-gold);
}

/* Banners */
.banner {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f0f0;
    margin: 20px 0;
    /* Removing auto side margins to ensure full width usage if container allows */
    overflow: hidden;
    position: relative;
    cursor: pointer;
    height: 90px;
    /* Fixed height */
    width: 100%;
    /* Full width */
}

/* Banner sizing for Leaderboards (Top/Footer) */
.banner img {
    height: 100%;
    /* Fill the container height */
    width: 100%;
    /* Fill the container width */
    object-fit: cover;
    /* Cover the area, might crop but fills the space "width of page" */
    display: block;
}

.banner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #004481;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    width: 100%;
    text-align: center;
    pointer-events: none;
    /* Let clicks pass through to container */
}

.banner-label {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    background: rgba(255, 255, 255, 0.8);
    padding: 1px 4px;
    color: #333;
}

/* Content Sections */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 50px 0 30px;
    position: relative;
    padding-bottom: 15px;
    border-bottom: none;
    font-family: 'Playfair Display', serif;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-gold);
    margin: 15px auto 0;
}

/* --- Hero Small (Page Headers) --- */
#banner-rutas {
    font-family: 'Playfair Display', serif;
    font-size: 3.1rem;
    margin-bottom: 10px;
    color: #ddd;
}

.hero-small {
    background-color: var(--primary-navy);
    background-image: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 30px 20px;
    /* Reduced height */
    text-align: center;
    border-radius: 4px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Optional: Add a subtle accent line or texture */
.hero-small::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gold);
}

.hero-small h1 {
    margin: 0;
    color: var(--white);
    /* Ensure contrast */
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* --- Magazine Grid & Cards --- */
.grid-container {
    display: grid;
    /* Adjusted for 3 columns: 250px min allows 3 cols in > 850px width */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.card {
    background-color: var(--white);
    border: none;
    border-radius: 2px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 2px solid var(--accent-gold);
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.4rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-navy);
    line-height: 1.3;
}

.card p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 20px;
    flex-grow: 1;
}

/* --- Elegant Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-navy);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--primary-navy);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    border-radius: 2px;
    text-decoration: none;
}

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

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

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

/* Forms */
form .form-group {
    margin-bottom: 15px;
}

form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

form input,
form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Routes Table & General Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: var(--primary-navy);
    color: var(--white);
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
}

/* Specific for route logic */
.input-group label {
    font-weight: 500;
    color: var(--primary-navy);
}

.route-dot {
    /* Handled in JS/Inline usually, adding backup */
}

/* Footer */
footer {
    background-color: var(--primary-navy);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;

    #banner-rutas {
        font-size: 2rem;
        /* Smaller hero text */
    }

    /* Grids */
    .grid-container {
        grid-template-columns: 1fr;
        /* Force single column on mobile */
        gap: 20px;
        padding: 20px 0;
    }

    /* Card Images */
    .card img {
        height: 180px;
        /* Slightly shorter images */
    }

    /* Tables Responsive */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    /* Banners */
    .banner {
        height: auto;
        /* Allow auto height if image aspect ratio is tricky, or keep fixed */
        min-height: 60px;
    }

    .banner-overlay {
        font-size: 14px;
    }

    .banner-label {
        font-size: 8px;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .footer-links a {
        margin-left: 0 !important;
        /* Override inline margin */
    }
}