﻿/* Safe scoped reset */
.cgtl, .cgtl * { box-sizing: border-box; }
.cgtl img { max-width: 100%; height: auto; }
.cgtl button { font: inherit; }


.cgtl{
  max-width: 1100px;
  margin: 0 auto;
}

.cgtl__header{
  display:flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}

.cgtl__headerTop{
  text-align: left;
}

.cgtl__controls{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  justify-content: center;   /* centered */
  align-items: center;
}

.cgtl__title{
  margin:0 0 6px 0;
  font-size: 28px;
  letter-spacing: .2px;
}
.cgtl__sub{
  margin:0;
  color: var(--muted);
  max-width: 62ch;
  line-height: 1.4;
}

/* Route buttons */
.cgtl__controls{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}
.cgtl__btn{
  border:1px solid rgba(14,34,51,.18);
  background: #fff;
  color: var(--ink);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight: 600;
  transition: transform .08s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.cgtl__btn:hover{ transform: translateY(-1px); }
.cgtl__btn.is-active{
  border-color: rgba(14,34,51,.36);
  box-shadow: 0 10px 20px rgba(0,0,0,.06);
}

/* ===== Timeline layout ===== */
.cgtl__timeline{
  display:grid;
  grid-template-columns: 110px 1fr 280px;
  gap: 18px;
  align-items: start;
}

/* Years column */
.cgtl__years{
  position: sticky;
  top: 18px;
  display:flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 6px;
}
.cgtl__year{
  border-left: 5px solid rgba(14,34,51,.18);
  padding: 10px 10px 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.6);
  font-weight: 900;
  letter-spacing: 1.5px;
  color: rgba(14,34,51,.78);
}
.cgtl__year--y0{ border-left-color: rgba(46,125,50,.35); }

/* Lanes area (middle) */
.cgtl__lanes{
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.56));
  border:1px solid rgba(14,34,51,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.lane{ margin-bottom: 16px; }
.lane__title{
  font-weight: 800;
  margin: 0 0 10px 0;
  color: rgba(14,34,51,.78);
}
.lane__stack{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.lane__stack--wide .tile{ padding: 14px 14px; }

/* Tiles */
.tile{
  background: var(--card);
  border: 1px solid rgba(14,34,51,.12);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease, opacity .2s ease, filter .2s ease;
}
.tile:hover{ transform: translateY(-1px); box-shadow: 0 14px 26px rgba(0,0,0,.08); }
.tile__kicker{
  font-size: 12px;
  font-weight: 800;
  color: rgba(14,34,51,.62);
  margin-bottom: 4px;
}
.tile__title{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .2px;
}

.tile--shared{ border-left: 8px solid rgba(30,136,229,.55); }
.tile--phd{ border-left: 8px solid rgba(43,87,154,.58); }
.tile--mres{ border-left: 8px solid rgba(240,160,32,.65); }
.tile--green{ border-left: 8px solid rgba(46,125,50,.62); }

/* Route split block */
.lane--routes{
  padding: 10px 0 4px 0;
}
.lane__split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.route{
  border-radius: 18px;
  padding: 12px;
  border: 1px dashed rgba(14,34,51,.18);
  background: rgba(255,255,255,.62);
  transition: opacity .2s ease, filter .2s ease;
}
.route__label{
  font-weight: 900;
  margin-bottom: 8px;
}
.route__tag{
  font-size: 13px;
  color: rgba(14,34,51,.72);
  margin-bottom: 10px;
}
.route__join{
  margin-top: 10px;

  font-size: 13px;
  color: rgba(14,34,51,.72);
}

/* Rail */
.cgtl__rail{
  position: sticky;
  top: 18px;
}

.rail{
  position: relative;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(14,34,51,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px 12px 14px;
}
.rail__line{
  position:absolute;
  top: 44px;
  bottom: 20px;

  left: 18px;
  width: 2px;
  background: rgba(14,34,51,.18);
}
.rail__group{
  margin-bottom: 14px;
  padding-left: 0;
}
.rail__groupLabel{
  font-weight: 900;
  color: rgba(14,34,51,.70);
  margin: 4px 0 10px 0;
  padding-left: 2px;
}
.rail__node{
  width: 100%;
  display:flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, opacity .2s ease, filter .2s ease;
}
.rail__node:hover{ background: rgba(14,34,51,.05); }
.rail__dot{
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  border: 3px solid rgba(30,136,229,.75);
  flex: 0 0 14px;
  margin-left: 6px;
  position: relative;
  z-index: 2;
}
.rail__node.is-mres .rail__dot{ border-color: rgba(240,160,32,.82); }
.rail__node.is-green .rail__dot{ border-color: rgba(46,125,50,.78); }

.rail__meta{ display:flex; flex-direction: column; gap:2px; }
.rail__time{
  font-size: 12px;
  font-weight: 900;
  color: rgba(14,34,51,.62);
}
.rail__label{
  font-size: 14px;
  font-weight: 800;
  color: rgba(14,34,51,.86);
}

/* ===== Route highlight/fade states ===== */
/* Root state */
.cgtl[data-selected="phd"] .route--mres,
.cgtl[data-selected="phd"] .tile--mres,
.cgtl[data-selected="phd"] .rail__node.is-mres{
  opacity: var(--fade);
  filter: grayscale(0.15);
}

.cgtl[data-selected="mres"] .route--phd{
  opacity: var(--fade);
  filter: grayscale(0.15);
}

/* Year 0 label visibility */
.cgtl[data-selected="phd"] .cgtl__year--y0{ opacity: var(--fade); }
.cgtl[data-selected="phd"] .route--mres .tile--mres{ pointer-events:none; }
.cgtl[data-selected="phd"] .rail__node.is-mres{ pointer-events:none; }

/* ===== Drawer ===== */
.cgtl__overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 50;
}

.cgtl__drawer{
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 92vw);
  background: #fff;
  box-shadow: -18px 0 40px rgba(0,0,0,.18);
  z-index: 60;
  transform: translateX(105%);
  transition: transform .22s ease;
  display:flex;
  flex-direction: column;
}
.cgtl__drawer.is-open{ transform: translateX(0); }

.drawer__header{
  padding: 18px 18px 12px 18px;
  border-bottom: 1px solid rgba(14,34,51,.10);
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 12px;
}
.drawer__kicker{
  font-size: 12px;
  font-weight: 900;
  color: rgba(14,34,51,.58);
  margin-bottom: 6px;
}
.drawer__title{
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.drawer__close{
  border: 1px solid rgba(14,34,51,.18);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
}

.drawer__body{
  padding: 14px 18px 18px 18px;
  overflow: auto;
}
.drawer__summary{
  margin: 0 0 14px 0;
  color: rgba(14,34,51,.75);
  line-height: 1.45;
}
.drawer__section{
  margin-top: 14px;
}
.drawer__section h4{
  margin: 0 0 8px 0;
  font-size: 13px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: rgba(14,34,51,.64);
}
.drawer__section ul{
  margin: 0;
  padding-left: 18px;
  color: rgba(14,34,51,.80);
  line-height: 1.5;
}
.drawer__footer{
  border-top: 1px solid rgba(14,34,51,.10);
  padding: 12px 18px;
  display:flex;
  gap: 10px;
}
.drawer__secondary,
.drawer__primary{
  flex:1;
  padding: 12px 12px;
  border-radius: 14px;
  font-weight: 900;
  cursor:pointer;
  border:1px solid rgba(14,34,51,.18);
  background:#fff;
}
.drawer__primary{
  background: rgba(30,136,229,.10);
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .cgtl__timeline{
    grid-template-columns: 1fr;
  }
  .cgtl__years{ position: relative; top:auto; flex-direction: row; flex-wrap: wrap; }
  .cgtl__rail{ position: relative; top:auto; }
  .lane__split{ grid-template-columns: 1fr; }
}

@media (max-width: 560px){

  .cgtl__header{ flex-direction: column; align-items: flex-start; }
}

/* Single sticky year indicator */
.cgtl__yearSticky{
  position: sticky;
  top: 18px;
  height: fit-content;
}

.cgtl__yearBadge{
  border-left: 5px solid rgba(14,34,51,.18);
  padding: 12px 12px 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  font-weight: 900;
  letter-spacing: 1.5px;
  color: rgba(14,34,51,.78);
  box-shadow: 0 10px 20px rgba(0,0,0,.06);
}

/* The invisible trigger lines */
.yearTrigger{
  height: 1px;
  margin: 0;
}


/* ===== 4 vertical columns (programme strands) ===== */

.lane--matrix{
  margin-top: 18px;
}

.strandGrid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  position: relative;
}

/* the vertical “bars” */
.strand{
  padding: 18px 18px;
  min-height: 380px;          /* increase if you want more “Year 2–4” presence */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  cursor: pointer;
}

/* kicker + title */
.strand__kicker{
  font-size: 12px;
  font-weight: 900;
  color: rgba(14,34,51,.58);
  margin-bottom: 10px;
  letter-spacing: .3px;
}

.strand__title{
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

/* subtle column dividers like your reference image */
.strandGrid::before{
  content:"";
  position:absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  right: 0;
  pointer-events:none;
  background:
    linear-gradient(to right,
      transparent 0%,
      transparent 24.75%,
      rgba(14,34,51,.10) 25%,
      transparent 25.25%,
      transparent 49.75%,
      rgba(14,34,51,.10) 50%,
      transparent 50.25%,
      transparent 74.75%,
      rgba(14,34,51,.10) 75%,
      transparent 75.25%,
      transparent 100%);
}

/* neutral left border tone for the supporting column */
.tile--neutral{
  border-left: 8px solid rgba(14,34,51,.28);
}

/* amber helper if you don't already have it */
.tile--amber{
  border-left: 8px solid rgba(240,160,32,.7);
}

/* Responsive: stack columns */
@media (max-width: 980px){
  .strandGrid{
    grid-template-columns: 1fr;
  }
  .strandGrid::before{
    display:none;
  }
  .strand{
    min-height: 120px;
  }
}
.strand:nth-child(1){
  background: linear-gradient(to bottom, rgba(30,136,229,.08), rgba(30,136,229,.02));
}

.strand:nth-child(2){
  background: linear-gradient(to bottom, rgba(46,125,50,.08), rgba(46,125,50,.02));
}

.strand:nth-child(3){
  background: linear-gradient(to bottom, rgba(240,160,32,.08), rgba(240,160,32,.02));
}

.strand:nth-child(4){
  background: linear-gradient(to bottom, rgba(14,34,51,.05), rgba(14,34,51,.015));
}

/* ===== Year bands + active-year highlight ===== */

/* Each strand gets subtle horizontal year bands (4 years) */
.strand{
  position: relative;
  overflow: hidden;
}

/* faint year segmentation lines (quarter bands) */
.strand::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(to bottom,
      rgba(14,34,51,.10) 0px, rgba(14,34,51,.10) 0px,
      transparent 0px) ; /* placeholder */
  background:
    linear-gradient(to bottom,
      transparent 0%,
      transparent 24.7%,
      rgba(14,34,51,.10) 25%,
      transparent 25.3%,
      transparent 49.7%,
      rgba(14,34,51,.10) 50%,
      transparent 50.3%,
      transparent 74.7%,
      rgba(14,34,51,.10) 75%,
      transparent 75.3%,
      transparent 100%);
  opacity: .35;
}

/* The active year highlight band across ALL strands */
.strandGrid{
  --active-year: 1;         /* JS updates this */
  --year-band: 25%;         /* 4 equal years */
  position: relative;
}

.strandGrid::after{
  content:"";
  position:absolute;
  left: 0;
  right: 0;
  height: var(--year-band);
  top: calc((var(--active-year) - 1) * var(--year-band));
  background: rgba(30,136,229,.06);
  border-radius: 14px;
  pointer-events:none;
  opacity: 0;
  transform: translateY(0);
  transition: top .35s ease, opacity .25s ease;
}

/* Only show highlight for Year 1–4 */
.cgtl[data-active-year="1"] .strandGrid::after,
.cgtl[data-active-year="2"] .strandGrid::after,
.cgtl[data-active-year="3"] .strandGrid::after,
.cgtl[data-active-year="4"] .strandGrid::after{
  opacity: 1;
}

/* Optional: slight glow to reinforce it */
.cgtl[data-active-year="1"] .strandGrid::after,
.cgtl[data-active-year="2"] .strandGrid::after,
.cgtl[data-active-year="3"] .strandGrid::after,
.cgtl[data-active-year="4"] .strandGrid::after{
  box-shadow: 0 10px 30px rgba(30,136,229,.10);
}

/* Route mute behaviour */
.cgtl[data-selected="phd"]  .route--mres { opacity: .35; filter: grayscale(1); }
.cgtl[data-selected="mres"] .route--phd  { opacity: .35; filter: grayscale(1); }

/* Optional: also mute MRes-only tiles/rail nodes when PhD selected */
.cgtl[data-selected="phd"] .tile--mres,
.cgtl[data-selected="phd"] .rail__node.is-mres {
  opacity: .35;
  filter: grayscale(1);
  pointer-events: none;
}