/* style.css */

/* --- CSS Variables --- */
:root {
    /* Fonts */
    --font-heading: 'Archivo Black', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Tetrad Color Scheme */
    --color-primary: #0077B6; /* Blue */
    --color-primary-dark: #005A8D;
    --color-accent1: #FF8C00; /* Orange */
    --color-accent1-dark: #CC7000;
    --color-accent2: #4CAF50; /* Green */
    --color-accent2-dark: #388E3C;
    --color-accent3: #9C27B0; /* Purple */
    --color-accent3-dark: #7B1FA2;

    /* Neutral Colors */
    --color-text-dark: #333333;
    --color-text-light: #FFFFFF;
    --color-text-medium: #555555;
    --color-text-subtle: #777777;
    --color-bg-light: #F8F9FA;
    --color-bg-white: #FFFFFF;
    --color-bg-dark: #333333;
    --color-bg-darker: #222222;
    --color-border: #DDDDDD;

    /* Transitions & Effects */
    --transition-speed: 0.3s;
    --transition-ease: ease-in-out;
    --box-shadow-light: 0 4px 10px rgba(0, 0, 0, 0.08);
    --box-shadow-medium: 0 6px 15px rgba(0, 0, 0, 0.12);
    --box-shadow-dark: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* --- Base & Typography --- */
body {
    font-family: var(--font-body);
    color: var(--color-text-dark);
    background-color: var(--color-bg-light);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: normal; /* Archivo Black is already bold */
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }

@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
}

p {
    margin-bottom: 1.25rem;
    color: var(--color-text-medium);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed) var(--transition-ease);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

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

/* --- Tailwind Complement & Global Styles --- */
.container {
    max-width: 1200px; /* Adjust as needed */
}

/* Section Styling */
section {
    padding-top: 4rem; /* Default padding, can be overridden by Tailwind utilities */
    padding-bottom: 4rem;
    position: relative;
    overflow: hidden; /* Contain skewed backgrounds */
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem; /* More space below title */
    color: var(--color-text-dark); /* Ensure dark color for titles */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}


/* --- Buttons (Global) --- */
.button-base {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    font-family: var(--font-body); /* Use body font for buttons for readability */
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed) var(--transition-ease);
    box-shadow: var(--box-shadow-light);
    text-decoration: none; /* Remove underline from button links */
    transform: perspective(1px) translateZ(0); /* Smooths rendering */
}
.button-base:hover {
    transform: translateY(-3px) scale(1.03); /* Subtle 3D lift */
    box-shadow: var(--box-shadow-medium);
    text-decoration: none; /* Ensure no underline on hover */
}
.button-base:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: var(--box-shadow-light);
}

.button-primary {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}
.button-primary:hover {
    background-color: var(--color-primary-dark);
    color: var(--color-text-light); /* Ensure text remains light */
}

.button-secondary {
    background-color: var(--color-accent1);
    color: var(--color-text-light);
}
.button-secondary:hover {
    background-color: var(--color-accent1-dark);
    color: var(--color-text-light);
}

/* Apply base styles to common button elements */
button,
input[type="submit"],
input[type="button"],
.button-primary, /* Apply to classes used in HTML */
.button-secondary {
    @apply button-base; /* Using Tailwind's @apply for brevity if needed, or copy styles */
    /* If not using @apply, copy styles from .button-base here */
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed) var(--transition-ease);
    box-shadow: var(--box-shadow-light);
    transform: perspective(1px) translateZ(0);
}
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.button-primary:hover,
.button-secondary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: var(--box-shadow-medium);
}
button:active,
input[type="submit"]:active,
input[type="button"]:active,
.button-primary:active,
.button-secondary:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: var(--box-shadow-light);
}


/* --- Header & Navigation --- */
header {
    /* Tailwind handles sticky, bg, shadow */
    transition: background-color var(--transition-speed) var(--transition-ease);
}

header nav a {
    color: var(--color-text-dark); /* Ensure dark text for header links on light bg */
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    text-decoration: none;
}
header nav a:hover {
    color: var(--color-primary);
    text-decoration: none; /* Remove underline */
}
header nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--color-primary);
    transition: all var(--transition-speed) var(--transition-ease);
    transform: translateX(-50%);
}
header nav a:hover::after {
    width: 80%;
}

header .button-primary { /* Style the contact button in nav */
     padding: 0.6rem 1.2rem;
     font-size: 0.9rem;
}

/* Burger Icon */
.burger-icon span {
    background-color: var(--color-text-dark); /* Ensure dark color */
    transition: all 0.3s ease-in-out;
}
.mobile-menu-button.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-button.open span:nth-child(2) {
    /*opacity: 0;*/
}
.mobile-menu-button.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
#mobile-menu {
    /* Tailwind handles hidden/block */
    border-top: 1px solid var(--color-border);
}
#mobile-menu a {
    color: var(--color-text-dark);
    transition: background-color var(--transition-speed) var(--transition-ease), color var(--transition-speed) var(--transition-ease);
}
#mobile-menu a:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
}


/* --- Hero Section --- */
#hero {
    /* min-height: 100vh; */ /* Removed fixed height */
    padding-top: 10vh; /* Adjust padding instead */
    padding-bottom: 10vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    display: flex; /* Ensure flex properties work */
    align-items: center; /* Vertically center content */
    justify-content: center; /* Horizontally center content */
}

.dark-overlay::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)); /* Slightly darker overlay */
    z-index: 1;
}

#hero .content-overlay {
    position: relative;
    z-index: 2;
    max-width: 800px; /* Limit text width */
}

#hero h1 {
    color: var(--color-text-light); /* Explicitly white */
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
}

#hero p {
    color: var(--color-text-light); /* Explicitly white */
    opacity: 0.9;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* --- Skewed Background Effect --- */
.skewed-bg {
    transform: skewY(-2deg); /* Adjust angle as needed */
    transform-origin: 0;
    /* Ensure background covers skewed area */
    position: absolute;
    left: 0;
    width: 100%;
    height: 150px; /* Adjust height as needed */
    z-index: 0; /* Below content */
}
.skewed-bg.bottom {
    bottom: 0;
    transform-origin: 100%;
}
.skewed-bg.top {
    top: 0;
    transform-origin: 0;
}
/* Sections need relative positioning and potentially z-index to stack correctly with skewed elements */
section {
    position: relative;
    z-index: 1; /* Ensures content is above previous section's bottom skew */
}
/* Specific adjustments might be needed based on placement */
#hero + section .skewed-bg.top {
    transform: skewY(-2deg) translateY(-50%); /* Overlap slightly */
}
section + section .skewed-bg.top {
     transform: skewY(-2deg) translateY(-50%);
}

/* Optional: Unskew content inside skewed sections if needed */
.unskew-content {
     transform: skewY(2deg);
}


/* --- Cards --- */
.card {
    background-color: var(--color-bg-white);
    border-radius: 10px;
    box-shadow: var(--box-shadow-light);
    transition: transform var(--transition-speed) var(--transition-ease), box-shadow var(--transition-speed) var(--transition-ease);
    overflow: hidden; /* Ensure content respects border radius */
    display: flex; /* For centering image */
    flex-direction: column; /* Stack image and content */
    height: 100%; /* Make cards in a grid equal height */
}

.card:hover {
    transform: translateY(-8px) rotateX(2deg) scale(1.02); /* Subtle 3D hover */
    box-shadow: var(--box-shadow-dark);
}

.card-image {
    width: 100%;
    /* height: 200px; */ /* Removed Fixed height - let aspect ratio control */
    aspect-ratio: 16 / 10; /* Control aspect ratio */
    overflow: hidden;
    margin: 0 auto; /* Center image container */
    flex-shrink: 0; /* Prevent image container from shrinking */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the container */
    object-position: center;
    transition: transform 0.4s var(--transition-ease);
}

.card:hover .card-image img {
    transform: scale(1.1); /* Zoom effect on hover */
}

.card-content {
    padding: 1.5rem;
    text-align: center; /* Center text content */
    flex-grow: 1; /* Allow content to fill remaining space */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push elements apart if needed */
}
.card-content h3 {
    margin-bottom: 0.75rem;
    color: var(--color-primary); /* Use primary color for card titles */
}
.card-content p {
    color: var(--color-text-medium);
    font-size: 0.95rem;
    margin-bottom: 1rem; /* Space before potential button/link */
}
.card-content blockquote {
    font-style: italic;
    color: var(--color-text-subtle);
    border-left: 4px solid var(--color-primary);
    padding-left: 1rem;
    margin-bottom: 1rem;
    text-align: left; /* Keep quote text left-aligned */
}
.card-content .font-semibold {
    color: var(--color-text-dark);
}

/* Specific Card Type Adjustments */
#recursos .card {
    text-align: left; /* Align resource card text left */
    justify-content: flex-start; /* Align content to top */
}
#recursos .card-content {
    text-align: left;
}
#recursos .card-content a {
    margin-top: auto; /* Push link to bottom */
    align-self: flex-start; /* Keep link left-aligned */
}

/* Read More Link Styling */
.card-content a[target="_blank"],
.read-more-link { /* Add class .read-more-link if needed */
    color: var(--color-accent1);
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    margin-top: 1rem;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}
.card-content a[target="_blank"]:hover,
.read-more-link:hover {
    color: var(--color-accent1-dark);
    text-decoration: underline;
    transform: translateX(4px);
}
.card-content a[target="_blank"]::after,
.read-more-link::after{
    content: ' →'; /* Add arrow */
    display: inline-block;
    transition: transform var(--transition-speed) ease;
}
.card-content a[target="_blank"]:hover::after,
.read-more-link:hover::after {
    transform: translateX(3px);
}


/* --- Timeline --- */
/* Styles are partially in HTML, ensure they integrate */
.timeline::after {
    background-color: var(--color-primary);
}
.timeline-container::after {
    border-color: var(--color-accent1);
    background-color: var(--color-bg-white);
}
.timeline-content {
    background-color: var(--color-bg-white);
    box-shadow: var(--box-shadow-medium);
    border-radius: 8px;
    position: relative; /* For potential pseudo-elements */
}
.timeline-content h3 {
    color: var(--color-primary); /* Primary color for timeline titles */
}
/* Add hover effect or subtle animation */
.timeline-content {
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.timeline-container:hover .timeline-content {
     transform: scale(1.03);
     box-shadow: var(--box-shadow-dark);
}


/* --- Forms --- */
.input-field,
.textarea-field {
    border: 1px solid var(--color-border);
    padding: 0.8rem 1rem;
    border-radius: 5px;
    width: 100%;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    font-family: var(--font-body);
    font-size: 1rem;
    background-color: #fdfdfd; /* Slightly off-white background */
}
.input-field:focus,
.textarea-field:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.2); /* Primary color focus ring */
}
label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-dark);
    font-weight: 500;
}
/* Contact Form Specific Wrapper */
#contacto .max-w-3xl {
     background: linear-gradient(145deg, var(--color-bg-white), #eef2f5);
     padding: 2.5rem;
     border-radius: 12px;
     box-shadow: var(--box-shadow-medium);
}


/* --- Footer --- */
footer {
    background-color: var(--color-bg-dark);
    color: #a0aec0; /* Lighter gray for footer text */
    padding: 4rem 0 2rem 0;
    font-size: 0.95rem;
}

footer h3 {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

footer a {
    color: #cbd5e0; /* Even lighter gray for links */
    text-decoration: none;
    transition: color var(--transition-speed) var(--transition-ease);
}

footer a:hover {
    color: var(--color-accent1); /* Accent color on hover */
    text-decoration: underline;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer ul li {
    margin-bottom: 0.75rem;
}

/* Footer Social Links (Text) */
footer .social-links a {
    display: inline-block; /* Allows margin */
    margin-right: 1rem; /* Space between links */
    margin-bottom: 0.5rem; /* Space below links */
    color: #cbd5e0; /* Match other footer links */
    font-weight: 500;
    transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}
footer .social-links a:hover {
    color: var(--color-accent1);
    transform: scale(1.1); /* Slight grow effect */
    text-decoration: none; /* No underline for social links */
}
footer .social-links a:last-child {
    margin-right: 0;
}

footer .border-t {
    border-color: rgba(255, 255, 255, 0.15); /* Subtle border */
    margin-top: 2.5rem;
    padding-top: 2rem;
}

footer .text-gray-500 {
    color: #718096; /* Slightly darker than other footer text for copyright */
}

/* --- Specific Page Styles --- */

/* Success Page */
.success-page-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Full viewport height */
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent2)); /* Gradient background */
}
.success-page-content {
    background-color: rgba(255, 255, 255, 0.9); /* Semi-transparent white card */
    padding: 3rem;
    border-radius: 10px;
    box-shadow: var(--box-shadow-dark);
    max-width: 600px;
}
.success-page-content h1 {
    color: var(--color-accent2); /* Green heading */
    margin-bottom: 1.5rem;
}
.success-page-content p {
    color: var(--color-text-medium);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}
.success-page-content .button-primary {
     background-color: var(--color-accent1); /* Orange button */
}
.success-page-content .button-primary:hover {
     background-color: var(--color-accent1-dark);
}


/* Privacy & Terms Pages */
.privacy-policy-container,
.terms-conditions-container {
    padding-top: 120px; /* Adjust based on fixed header height + extra space */
    padding-bottom: 4rem;
    min-height: calc(100vh - 80px); /* Ensure footer is pushed down, adjust 80px based on footer height */
}
.privacy-policy-container .content-wrapper,
.terms-conditions-container .content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--color-bg-white);
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow-medium);
}
.privacy-policy-container h1,
.terms-conditions-container h1 {
    color: var(--color-primary);
    margin-bottom: 2rem;
    text-align: center;
}
.privacy-policy-container h2,
.terms-conditions-container h2 {
    color: var(--color-primary-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary-light); /* Adjust color */
}

/* --- Utilities --- */
.high-contrast-darkbg { color: var(--color-text-light); }
.high-contrast-lightbg { color: var(--color-text-dark); }

/* --- Animations (Complement GSAP) --- */
/* Add subtle fade-in for elements animated by GSAP if needed */
.scroll-animate {
    /*opacity: 0; !* Initially hidden, GSAP will fade it in *!*/
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    /* Adjust card grid, timeline, etc. */
    .grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .md\:grid-cols-2 { /* Styles for medium screens applied by Tailwind */ }
    .md\:grid-cols-3 { /* Styles for medium screens applied by Tailwind */ }
    .lg\:grid-cols-3 { /* Styles for large screens applied by Tailwind */ }

    /* Reduce padding on smaller screens */
    .card-content { padding: 1rem; }
    #contacto .max-w-3xl { padding: 1.5rem; }
    .privacy-policy-container .content-wrapper,
    .terms-conditions-container .content-wrapper { padding: 1.5rem; }
}

/* --- Cookie Popup (From HTML, ensure consistency) --- */
#cookie-popup {
    background-color: rgba(0, 0, 0, 0.88); /* Ensure dark enough */
    color: var(--color-text-light);
    font-family: var(--font-body);
    font-size: 14px;
    align-items: center; /* Vertically center */
    justify-content: space-between; /* Space out text and button */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 15px; /* Space between items when wrapped */
}
#cookie-popup p {
    color: var(--color-text-light);
    margin: 0;
    flex-grow: 1; /* Allow text to take available space */
    line-height: 1.5;
    margin-bottom: 0; /* Override default p margin */
}
#cookie-popup a {
    color: var(--color-accent1); /* Use accent color for link */
    text-decoration: underline;
    font-weight: bold;
}
#cookie-popup a:hover {
     color: var(--color-accent1-dark);
}
#accept-cookies {
    background-color: var(--color-primary);
    color: var(--color-text-light);
    border: none;
    padding: 8px 18px; /* Slightly more padding */
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color var(--transition-speed) ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}
#accept-cookies:hover {
    background-color: var(--color-primary-dark);
}