/* IF Academy homepage — compact layout (Nov 2026): tighter sections, slim chapter bands,
   moving photo gallery near the top, staff in one scrolling row, app directory folded. */

/* tighter sections */
section, main section { padding-block: 60px !important; }
.section-head { margin-bottom: 30px !important; }
@media (max-width: 640px) { section, main section { padding-block: 42px !important; } .section-head { margin-bottom: 20px !important; } }

/* chapter bands: a slim strip instead of a full screen */
.x-open { height: clamp(120px, 15vw, 210px) !important; margin-top: 18px !important; }
.x-open .wrap { padding-bottom: 16px !important; }
.x-open-t { font-size: clamp(40px, 7.5vw, 112px) !important; }
.x-open-n { padding-bottom: 8px !important; }
.x-open.x-team { height: auto !important; }

/* ---------- gallery: featured photo + tidy grid, kept inside the page width ---------- */
#gallery .g-event { margin: 0 0 16px !important; }
#gallery .g-grid { columns: auto !important; display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 14vw, 200px); grid-auto-flow: dense; gap: 12px; margin: 0; }
#gallery .g-item { margin: 0 !important; position: relative; overflow: hidden; border-radius: 14px; background: #e9e3d8; box-shadow: 0 10px 24px -18px rgba(10, 24, 47, .5);
  opacity: 0; transform: translateY(14px); transition: opacity .55s ease var(--d, 0ms), transform .55s ease var(--d, 0ms); }
#gallery .g-item.in { opacity: 1; transform: none; }
#gallery .g-item[hidden] { display: none !important; }
#gallery .g-item.feat { grid-column: span 2; grid-row: span 2; }
#gallery .g-item.wide { grid-column: span 2; }
#gallery .g-item a { display: block; height: 100%; }
#gallery .g-item img { width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
#gallery .g-item.feat img { animation: gzoom 18s ease-in-out infinite alternate; }
@keyframes gzoom { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
@media (hover: hover) { #gallery .g-item:not(.feat):hover img { transform: scale(1.05); } }
#gallery .g-item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; color: #fff; font-size: 13px; line-height: 1.3; background: linear-gradient(transparent, rgba(8, 18, 36, .72)); pointer-events: none; }
#gallery .g-item.feat figcaption { font-size: 15px; padding: 40px 18px 14px; }
#gallery .g-more { display: block; margin: 16px auto 0; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border-c, #d9d0bf); background: transparent; font: 600 14px/1.2 inherit; color: inherit; cursor: pointer; }
#gallery .g-more:hover { border-color: currentColor; }
#gallery .g-more[hidden] { display: none; }
@media (max-width: 900px) { #gallery .g-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: clamp(130px, 22vw, 190px); } }
@media (max-width: 560px) { #gallery .g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 42vw; gap: 8px; } }
@media (prefers-reduced-motion: reduce) { #gallery .g-item { opacity: 1; transform: none; transition: none; } #gallery .g-item.feat img { animation: none; } }
#gallery .ig-head { margin: 26px 0 12px !important; font-size: 20px !important; }
#gallery .ig-row { grid-template-columns: repeat(4, 1fr) !important; gap: 10px !important; }
#gallery .ig-row .frame { aspect-ratio: auto !important; min-height: 88px; padding: 14px !important; }
@media (max-width: 760px) { #gallery .ig-row { grid-template-columns: 1fr 1fr !important; } }
@media (prefers-reduced-motion: reduce) { #gallery .g-track { animation: none !important; flex-wrap: wrap; width: auto; justify-content: center; } }

/* ---------- staff: one row you can swipe ---------- */
/* staff: a 3 × 3 grid, everyone visible without sideways scrolling */
#teachers .eco-grid { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; overflow: visible; gap: 18px !important; background: none !important; border: 0 !important; align-items: stretch; }
#teachers .eco-grid .teacher-portrait { width: 100% !important; max-width: none !important; aspect-ratio: 1 / 1 !important; height: auto !important; object-fit: cover; object-position: 50% 18%; border-radius: 12px; display: block; }
@media (max-width: 560px) { #teachers .eco-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; } #teachers .eco-card { padding: 12px !important; } #teachers .eco-card h3 { font-size: 16px !important; } }
#teachers .eco-card { min-width: 0; border: 1px solid var(--border-c, #e4dccd); border-radius: 18px; padding: 18px !important; grid-column: auto !important; }
#teachers .teacher-portrait { aspect-ratio: 4/5 !important; margin-bottom: 12px !important; }
#teachers .eco-card p { font-size: 13.5px !important; }
#teachers .eco-card:first-child { padding: 18px !important; }

/* ---------- apps: first rows of the directory, the rest on demand ---------- */
#academy-directory.folded { max-height: 520px; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent); mask-image: linear-gradient(180deg, #000 78%, transparent); }
.dir-more { display: block; margin: 14px auto 0; color: #fff !important; border-color: rgba(255,255,255,.55) !important; background: transparent !important; }

/* ---------- pricing: slimmer rows ---------- */
#pricing .program-row { padding-block: 16px !important; }
#pricing .cat-label { margin-top: 26px !important; }

/* staff cards: short bio, full text on "Read more" */
#teachers .eco-card { display: flex; flex-direction: column; }
#teachers .eco-card > p:not(.meta) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0; }
#teachers .eco-card > .profile-subheading, #teachers .eco-card > .profile-subheading ~ p { display: none; }
#teachers .eco-card.open > p:not(.meta) { display: block; -webkit-line-clamp: none; }
#teachers .eco-card.open > .profile-subheading { display: block; }
#teachers .eco-card.open > .profile-subheading ~ p { display: block; }
#teachers .t-more { margin-top: 10px; align-self: flex-start; background: none; border: 0; padding: 0; font: 600 13px/1.4 inherit; color: var(--accent, #b08a3e); cursor: pointer; text-decoration: underline; }

/* ---------- tablets (iPad portrait and landscape) ---------- */
@media (min-width: 641px) and (max-width: 1100px) {
  .x-hero .hero-actions { flex-direction: row !important; flex-wrap: wrap; align-items: center !important; justify-content: flex-start !important; }
  .x-hero .hero-actions .cta { flex: none; }
  /* robot sits top-right, clear of the buttons and the facts row */
  .x-bot { right: 20px; bottom: auto; top: 110px; width: 180px; }
  .bot { width: 180px; }
  .x-bubble { right: 146px; top: -30px; min-width: 130px; padding: 8px 14px 7px; }
  .hi3d { font-size: 26px; }
  .hi3d.q { font-size: 21px; }
  .hi-lang { font-size: 10px; }
}
/* the open menu on tablets: bigger tap targets, scrolls if it is taller than the screen */
@media (min-width: 641px) and (max-width: 1280px) {
  .navlinks.open { max-height: calc(100dvh - 96px); overflow-y: auto; -webkit-overflow-scrolling: touch; padding-inline: 36px !important; }
  .navlinks.open > a:not(.cta) { padding-block: 14px; font-size: 16px; }
}

/* pricing: "from" prices per course group, exact price on request */
#pricing .cat-from { margin: -4px 0 10px; font-size: 15px; color: var(--text-soft, #5b6475); }
#pricing .cat-from b { font-size: 22px; color: var(--text, #0b1f3a); font-weight: 700; margin: 0 2px; }
#pricing .cat-from small { font-size: 13px; }
#pricing .prog-ask { justify-self: end; align-self: center; white-space: nowrap; font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-c, #d9d0bf); color: inherit; text-decoration: none; transition: border-color .2s, background .2s; }
#pricing .prog-ask:hover { border-color: currentColor; }
@media (max-width: 760px) { #pricing .prog-ask { justify-self: start; } }

/* apps: six highlights and one way into the IF Learning Centre */
#apps .feat-apps { margin-top: 18px; display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (max-width: 760px) { #apps .feat-apps { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 460px) { #apps .feat-apps { grid-template-columns: 1fr !important; } }
