/* Shared sections: Equipo docente (carousel), Nuestros espacios, Calendario escolar.
   Each prototype sets --x-display / --x-weight / --hand / colours in :root. */
.x-sec { padding: clamp(80px, 10vw, 140px) 0; position: relative; overflow: hidden; }
.x-head { display: flex; justify-content: space-between; align-items: end; gap: 28px; flex-wrap: wrap; margin-bottom: 48px; }
.x-head h2 { font: var(--x-weight, 800) clamp(36px, 4.8vw, 64px)/1.02 var(--x-display, inherit); letter-spacing: -.03em; color: var(--navy); margin: 0; max-width: 16ch; }
.x-kick { display: inline-block; font: 400 30px/1 var(--hand); color: var(--leaf); transform: rotate(-5deg); margin-bottom: 14px; }
.x-head p { color: var(--muted, #56617B); max-width: 430px; margin: 0; }

/* ---------- Equipo docente ---------- */
.team-sec { background: var(--x-team-bg, #fff); }
.team { position: relative; }
.team-track {
  display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 30px max(20px, calc((100vw - var(--max, 1240px)) / 2)) 60px; scroll-padding-inline: max(20px, calc((100vw - var(--max, 1240px)) / 2)); scrollbar-width: none; cursor: grab;
}
.team-track::-webkit-scrollbar { display: none; }
.team-track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.t-card {
  flex: 0 0 clamp(240px, 24vw, 290px); scroll-snap-align: start; position: relative;
  background: #fff; border-radius: 22px; padding: 14px 14px 22px; box-shadow: 0 18px 40px rgba(16, 36, 84, .12);
  transform: rotate(var(--rot, -2deg)) translateY(var(--dy, 0)); transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s;
}
.t-card:nth-child(even) { --rot: 2deg; --dy: 26px; }
.t-card:nth-child(3n) { --rot: -1deg; }
.t-card:hover { transform: rotate(0) translateY(-10px) scale(1.03); box-shadow: 0 30px 60px rgba(16, 36, 84, .2); z-index: 2; }
/* washi tape */
.t-card::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; translate: -50% 0; rotate: -4deg; z-index: 3;
  background: color-mix(in srgb, var(--sun) 75%, transparent); border-radius: 3px; box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.t-card:nth-child(even)::before { background: color-mix(in srgb, var(--leaf) 55%, transparent); rotate: 5deg; }
.t-card figure { margin: 0; position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 5; background: #C9D7EA; }
.t-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2,.8,.2,1), filter .5s; filter: saturate(.92); }
.t-card:hover img { transform: scale(1.07); filter: saturate(1.05); }
/* sun badge with the subject, pops on hover */
.t-card .t-tag {
  position: absolute; right: 12px; bottom: 12px; padding: 7px 12px; border-radius: 999px; background: #fff; color: var(--navy);
  font-size: 12.5px; font-weight: 700; box-shadow: 0 6px 16px rgba(0,0,0,.12); transform: translateY(8px) scale(.9); opacity: 0;
  transition: transform .4s cubic-bezier(.2,1.6,.4,1), opacity .3s;
}
.t-card:hover .t-tag, .t-card:focus-within .t-tag { transform: none; opacity: 1; }
.t-name { font: 400 31px/1 var(--hand); color: var(--navy); margin: 18px 4px 4px; transform: rotate(-2deg); transform-origin: left; }
.t-role { font-size: 13px; font-weight: 700; color: var(--leaf); margin: 0 4px 8px; letter-spacing: .01em; }
.t-desc { font-size: 14.5px; line-height: 1.5; color: var(--muted, #56617B); margin: 0 4px; }
.team-ui { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(var(--max, 1240px), 100% - 40px); margin: 0 auto; }
.team-dots { display: flex; gap: 6px; }
.team-dots button { width: 9px; height: 9px; border-radius: 9px; border: 0; padding: 0; background: color-mix(in srgb, var(--navy) 22%, transparent); cursor: pointer; transition: width .3s, background .3s; }
.team-dots button[aria-current="true"] { width: 28px; background: var(--navy); }
.team-arrows { display: flex; gap: 10px; }
.team-arrows button {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--navy); background: transparent; color: var(--navy);
  display: grid; place-items: center; cursor: pointer; transition: background .25s, color .25s, transform .25s;
}
.team-arrows button:hover { background: var(--navy); color: #fff; transform: scale(1.06); }
.team-arrows button:focus-visible, .team-dots button:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.team-note { font: 400 28px/1 var(--hand); color: var(--navy); transform: rotate(-4deg); margin-left: auto; margin-right: 24px; }
.team-sec { padding-bottom: clamp(50px, 6vw, 80px); }

/* ---------- Nuestros espacios ---------- */
.spaces-sec { background: var(--x-spaces-bg, var(--sky)); }
.spaces { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 22px; }
.space {
  position: relative; border-radius: 26px; overflow: hidden; min-height: 520px; color: #fff; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 28px;
}
.space > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.1s cubic-bezier(.2,.8,.2,1); }
.space::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8,20,50,0) 35%, rgba(8,20,50,.86) 100%); transition: background .5s; }
.space:hover > img { transform: scale(1.08); }
.space:hover::after { background: linear-gradient(180deg, rgba(8,20,50,.15) 10%, rgba(8,20,50,.92) 100%); }
.space h3 { font: var(--x-weight, 800) clamp(26px, 2.4vw, 34px)/1.05 var(--x-display, inherit); letter-spacing: -.02em; margin: 0 0 8px; color: #fff; }
.space p { margin: 0; max-width: 34ch; color: rgba(255,255,255,.88); font-size: 15.5px; line-height: 1.5; }
.space .more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s cubic-bezier(.2,.8,.2,1); }
.space .more > div { overflow: hidden; }
.space:hover .more, .space:focus-within .more { grid-template-rows: 1fr; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 16px; margin: 0; list-style: none; }
.chips li { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.25); }
.space .sticker {
  position: absolute; top: 22px; left: 22px; font: 400 24px/1.05 var(--hand); color: var(--navy); background: var(--sun);
  padding: 10px 16px 12px; border-radius: 14px; transform: rotate(-5deg); box-shadow: 0 10px 24px rgba(0,0,0,.18);
  transition: transform .5s cubic-bezier(.2,1.6,.4,1);
}
.space:nth-child(2) .sticker { background: #fff; transform: rotate(4deg); }
.space:nth-child(3) .sticker { background: color-mix(in srgb, var(--leaf) 70%, #fff); transform: rotate(-3deg); }
.space:hover .sticker { transform: rotate(0) scale(1.08); }
.space .num { position: absolute; top: 18px; right: 22px; font: 800 13px/1 system-ui, sans-serif; letter-spacing: .08em; opacity: .7; }

/* ---------- Calendario escolar ---------- */
.cal-sec { background: var(--x-cal-bg, #fff); }
.cal { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(36px, 6vw, 90px); align-items: start; }
.cal-page {
  position: relative; background: #fff; border-radius: 26px; box-shadow: 0 30px 60px rgba(16,36,84,.16); overflow: visible;
  transform: rotate(-4deg); max-width: 380px; margin: 30px auto 0; animation: cal-float 6s ease-in-out infinite;
}
@keyframes cal-float { 50% { transform: rotate(-2deg) translateY(-12px); } }
.cal-page::before, .cal-page::after {
  content: ""; position: absolute; top: -14px; width: 16px; height: 34px; border-radius: 10px; background: #C8D3E4; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08);
}
.cal-page::before { left: 26%; } .cal-page::after { right: 26%; }
.cal-top { background: var(--navy); color: #fff; border-radius: 26px 26px 0 0; padding: 26px 20px 18px; text-align: center; font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.cal-day { text-align: center; padding: 14px 20px 6px; font: var(--x-weight, 800) 150px/1 var(--x-display, inherit); color: var(--navy); letter-spacing: -.05em; }
.cal-what { text-align: center; font: 400 34px/1.05 var(--hand); color: var(--leaf); padding: 0 20px 30px; transform: rotate(-3deg); }
.cal-page .burst { position: absolute; right: -18px; top: 60px; }
.cal-tabs [role="tablist"] { display: inline-flex; gap: 6px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--navy) 7%, #fff); margin-bottom: 26px; flex-wrap: wrap; }
.cal-tabs [role="tab"] {
  border: 0; background: transparent; color: var(--navy); font: 700 15px/1 inherit; font-family: inherit; padding: 13px 20px; border-radius: 999px; cursor: pointer; transition: background .3s, color .3s;
}
.cal-tabs [role="tab"][aria-selected="true"] { background: var(--navy); color: #fff; }
.cal-tabs [role="tab"]:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.cal-tabs [data-pane] { display: none; }
.cal-tabs [data-pane].active { display: block; animation: cal-in .5s cubic-bezier(.2,.8,.2,1); }
@keyframes cal-in { from { opacity: 0; transform: translateY(14px); } }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cal-list li {
  display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 18px; padding: 14px 18px 14px 14px;
  border-radius: 18px; background: color-mix(in srgb, var(--navy) 4%, #fff); transition: transform .3s, background .3s;
}
.cal-list li:hover { transform: translateX(6px); background: color-mix(in srgb, var(--sun) 16%, #fff); }
.cal-date { background: #fff; border-radius: 12px; padding: 10px 8px; text-align: center; font-weight: 800; color: var(--navy); font-size: 15px; line-height: 1.15; box-shadow: 0 4px 12px rgba(16,36,84,.08); }
.cal-date small { display: block; font-size: 11.5px; font-weight: 700; color: var(--leaf); letter-spacing: .06em; }
.cal-list b { display: block; color: var(--navy); font-size: 16.5px; }
.cal-list span { color: var(--muted, #56617B); font-size: 14px; }
.cal-pill { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.cal-pill.off { background: #FFE9EC; color: #B4233C; }
.cal-pill.on { background: #E6F4E7; color: #2E6B31; }
.cal-pill.fun { background: #FFF4D1; color: #8A6400; }
.cal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }
.cal-note { font-size: 13.5px; color: var(--muted, #56617B); margin-top: 16px; }

@media (max-width: 1024px) {
  .spaces { grid-template-columns: 1fr 1fr; }
  .spaces .space:first-child { grid-column: span 2; min-height: 440px; }
  .cal { grid-template-columns: 1fr; }
  .team-note { display: none; }
}
@media (max-width: 680px) {
  .spaces { grid-template-columns: 1fr; }
  .spaces .space:first-child { grid-column: auto; }
  .space { min-height: 430px; }
  .space .more { grid-template-rows: 1fr; }
  .t-card { flex-basis: 76vw; }
  .t-card .t-tag { opacity: 1; transform: none; }
  .cal-list li { grid-template-columns: 88px 1fr; }
  .cal-pill { grid-column: 2; justify-self: start; }
  .cal-day { font-size: 120px; }
}
@media (prefers-reduced-motion: reduce) { .cal-page { animation: none; } .team-track { scroll-behavior: auto; } }
.x-link { color: var(--navy); font-weight: 700; text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: 6px; padding: 16px 6px; }
