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

    --primario: #784D3C;
    --blanco: #ffffff;
    --negro: #000000;
    --gris: #E1E1E1;
}

/* Regla global */
html {
    box-sizing: border-box;
    font-size: 62.5%;
    /* 1rem = 10px */
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    font-family: var(--fuenteParrafo);
    font-size: 1.6rem;
    line-height: 2;
    margin: 0;
    background-color: #fff;
}

/* Contenedor general */
.contenedor {
    width: min(90%, 120rem);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Tipografías generales */
h1,
h2,
h3,
h4 {
    font-family: var(--fuenteHeading);
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
}

h1 {
    font-size: 4.8rem;
}

h2 {
    font-size: 4rem;
}

h3 {
    font-size: 3.2rem;
    /* corregido el uso de coma a punto */
}

h4 {
    font-size: 2.8rem;
    /* corregido el uso de coma a punto */
}

/* Imágenes */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 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 {
    background-image: url(../img/banner.jpg);
    height: 60rem;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

.header__texto {
    text-align: center;
    color: var(--blanco);
    margin-top: 5rem;
}

@media (min-width: 768px) {
    .header__texto {
        margin-top: 15rem;
    }
}

/* Barra de navegación */
.barra {
    padding: 4rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .barra {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 2rem 1rem;
    }
}

/* Logo */
.logo {
    color: var(--blanco);
    max-width: 100%;
    height: auto;
    display: block;
}

.logo__nombre {
    font-weight: 400;
    font-size: 3.6rem;
    /* tamaño más equilibrado en desktop */
    margin: 0;
}

.logo__bold {
    font-weight: 700;
}

@media (max-width: 768px) {
    .logo__nombre {
        font-size: 2.5rem;
        text-align: center;
    }
}

/* Navegación */
.navegacion {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.navegacion__enlace {
    font-size: 1.8rem;
    color: var(--blanco);
    text-align: center;
    text-decoration: none;
    display: block;
    padding: 0.5rem 1rem;
}

@media (max-width: 768px) {
    .navegacion {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        align-items: center;
    }
}

/* Contenido principal */
.contenido-principal {
    display: grid;
    grid-template-columns: 2fr 1fr;
    column-gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .contenido-principal {
        display: block;
        padding: 1rem 0;
    }
}

/* Entradas */
.entrada {
    border-bottom: 1px solid var(--gris);
    margin-bottom: 4rem;
    padding-bottom: 2rem;
}

.entrada:last-of-type {
    border: none;
    margin-bottom: 0;
}

/* Botones */
.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: 0.5rem;
    background-color: var(--primario);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.boton:hover {
    background-color: var(--primario);
}

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

/* Cursos */
.cursos {
    list-style: none;
    padding-left: 0;
}

.widget-curso {
    border-bottom: 1px solid var(--gris);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.widget-curso:last-of-type {
    border: none;
    margin-bottom: 0;
}

.widget-curso__label,
.widget-curso__info {
    font-size: 2rem;
}

.widget-curso__label {
    font-family: var(--fuenteHeading);
    font-weight: bold;
}

.widget-curso__info {
    font-weight: 400;
}

/* Footer */
.footer {
    background-color: var(--negro);
    padding: 3rem 1rem;
    margin-top: 4rem;
    color: var(--blanco);
    text-align: center;
    font-size: 1.4rem;
}

/* Sobre nosotros */
.sobre-nosotros {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 768px) {
    .sobre-nosotros {
        display: block;
    }
}

/* Cursos (detalle) */
.curso {
    padding: 3rem 1rem;
    border-bottom: 1px solid var(--gris);
}

.curso:last-of-type {
    border: none;
}

@media (min-width: 768px) {
    .curso {
        display: grid;
        grid-template-columns: 1fr 2fr;
        column-gap: 2rem;
    }
}

.curso__label,
.curso__info {
    font-size: 2rem;
}

.curso__label {
    font-family: var(--fuenteHeading);
    font-weight: bold;
}

.curso__info {
    font-weight: 400;
}

/* Contacto */
.contacto-bg {
    background-image: url(../img/contacto.jpg);
    height: 40rem;
    background-size: cover;
    background-repeat: no-repeat;
}

.formulario {
    background-color: var(--blanco);
    margin: -5rem auto 0 auto;
    width: 95%;
    max-width: 700px;
    padding: 3rem 2rem;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
}

.campo {
    display: flex;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.campo__label {
    flex: 0 0 9rem;
    text-align: right;
    align-self: center;
}

.campo__field {
    flex: 1 1 auto;
    border-bottom: 1px solid var(--gris);
    padding: 0.5rem;
    font-size: 1.6rem;
}

.campo__field--textarea {
    height: 200px;
    resize: vertical;
}

@media (max-width: 768px) {
    html {
        font-size: 56.25%;
        /* un poco más chica para móviles, 9px base */
    }

    .contenedor {
        width: 95%;
        padding: 0 1rem;
    }

    h1 {
        font-size: 3.6rem;
    }

    h2 {
        font-size: 3rem;
    }

    h3 {
        font-size: 2.4rem;
    }

    h4 {
        font-size: 2rem;
    }

    .barra {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 2rem 1rem;
    }

    .logo__nombre {
        font-size: 2.5rem;
        text-align: center;
    }

    .navegacion {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        align-items: center;
    }

    .contenido-principal {
        display: block;
        padding: 1rem 0;
    }

    .curso {
        padding: 2rem 1rem;
    }

    .campo {
        flex-direction: column;
    }

    .campo__label {
        flex: 1 0 auto;
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .campo__field {
        flex: 1 0 auto;
    }
}