
/* =========================================================
   VARIABLES GLOBALES
========================================================= */

:root {
  --verde-institucional: #0A8F2A;
  --verde-institucional-oscuro: #0C6921;
  --azul-institucional: #0B2C4D;
  --dorado-institucional: #D4A017;
  --rojo-institucional: #C62828;
  --celeste-institucional: #4FA3D1;
  --blanco: #ffffff;
  --gris-fondo: #f5f7f3;
  --texto-principal: #183148;
  --texto-secundario: #51657a;
}

/* =========================================================
   BODY GENERAL
========================================================= */

body {
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 3pc;
  background: #fff;
  color: var(--texto-principal);

  opacity: 0;
  animation: aparecer 0.6s ease-in forwards;
}

img,
video,
iframe {
  max-width: 100%;
}

.container,
.container-fluid {
  min-width: 0;
}

/* =========================================================
   TITULOS GENERALES
========================================================= */

h1,
h2,
h3 {
  color: var(--verde-institucional-oscuro);
  font-family: 'Montserrat', sans-serif;
}

h2,
h3 {
  letter-spacing: -0.02em;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dorado-institucional);
}

.section-kicker-light {
  color: rgba(255, 255, 255, 0.82);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================================
   ANIMACIONES
========================================================= */

@keyframes aparecer {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

@keyframes zoomIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================================
   BOTONES GENERALES
========================================================= */

.btn-institucional {
  background-color: var(--verde-institucional);
  color: var(--blanco);
  border: none;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 14px 28px rgba(10, 143, 42, 0.2);
}

.btn-institucional:hover {
  background-color: var(--dorado-institucional);
  transform: translateY(-2px);
  color: #09253d;
}

/* =========================================================
   SCROLL PERSONALIZADO
========================================================= */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0b1f3a;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d4af37, #b8962e);
  border-radius: 20px;
}

/* =========================================================
   SECCION DOBLE
========================================================= */

.seccion-doble {
  background: #f8f9fa;
}

/* =========================================================
   BLOQUES GENERALES
========================================================= */

.bloque {
  padding: 20px;
  text-align: center;
}

.bloque h3 {
  font-family: 'Montserrat', sans-serif;
  margin-bottom: 10px;
}

.bloque p {
  margin-bottom: 15px;
  color: #555;
}

.bloque img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

/* =========================================================
   NOTICIAS
========================================================= */

.noticia-card {
  border-radius: 8px;
  overflow: hidden;

  transition: 0.3s ease;

  background: white;
}

.noticia-card:hover {
  transform: translateY(-5px);
}

.noticia-card img {
  height: 320px;
  object-fit: cover;
}

.imagen-fallback {
  background:
    linear-gradient(135deg, rgba(11, 44, 77, 0.95), rgba(10, 143, 42, 0.85)),
    url('../imagenes/escudo-escuela.webp') center/82px auto no-repeat;
  min-height: 58px;
  object-fit: contain;
}

.noticia-card .imagen-fallback {
  height: 320px;
}

.noticia-card .card-body {
  padding: 25px;
}

.noticia-card h3 {
  font-size: 1.5rem;
  color: #0d2b52;
}

.noticia-card p {
  font-size: 1rem;
  line-height: 1.6;
}

.noticia-card .badge {
  background-color: var(--verde-institucional) !important;
  border-radius: 4px;
  font-weight: 600;
}

.noticia-card .btn {
  border-radius: 4px;
  font-weight: 600;
}

.noticia-card .card-text {
  display: -webkit-box;
  min-height: 4.8rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.admin-page {
  background: #f4f6f8;
}

.admin-header {
  background: #0b2c4d;
  border-bottom: 4px solid var(--dorado-institucional);
  color: white;
}

.admin-panel {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(11, 44, 77, 0.12);
}

.admin-panel h1,
.admin-panel h2,
.admin-panel h3 {
  color: var(--azul-institucional);
}

.admin-toolbar {
  gap: 0.75rem;
}

.admin-loading {
  position: sticky;
  top: 4.5rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(10, 143, 42, 0.25);
  border-radius: 8px;
  background: #eef8f1;
  color: #0b5f21;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(11, 44, 77, 0.12);
}

.admin-is-loading .admin-panel,
.admin-is-loading .table-responsive {
  opacity: 0.72;
}

.admin-is-loading button,
.admin-is-loading input,
.admin-is-loading textarea,
.admin-is-loading select {
  cursor: wait;
}

.admin-table-img {
  width: 92px;
  height: 58px;
  border-radius: 4px;
  object-fit: cover;
  background-color: #e8eef3;
}

.admin-login {
  max-width: 480px;
  margin: 0 auto;
}

.admin-dropzone {
  min-height: 190px;
  border: 2px dashed #9db4c7;
  border-radius: 8px;
  background: #f8fbfd;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.admin-dropzone.is-dragging,
.admin-dropzone:hover {
  border-color: var(--verde-institucional);
  background: #eef8f1;
}

.admin-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.5rem;
  color: #496172;
  text-align: center;
}

.admin-dropzone-empty i {
  color: var(--verde-institucional);
  font-size: 2.4rem;
}

.admin-dropzone-empty span {
  font-size: 0.9rem;
}

.admin-dropzone-preview {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.admin-editor {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.admin-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.65rem;
  border-bottom: 1px solid #e6ebef;
  background: #f8f9fa;
}

.admin-editor-toolbar .form-select {
  width: auto;
  min-width: 120px;
}

.admin-editor-area {
  min-height: 220px;
  padding: 1rem;
  outline: none;
  line-height: 1.8;
}

.admin-editor-area:empty::before {
  content: "Escribí el primer cuerpo de la noticia...";
  color: #8a98a5;
}

.admin-editor-area:focus {
  box-shadow: inset 0 0 0 2px rgba(10, 143, 42, 0.18);
}

.admin-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 0.6rem;
}

.admin-media-item {
  position: relative;
  border: 1px solid #e0e6eb;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f9fa;
  aspect-ratio: 4 / 3;
}

.admin-media-item img,
.admin-media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-media-item span {
  position: absolute;
  left: 0.35rem;
  bottom: 0.35rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.68);
  color: white;
  font-size: 0.75rem;
}

/* =========================================================
   RESPONSIVE GENERAL
========================================================= */

@media (max-width: 768px) {
  body {
    padding-top: 4.25rem;
  }

  h1 {
    overflow-wrap: anywhere;
  }

  .video-box {
    height: 250px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .noticia-card img,
  .noticia-card .imagen-fallback {
    height: 220px;
  }

  .noticia-card .card-body {
    padding: 1rem;
  }

  .noticia-card h3 {
    font-size: 1.2rem;
  }

  .admin-header .container {
    align-items: stretch;
  }

  .admin-panel .card-body {
    padding: 1rem !important;
  }

  .admin-editor-toolbar .form-select {
    flex: 1 1 120px;
  }

  .table-responsive {
    overflow-x: auto;
  }
}

@media (max-width: 420px) {
  body {
    padding-top: 4.75rem;
  }

  .btn,
  .form-control,
  .form-select {
    min-height: 44px;
  }

  .admin-toolbar .btn {
    flex: 1 1 100%;
  }
}
