/* ─────────────────────────────────────────────
   Salón Eulen · Directorio de la clase
   Credenciales escolares por grado · mobile first
───────────────────────────────────────────── */
.dir {
  --k1: #2f7d5b; --k1-2: #dcefe4; --k1-3: #b6d9c6; --k1-ink: #ffffff;
  --k2: #c4463f; --k2-2: #f9dfdc; --k2-3: #f0b9b4; --k2-ink: #ffffff;
  --k3: #dcab4c; --k3-2: #f6ead2; --k3-3: #ecd29c; --k3-ink: #3b2a08;
  --stock: #fffdf8;
}
.dir ::selection { background: var(--verde-2); color: var(--ink); }
.dir { scrollbar-color: var(--verde-3) transparent; }
.dir :focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; border-radius: 12px; }
.dir a { color: inherit; text-underline-offset: 3px; }
.dir .acceso-pie { color: var(--ink-2); }
.dir .campo input::placeholder { color: #66796d; }
.dir .toast { animation: subir-suave .35s cubic-bezier(.16,1,.3,1); }
@keyframes subir-suave { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
.oculto { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; clip: rect(0 0 0 0); }

.dir-main { padding-bottom: 4rem; }

/* ───── cabeza ───── */
.dir-cabeza { padding: 1.1rem 0 1.3rem; }
.dir-volver {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .45rem .85rem .45rem .55rem; border-radius: 999px;
  font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--ink-2);
  background: rgba(255,255,255,.7); box-shadow: inset 0 0 0 1px var(--line);
}
.dir-volver:hover { color: var(--ink); background: #fff; }
.dir-volver svg { width: 1.05rem; height: 1.05rem; }
.dir-titulo { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: center; margin-top: 1.1rem; }
.dir-buho { width: 74px; height: auto; filter: drop-shadow(0 10px 14px rgba(31,61,47,.18)); animation: mecer 6s ease-in-out infinite; transform-origin: 50% 92%; }
.dir-titulo h1 {
  margin: 0; font-family: var(--display); font-style: italic; font-weight: 600;
  font-size: clamp(2.15rem, 9vw, 3.6rem); line-height: .98; letter-spacing: -.015em; text-wrap: balance;
}
.dir-sub { margin: .45rem 0 0; color: var(--ink-2); font-weight: 600; font-size: .93rem; }

/* ───── barra: buscador + grados ───── */
.dir-barra {
  position: sticky; top: .55rem; z-index: 5;
  display: grid; gap: .55rem; padding: .55rem;
  border-radius: 22px; background: rgba(251,249,244,.88);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 14px 30px -22px rgba(31,61,47,.5), 0 0 0 1px var(--line);
}
.buscador { position: relative; display: block; }
.buscador > svg { position: absolute; left: 1rem; top: 50%; width: 1.25rem; height: 1.25rem; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.buscador input {
  width: 100%; height: 52px; padding: 0 3rem 0 2.85rem; border: 0; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--verde-3); transition: box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
.buscador input::placeholder { color: #66796d; font-weight: 500; }
.buscador input::-webkit-search-cancel-button { display: none; }
.buscador input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--verde), 0 0 0 4px var(--verde-2); }
.buscador-limpiar {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2);
  display: grid; place-items: center;
}
.buscador-limpiar:hover { background: var(--verde-2); color: var(--ink); }
.buscador-limpiar svg { width: 1.1rem; height: 1.1rem; }

.dir-filtros { display: block; }
.segmento { flex: 1; display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: .2rem; padding: .22rem; border-radius: 999px; background: var(--verde-2); }
.segmento button {
  min-height: 40px; border: 0; border-radius: 999px; background: transparent;
  font-weight: 700; font-size: .9rem; color: var(--ink-2); transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.segmento button:hover { color: var(--ink); }
.segmento button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 4px 12px -6px rgba(31,61,47,.4); }
.segmento button[data-grado="K1"][aria-checked="true"] { color: var(--k1); }
.segmento button[data-grado="K2"][aria-checked="true"] { color: var(--k2); }
.segmento button[data-grado="K3"][aria-checked="true"] { color: #8a6114; }

/* ───── cumpleaños del mes ───── */
.cumples { margin: 1.6rem 0 0; }
.cumples h2 { margin: 0 0 .7rem; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.45rem; line-height: 1.1; }
.cumples h2 span { color: var(--rojo); }
.cumples-lista {
  list-style: none; margin: 0 -1.25rem; padding: .2rem 1.25rem .6rem; display: flex; gap: .7rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.cumples-lista::-webkit-scrollbar { display: none; }
.cumples-lista li { scroll-snap-align: start; flex: 0 0 auto; }
.cumple {
  display: grid; grid-template-columns: 48px auto; gap: .65rem; align-items: center;
  padding: .45rem 1rem .45rem .45rem; border-radius: 999px; text-decoration: none;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line), 0 10px 20px -16px rgba(31,61,47,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cumple:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--line), 0 14px 24px -16px rgba(31,61,47,.55); }
.cumple-cara { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--g-2); color: var(--g-txt); font-family: var(--display); font-style: italic; font-weight: 600; font-size: 1.4rem; }
.cumple-cara img { width: 100%; height: 100%; object-fit: cover; }
.cumple b { display: block; font-weight: 700; font-size: .95rem; line-height: 1.15; }
.cumple small { display: block; font-weight: 600; font-size: .8rem; color: var(--ink-2); }
.cumple.hoy { background: var(--oro-2); box-shadow: inset 0 0 0 1.5px var(--k3); }
.cumple.hoy small { color: #7a5410; }
.cumple.paso { opacity: .62; }

.dir-resultado { margin: .9rem 0 0; min-height: 0; font-weight: 600; font-size: .9rem; color: var(--ink-2); }

/* ───── grados ───── */
.grado { margin-top: 2.2rem; scroll-margin-top: 9rem; }
.grado:first-child { margin-top: .6rem; }
.grado-cabeza { position: relative; display: flex; align-items: baseline; gap: .7rem; margin: 0 0 1.1rem; padding-left: .1rem; }
.grado-cabeza::before {
  content: ""; position: absolute; z-index: -1; left: -.6rem; top: .15rem; width: 9.5rem; height: 2.6rem;
  border-radius: 48% 52% 55% 45% / 60% 50% 50% 40%; background: var(--g-2); filter: blur(1px); opacity: .9;
}
.grado-cabeza h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(2rem, 7vw, 2.6rem); line-height: 1; color: var(--g-txt); }
.grado-cabeza span { font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.grado-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }

.grado[data-grado="K1"], .credencial[data-grado="K1"], .cumple[data-grado="K1"] { --g: var(--k1); --g-2: var(--k1-2); --g-3: var(--k1-3); --g-ink: var(--k1-ink); --g-txt: var(--k1); }
.grado[data-grado="K2"], .credencial[data-grado="K2"], .cumple[data-grado="K2"] { --g: var(--k2); --g-2: var(--k2-2); --g-3: var(--k2-3); --g-ink: var(--k2-ink); --g-txt: #b13b35; }
.grado[data-grado="K3"], .credencial[data-grado="K3"], .cumple[data-grado="K3"] { --g: var(--k3); --g-2: var(--k3-2); --g-3: var(--k3-3); --g-ink: var(--k3-ink); --g-txt: #8a6114; }

/* ───── credencial ───── */
.credencial {
  position: relative; display: flex; flex-direction: column;
  background: var(--stock); border-radius: 22px; scroll-margin-top: 9rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 0 0 1px rgba(31,61,47,.07), 0 22px 40px -28px rgba(31,61,47,.55);
  transition: box-shadow .3s ease, transform .3s ease;
}
.credencial.oculta { display: none; }
.credencial.destacada { box-shadow: 0 0 0 3px var(--g), 0 22px 40px -24px rgba(31,61,47,.6); }

.cr-banda {
  position: relative; display: flex; justify-content: space-between; align-items: center;
  padding: 1.15rem 1.15rem .75rem; border-radius: 22px 22px 0 0;
  background: var(--g); color: var(--g-ink);
  font-weight: 700; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
}
.cr-banda::before { /* ranura del gafete */
  content: ""; position: absolute; left: 50%; top: .5rem; width: 46px; height: 9px; transform: translateX(-50%);
  border-radius: 99px; background: var(--paper); box-shadow: inset 0 2px 3px rgba(0,0,0,.28);
}
.cr-banda span:last-child { opacity: .82; }

.cr-marco { position: relative; margin: 1.1rem 1rem 0; }
.cr-cinta {
  position: absolute; z-index: 2; top: -11px; width: 78px; height: 24px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.28), transparent 40%, rgba(0,0,0,.04)), color-mix(in srgb, var(--g) 32%, rgba(255,255,255,.6));
  box-shadow: 0 2px 4px -2px rgba(31,61,47,.25);
  -webkit-mask: linear-gradient(90deg, transparent 0, #000 3px calc(100% - 3px), transparent 100%);
          mask: linear-gradient(90deg, transparent 0, #000 3px calc(100% - 3px), transparent 100%);
}
.cr-cinta.izq { left: 14%; transform: rotate(-7deg); }
.cr-cinta.der { right: 12%; transform: rotate(5deg); width: 60px; }
.cr-cinta.pega { animation: pegar .6s cubic-bezier(.16,1,.3,1) both; }
@keyframes pegar { from { opacity: 0; translate: 0 -16px; scale: 1.18; } }

.cr-foto {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 0 0 6px #fff, 0 0 0 7px rgba(31,61,47,.08), 0 14px 22px -18px rgba(31,61,47,.6);
}
.cr-foto { transition: aspect-ratio .4s ease; }
.cr-foto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: opacity .5s ease, filter .5s ease; }
.cr-foto img.cargando { opacity: 0; filter: blur(8px); }
.cr-foto.vacia {
  display: grid; place-items: center; text-align: center;
  background:
    radial-gradient(60% 55% at 30% 35%, var(--g-3), transparent 70%),
    radial-gradient(55% 60% at 75% 70%, var(--g-2), transparent 72%),
    radial-gradient(40% 40% at 70% 25%, rgba(255,255,255,.9), transparent 70%),
    var(--g-2);
}
.cr-inicial { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 5.2rem; line-height: 1; color: var(--g-txt); opacity: .9; }
.cr-sinfoto { display: block; margin-top: .2rem; font-weight: 600; font-size: .8rem; color: var(--ink-2); }
.cr-foto-btn {
  position: absolute; right: .55rem; bottom: .55rem; z-index: 1;
  display: inline-flex; align-items: center; gap: .35rem; min-height: 40px; padding: 0 .9rem 0 .7rem;
  border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink);
  font-weight: 700; font-size: .82rem; box-shadow: 0 8px 18px -10px rgba(31,61,47,.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .15s ease, background .15s ease;
}
.cr-foto-btn:hover { background: #fff; transform: translateY(-1px); }
.cr-foto-btn svg { width: 1.05rem; height: 1.05rem; }
.cr-foto.vacia .cr-foto-btn { position: static; margin-top: .8rem; background: #fff; }
.cr-foto.vacia .cr-vacia-cont { display: grid; justify-items: center; }

.cr-previa { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; justify-content: center; gap: .5rem; padding: .7rem; background: linear-gradient(transparent 45%, rgba(20,40,30,.55)); }
.cr-previa button { min-height: 42px; padding: 0 1.1rem; border: 0; border-radius: 999px; font-weight: 700; font-size: .88rem; }
.cr-previa .si { background: var(--verde); color: #fff; box-shadow: 0 10px 20px -10px rgba(0,0,0,.6); }
.cr-previa .no { background: rgba(255,255,255,.92); color: var(--ink); }
.cr-previa button:disabled { opacity: .6; cursor: wait; }

.cr-cuerpo { padding: 1.2rem 1.15rem 1.2rem; display: grid; gap: .9rem; }
.cr-nombre { margin: 0; font-family: var(--display); font-style: italic; font-weight: 600; font-size: clamp(2.1rem, 9vw, 2.55rem); line-height: .98; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cr-apellidos { margin: .25rem 0 0; font-weight: 600; font-size: 1.02rem; color: var(--ink-2); }
.cr-cumple { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0; font-weight: 700; font-size: .95rem; }
.cr-cumple svg { width: 1.2rem; height: 1.2rem; color: var(--rojo); flex: none; }
.cr-cumple .pronto { padding: .15rem .6rem; border-radius: 999px; background: var(--oro-2); color: #7a5410; font-size: .75rem; letter-spacing: .02em; }

.cr-datos { margin: 0; display: grid; gap: .1rem; border-top: 1px dashed rgba(31,61,47,.16); padding-top: .75rem; }
.cr-fila { display: grid; grid-template-columns: 4.3rem minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .4rem 0; }
.cr-fila + .cr-fila { border-top: 1px solid rgba(31,61,47,.06); }
.cr-fila dt { margin: 0; font-weight: 700; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.cr-fila dd { margin: 0; min-width: 0; }
.cr-persona { display: block; font-weight: 700; font-size: .95rem; line-height: 1.25; }
.cr-tel { display: block; font-weight: 600; font-size: .85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.cr-acciones { display: flex; gap: .35rem; }
.cr-accion {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: var(--verde-2); color: var(--verde); transition: background .15s ease, transform .15s ease, color .15s ease;
}
.cr-accion:hover { background: var(--verde); color: #fff; transform: translateY(-1px); }
.cr-accion.tel { background: #f1f4f2; color: var(--ink-2); }
.cr-accion.tel:hover { background: var(--ink); color: #fff; }
.cr-accion svg { width: 1.25rem; height: 1.25rem; }
.cr-fila.hermanos { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
.cr-fila.hermanos dt { padding-top: .1rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.chips li { padding: .3rem .7rem; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px rgba(31,61,47,.12); font-weight: 700; font-size: .85rem; }
.chips small { font-weight: 600; color: var(--ink-2); font-size: .8rem; }

mark { background: var(--oro-2); color: inherit; border-radius: 4px; padding: 0 .08em; box-shadow: 0 0 0 1px var(--k3-3); }

/* ───── vacío / estado / pie ───── */
.dir-vacio { margin: 2rem auto 0; max-width: 420px; text-align: center; padding: 1.6rem 1.2rem; border-radius: 22px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.dir-vacio p { margin: 0 0 .4rem; color: var(--ink-2); }
.dir-vacio strong { color: var(--ink); }
.dir-vacio .btn { margin-top: .6rem; }
.dir-estado { text-align: center; margin: 2.5rem 0; font-weight: 600; color: var(--ink-2); }
.dir-pie { margin-top: 3.5rem; text-align: center; color: var(--ink-2); font-weight: 600; font-size: .85rem; }
.dir-pie p { margin: 0 0 .4rem; }
.link { background: none; border: 0; padding: .5rem; color: var(--ink-2); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--verde-3); cursor: pointer; }


/* ───── tablet / escritorio ───── */
@media (min-width: 700px) {
  .dir-cabeza { padding-top: 1.6rem; }
  .dir-buho { width: 96px; }
  .dir-barra { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .segmento { min-width: 300px; }
  .grado-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cumples-lista { margin: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 1060px) {
  .grado-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
  .cr-nombre { font-size: 2.35rem; }
}

/* transición de reacomodo al buscar */
::view-transition-group(*) { animation-duration: .38s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }

@media (prefers-reduced-motion: reduce) {
  .dir-buho, .cr-cinta.pega { animation: none; }
  .credencial, .cr-foto img, .cumple { transition: none; }
  ::view-transition-group(*) { animation: none; }
}

