:root {
    --fuenteHeading: 'PT Sans', sans-serif;
    --fuenteParrafos: 'Open Sans', sans-serif;

    --primario: #784D3C;
    --primario-oscuro: #5a3a2c;
    --primario-claro: #a46d5a;
    --secundario: #d4a574;
    --acento: #e8b87f;
    --gris: #e1e1e1;
    --gris-oscuro: #8c8c8c;
    --gris-claro: #f8f8f8;
    --blanco: #ffffff;
    --negro: #000000;
    --sombra: 0 4px 6px rgba(0, 0, 0, 0.1);
    --sombra-suave: 0 2px 4px rgba(0, 0, 0, 0.05);
    --borde-redondeado: 8px;
    --transicion: all 0.3s ease;
}
html {
    box-sizing: border-box;
    font-size: 62.5%; /* 1 rem = 10px */    
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    font-family: var(--fuenteParrafos);
    font-size: 1.6rem;
    line-height: 1.8;
    color: #333;
    background-color: var(--gris-claro);
}

/** Globales **/
.contenedor {
    width: min(85%, 140rem);
    margin: 0 auto;
    padding: 0 2rem;
}

.contenedor--fluid {
    width: 100%;
    padding: 0 2rem;
}

.seccion {
    padding: 8rem 0;
}

.seccion--pequena {
    padding: 4rem 0;
}

.grid {
    display: grid;
    gap: 3rem;
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
}

.flex--column {
    flex-direction: column;
}

.flex--centrado {
    justify-content: center;
    align-items: center;
}

.flex--entre {
    justify-content: space-between;
    align-items: center;
}

.espaciado--pequeno {
    margin-bottom: 2rem;
}

.espaciado--mediano {
    margin-bottom: 4rem;
}

.espaciado--grande {
    margin-bottom: 6rem;
}
a {
    text-decoration: none;
    color: var(--primario);
    transition: var(--transicion);
}

a:hover {
    color: var(--primario-oscuro);
}
h1, h2, h3, h4 {
    font-family: var(--fuenteHeading);
    line-height: 1.2;
}
h1 {
    font-size: 4.8rem;
}
h2 {
    font-size: 4rem;
}
h3 {
    font-size: 3.2rem;
}
h4 {
    font-size: 2.8rem;
}
img {
    max-width: 100%;
}
/** Utilidades **/
.no-margin {
    margin: 0;
}
.no-padding {
    padding: 0;
}
.centrar-texto {
    text-align: center;
}

/** Header **/
.webp .header {
    background-image: url(../img/banner.webp);
}
.no-webp .header {
    background-image: url(../img/banner.jpg);
}
.header {
    min-height: 100vh;
    height: auto;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(120, 77, 60, 0.8), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

.header > .contenedor {
    position: relative;
    z-index: 2;
}

.header__texto {
    position: relative;
    z-index: 2;
}
.header__texto {
   text-align: center;
   color: var(--blanco);
   padding: 8rem 2rem;
   animation: fadeInUp 1s ease-out;
   max-width: 80rem;
   margin: 0 auto;
}

.header__texto h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    font-size: clamp(3rem, 5vw, 5rem);
    line-height: 1.1;
}

.header__texto p {
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.header__texto .boton {
    margin: 0 auto;
    display: inline-block;
    min-width: 20rem;
}
@media (min-width: 768px) {
    .header__texto {
        margin-top: 15rem;
    }
}
.barra {
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transicion);
}

.barra:hover {
    background: rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .barra {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
.logo {
    color: var(--blanco);
    transition: var(--transicion);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.logo:hover {
    transform: scale(1.05);
    color: var(--acento);
}
.logo__nombre {
    font-weight: 400;
}
.logo__bold {
    font-weight: 700;
}
@media (min-width: 768px) {
    .navegacion {
        display: flex;
        gap: 2rem;
    }
}
.navegacion__enlace {
    display: block;
    text-align: center;
    font-size: 1.8rem;
    color: var(--blanco);
    padding: 0.5rem 1rem;
    border-radius: var(--borde-redondeado);
    transition: var(--transicion);
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.navegacion__enlace:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    color: var(--acento);
}

.navegacion__enlace::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--acento);
    transition: var(--transicion);
    transform: translateX(-50%);
}

.navegacion__enlace:hover::after {
    width: 80%;
}

.contenido-principal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    margin-top: -4rem;
    position: relative;
    z-index: 10;
}

@media (min-width: 1024px) {
    .contenido-principal {
        grid-template-columns: 2.5fr 1fr;
        column-gap: 5rem;
    }
}

.blog {
    background: var(--blanco);
    border-radius: var(--borde-redondeado);
    padding: 3rem;
    box-shadow: var(--sombra);
}

.sidebar {
    position: sticky;
    top: 10rem;
    height: fit-content;
}

@media (max-width: 767px) {
    .campo {
        flex-direction: column;
    }
    
    .campo__label {
        flex: none;
        text-align: left;
        padding-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .formulario {
        padding: 3rem 2rem;
    }
    
    .header {
        min-height: auto;
        height: auto;
    }
    
    .header__texto {
        padding: 4rem 2rem;
    }
    
    .barra {
        position: relative;
        top: 0;
    }
    
    .contenido-principal {
        margin-top: 2rem;
        gap: 2rem;
    }
    
    .blog {
        padding: 2rem;
    }
    
    .sidebar {
        position: relative;
        top: 0;
    }
    
    .seccion {
        padding: 4rem 0;
    }
    
    .entrada__imagen {
        height: 20rem;
    }
    
    .curso__imagen {
        height: 15rem;
    }
}

@media (max-width: 480px) {
    .contenedor {
        width: min(95%, 120rem);
        padding: 0 1rem;
    }
    
    .entrada__contenido {
        padding: 1.5rem;
    }
    
    .curso__informacion {
        padding: 1.5rem;
    }
    
    .sidebar {
        padding: 1.5rem;
    }
    
    .boton {
        padding: 0.8rem 2rem;
        font-size: 1.6rem;
    }
    
    .header__texto {
        padding: 3rem 1rem;
    }
    
    .entrada__imagen {
        height: 15rem;
    }
    
    .curso__imagen {
        height: 12rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Stagger animations */
.entrada:nth-child(1) {
    animation: fadeInUp 0.8s ease-out;
}

.entrada:nth-child(2) {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.entrada:nth-child(3) {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.widget-curso:nth-child(1) {
    animation: slideInFromRight 0.8s ease-out;
}

.widget-curso:nth-child(2) {
    animation: slideInFromRight 0.8s ease-out 0.2s both;
}

/* Utility classes for animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Clases de utilidad adicionales */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

/* Mejoras de accesibilidad */
.boton:focus,
.navegacion__enlace:focus,
.campo__field:focus {
    outline: 2px solid var(--primario);
    outline-offset: 2px;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Selección de texto */
::selection {
    background-color: var(--primario);
    color: var(--blanco);
}

::-moz-selection {
    background-color: var(--primario);
    color: var(--blanco);
}

.entrada {
    background: var(--blanco);
    border-radius: var(--borde-redondeado);
    padding: 0;
    box-shadow: var(--sombra-suave);
    transition: var(--transicion);
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.entrada__imagen {
    height: 25rem;
    overflow: hidden;
    position: relative;
}

.entrada__imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transicion);
}

.entrada__contenido {
    padding: 2.5rem;
}

.entrada__contenido h4 {
    color: var(--primario);
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    line-height: 1.3;
}

.entrada__contenido p {
    color: var(--gris-oscuro);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1.7rem;
}

.entrada:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra);
}

.entrada__imagen {
    margin-bottom: 1.5rem;
    border-radius: var(--borde-redondeado);
    overflow: hidden;
}

.entrada__imagen img {
    transition: var(--transicion);
}

.entrada:hover .entrada__imagen img {
    transform: scale(1.05);
}

.entrada__contenido h4 {
    color: var(--primario);
    margin-bottom: 1rem;
    font-size: 2.4rem;
}

.entrada__contenido p {
    color: var(--gris-oscuro);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.entrada:last-of-type {
    border: none;
    margin-bottom: 0;
}
.boton {
    display: block;
    font-family: var(--fuenteHeading);
    color: var(--blanco);
    text-align: center;
    padding: 1rem 3rem;
    font-size: 1.8rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2rem;
    border: none;
    border-radius: var(--borde-redondeado);
    cursor: pointer;
    transition: var(--transicion);
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.boton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.boton:hover::before {
    left: 100%;
}

@media (min-width: 768px) {
    .boton {
        display: inline-block;

    }
}
.boton:hover {
    cursor: pointer;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.boton:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.boton--primario {
    background: linear-gradient(135deg, var(--negro), var(--gris-oscuro));
}
.boton--secundario {
    background: linear-gradient(135deg, var(--primario), var(--primario-oscuro));
}

.boton--primario:hover {
    background: linear-gradient(135deg, var(--gris-oscuro), var(--negro));
}

.boton--secundario:hover {
    background: linear-gradient(135deg, var(--primario-oscuro), var(--primario));
}

.cursos {
    list-style: none;
}

.sidebar {
    background: var(--blanco);
    border-radius: var(--borde-redondeado);
    padding: 2.5rem;
    box-shadow: var(--sombra);
}

.sidebar h3 {
    color: var(--primario);
    margin-bottom: 2rem;
    font-size: 2.2rem;
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gris-claro);
}

.widget-curso {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--gris-claro);
    border-radius: var(--borde-redondeado);
    transition: var(--transicion);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.widget-curso:last-child {
    margin-bottom: 0;
}

.widget-curso:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra);
}

.widget-curso h4 {
    color: var(--primario);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}
.widget-curso:last-of-type {
    border: none;
    margin-bottom: 0;
}
.widget-curso__label {
    font-family: var(--fuenteHeading);
    font-weight: bold;
}
.widget-curso__info {
    font-weight: normal;
}
.widget-curso__label,
.widget-curso__info {
    font-size: 2rem;
}

.footer {
    background: linear-gradient(135deg, var(--negro), var(--primario-oscuro));
    padding: 6rem 0 3rem 0;
    margin-top: 8rem;
    position: relative;
}

.footer .barra {
    background: transparent;
    border-bottom: none;
    position: static;
    padding: 0;
}

.footer .barra:hover {
    background: transparent;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primario), var(--secundario), var(--acento));
}

/** Sobre Nosotros **/
@media (min-width: 768px) {
    .sobre-nosotros {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 2rem;
    }
}

/** Cursos **/
.curso {
    background: var(--blanco);
    border-radius: var(--borde-redondeado);
    margin-bottom: 3rem;
    box-shadow: var(--sombra);
    transition: var(--transicion);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.curso__imagen {
    height: 20rem;
    overflow: hidden;
}

.curso__imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transicion);
}

.curso__informacion {
    padding: 2.5rem;
}

.curso:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra);
}

.curso__imagen {
    border-radius: var(--borde-redondeado);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.curso__imagen img {
    transition: var(--transicion);
}

.curso:hover .curso__imagen img {
    transform: scale(1.05);
}

.curso__informacion h4 {
    color: var(--primario);
    margin-bottom: 1rem;
    font-size: 2.2rem;
}

.curso__descripcion {
    color: var(--gris-oscuro);
    line-height: 1.6;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .curso {
        display: grid;
        grid-template-columns: 1fr 2fr;
        column-gap: 2rem;
    }
}
.curso:last-of-type {
   border: none;
}
.curso__label {
    font-family: var(--fuenteHeading);
    font-weight: bold;
}
.curso__info {
    font-weight: normal;
}
.curso__label,
.curso__info {
    font-size: 2rem;
}

/** Contacto **/
.contacto-bg {
    background-image: url(../img/contacto.jpg);
    height: 40rem;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: var(--borde-redondeado);
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.contacto-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(120, 77, 60, 0.3), rgba(0, 0, 0, 0.5));
}

.formulario {
    background-color: var(--blanco);
    margin: -5rem auto 0 auto;
    width: 95%;
    padding: 5rem;
    border-radius: var(--borde-redondeado);
    box-shadow: var(--sombra);
    position: relative;
    z-index: 10;
}
.campo {
    display: flex;
    margin-bottom: 2rem;
}
.campo__label {
    flex: 0 0 9rem;
    text-align: right;
    padding-right: 2rem;
    font-weight: 600;
    color: var(--primario);
    font-family: var(--fuenteHeading);
}
.campo__field {
    flex: 1;
    border: 2px solid var(--gris);
    padding: 1rem;
    border-radius: var(--borde-redondeado);
    font-size: 1.6rem;
    font-family: var(--fuenteParrafos);
    transition: var(--transicion);
    background-color: var(--blanco);
}

.campo__field:focus {
    outline: none;
    border-color: var(--primario);
    box-shadow: 0 0 0 3px rgba(120, 77, 60, 0.1);
}

.campo__field::placeholder {
    color: var(--gris-oscuro);
    opacity: 0.7;
}
.campo__field--textarea {
    height: 20rem;
    resize: vertical;
    min-height: 10rem;
}