@font-face {
    font-family: 'Castio';
    src: url('fonts/Castio-Regular.otf') format('opentype'),
         url('fonts/Castio-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Castio Italic';
    src: url('fonts/Castio-Italic.otf') format('opentype'),
         url('fonts/Castio-Italic.ttf') format('truetype');
}

body {
    font-family: 'Helvetica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #273f22;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    animation: fadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.top-bar {
    background: linear-gradient(135deg, #273f22 0%, #1f3319 100%);
    color: #ffffff;
    padding: 8px 0;
    font-size: 0.85em;
}

.top-bar .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.contact-info {
    font-family: 'Helvetica', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.contact-info a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.contact-info a:hover {
    color: inherit;
    text-decoration: none;
}

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

.top-social a {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.top-social a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

header {
    background: #ffffff;
    color: #273f22;
    padding: 15px 0;
    border-bottom: 1px solid rgba(39, 63, 34, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px; /* small divider */
    background: linear-gradient(90deg, #273f22 0%, #1f3319 50%, #273f22 100%);
    pointer-events: none;
    z-index: 101;
    border-radius: 0 0 6px 6px;
}

/* Hero Banner - Equipo */
.hero-banner {
    position: relative;
    margin-top: 0;
    margin-bottom: 0; /* no overlap to ensure logo section is fully visible */
    z-index: 10;
}

.hero-image {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Remove the dark filter to show faces clearly */
}

.hero-content {
    position: absolute;
    top: calc(100% - 40px); /* back to original good position */
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    z-index: 20;
}

.hero-title {
    font-family: 'Castio', serif;
    font-size: 2.8rem;
    font-weight: 400;
    color: #273f22;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem; /* larger than default body text to maintain hierarchy */
    color: #555;
    margin: 0 0 2.5rem 0;
    line-height: 1.6;
}

.hero-button {
    display: inline-block;
    background: linear-gradient(135deg, #273f22 0%, #1f3319 100%);
    color: #ffffff !important;
    padding: 16px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(39, 63, 34, 0.3);
}

.hero-button:hover {
    background: linear-gradient(135deg, #1f3319 0%, #273f22 100%);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 63, 34, 0.4);
    text-decoration: none;
}

.hero-button:visited,
.hero-button:focus,
.hero-button:active {
    color: #ffffff !important;
    text-decoration: none;
}

/* Hero spacer to push content down below floating card */
.hero-spacer {
    height: 350px; /* proportional to hero-content height + 10px */
    width: 100%;
    background: linear-gradient(135deg, #273f22 0%, #1f3319 50%, #273f22 100%);
}

/* Main content spacing - reduced since spacer handles the spacing */
main {
    padding-top: 20px; /* small padding to ensure content is visible */
}

/* Main content spacing - reduced since spacer handles the spacing */
main {
    padding-top: 20px; /* small padding to ensure content is visible */
}

/* Team Page Styles */
.team-header {
    text-align: center;
    margin: 3rem 0 1rem 0;
    padding: 1rem 0;
}

.team-header h1 {
    font-family: 'Castio', serif;
    font-size: 3.5rem;
    color: #ffffff;
    margin: 0 0 1rem 0;
    font-weight: 400;
}

.team-intro {
    font-size: 1.4rem;
    color: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.95;
}

.team-image {
    margin: 5px 0px 0px 0px;
    text-align: center;
}

.team-image img {
    width: 100%;
    max-width: 1200px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.team-description {
    max-width: 900px;
    margin: auto auto 0px auto;
    text-align: center;
    padding: 16px 0 0 0px;
}

.team-description h2 {
    font-family: 'Castio', serif;
    font-size: 2.5rem;
    color: #ffffff;
    margin: 0 0 16px 0;
    text-align: center;
}

.team-description p {
    font-size: 1.2rem;
    line-height: 1.7;
    margin: 0 0 1.5rem 0;
    color: #ffffff;
    opacity: 0.95;
}

/* Team Members Grid */
.team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin: 4rem 0;
}

.team-member {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(39, 63, 34, 0.1);
}

.team-member:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.member-photo {
    width: 100%;
    height: 280px;
    overflow: hidden;
    position: relative;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%; /* Mejor posición para mostrar caras */
    transition: transform 0.3s ease;
}

.team-member:hover .member-photo img {
    transform: scale(1.05);
}

.member-info {
    padding: 20px 10px 10px;
}

.member-name {
    font-family: 'Castio', serif;
    font-size: 1.2em;
    color: #273f22;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
    line-height: 1.3;
}

.member-position {
    font-family: 'Castio', serif;
    font-size: 1rem;
    color: #1f3319;
    margin: 0 0 1rem 0;
    font-weight: 400;
    font-style: italic;
}

.member-bio {
    font-family: 'Helvetica', sans-serif;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
    text-align: justify;
}

.member-bio p {
    margin: 0 10px 0.5rem 0;
}

.member-bio ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style: none; /* Remove default bullets */
}

.member-bio li {
    margin-bottom: 0.3rem;
    text-align: justify;
    padding-left: 1.2rem;
    background-image: url('media/Vineta.png');
    background-repeat: no-repeat;
    background-position: 0 0.35rem;
    background-size: 0.7rem 0.7rem;
}

.member-bio ul ul {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

.member-bio ul ul li {
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
    padding-left: 1.4rem;
    background-position: 0.2rem 0.35rem;
    background-size: 0.6rem 0.6rem;
}

header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.logo {
    max-height: 50px;
    height: auto;
    width: auto;
    margin: 0;
    transition: transform 0.3s ease;
}

/* Permite que el logo sea clickable sin afectar estilos */
.logo-link {
    display: inline-block;
    line-height: 0;
}

.logo:hover {
    transform: scale(1.02);
}

.brand {
    display: flex;
    align-items: center;
}

/* Brand text styles removed - using horizontal logo only */

.header-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.header-nav a {
    text-decoration: none;
    color: #273f22;
    font-family: 'Castio', sans-serif;
    font-size: 1em;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.25s ease-in-out;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1.5px solid transparent;
}

.header-nav a svg {
    transition: transform 0.3s ease;
}

.header-nav a:hover {
    color: #ffffff;
    background: #273f22;
    border-color: #273f22;
    transform: translateY(0);
    box-shadow: none;
}

.header-nav a:hover svg {
    transform: scale(1.1);
}

.header-nav a.active {
    color: #ffffff;
    background: #273f22;
    border-color: #273f22;
    box-shadow: none;
}

.header-nav a span {
    font-weight: 500;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #007BFF; /* Cambiar a un color visible */
}

@media (max-width: 768px) {
    .top-bar .container {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .top-bar {
        padding: 5px 0;
    }
    
    /* En móvil ocultamos el email, dejando sólo RRSS */
    .contact-info {
        display: none;
    }
    
    .top-social {
        gap: 12px;
    }
    
    .top-social a {
        width: 28px;
        height: 28px;
    }
    
    header {
        padding: 15px 0;
    }
    
    .logo-section {
        margin: 8px 0 12px 0;
        padding: 5px 0;
        text-align: center;
    }
    
    .logo-carta {
        max-width: 180px;
        height: auto;
    }
    
    header .container {
        flex-direction: column;
        gap: 15px;
        padding: 0 12px;
    }
    
    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .logo {
        max-height: 55px;
    }
    
    /* Brand text styles removed - using horizontal logo only */
    
    .header-nav ul {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-nav a {
        font-size: 0.9em;
        padding: 10px 16px;
        gap: 6px;
    }
    
    main {
        padding: 5px 0 30px 0;
    }
    
    main .container {
        padding: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .carta {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        padding: 25px 20px;
        font-size: 1em;
        line-height: 1.8;
        letter-spacing: 0.01em;
        overflow-wrap: break-word;
        box-sizing: border-box;
        text-align: left;
        border-radius: 0;
        word-spacing: 0.05em;
    }
    
    .carta p {
        margin-bottom: 20px;
        max-width: 100%;
    }
    
    .carta .titulo {
        font-size: 1.15em;
        font-weight: 600;
        margin-bottom: 25px;
    }
    
    .social-section {
        padding: 40px 0 60px 0;
    }
    
    .social-section h2 {
        font-size: 2.2em;
        margin-top: 0;
    }
    
    .social-description {
        margin-bottom: 30px;
        padding: 0 12px;
    }
    
    .social-icons {
        gap: 50px;
        padding: 0 20px;
    }
    
    .social-icon {
        padding: 30px 25px;
    }
    
    footer {
        padding: 50px 0 30px 0;
    }
    
    .legal-links {
        gap: 15px;
        padding: 0 20px;
    }
    
    .legal-links a {
        font-size: 0.85em;
    }
}

/* --- Mobile fixes: carta full-width and hide Contacto --- */
@media (max-width: 768px) {
  /* Carta: edge-to-edge, readable */
  .carta {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: 14px;
    padding-right: 14px;
    text-align: left; /* avoid extra spacing from justify on small screens */
    hyphens: auto;
    -webkit-hyphens: auto;
    overflow-wrap: anywhere;
  }

  /* Paragraph spacing tuned for mobile */
  .carta p { margin-bottom: 18px; }

  /* Hide any Contacto item in nav on mobile, in case a cached include shows it */
  .header-nav a[href*="contacto"],
  .header-nav a[href*="#redes-sociales"] {
    display: none !important;
  }
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0 40px 0; /* Reduce top and bottom padding */
    background: linear-gradient(135deg, #273f22 0%, #1f3319 50%, #273f22 100%);
    color: #ffffff;
    position: relative; /* crea contexto para su pseudo-elemento */
    z-index: 0;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    pointer-events: none; /* no intercepta clics */
    z-index: -1; /* queda por debajo del contenido y no solapa el footer */
}

.logo-section {
    text-align: center;
    margin: 15px 0 30px 0;
    padding: 10px 0;
}

.logo-carta {
    max-width: 300px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-carta:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.3));
}

.carta {
    max-width: 900px;
    background: linear-gradient(135deg, #ffffff 0%, #fafcfa 100%);
    color: #273f22;
    padding: 60px 80px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
    font-size: 1em;
    text-align: justify;
    position: relative;
    border: 1px solid rgba(39, 63, 34, 0.1);
}

.carta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #273f22 0%, #1f3319 50%, #273f22 100%);
    border-radius: 20px 20px 0 0;
}

.carta p {
    margin-bottom: 24px;
    text-indent: 0;
}

.carta p:last-of-type:not(.firma) {
    margin-bottom: 0;
}

.titulo {
    font-family: 'Castio', sans-serif;
    font-weight: bold;
    font-size: 1.3em;
    color: #273f22;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.titulo::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: #273f22;
}

.vivas {
    font-family: 'Castio', sans-serif;
    font-weight: bold;
    text-align: center;
    font-size: 24px;
    color: #273f22;
    margin: 8px 0;
    text-transform: none;
}

.firma {
    font-family: 'Castio Italic', cursive;
    font-size: 2.2em;
    text-align: center;
    margin-top: 60px;
    font-weight: normal;
    color: #273f22;
    position: relative;
    padding-top: 40px;
}

.firma::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #273f22 50%, transparent 100%);
}

main h2 {
    font-size: 3em;
    color: #273f22;
    margin: 0 0 20px 0;
}

main p {
    font-size: 1.5em;
    color: #273f22;
    margin: 10px 0;
}

footer {
    background: linear-gradient(135deg, #273f22 0%, #1f3319 50%, #273f22 100%);
    padding: 60px 0 40px 0;
    font-size: 0.9em;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    /* Evita que la capa decorativa bloquee los clics en los enlaces del footer */
    pointer-events: none;
    z-index: 0;
}

footer p {
    font-family: 'Castio', sans-serif;
    margin: 0;
    opacity: 0.9;
}

.legal-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 0 40px;
}

.legal-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-family: 'Helvetica', sans-serif;
    font-size: 0.95em;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 400;
}

.legal-links a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.legal-links span {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .legal-links {
        gap: 10px;
        font-size: 0.8em;
    }
}

.social-links {
    display: flex;

    /* Asegura que el contenido del footer esté por encima de su capa decorativa */
    footer .container {
        position: relative;
        z-index: 1;
    }
    justify-content: center;
    gap: 25px;
    margin-bottom: 40px;
}

.social-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.social-links a:hover {
    color: #ffffff;
    transform: translateY(-4px) scale(1.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.social-section {
    background: linear-gradient(135deg, #f5f8f5 0%, #edf2ed 100%);
    padding: 40px 0 60px 0;
    position: relative;
    overflow: hidden;
}

.social-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 70% 80%, rgba(39, 63, 34, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.social-section h2 {
    font-family: 'Castio', sans-serif;
    color: #273f22;
    font-size: 2.2em;
    text-align: center;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
    position: relative;
}

.social-section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #273f22 0%, #1f3319 50%, #273f22 100%);
    border-radius: 2px;
}

.social-description {
    font-family: 'Helvetica', sans-serif;
    color: #273f22;
    font-size: 1.3em;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.8;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
    padding: 0 12px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 80px;
    flex-wrap: wrap;
    position: relative;
}

.social-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #273f22;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 40px 35px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 248, 0.9) 100%);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.social-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(39, 63, 34, 0.05) 0%, rgba(31, 51, 25, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.social-icon:hover::before {
    opacity: 1;
}

.social-icon:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
}

.social-icon.facebook:hover {
    color: #1877f2;
}

.social-icon.twitter:hover {
    color: #000000;
}

.social-icon.instagram:hover {
    color: #e4405f;
}

.social-icon span {
    font-family: 'Castio', sans-serif;
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 20px;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .social-icons {
        gap: 30px;
        padding: 0 20px;
    }
    
    .social-icon {
        padding: 20px;
    }
    
    .social-icon svg {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    main h2 {
        font-size: 2.5em;
    }
    main p {
        font-size: 1.2em;
    }
}

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

/* Legal pages styles */
.legal-content {
    max-width: 900px;
    background: linear-gradient(135deg, #ffffff 0%, #fafcfa 100%);
    color: #273f22;
    padding: 60px 80px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 20px rgba(0, 0, 0, 0.1);
    line-height: 1.7;
    font-size: 1em;
    text-align: left;
    position: relative;
    border: 1px solid rgba(39, 63, 34, 0.1);
    margin: 0 auto;
}

.legal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    pointer-events: none;
}

.legal-content h1 {
    font-family: 'Castio', serif;
    font-size: 2.5em;
    color: #273f22;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 400;
    letter-spacing: -0.02em;
    position: relative;
}

.legal-content h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #273f22, #4a6b42);
    margin: 20px auto;
    border-radius: 2px;
}

.legal-content h2 {
    font-family: 'Castio', serif;
    font-size: 1.4em;
    color: #273f22;
    margin: 40px 0 20px 0;
    font-weight: 500;
    position: relative;
    padding-left: 20px;
}

.legal-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #273f22;
    border-radius: 50%;
}

.legal-content p {
    margin-bottom: 20px;
    text-align: justify;
    position: relative;
}

.legal-content ul {
    margin: 20px 0;
    padding-left: 30px;
    position: relative;
}

.legal-content li {
    margin-bottom: 12px;
    text-align: justify;
    position: relative;
}

.legal-content li::marker {
    color: #273f22;
}

.legal-content strong {
    font-weight: 600;
    color: #1f3319;
}

.legal-content a {
    color: #273f22;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.legal-content a:hover {
    color: #4a6b42;
    text-decoration: none;
}

/* Legal navigation buttons */
.legal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.legal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(39, 63, 34, 0.1);
    border: 1px solid rgba(39, 63, 34, 0.2);
    border-radius: 8px;
    text-decoration: none;
    color: #273f22;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
}

.legal-btn:hover {
    background: rgba(39, 63, 34, 0.15);
    border-color: rgba(39, 63, 34, 0.3);
    transform: translateY(-1px);
}

.legal-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.legal-btn span {
    font-family: 'Helvetica', sans-serif;
}

/* Mobile styles for legal pages */
@media (max-width: 768px) {
    .legal-content {
        margin: 0 20px;
        padding: 40px 30px;
        border-radius: 16px;
        font-size: 0.95em;
        line-height: 1.6;
    }
    
    .legal-content h1 {
        font-size: 2em;
        margin-bottom: 30px;
    }
    
    .legal-content h2 {
        font-size: 1.2em;
        margin: 30px 0 15px 0;
        padding-left: 15px;
    }
    
    .legal-content h2::before {
        width: 6px;
        height: 6px;
    }
    
    .legal-content ul {
        padding-left: 20px;
    }
    
    .legal-content p {
        margin-bottom: 15px;
    }
}

/* Legal buttons mobile styles */
@media (max-width: 768px) {
    .legal-btn {
        padding: 7px 14px;
        font-size: 0.85em;
        gap: 7px;
    }

    .legal-btn svg {
        width: 17px;
        height: 17px;
    }
}

/* Estilos específicos para páginas legales - sobrescribir main */
.legal-page main {
    background: #f8faf9 !important;
    color: #273f22 !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 40px 0 !important;
}

.legal-page main::before {
    display: none !important;
}

/* Asegurar que el footer mantenga sus estilos en páginas legales */
.legal-page footer {
    background: linear-gradient(135deg, #273f22 0%, #1f3319 50%, #273f22 100%) !important;
    color: #ffffff !important;
}

/* --- Strong mobile overrides for improved readability on small screens --- */
@media (max-width: 600px) {
  html, body {
    -webkit-text-size-adjust: 100%;
  }

  /* Make the main container use the viewport width with minimal gutters */
  .container {
    max-width: 100%;
    padding-left: 13px !important; /* previously 8px, add ~5px more */
    padding-right: 13px !important;
    margin: 0 auto;
  }

  header, .top-bar {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  /* Carta: full-width reading area with comfortable typography */
  .carta {
    width: calc(100% - 0px) !important; /* fill available space inside .container */
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 18px 10px !important; /* small lateral padding but wider than before */
    font-size: 1.05rem !important; /* slightly larger overall */
    line-height: 1.6 !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-align: left !important; /* avoid justified rivers */
    hyphens: auto !important;
    -webkit-hyphens: auto !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(39,63,34,0.06) !important;
    max-width: 100% !important;
  }

  .carta p {
    margin-bottom: 16px !important;
    text-indent: 0 !important;
  }

  .logo-carta {
    max-width: 160px !important;
    margin-bottom: 8px;
  }

  /* Reduce header/nav scale so it doesn't dominate the viewport */
  .header-nav a { font-size: 0.95em !important; padding: 8px 10px !important; }

  /* Hide any Contacto nav items defensively */
  .header-nav a[href*="contacto"],
  .header-nav a[href*="#redes-sociales"] {
    display: none !important;
  }

  /* Legal pages mobile adjustments */
  .legal-page .legal-content {
    margin: 0 10px !important;
    padding: 30px 20px !important;
    font-size: 0.9em !important;
    line-height: 1.5 !important;
  }

  .legal-page .legal-content h1 {
    font-size: 1.8em !important;
    margin-bottom: 25px !important;
  }

  .legal-page .legal-content h2 {
    font-size: 1.1em !important;
    margin: 25px 0 12px 0 !important;
    padding-left: 12px !important;
  }

  .legal-page .legal-content p {
    margin-bottom: 12px !important;
  }

  /* Legal buttons mobile */
  .legal-btn {
    padding: 6px 12px !important;
    font-size: 0.8em !important;
    gap: 6px !important;
  }

  .legal-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}

/* Header divider and single-row header tweaks */
header {
  position: sticky; /* already sticky, ensure stacking context */
  z-index: 100;
}

/* thin corporate divider at header bottom to separate from content */
header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px; /* small divider */
  background: linear-gradient(90deg, #273f22 0%, #1f3319 50%, #273f22 100%);
  pointer-events: none;
  z-index: 101;
  border-radius: 0 0 6px 6px;
}

@media (max-width: 600px) {
  /* Force header contents into one row on small screens, scale elements to fit */
  header .container {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding-left: 13px !important; /* align with container gutters */
    padding-right: 13px !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .logo {
    max-height: 42px !important; /* smaller logo to save space */
  }

  .brand {
    display: flex;
    align-items: center;
  }

  /* Keep nav compact and inline */
  .header-nav { 
    display: flex !important; 
    justify-content: flex-end;
  }
  .header-nav ul {
    display: flex !important;
    gap: 0px !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  .header-nav a { 
    padding: 8px 10px !important; 
    font-size: 0.9em !important; 
  }
  .header-nav a span {
    display: none; /* Hide text on mobile, show only icon */
  }

  /* Ensure header-left stays left and nav moves to the right */
  .header-left { flex: 0 0 auto !important; }
  .header-nav { margin-left: auto !important; }

  /* Brand text styles removed - using horizontal logo only */

  /* Hero Banner mobile */
  .hero-banner {
    margin-bottom: 0 !important; /* no overlap to ensure logo is visible on mobile */
  }
  
  .hero-image {
    height: 300px !important;
  }
  
  .hero-content {
    width: 80% !important;
    padding: 1.5rem 1rem !important; /* reduced padding to prevent overflow */
    top: calc(100% - 20px) !important; /* back to good position on mobile */
    bottom: auto !important;
  }
  
  .hero-title {
    font-size: 2rem !important;
    margin: 0 0 0.8rem 0 !important;
    line-height: 1.1 !important;
  }
  
  .hero-description {
    font-size: 1.1rem !important; /* larger than carta text (1.05rem) to maintain hierarchy */
    margin: 0 0 1.2rem 0 !important;
    line-height: 1.4 !important;
  }
  
  .hero-button {
    padding: 10px 20px !important;
    font-size: 0.85rem !important;
  }

  /* Hero spacer mobile */
  .hero-spacer {
    height: 400px !important; /* proportional to mobile hero-content height + 10px */
  }
  
  /* No additional main padding needed on mobile */
  main {
    padding-top: 0 !important;
  }

  /* Team page mobile */
  .team-header {
    margin: 2rem 1rem 1rem 1rem !important;
    padding: 1rem !important;
  }
  
  .team-header h1 {
    font-size: 2.5rem !important;
    margin: 0 0 1rem 0 !important;
  }
  
  .team-intro {
    font-size: 1.2rem !important;
    padding: 0 10px !important;
  }
  
  .team-description {
    margin: 48px 16px 32px 16px !important;
    padding: 24px !important;
  }
  
  .team-description h2 {
    font-size: 2rem !important;
    margin: 0 0 24px 0 !important;
  }
  
  .team-description p {
    font-size: 1.1rem !important;
  }

  /* Team members mobile */
  .team-members {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    margin: 2rem 0 !important;
    padding: 0 20px !important; /* Padding adicional para las imágenes */
  }

  .team-member {
    margin: 0 !important;
    padding: 1rem !important;
  }

  .member-photo {
    width: 200px !important; /* Cuadrado perfecto 1:1 */
    height: 200px !important;
    margin: 0 auto !important; /* Centrado horizontal */
    padding: 10px !important; /* Padding para mejor visibilidad */
  }

  .member-photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center 20% !important; /* Mejor posición para mostrar caras */
    border-radius: 8px !important;
  }

  .member-name {
    font-size: 1.3rem !important;
  }

  .member-position {
    font-size: 1.0rem !important;
  }

  .member-bio {
    font-size: 0.9rem !important;
  }

  .member-bio li {
    padding-left: 16px !important;
    background-image: url('media/Vineta.png') !important;
    background-repeat: no-repeat !important;
    background-position: 0 6px !important;
    background-size: 10px 10px !important;
  }

  .member-bio ul ul li {
    padding-left: 20px !important;
    background-image: url('media/Vineta.png') !important;
    background-repeat: no-repeat !important;
    background-position: 4px 6px !important;
    background-size: 8px 8px !important;
  }
}