/* ==========================================================================
   EES N° 23 - SISTEMA ESCOLAR INTEGRADO
   Base, Reset y Layout Estructural (CSS Nativo)
   ========================================================================== */

/* 1. Base 62.5% (1rem = 10px exactos) */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-family-base);
  font-size: 1.5rem; /* 15px */
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

h1 { font-size: 3.2rem; }
h2 { font-size: 2.4rem; }
h3 { font-size: 2.0rem; }
h4 { font-size: 1.7rem; }
h5 { font-size: 1.5rem; }
h6 { font-size: 1.3rem; }

p {
  font-size: 1.5rem;
  color: var(--text-muted);
}

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

a:hover {
  color: var(--color-primary-hover);
}

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1.4rem;
}

/* Layouts principales */
.app-layout {
  display: grid;
  grid-template-columns: 26rem 1fr;
  min-height: 100vh;
  width: 100%;
  background-color: var(--bg-main);
  margin: 0;
  padding: 0;
}

.main-content {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  min-height: 100vh;
}

.page-container {
  width: 100%;
  max-width: var(--max-content-width);
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 2.4rem 3.2rem;
  box-sizing: border-box;
}

/* Contenedor del Portal Público */
.public-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
}

.public-container {
  width: 100%;
  max-width: 120rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0 2.4rem;
}

/* Clases auxiliares Flex y Grid */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 0.4rem; }
.gap-sm { gap: 0.8rem; }
.gap-md { gap: 1.6rem; }
.gap-lg { gap: 2.4rem; }
.gap-xl { gap: 3.2rem; }

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

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--status-success); }
.text-danger { color: var(--status-danger); }
.text-warning { color: var(--status-warning-dark); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Ocultar elementos visualmente para accesibilidad */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsividad general */
@media (max-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 56.25%; /* adaptado a pantallas pequeñas */
  }
  .app-layout {
    grid-template-columns: 1fr;
  }
  .grid-cols-4, .grid-cols-3, .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  .page-container, .public-container {
    padding: 1.6rem;
  }
}
