/* ==========================================================================
   MuSkLE Summer School – stylesheet
   ========================================================================== */

:root {
  color-scheme: light;

  /* Brand – historic MuSkLE logo colours */
  --brand-yellow: #F7AC2F;
  --brand-orange: #EF6A32;
  --brand-navy:   #182651;

  --c-primary: var(--brand-navy);
  --c-primary-dark: #0f1838;
  --c-accent: var(--brand-orange);        /* backgrounds, borders, accents */
  --c-accent-text: #b8441a;               /* darker orange, readable as text on white */
  --c-accent-soft: #fdeee6;
  --c-highlight: var(--brand-yellow);

  /* Neutrals */
  --c-bg: #f6f7f9;
  --c-surface: #ffffff;
  --c-text: #1b2033;
  --c-muted: #5b6275;
  --c-border: #e3e6ec;
  --c-link-line: rgb(24 38 81 / 0.25);    /* discreet underline */

  /* Program slot colours (derived from the brand palette) */
  --slot-symposium: var(--brand-navy);
  --slot-practical: #fde6bd;
  --slot-break: #e6e7ec;
  --slot-quiz: var(--brand-yellow);
  --slot-workshop: #c9cfe3;
  --slot-social: #fbd2bf;

  --radius: 0.5rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --content-max: 72rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--c-primary);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--c-link-line);
  text-underline-offset: 0.2em;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--c-accent-text); text-decoration-color: currentColor; }

h1, h2, h3 { line-height: 1.25; color: var(--c-primary-dark); letter-spacing: -0.01em; }
h1 { font-weight: 700; }
h2, h3 { font-weight: 600; }
h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.25rem; }

:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--c-surface); padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { top: 1rem; }

.muted { color: var(--c-muted); }
.small { font-size: 0.875rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--c-primary);
  color: #fff;
  border-bottom: 3px solid var(--c-accent);
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}
.brand { color: inherit; text-decoration: none; display: grid; }
.brand:hover { color: inherit; }
.brand__name { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 600; }
.brand__name strong { color: var(--brand-yellow); }
.brand__tagline { font-size: 0.9rem; opacity: 0.85; }

.event-info { margin: 0; display: grid; gap: 0.15rem; font-size: 0.95rem; }
.event-info div { display: flex; gap: 0.5rem; }
.event-info dt { opacity: 0.75; min-width: 4.5rem; }
.event-info dd { margin: 0; font-weight: 500; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 1.5rem 3rem;
  align-items: start;
}

.content {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  min-width: 0;
}
.content::after { content: ""; display: block; clear: both; }

.page-title { margin-top: 0; font-size: clamp(1.5rem, 3vw, 2rem); }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 1rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.site-nav__toggle { display: none; }
.site-nav__list { list-style: none; margin: 0; padding: 0.5rem 0; }
.site-nav__list a {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--c-text);
  text-decoration: none;
  border-left: 3px solid transparent;
}
.site-nav__list a:hover { background: var(--c-bg); color: var(--c-primary); }
.site-nav__list a[aria-current="page"] {
  border-left-color: var(--c-accent);
  color: var(--c-primary-dark);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding-block: 2rem;
}
.partners {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 1.25rem 2rem;
}
.partners img { height: 3rem; width: auto; max-width: 8rem; object-fit: contain; }
.site-footer__meta { text-align: center; color: var(--c-muted); font-size: 0.875rem; margin: 1.5rem 0 0; }
.site-footer__egg { text-align: center; font-size: 0.875rem; margin: 0.25rem 0 0; color: var(--c-surface); }
.site-footer__egg::selection { color: #fff; background: var(--brand-orange); }

/* ---------- Generic components ---------- */

.figure-right {
  float: right;
  width: min(300px, 40%);
  margin: 0 0 1rem 1.5rem;
  border-radius: var(--radius);
}
.figure-right--half { width: 50%; }

.button {
  display: inline-block;
  background: var(--c-primary);
  color: #fff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.15s;
}
.button:hover { background: var(--c-accent-text); color: #fff; }
.button--large { font-size: 1.1rem; padding: 0.8rem 1.75rem; }

.callout {
  background: var(--c-accent-soft);
  border-left: 3px solid var(--c-accent);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout--muted { background: var(--c-bg); border-left-color: var(--c-muted); }

.card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { margin-top: 0; font-size: 1.15rem; }
.card--highlight { background: var(--c-bg); }

.tag { font-size: 0.9rem; }

/* ---------- Home ---------- */
.facts {
  list-style: none; padding: 0; margin: 1.5rem 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem;
  clear: both;
}
.facts li {
  background: var(--c-bg); border-radius: var(--radius);
  padding: 0.75rem 1rem; text-align: center; font-size: 0.95rem;
}
.facts strong { display: block; font-size: 1.25rem; color: var(--c-primary); }

.key-dates { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.key-dates li { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.key-dates__when { font-weight: 700; color: var(--c-accent-text); min-width: 11rem; }

.video { margin-top: 2rem; clear: both; }
.video--hero { margin: 0 0 2rem; }
.video__facade, .video iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; background: #000; cursor: pointer;
}
.video__facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.video__play {
  position: absolute; inset: 50% auto auto 50%; translate: -50% -50%;
  width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--c-primary);
}
.video__play::after {
  content: ""; position: absolute; inset: 50% auto auto 54%; translate: -50% -50%;
  border-style: solid; border-width: 0.7rem 0 0.7rem 1.2rem; border-color: transparent transparent transparent #fff;
}
.video__facade:hover .video__play { background: var(--c-accent-text); }

/* ---------- Committee ---------- */
.committee {
  list-style: none; padding: 0;
  columns: 2 16rem; column-gap: 2rem;
}
.committee li { break-inside: avoid; padding: 0.3rem 0; border-bottom: 1px solid var(--c-border); }
.committee__name { font-weight: 500; }
.committee .muted { font-size: 0.875rem; }

/* ---------- Speakers ---------- */
.session { scroll-margin-top: 1rem; }
.speaker-cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem;
}
.speaker-card {
  display: flex; gap: 1rem; align-items: center;
  border: 1px solid var(--c-border); border-radius: var(--radius); padding: 0.75rem;
  transition: border-color 0.15s;
}
.speaker-card:hover { border-color: var(--c-muted); }
.speaker-card picture { flex: none; }
.speaker-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; }
.speaker-card__name { font-weight: 600; text-decoration: none; }
.speaker-card--tba { border-style: dashed; color: var(--c-muted); }
.speaker-card__placeholder { width: 96px; height: 96px; flex: none; color: var(--brand-navy); }
.keywords { margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.keywords__label { font-weight: 600; margin-right: 0.25rem; }
.keyword { padding: 0.1rem 0.6rem; border-radius: 999px; border: 1px solid var(--c-border); background: var(--c-bg); }
.speaker-card p { margin: 0.25rem 0 0; font-size: 0.9rem; line-height: 1.4; }

.speaker { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1rem 2rem; align-items: start; }
.speaker__photo { border-radius: var(--radius); width: 200px; aspect-ratio: 1; object-fit: cover; object-position: top; }
.speaker__body .page-title { margin-bottom: 0.25rem; }
.speaker__body .tag { margin-bottom: 1.5rem; }

/* ---------- Host labs ---------- */
.labs { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.labs__item {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1.5rem; align-items: center;
  border-bottom: 1px solid var(--c-border); padding-bottom: 1rem;
}
.labs__item img { max-height: 5rem; width: auto; object-fit: contain; margin-inline: auto; }
.labs__item h2 { font-size: 1.05rem; margin: 0 0 0.25rem; }
.labs__item p { margin: 0; font-size: 0.9rem; }

/* ---------- Call to action (Apply) ---------- */
.cta {
  clear: both;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  margin: 2rem 0; padding: 1.75rem 1rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  text-align: center;
}
.button--cta { font-size: 1.2rem; padding: 0.8rem 3rem; }
.button--disabled { background: var(--c-border); color: var(--c-muted); cursor: not-allowed; }
.button--disabled:hover { background: var(--c-border); color: var(--c-muted); }
.cta__note { font-size: 0.9rem; color: var(--c-muted); }
.cta__deadline { font-size: 0.95rem; }

.lead { font-size: 1.1rem; }

/* ---------- Alumni network ---------- */
/* <muskle-map> widget (https://github.com/Xiboid/muskle-map), rendered directly in the page */
.network-map { margin: 1.5rem 0 0.5rem; min-height: 30rem; }
.network-map .muskle-map-wrapper { width: 100%; max-width: none; }
/* The page already has its own title: hide the widget's "Summer School Network" heading */
.network-map .muskle-header-container { display: none; }
/* Stacked layout at every width: map on top, people list below growing with the page
   (no scroll area inside the page). */
.network-map .muskle-split-container { display: flex; flex-direction: column; height: auto; gap: 1rem; }
.network-map .muskle-map-box { width: 100%; height: clamp(320px, 60vh, 560px); }
.network-map .muskle-panel-box { height: auto; overflow: visible; }
.network-map img { display: inline-block; }

.carousel { position: relative; }
.carousel__track {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  border-radius: var(--radius);
}
.carousel__slide { flex: 0 0 100%; scroll-snap-align: center; }
.carousel__slide figure { margin: 0; }
.carousel__slide img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.carousel__slide figcaption { text-align: center; color: var(--c-muted); margin-top: 0.5rem; font-weight: 600; }
.carousel__btn {
  position: absolute; top: calc(50% - 1.5rem); translate: 0 -50%; z-index: 1;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--c-border); background: rgb(255 255 255 / 0.92); color: var(--brand-navy);
  font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.carousel__btn:hover { background: var(--c-primary); color: #fff; }
.carousel__btn:disabled { opacity: 0.35; cursor: default; background: #fff; }
.carousel__btn--prev { left: 0.75rem; }
.carousel__btn--next { right: 0.75rem; }

/* ---------- Practical information ---------- */
.itineraries { list-style: none; padding: 0; display: grid; gap: 1.25rem; }
.itinerary {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem;
  border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1rem;
}
.itinerary p { margin: 0 0 0.5rem; }
.route-map {
  min-height: 16rem;
  border-radius: calc(var(--radius) / 2);
  background: var(--c-bg);
  z-index: 0;
}
.route-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.9rem; }

address { font-style: normal; }
.contact-email { font-size: 1.2rem; font-weight: 600; }

/* ---------- Program timetable ---------- */
.legend {
  list-style: none; padding: 0; margin: 0 0 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.85rem;
}
.legend li { display: flex; align-items: center; gap: 0.4rem; }
.legend__swatch { width: 0.9rem; height: 0.9rem; border-radius: 3px; border: 1px solid rgb(0 0 0 / 0.08); }

.slot--symposium { background: var(--slot-symposium); color: #fff; }
.slot--practical { background: var(--slot-practical); }
.slot--break     { background: var(--slot-break); }
.slot--quiz      { background: var(--slot-quiz); }
.slot--workshop  { background: var(--slot-workshop); }
.slot--social    { background: var(--slot-social); }

.timetable-scroll { overflow-x: auto; }

.timetable {
  display: grid;
  grid-template-columns: 2.75rem repeat(var(--days), minmax(6.5rem, 1fr));
  grid-template-rows: auto repeat(var(--rows), minmax(0.85rem, auto));
  column-gap: 3px;
  font-size: 0.78rem;
  line-height: 1.3;
  min-width: 42rem;
}
.tt-col {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: subgrid;
  margin: 0;
}
.tt-list {
  grid-row: 2 / -1;
  display: grid;
  grid-template-rows: subgrid;
  list-style: none; margin: 0; padding: 0;
}
.tt-head {
  margin: 0 0 6px;
  background: none;
  border-bottom: 2px solid var(--c-primary);
  color: var(--c-primary-dark);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.25rem 0.25rem 0.4rem;
  display: grid;
}
.tt-col--times .tt-head { border: 0; }
.tt-head__weekday { font-weight: 400; color: var(--c-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.tt-head__venue { font-size: 0.75rem; font-weight: 600; color: var(--c-accent-text); }

.tt-time {
  grid-row: var(--from) / span 2;
  color: var(--c-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  translate: 0 -0.5em;
}

.slot {
  grid-row: var(--from) / var(--to);
  margin-bottom: 2px;
  border-radius: 3px;
  padding: 0.2rem 0.4rem;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  overflow: hidden;
}
.slot__time { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.slot__kind { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.slot__title { font-weight: 600; color: var(--c-text); }
a.slot__title { text-decoration: none; }
a.slot__title:hover { text-decoration: underline; }
.slot__speakers { font-size: 0.75rem; }
.slot__speakers a { color: var(--c-primary-dark); text-decoration: none; }
.slot__speakers a:hover { text-decoration: underline; }
.slot__venue { font-size: 0.7rem; opacity: 0.75; }
.slot--break .slot__title { font-weight: 400; }
.slot--symposium .slot__title,
.slot--symposium .slot__speakers a { color: #fff; }
.slot--symposium .slot__kind { color: var(--brand-yellow); opacity: 1; }
.slot--symposium a { text-decoration-color: rgb(255 255 255 / 0.4); }
.slot--symposium a:hover { color: var(--brand-yellow); }

.venues { padding-left: 1.25rem; }
.venues li { margin-bottom: 0.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 52rem) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1rem; }

  .site-nav { position: static; }
  .site-nav__toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 0.75rem 1.25rem; border: 0; background: none;
    font: inherit; font-weight: 600; color: var(--c-primary); cursor: pointer;
  }
  .site-nav__toggle::after { content: "☰"; font-size: 1.2rem; }
  .site-nav__toggle[aria-expanded="true"]::after { content: "✕"; }
  .js .site-nav__list { display: none; }
  .js .site-nav__toggle[aria-expanded="true"] + .site-nav__list { display: block; }

  .figure-right { float: none; width: 100%; max-width: 300px; margin: 0 auto 1rem; }

  .speaker { grid-template-columns: minmax(0, 1fr); }
  .speaker__photo { width: 160px; }

  .labs__item, .itinerary { grid-template-columns: minmax(0, 1fr); }
  .labs__item img { margin-inline: 0; }

  /* Program: one list per day instead of the grid */
  .timetable { display: block; min-width: 0; font-size: 0.9rem; }
  .tt-col { display: block; margin-bottom: 1.5rem; }
  .tt-col.tt-col--times { display: none; }
  .tt-head { display: flex; gap: 0.5rem; justify-content: flex-start; align-items: baseline; text-align: left; padding: 0.5rem 0.75rem; font-size: 1rem; }
  .tt-head__venue { margin-left: auto; }
  .tt-list { display: block; }
  .slot {
    display: grid; grid-template-columns: 6.5rem minmax(0, 1fr);
    align-items: start; text-align: left; padding: 0.5rem 0.75rem; column-gap: 0.75rem;
  }
  .slot > :not(.slot__time) { grid-column: 2; }
  .slot__time {
    position: static; width: auto; height: auto; clip: auto;
    grid-row: 1 / span 4; font-weight: 600; font-variant-numeric: tabular-nums;
  }
}
