/* Committees — listing + detail page redesign
   Brand palette reused from mundp.webflow.shared css:
   black #000, antique-white #f4e5d0, seashell #faf3f0, peach #f5dfd1, brown #2a1816, blue #0356f0

   Note: intentionally NOT using the shared .background-color-antique-white /
   .background-color-seashell Webflow classes for new sections below — theme.css
   redefines them per-page (one variant resolves to a dark navy #012972), and that
   cascade fight is what made the list section unreadable. .cx-section-white owns
   its own explicit background so it can't be hijacked.
*/

.cx-section-white {
  background-color: #ffffff;
}

/* ---------- Listing hero collage ----------
   Literally the home hero's collage: same tiles (assets/img/collage/c01–c19),
   same reel markup built by home-hero-collage.js, same scrim gradient.
   Rules copied from intro.css (which this page doesn't load). */
.cx-hero-has-collage {
  position: relative;
  overflow: hidden;
  background-image: none !important;
}

.cx-hero-has-collage .grid-halves-section {
  position: relative;
  z-index: 1;
}

.home-hero-collage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  overflow: hidden;
}

.home-hero-collage-reel {
  position: relative;
  flex: 1 1 0%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  will-change: transform;
  transform: translate3d(0, calc(var(--home-hero-reel-base, 0px) + var(--home-hero-progress, 0) * var(--home-hero-reel-shift, 0px)), 0);
}

.home-hero-collage-reel img {
  width: 100%;
  height: 190px; /* keep in sync with TILE_H in home-hero-collage.js */
  flex: none;
  object-fit: cover;
  display: block;
  filter: saturate(0.75) contrast(1.05);
  background: #13224a; /* navy placeholder while a tile loads — matches the coat-of-arms tile ground */
}

/* Static still replacing the collage host — same box, one cover image
   (the theme page's coa-still-hero.webp). */
.home-hero-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.home-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 15, 40, 0.6) 0%, rgba(6, 15, 40, 0.42) 45%, rgba(6, 15, 40, 0.78) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-collage-reel {
    transform: none;
  }
}

/* ---------- Listing hero ---------- */
.cx-hero-sub {
  max-width: 40rem;
  margin-top: 1.25rem;
  color: #f0f0f0;
  font-size: 1.25rem;
  line-height: 1.6;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.65), 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* ---------- Toolbar: filters + individual-apps note ---------- */
.cm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 1.5rem;
  padding: 2.75rem 0 0;
}

.cm-filter-bar {
  position: relative;
  display: inline-flex;
  padding: 0.3rem;
  border-radius: 999px;
  background: #e6ebf6;
  border: 1px solid rgba(1, 41, 114, 0.16);
  box-shadow: inset 0 1px 4px rgba(1, 41, 114, 0.12), 0 1px 0 rgba(255, 255, 255, 0.6);
}

.cm-filter-thumb {
  position: absolute;
  top: 0.3rem;
  left: 0;
  height: calc(100% - 0.6rem);
  border-radius: 999px;
  background: linear-gradient(180deg, #022560 0%, #011a45 100%);
  box-shadow: 0 2px 8px rgba(1, 20, 55, 0.5), 0 1px 2px rgba(1, 20, 55, 0.35);
  transition: transform 0.35s cubic-bezier(0.3, 0.9, 0.3, 1), width 0.35s cubic-bezier(0.3, 0.9, 0.3, 1);
  will-change: transform, width;
  pointer-events: none;
}

.cm-filter-btn {
  position: relative;
  z-index: 1;
  appearance: none;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #51608a;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  transition: color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.cm-filter-btn:hover {
  color: #012972;
}

.cm-filter-btn.is-active {
  color: #fff;
}

/* Fallback highlight until the JS thumb takes over */
.cm-filter-bar:not(.has-thumb) .cm-filter-btn.is-active {
  background: #011a45;
}

@media (prefers-reduced-motion: reduce) {
  .cm-filter-thumb {
    transition: none;
  }
}

/* ---------- Card grid ---------- */
.cm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin-top: 2.25rem;
}

.cm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 1.35rem;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(42, 24, 22, 0.1);
  box-shadow: 0 1px 2px rgba(16, 12, 10, 0.05), 0 10px 26px -14px rgba(16, 12, 10, 0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cm-card:hover,
.cm-card:focus-within {
  transform: translateY(-6px);
  border-color: rgba(42, 24, 22, 0.18);
  box-shadow: 0 4px 10px rgba(16, 12, 10, 0.08), 0 26px 48px -18px rgba(16, 12, 10, 0.4);
}

.cm-card.is-hidden {
  display: none;
}

.cm-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: #f4e5d0;
}

.cm-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.cm-card:hover .cm-card__media img {
  transform: scale(1.07);
}

.cm-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(16, 12, 10, 0.35), rgba(16, 12, 10, 0) 45%);
  pointer-events: none;
}

.cm-chip {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 1;
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cm-chip.is-development {
  background: rgba(244, 229, 208, 0.92);
  color: #2a1816;
}

.cm-chip.is-special {
  background: rgba(16, 16, 16, 0.78);
  color: #f5dfd1;
}

.cm-badge-apply {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(3, 86, 240, 0.92);
  color: #ffffff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cm-card__body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 1.5rem 1.6rem 1.6rem;
}

.cm-card__name {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  color: #101010;
}

.cm-card__desc {
  margin: 0 0 1.35rem;
  color: #55504e;
  font-size: 1.02rem;
  line-height: 1.55;
  flex-grow: 1;
}

.cm-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(42, 24, 22, 0.1);
}

/* Primary link stretches over the whole card */
.cm-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: #101010;
  text-decoration: none;
  white-space: nowrap;
}

.cm-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cm-card__link svg {
  transition: transform 0.25s ease;
}

.cm-card:hover .cm-card__link svg {
  transform: translateX(4px);
}

/* Apply link sits above the stretched link */
.cm-card__apply {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
  color: #0356f0;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px solid rgba(3, 86, 240, 0.35);
  background: rgba(3, 86, 240, 0.06);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.cm-card__apply:hover {
  background: #0356f0;
  border-color: #0356f0;
  color: #ffffff;
  transform: translateY(-1px);
}

.cm-card__apply svg {
  flex-shrink: 0;
}

/* ---------- Reveal on scroll ---------- */
.cm-card.cm-reveal {
  opacity: 0;
  transform: translateY(22px);
}

.cm-card.cm-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.55s ease, transform 0.55s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cm-card.cm-reveal.is-visible:hover,
.cm-card.cm-reveal.is-visible:focus-within {
  transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
  .cm-card.cm-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cm-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 700px) {
  .cm-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }
  .cm-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cm-filter-btn {
    flex: 1 1 0;
    padding: 0.6rem 0.5rem;
  }
  .cm-card__name {
    font-size: 1.6rem;
  }
}

/* ---------- Detail page: shortened committee name (e.g. "UNESCO") ---------- */
.heading.cx-detail-name {
  font-size: clamp(3.25rem, 7.5vw, 5.5rem);
  line-height: 1;
}

/* ---------- Detail page: category label ("Special/Development Committee") ---------- */
.heading.type.cx-detail-category {
  color: #f0ece9;
  font-size: 1.25rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75), 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* ---------- Detail page: hero subtitle (deabbreviated name) ---------- */
.cx-detail-subtitle {
  margin: 0.75rem 0 0;
  color: #f0f0f0;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.65), 0 12px 28px rgba(0, 0, 0, 0.5);
}

@media (max-width: 767px) {
  .cx-detail-subtitle {
    font-size: 1.4rem;
  }
}

/* ---------- Detail page: back button ---------- */
.cx-back-button {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.65rem 1.25rem 0.65rem 1.05rem;
  border-radius: 999px;
  background: #ffffff;
  color: #101010;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22), 0 10px 22px -8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cx-back-button svg {
  transition: transform 0.2s ease;
}

.cx-back-button:hover {
  background: #f4e5d0;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.26), 0 16px 28px -8px rgba(0, 0, 0, 0.45);
}

.cx-back-button:hover svg {
  transform: translateX(-3px);
}

.cx-back-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ---------- Detail page: about ---------- */
.cx-about {
  max-width: 46rem;
}

.cx-about p {
  font-size: 1.15rem;
  line-height: 1.75;
  color: #33302f;
  margin: 0 0 1.15em;
}

.cx-about p:last-child {
  margin-bottom: 0;
}

.cx-about strong {
  color: #101010;
}

/* ---------- Detail page: agenda placeholder ---------- */
.cx-agenda-placeholder {
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px dashed rgba(42, 24, 22, 0.3);
  border-radius: 0.85rem;
  padding: 1.25rem 1.5rem;
  max-width: 32rem;
}

.cx-agenda-placeholder__icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #f4e5d0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cx-agenda-placeholder__title {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 1.1rem;
}

.cx-agenda-placeholder__desc {
  margin: 0;
  color: #6e6863;
  font-size: 1rem;
}

/* ---------- HISTO: tilted repeating "CRISIS" placeholder (stand-in for images) ---------- */
.cx-crisis-pattern {
  position: relative;
  overflow: hidden;
  background-color: #0d0d10;
}

.cx-crisis-pattern::before {
  content: "";
  position: absolute;
  inset: -30%;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='420'%20height='140'%3E%3Cg%20fill='%23f5dfd1'%20fill-opacity='.11'%20font-family='Arial%20Black,Arial,sans-serif'%20font-size='46'%20font-weight='900'%20letter-spacing='8'%3E%3Ctext%20x='210'%20y='52'%20text-anchor='middle'%3ECRISIS%3C/text%3E%3Ctext%20x='0'%20y='122'%20text-anchor='middle'%3ECRISIS%3C/text%3E%3Ctext%20x='420'%20y='122'%20text-anchor='middle'%3ECRISIS%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-size: 420px 140px;
  transform: rotate(-5deg);
  pointer-events: none;
}

/* Detail-page hero variant: kill the default hero photo, keep content above the pattern */
.section-hero.cx-crisis-pattern {
  background-image: none;
}

.section-hero.cx-crisis-pattern > * {
  position: relative;
  z-index: 1;
}

/* Committees-grid card variant: smaller type, hover zoom to match photo cards */
.cm-card__media.cx-crisis-pattern::before {
  background-size: 240px 80px;
  transition: transform 0.55s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.cm-card:hover .cm-card__media.cx-crisis-pattern::before {
  transform: rotate(-5deg) scale(1.07);
}

/* The crisis hero is a flat dark ground + CRISIS pattern; without this the
   shared Webflow stylesheet's default hero photo (DSC_0054) leaks through
   and gets downloaded for nothing. */
.section-hero.background-color-black.cx-crisis-pattern {
  background-image: none;
}

/* ---------- language toggle (FR / EN slider, same as the application forms) ---------- */
.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: #ececf0;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 999px;
}

.header_content-left .lang-toggle {
  margin-top: 1rem;
}

.lang-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
  transition: transform 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.lang-toggle[data-active="en"] .lang-thumb { transform: translateX(100%); }

.lang-option {
  position: relative;
  z-index: 1;
  width: 3.25rem;
  padding: 0.4rem 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  color: #6e6e73;
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.2s ease;
}

.lang-option.is-active { color: #1d1d1f; }

@media (prefers-reduced-motion: reduce) {
  .lang-thumb { transition: none; }
}
