/* === 1. VARIABLES CSS ===================================== */

:root {
  /* ===== COLORES BASE (Logo) ===== */
  --negro: #120813;
  --morado: #78278b;
  --rosa: #c45bd4;
  --rosita: #e58df1;
  --rosa-muy-claro: #f8d8f0;
  --blanco: #e8e1e9;
  --gris: #222;

  /* ===== COLORES TEMA OSCURO ===== */
  --fondo: var(--negro);
  --texto: var(--blanco);
  --titulo-color: var(--rosa);
  --light-fondo: var(--rosita);
  --light-titulo: var(--gris);
  --light-text: var(--negro);

  /* ===== ENLACES ===== */
  --link-color: var(--morado);
  --link-hover-color: var(--rosa);
  --light-link: var(--morado);
  --light-link-hover: var(--rosa);

  /* ===== BOTONES ===== */
  --btn-hover-bg: var(--rosa);
  --light-btn-hover-bg: var(--rosita);
  --active-color: var(--negro);

  /*===== CODE =====*/
  --code-color: var(--rosa);

  /* ===== FOCUS Y TRANSICIÓN ===== */
  --focus-color: var(--morado);
  --link-transition:
    color 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* ===== TIPOGRAFÍA ===== */
  --font-main: "Montserrat", sans-serif;
  --font-titulo: "Cinzel", serif;
  --font-subtitulo: "Beth Ellen", cursive;
  --letter-spacing: 0.08rem;
  --line-height: 1.8;
  --line-height-heading: 1.2;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --font-size-root: 62.5%;
  /*html*/
  --font-size: 1.8rem;
  /*body*/

  --h1-size: 3rem;
  --h1-size-tablet: 2.5rem;
  --h1-size-movil: 2rem;
  --h1-size-escritorio: 4.2rem;

  --h2-size: 2.5rem;
  --h2-size-tablet: 2.25rem;
  --h2-size-movil: 2rem;
  --h2-size-escritorio: 3.2rem;

  --h3-size: 2rem;
  --h3-size: 2rem;
  --h3-size-movil: 1.9rem;
  --h3-size-escritorio: 2.4rem;

  --h4-size: 1.25rem;
  --h5-size: 1rem;
  --h6-size: 0.875rem;

  --p-escritorio: 2.2rem;

  --enlaces-size: 1.5rem;
  --btn-size: 1.5rem;
  --btn-size-escritorio: 1.75rem
    /* ===== ESPACIADOS ===== */
    --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;

  /* ===== BORDES Y RADIOS ===== */
  --border-width: 1px;
  --border-width-focus: 2px;
  --outline-offset: 2px;
  --borde-radio-peq: 10px 10px 0px 10px;
  --borde-radio-grande: 25px 25px 0 25px;

}

/* === 2. RESET Y ELEMENTOS BASE ============================ */

html {
  font-size: var(--font-size-root);
  font-family: var(--font-main);
  line-height: var(--line-height);
}

body {
  position: relative;
  min-height: 100vh;
  font-size: var(--font-size);
  background: var(--fondo);
  color: var(--texto);
  overflow-x: hidden;
}

*:focus {
  outline: var(--border-width-focus) solid var(--focus-color);
  outline-offset: var(--outline-offset);
  border-radius: var(--borde-radio-grande);
}

/* ===== Imágenes ===== */
img {
  width: 100%;
  height: auto;
  border-radius: var(--borde-radio-grande);
}

/* Logo fijo en encabezado */
.logo img {
  min-height: 150px;
  max-height: 150px;
  height: 150px;
  width: auto;
  object-fit: contain;
}


/* === 3. TEMA CLARO ======================================== */

.light {
  border-bottom: 1px solid rgba(100, 100, 150, 0.3);
  box-shadow: inset 0 -10px 40px rgba(100, 100, 150, 0.2);
  color: var(--light-text);
  background: linear-gradient(135deg, var(--morado) 0%, var(--rosita) 100%);
  text-decoration: none;
  border-radius: var(--borde-radio-grande);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(167, 139, 250, 0.3);
  border: none;

  a {
    color: var(--light-link);

    &:hover,
    &:focus {
      color: var(--light-link-hover);
    }

    &:active {
      color: var(--light-active-color);
      position: relative;
    }
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--light-titulo);
  }

  .btn {
    background: var(--morado);
    color: var(--blanco);


    &:hover,
    &:focus {
      background: var(--light-btn-hover-bg);
      color: var(--negro);
    }

    &:active {
      background: var(--active-color);
      color: var(--blanco);
    }
  }

  input,
  textarea,
  select {
    border-color: var(--negro);

    &:hover {
      border-color: var(--morado);
    }

    &:focus {
      border-color: var(--focus-color);
      box-shadow: 0 0 0 3px rgba(120, 39, 139, 0.2);
    }

    &:active {
      border-color: var(--active-color);
    }
  }
}

/* === 4. TIPOGRAFÍA ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-titulo);
  font-weight: var(--font-weight-medium);
  color: var(--titulo-color);
  padding: 0;
  hyphens: auto;
  /* Permite dividir palabras largas en móviles con guiones */
}

h1 {
  font-size: calc(var(--font-size) * 2.5);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing);
  text-align: center;
  line-height: var(--line-height-heading);
}

h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: calc(var(--font-size) * 2);
  line-height: 1.25;
}

h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: calc(var(--font-size) * 1.5);
  line-height: 1.3;
}

h4 {
  font-size: calc(var(--font-size) * 1.25);
  line-height: 1.35;
}

h5 {
  font-size: calc(var(--font-size) * 1);
  line-height: 1.4;
}

h6 {
  font-size: calc(var(--font-size) * 0.875);
  line-height: 1.45;
}

p {
  margin-bottom: 1.5rem;
}

/* === 5. LISTAS ============================================ */
ul,
ol {
  list-style-position: inside;
}

ul {
  list-style-type: none;
}

ol {
  list-style-type: decimal;
}

/* === 6. ENLACES =========================================== */
a {
  color: var(--link-color);
  text-decoration: none;
  font-size: var(--enlaces-size);
  transition: var(--link-transition);
  cursor: pointer;

  &:hover,
  &:focus {
    color: var(--link-hover-color);
  }

  &:active {
    color: var(--active-color);
    position: relative;
    top: 1px;
  }
}

/* === 7. BOTONES =========================================== */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--morado);
  color: var(--blanco);
  border: none;
  border-radius: var(--borde-radio-peq);
  font-weight: var(--font-weight-bold);
  font-size: var(--btn-size);
  cursor: pointer;
  transition: var(--link-transition);
  text-align: center;
  text-decoration: none;

  &:hover,
  &:focus {
    background: var(--btn-hover-bg);
    color: var(--negro);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  &:active {
    background: var(--active-color);
    color: var(--blanco);
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  }
}


/* === 8. FORMULARIOS ======================================= */
input,
textarea,
select {
  width: 100%;
  padding: var(--spacing-sm);
  border: var(--border-width) solid var(--rosita);
  border-radius: var(--borde-radio-peq, 4px);
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--font-main);
  font-size: var(--font-size);
  transition: var(--link-transition);

  &:hover {
    border-color: var(--rosa);
  }

  &:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: 0 0 0 3px rgba(196, 91, 212, 0.2);
  }

  &:active {
    border-color: var(--active-color);
  }
}


/* === 9. TABLAS ============================================ */
table {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size);
  background: var(--blanco);
  color: var(--morado);
  box-shadow: 0 2px 8px rgba(120, 39, 139, 0.07);
  border-radius: var(--borde-radio-grande);
  overflow: hidden;


  th,
  td {
    padding: 0.7em 1em;
    border-bottom: 1px solid #e0c6e6;
    text-align: left;
  }

  th {
    background: var(--rosa-muy-claro);
    font-weight: var(--font-weight-bold);
  }

  tr:last-child td {
    border-bottom: none;
  }
}

/* === 10. ACCESIBILIDAD Y UTILIDADES ======================= */
/* --- Solo para lectores de pantalla --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Enlace para saltar al contenedor principal */
.skip-link {
  position: absolute;
  top: -40px;
  /* Oculto por defecto */
  left: 0;
  background: var(--negro);
  color: var(--blanco);
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
  transition: top 0.2s ease;

  &:focus {
    top: 0;
    /* Visible al enfocar con Tab */
  }


}




/* === 11. DETAILS Y SUMMARY (Acordeón) ===================== */

details,
details[class],
.light details,
.light details[class] {
  margin: var(--spacing-md) 0;
  border-radius: var(--borde-radio-grande);
  background: var(--rosa-muy-claro);
  color: var(--gris);
  box-shadow: 10px 12px 8px #0001;
  padding: 1rem 1rem;
  transition: box-shadow 0.3s;
}

details[open],
details[class][open],
.light details[open],
.light details[class][open] {
  box-shadow: 10px 12px 8px #0001;
}

details summary,
details[class] summary,
.light details summary,
.light details[class] summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--morado);
  outline: none;
  transition: color 0.2s, background 0.2s;
  list-style: none;
  display: block;
  padding: 20px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: transparent;
  border-radius: var(--borde-radio-grande);
}

details summary.btn {
  border-radius: var(--borde-radio-grande);
}

details summary:hover,
details summary:focus {
  background: var(--rosita);
  color: var(--negro);
}

details summary::-webkit-details-marker,
details[class] summary::-webkit-details-marker,
.light details summary::-webkit-details-marker,
.light details[class] summary::-webkit-details-marker {
  display: none;
}

details summary:after,
details[class] summary:after,
.light details summary:after,
.light details[class] summary:after {
  content: "+ más información";
  display: block;
  font-weight: bold;
  margin-left: 0;
  margin-top: 0.2em;
  text-align: center;
  transition: content 0.2s;
}

details[open] summary:after,
details[class][open] summary:after,
.light details[open] summary:after,
.light details[class][open] summary:after {
  content: " −";
}

details>*:not(summary) {
  margin-top: 0.7em;
  padding-left: 0.5em;
  color: var(--gris);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === 12. LAYOUT (article, etc.) =========================== */

/* === 13. MEDIA QUERIES ==================================== */
/* ===== Escritorio Grande ===== */
@media (min-width: 1200px) {
  h1 {
    font-size: var(--h1-size-escritorio);
    line-height: 1.2;
  }

  h2 {
    font-size: var(--h2-size-escritorio);
    line-height: 1.2;
  }

  h3 {
    font-size: var(--h3-size-escritorio);
    line-height: 1.2;
  }

  p {
    font-size: var(--p-escritorio);
  }

  .btn {
    font-size: var(--btn-size-escritorio);
  }

  img {
    max-width: 500px;
  }
}

/* ===== Tableta ===== */
@media (max-width: 768px) {
  .encabezado-contenido h1 {
    font-size: var(--h1-size-tablet);
    line-height: 1.2;
    word-break: break-word;
  }

  h2 {
    font-size: var(--h2-size-tablet);
    line-height: 1.3;
  }

  h3 {
    font-size: var(--h3-size-tablet);
    line-height: 1.3;
  }
}

/* ===== Móvil ===== */
@media (max-width: 480px) {
  .encabezado-contenido h1 {
    font-size: var(--h1-size-movil);
    line-height: 1.2;
    word-break: break-word;
  }

  h2 {
    font-size: var(--h2-size-movil);
    line-height: 1.3;
  }

  h3 {
    font-size: var(--h3-size-movil);
    line-height: 1.3;
  }
}