/* Estilos del portal. --brand y --on-brand los define /tema.css (color de cada colegio). */
:root {
  --brand: #1e3a8a;
  --on-brand: #ffffff;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #5b6472;
  --line: #e3e6eb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.inline { display: inline; margin: 0; }

/* barra superior */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px; background: var(--brand); color: var(--on-brand);
  position: sticky; top: 0; z-index: 10;
}
.topbar nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; justify-content: flex-end; }
.brandmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: inherit; text-decoration: none; }
.brandmark.dark { color: var(--ink); margin-bottom: 20px; }
.navlink, .navtext { color: inherit; text-decoration: none; opacity: .9; font-size: .95rem; }
.navlink:hover { opacity: 1; text-decoration: underline; }
.navtext { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .navlink { display: none; } }

/* botones */
.btn, .linkbtn {
  font: inherit; cursor: pointer; border: 0; text-decoration: none;
}
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px; font-weight: 600;
  background: var(--brand); color: var(--on-brand);
  outline: 2px solid transparent; outline-offset: 2px;
}
.topbar .btn { background: var(--on-brand); color: var(--brand); }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, .tile:focus-visible, .linkbtn:focus-visible { outline-color: currentColor; }
.btn-light { background: var(--on-brand); color: var(--brand); }
.btn-ghost { background: transparent; color: inherit; border: 1px solid currentColor; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 8px; }
.linkbtn { background: none; color: var(--brand); padding: 0; text-decoration: underline; }

/* portada */
.hero { position: relative; background: var(--brand); color: var(--on-brand); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.hero:has(.hero-img)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 55%, transparent) 55%, transparent 100%); }
.hero-inner { z-index: 1; }
.hero-inner { position: relative; width: min(1080px, 100% - 32px); margin-inline: auto; padding: clamp(56px, 12vw, 120px) 0; }
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.35rem); max-width: 42ch; opacity: .95; margin: 0 0 24px; }

/* secciones del sitio */
.block { padding: clamp(36px, 7vw, 72px) 0; }
.block:nth-child(even) { background: var(--surface); }
.prose { white-space: pre-line; max-width: 68ch; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { margin: 0; color: var(--muted); }
.cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.dates { margin: 0; display: grid; grid-template-columns: 1fr; gap: 2px; }
.dates dt { font-weight: 600; margin-top: 10px; }
.dates dd { margin: 0; color: var(--muted); }
ul { padding-left: 1.2em; margin: 0; }
li { margin-bottom: 6px; }
.prices { width: 100%; border-collapse: collapse; }
.prices td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.prices .amount { text-align: right; font-weight: 600; white-space: nowrap; padding-left: 12px; }
.note { color: var(--muted); margin-top: 20px; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.gallery figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
figure { margin: 0; }
.contact { list-style: none; padding: 0; }
.contact strong { display: inline-block; min-width: 96px; }

.footer { padding: 24px 0 40px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ingreso / avisos */
body.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.panel { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 8px 30px rgba(17, 24, 39, .06); }
.panel h1 { font-size: 1.6rem; }
form label { display: block; font-weight: 600; font-size: .92rem; margin: 14px 0 0; }
form input[type=email], form input[type=password] {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit;
  border: 1px solid #c8cdd5; border-radius: 10px; background: #fff; color: var(--ink);
}
form input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 4px; }
.alert { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; border-radius: 10px; padding: 10px 12px; margin: 14px 0 0; }
.foot { text-align: center; margin: 18px 0 0; font-size: .92rem; }

/* mosaico de apps */
.page { padding: 32px 0 64px; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 24px; }
.tiles form { display: contents; }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; width: 100%; height: 100%;
  text-align: left; font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; cursor: pointer;
  outline: 2px solid transparent; outline-offset: 2px; transition: border-color .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgba(17, 24, 39, .08); }
.tile-icon { font-size: 1.9rem; line-height: 1; }
.tile-name { font-weight: 700; font-size: 1.05rem; }
.tile-desc { color: var(--muted); font-size: .92rem; }
.tile-off { cursor: default; opacity: .65; }
.tile-off:hover { border-color: var(--line); box-shadow: none; }
.badge { margin-top: auto; font-size: .78rem; font-weight: 700; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.empty { margin-top: 32px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- editor del sitio y vista previa ---------- */
.editor-page .topbar { position: static; }
a.tile { text-decoration: none; }
.preview-banner { background: #fff4ce; color: #5c4400; text-align: center; padding: 8px 16px; font-size: .92rem; border-bottom: 1px solid #ecd58a; position: sticky; top: 0; z-index: 20; }
.preview-banner a { color: inherit; font-weight: 700; }

.btn-small { padding: 6px 12px; font-size: .9rem; }
.btn-ghost-dark { background: transparent; color: var(--ink); border: 1px solid #c8cdd5; }
.topbar .btn-ghost-dark { color: inherit; border-color: currentColor; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
[hidden] { display: none !important; }

.ed-bar { position: sticky; top: 0; z-index: 9; background: var(--surface); border-bottom: 1px solid var(--line); }
.ed-bar-inner { width: min(860px, 100% - 32px); margin-inline: auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; }
.ed-status { margin: 0; font-weight: 600; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-main { width: min(860px, 100% - 32px); padding: 24px 0 80px; }
.ed-errors { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; border-radius: 10px; padding: 12px 16px 12px 32px; margin: 0 0 16px; }
.ed-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.ed-card h2 { font-size: 1.15rem; margin-bottom: 8px; }
.ed-card h4 { margin: 18px 0 4px; font-size: .95rem; }
.ed-field { display: block; margin: 12px 0 0; font-weight: 600; font-size: .92rem; }
.ed-field > span { display: block; margin-bottom: 4px; }
.ed-field small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
.ed-field input[type=text], .ed-field textarea, .ed-adder select {
  display: block; width: 100%; padding: 9px 11px; font: inherit; font-weight: 400;
  border: 1px solid #c8cdd5; border-radius: 10px; background: #fff; color: var(--ink);
}
.ed-field textarea { resize: vertical; min-height: 4.2em; }
.ed-note { color: var(--muted); font-size: .9rem; margin: 0 0 4px; }
.ed-field input:focus, .ed-field textarea:focus, .ed-adder select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.ed-row { display: flex; gap: 8px; align-items: stretch; }
.ed-row .btn { white-space: nowrap; }
.ed-row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .ed-row2 { grid-template-columns: 1fr; } }
.ed-thumb { margin-top: 8px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.ed-msg { color: var(--danger); }
.ed-list { display: grid; gap: 12px; margin-top: 12px; }
.ed-item { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 12px; background: #fcfcfd; }
.ed-item-body { flex: 1; min-width: 0; }
.ed-item-tools { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; }
.icon { width: 32px; height: 32px; border: 1px solid #c8cdd5; border-radius: 8px; background: #fff; cursor: pointer; font: inherit; line-height: 1; }
.icon.danger { color: var(--danger); }
.ed-section { padding-top: 8px; }
.ed-tag { margin: 6px 0 0; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ed-adder { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-adder select { width: auto; min-width: 220px; }
