@import 'variables.css';

/* We will rely on Bootstrap for proper Reset, but keeping some defaults */
body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-family-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    /* Prevent horizontal scroll causing white space */
    width: 100%;
    padding-top: 100px;
    /* Compensate for fixed header desktop */
}

@media (max-width: 991px) {
    body {
        padding-top: 86px;
        /* Adjusted for smaller header */
    }
}

@media (max-width: 576px) {
    body {
        padding-top: 76px;
        /* Adjusted for mobile header */
    }
}

html {
    overflow-x: hidden;
}

main {
    flex: 1;
}

/* Header customization */
#header-container {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    background-color: #fff;
    /* Ensure background is opaque */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* Add shadow for separation */
}

.navbar {
    background-color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 500;
    color: #333 !important;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.logo-placeholder {
    height: 60px;
    width: auto;
    transition: height 0.3s ease;
}

@media (max-width: 991px) {
    .navbar-brand {
        font-size: 0.95rem;
        gap: 10px;
    }

    .logo-placeholder {
        height: 50px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 0.85rem;
    }

    .navbar-brand span {
        white-space: normal;
        /* Allow text to wrap */
        max-width: 220px;
        /* Constrain width to force wrap if needed, or keep it manageable */
        line-height: 1.2;
    }

    .logo-placeholder {
        height: 40px;
    }
}

.nav-link {
    color: #666 !important;
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    margin-left: 1rem;
    letter-spacing: 0.5px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-wine-primary) !important;
}


.dropdown-toggle::after {
    vertical-align: middle;
}

/* Dropdown Menu Fix */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    /* Adapt width to longest phrase */
    width: max-content;
    max-width: 90vw;
    /* Prevent overflow on small screens */
    min-width: auto;
    /* Reset min-width */
}

@media (max-width: 991px) {
    .dropdown-menu {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }
}

.dropdown-item {
    font-size: 13px;
    /* Reduced by ~2px (approx 0.8rem) */
    padding: 8px 20px;
    color: #555;
    white-space: normal;
    /* Allow text wrapping */
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-wine-primary);
}

/* Footer customization */
.footer-custom {
    background-color: var(--color-bg-footer);
    padding: 3rem 0;
    /* Increased from 1.5rem to 3rem */
    font-size: 0.9rem;
    color: #000;
    margin-top: auto;
    /* Push to bottom if content is short */
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
}

.social-icons a {
    color: #000;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--color-wine-primary);
}

.legal-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.legal-separator {
    border-left: 1px solid #999;
    height: 20px;
}

@media (max-width: 991px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .legal-links {
        justify-content: center;
    }
}

/* --- HERO SECTION --- */
.hero-section {
    position: relative;
    height: 80vh;
    /* Takes up 80% of viewport height */
    min-height: 500px;
    background-image: url('../resources/img/fondo_index.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
}

/* Specific Hero for VI Concurso Nacional del Vino */
.hero-concurso-vino-VI {
    /* TO CHANGE IMAGE: Replace the url below with your new image path */
    background-image: url('../resources/img/Fondo-Concursos.webp') !important;
    /* Example: background-image: url('../resources/img/flyer-vino.jpg') !important; */
}

/* Specific Overlay for VI Concurso Nacional del Vino */
.hero-concurso-vino-VI::before {
    background: linear-gradient(to bottom, rgba(44, 0, 11, 0.747), rgba(0, 0, 0, 0.123)) !important;
}

/* Overlay to darken image */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(0, 0, 0, 0.4); Old dark overlay */
    background: linear-gradient(to bottom, rgba(44, 0, 11, 0.747), rgba(0, 0, 0, 0.123));
    /* Gradient from Wine (#800020) to subtle white */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}

.hero-title {
    font-size: 2.2rem;
    /* Reduced from 2.5rem */
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Hero Logo */
.hero-logo {
    width: 200px;
    /* Increased from 150px */
    height: 200px;
    /* Increased from 150px */
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #fff;
    /* Slightly thicker border */
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background-color: #fff;
    /* Ensure transparent parts look good if any */
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
        /* Reduced from 3.5rem */
    }
}

@media (max-width: 767px) {
    .hero-title {
        font-size: 1.8rem;
        /* Reduced from 2.2rem */
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-logo {
        width: 160px;
        /* Scale down slightly on mobile, but still larger than before relative to screen */
        height: 160px;
    }
}

.hero-subtitle {
    font-size: 1.1rem;
    /* Slightly smaller */
    margin-bottom: 3rem;
    font-weight: 300;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-hero {
    /* ... existing styles ... Keep basic layout */
    background-color: var(--color-gold-primary);
    color: #fff;
    padding: 12px 40px;
    border-radius: 30px;
    margin-top: -25px;
    text-decoration: underline;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    transition: 0.25s;
    /* Faster transition for button effect */
}

/* Raise Effect */
.btn-hero:hover,
.btn-hero:focus {
    transform: translateY(-0.25em) scale(1.2);
    /* Increased scale for more impact */
    box-shadow: 0 0.5em 0.5em -0.4em var(--color-gold-hover);
    background-color: var(--color-gold-hover);
    color: #fff;
    text-decoration: underline;
}



/* --- INFO CARDS SECTION --- */
/* --- INFO CARDS SECTION --- */
.info-card-link {
    display: block;
    position: relative;
    text-decoration: none;
    transition: transform 0.3s;
    margin-bottom: 20px;
    /* Space for underline */
}

.info-card-link:hover {
    transform: translateY(-5px);
}

.info-card-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square cards */
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.info-card-link:hover .info-card-img {
    transform: scale(1.1);
}

/* Ribbon Banner */
.info-card-banner {
    position: absolute;
    bottom: 20px;
    left: -10px;
    /* Stick out to left */
    width: 85%;
    background-color: var(--color-wine-primary);
    color: #fff;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Ribbon Fold */
.info-card-banner::before {
    content: '';
    position: absolute;
    top: -10px;
    /* Height of protrusion */
    left: 0;
    width: 0;
    height: 0;
    border-bottom: 10px solid var(--timeline-primary-text);
    /* Darker shade for fold */
    border-left: 10px solid transparent;
}

.info-card-banner i {
    font-size: 1.2rem;
}

.info-card-banner span {
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
}

/* Decorative Underline */
.info-card-link::after {
    content: '';
    display: block;
    width: 80%;
    height: 3px;
    background-color: var(--color-wine-primary);
    margin: 20px auto 0;
    /* Centered below */
}






/* --- ORGANIZERS & COUNTDOWN SECTION --- */
.organizers-countdown-section {
    position: relative;
    width: 100%;
}

.organizers-background {
    position: relative;
    width: 100%;
    /* Use a linear gradient as placeholder or the actual image if available */
    background: url('../resources/img/PortadaIndex.jpg') no-repeat center center/cover;
    /* Fallback if image fails or while loading */
    background-color: #5e0017;
}

.organizers-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(94, 0, 23, 0.7);
    /* Red wine overlay */
    z-index: 1;
}

.organizers-card {
    max-width: 900px;
    position: relative;
    background: rgba(255, 255, 255, 0.95) !important;
    /* Slightly transparent white */
    backdrop-filter: blur(5px);
}

.organizer-logo {
    max-height: 180px;
    /* Increased from 80px */
    width: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.organizer-logo:hover {
    transform: scale(1.05);
}

/* Countdown Bar */
.countdown-bar {
    background-color: var(--color-wine-primary);
    border-top: 4px solid var(--color-gold-primary);
    position: relative;
    z-index: 10;
}

.timer-box {
    min-width: 80px;
}

.timer-box small {
    color: var(--color-gold-primary);
    font-weight: 600;
}

/* --- ORGANIZING COMMITTEE SECTION --- */
.member-img {
    width: 120px;
    /* Adjust size to match design */
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--color-gold-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.member-info h4 {
    font-size: 1.5rem;
    color: #000;
}

.member-link {
    color: var(--color-wine-primary);
    font-style: italic;
    text-decoration: underline;
    font-weight: 500;
}

.member-link:hover {
    color: var(--color-wine-secondary);
}

/* --- FINAL CTA SECTION --- */
.final-cta-section {
    background-color: var(--color-wine-primary);
    color: #fff;
}

.btn-gold {
    background-color: var(--color-gold-primary);
    color: #fff;
    transition: all 0.3s ease;
    border: none;
}

.btn-gold:hover {
    background-color: var(--color-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(166, 124, 69, 0.4);
    color: #fff;
}

/* --- LAYOUT REFINEMENT --- */
.section-separator {
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-border), transparent);
    margin: 0.1rem auto;
    opacity: 0.6;
}

/* Adjusting global section spacing */
section {
    position: relative;
}

/* --- CONTEST TEMPLATE STYLES --- */
.standards-section {
    padding: 4rem 0;
    text-align: center;
}

.standards-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #000;
}

.standard-card {
    border: 2px solid #e0c9a6;
    /* Gold/Beige border */
    padding: 2rem;
    height: 100%;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.standard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.standard-card h4 {
    color: var(--color-wine-primary);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.standard-card p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.standard-icon {
    width: 60px;
    height: auto;
    color: var(--color-wine-secondary);
    font-size: 3rem;
    /* Fallback if using fonts */
}

/* Specific Hero override for contests if needed */
.contest-hero {
    /* reuse hero-section but maybe different overlay or height */
}

/* --- MEDALLERO SECTION --- */
.medallero-section {
    padding: 4rem 0;
    text-align: center;
    background-color: #fff;
}

.medallero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 3rem;
    color: #000;
    position: relative;
    display: inline-block;
}

/* Underline for Medallero title */
.medallero-title::after {
    content: '';
    display: block;
    width: 60%;
    height: 3px;
    background-color: #b8860b;
    /* Gold color */
    margin: 10px auto 0;
}

.medal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
    /* Smooth hover transition */
    cursor: pointer;
}

/* Hover effect for medal item */
.medal-item:hover {
    transform: scale(1.1);
}

.medal-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background: #ccc;
    /* fallback */
    position: relative;
}

.medal-gold {
    background: linear-gradient(135deg, #ffd700, #b8860b);
}

.medal-silver {
    background: linear-gradient(135deg, #e0e0e0, #a9a9a9);
}

.medal-bronze {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
}

.medal-count {
    font-size: 1.1rem;
    color: #333;
    position: relative;
    padding-bottom: 5px;
}

/* Underline for medal count */
.medal-count::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background-color: #b8860b;
    position: absolute;
    bottom: 0;
    left: 0;
}

.btn-results {
    background-color: transparent;
    border: 2px solid #b8860b;
    color: #333;
    padding: 10px 30px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
    margin-top: 2rem;
}

.btn-results:hover {
    background-color: #b8860b;
    color: #fff;
}

/* --- COMPETITION DETAILS SECTION --- */
.competition-details-section {
    background-color: #6d1822;
    /* Deep wine color from reference */
    padding: 3rem 0;
    color: #fff;
}

.details-title-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.details-title {
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.details-img {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.detail-card {
    background-color: #f3e5d0;
    /* Beige/Gold light background */
    color: #333;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    /* Slight rounding or none based on image */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
}

.detail-card-left {
    flex: 1;
    border-right: 1px solid #ccc;
    padding-right: 1rem;
}

.detail-card-right {
    flex: 1;
    padding-left: 1rem;
}

.detail-label {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.detail-text {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.detail-link {
    color: #8b0000;
    text-decoration: underline;
    font-weight: 600;
    font-size: 0.85rem;
}

.gold-divider {
    border: 0;
    height: 1px;
    background-color: #e0c9a6;
    margin: 1.5rem 0;
    width: 100%;
    opacity: 0.6;
}

/* --- FACEBOOK FEED SECTION --- */
.facebook-feed-section {
    background-color: #fcefe9;
    /* Fallback peach/beige */
    background-image: url('../resources/img/fondo_publicaciones.png');
    background-size: cover;
    background-position: top center;
    /* Ensure top vine is visible if part of bg */
    background-repeat: no-repeat;
    /* Gold/Brown shade from reference */
    padding: 4rem 0;
}

/* Custom Spacing for Related Publications Title */
.related-title {
    margin-bottom: 150px;
    /* Adjust this value to control space between Title and Cards */
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .related-title {
        margin-bottom: 40px;
        /* Reduced spacing for mobile */
    }
}

.facebook-card {
    background-color: #f3e5d0;
    /* Light beige content background */
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    /* Center content without flex to avoid SDK width issues */
    overflow: hidden;
    width: 100%;
}

@media (max-width: 576px) {
    .facebook-card {
        padding: 0;
        /* Remove padding to give max space */
    }

    .facebook-feed-section {
        padding: 2rem 0;
    }
}

/* Force scale down for very small screens (Facebook min-width issue) */
@media (max-width: 500px) {
    .facebook-card {
        padding: 0;
        overflow: hidden;
    }

    /* Target the FB post container */
    .facebook-card .fb-post {
        zoom: 0.8;
        /* Scales content AND reflows layout (removes bottom gap) */

        /* Ensure the iframe/content inside is centered */
        display: flex !important;
        justify-content: center !important;
    }

    /* Fallback for iframe if directly targeted */
    .facebook-card iframe {
        margin: 0 auto !important;
    }
}