:root{
  --magenta:#9F066B;
  --anthracite:#343434;
  --beige:#D7C4B8;
  --stone:#DDD8D6;
  --cotton:#FAF8F6;
  --taupe:#696367;
  --line:rgba(52,52,52,.10);
  --serif:"Cormorant Garamond",Georgia,serif;
  --sans:"Montserrat",Arial,sans-serif;
  --max:1160px;

  --time-col:64px;
  --hour-height:48px;
  --schedule-radius:22px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--cotton);
  color:var(--anthracite);
  font-family:var(--sans);
  -webkit-font-smoothing:antialiased;
}
button{font:inherit}
.wrap{width:min(var(--max),calc(100% - 44px));margin-inline:auto}

.kicker{
  margin:0 0 13px;
  color:var(--magenta);
  font-size:9.5px;
  font-weight:600;
  letter-spacing:.22em;
  text-transform:uppercase;
}

.horaris-hero{padding:52px 0 42px}
.horaris-hero-grid{
  display:grid;
  grid-template-columns:1fr 340px;
  gap:70px;
  align-items:end;
}
.horaris-hero h1{
  max-width:720px;
  margin:0;
  font-family:var(--serif);
  font-size:clamp(52px,5vw,76px);
  line-height:.98;
  letter-spacing:-.035em;
  font-weight:500;
  color:var(--magenta);
}
.horaris-hero .lead{
  max-width:650px;
  margin:22px 0 0;
  color:var(--taupe);
  font-family:var(--serif);
  font-size:20px;
  line-height:1.55;
}
.horaris-note{
  border:1px solid var(--line);
  border-radius:20px;
  padding:22px 24px;
  background:rgba(255,255,255,.36);
  display:grid;
  gap:7px;
}
.horaris-note-label{
  color:var(--magenta);
  font-size:9px;
  font-weight:600;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.horaris-note strong{
  font-family:var(--serif);
  font-size:26px;
  line-height:1.05;
  font-weight:500;
  color:var(--anthracite);
}
.horaris-note span:last-child{
  color:var(--taupe);
  font-size:11px;
  line-height:1.6;
}

.horaris-main{padding:4px 0 54px}
.horaris-wide{
  width:min(1320px,calc(100% - 32px));
  margin-inline:auto;
}
.filters-head{
  width:min(var(--max),calc(100% - 12px));
  margin:0 auto 20px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:36px;
  align-items:end;
}
.filters-head h2{
  margin:0;
  font-family:var(--serif);
  color:var(--magenta);
  font-weight:500;
  font-size:clamp(36px,3.7vw,52px);
  line-height:1;
}
.filters-help{
  max-width:360px;
  margin:0 0 3px;
  color:var(--taupe);
  font-size:12px;
  line-height:1.6;
  text-align:right;
}

/* FILTRES */
.discipline-filters{
  width:min(var(--max),calc(100% - 12px));
  margin:0 auto 16px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.filter-btn{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:36px;
  padding:7px 12px;
  border:1px solid var(--stone);
  border-radius:999px;
  background:rgba(255,255,255,.68);
  color:var(--anthracite);
  cursor:pointer;
  font-size:10.5px;
  font-weight:600;
  white-space:nowrap;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease;
  -webkit-tap-highlight-color:transparent;
}
.filter-dot{
  width:9px;
  height:9px;
  border-radius:50%;
  flex:0 0 auto;
}
.filter-btn[aria-pressed="true"]{
  border-color:rgba(159,6,107,.55);
  background:#fff;
  color:var(--magenta);
  box-shadow:0 6px 18px rgba(159,6,107,.08);
}
.filter-btn:focus-visible{
  outline:2px solid var(--magenta);
  outline-offset:2px;
}

/* GRAELLA */
.schedule-shell{
  overflow:hidden;
  border:1px solid var(--stone);
  border-radius:var(--schedule-radius);
  background:#fff;
  box-shadow:0 16px 46px rgba(52,52,52,.055);
}
.schedule-grid{
  display:grid;
  grid-template-columns:var(--time-col) repeat(5,minmax(0,1fr));
  width:100%;
  min-width:0;
  position:relative;
}
.schedule-corner,
.day-head{
  height:54px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#F4EFEC;
  border-bottom:1px solid var(--stone);
  min-width:0;
}
.schedule-corner{
  border-right:1px solid var(--stone);
  font-size:9px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--taupe);
}
.day-head{
  position:relative;
  border-right:1px solid #E9E4E1;
  color:var(--anthracite);
  font-size:10.5px;
  font-weight:700;
  letter-spacing:.07em;
  text-transform:uppercase;
  transition:background .18s ease,color .18s ease;
}
.day-head.is-today{
  background:rgba(159,6,107,.07);
  color:var(--magenta);
}
.day-head.is-today::after{
  content:"Avui";
  position:absolute;
  top:5px;
  right:7px;
  font-size:6.5px;
  letter-spacing:.08em;
  color:var(--magenta);
}
.day-short{display:none}

.time-column,
.day-column{
  position:relative;
  height:calc((22 - 7.5) * var(--hour-height));
  min-width:0;
}
.time-column{
  background:#fff;
  border-right:1px solid var(--stone);
}
.day-column{
  border-right:1px solid #ECE7E4;
  background-image:repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--hour-height) / 2 - 1px),
    rgba(221,216,214,.52) calc(var(--hour-height) / 2 - 1px),
    rgba(221,216,214,.52) calc(var(--hour-height) / 2)
  );
}
.day-column.is-today{
  background-color:rgba(159,6,107,.018);
}
.time-label{
  position:absolute;
  left:0;
  right:0;
  transform:translateY(-50%);
  text-align:center;
  font-size:9.5px;
  font-weight:500;
  color:var(--taupe);
  background:#fff;
  line-height:1;
}
.event-card{
  position:absolute;
  left:5px;
  right:5px;
  min-height:34px;
  border-radius:10px;
  padding:6px 8px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  text-align:center;
  line-height:1.15;
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.42);
  transition:transform .16s ease,box-shadow .16s ease,opacity .18s ease,filter .18s ease;
  transform-origin:center;
}
.event-card.is-hidden{
  opacity:.07;
  pointer-events:none;
  filter:grayscale(.9);
}
.event-time{
  font-size:9.5px;
  font-weight:500;
  opacity:.95;
  white-space:nowrap;
}
.event-name{
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  overflow-wrap:anywhere;
}
.schedule-legend{
  width:min(var(--max),calc(100% - 12px));
  margin:13px auto 0;
  display:flex;
  align-items:center;
  gap:9px;
  color:var(--taupe);
  font-size:10.5px;
  line-height:1.5;
}
.legend-mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:24px;
  padding:0 7px;
  border:1px solid rgba(159,6,107,.16);
  border-radius:999px;
  color:var(--magenta);
  font-weight:600;
  background:rgba(255,255,255,.48);
}

/* CTA */
.horaris-cta{padding:0 0 64px}
.horaris-cta-inner{
  display:grid;
  grid-template-columns:1fr auto;
  gap:40px;
  align-items:center;
  border-top:1px solid var(--line);
  padding-top:38px;
}
.horaris-cta h2{
  margin:0;
  max-width:720px;
  font-family:var(--serif);
  font-size:clamp(34px,3.5vw,48px);
  line-height:1.03;
  color:var(--magenta);
  font-weight:500;
}
.horaris-cta p:not(.kicker){
  margin:12px 0 0;
  max-width:700px;
  color:var(--taupe);
  font-size:13px;
  line-height:1.7;
}
.horaris-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:43px;
  padding:0 18px;
  border-radius:999px;
  background:var(--magenta);
  color:#fff;
  text-decoration:none;
  font-size:10px;
  font-weight:600;
  letter-spacing:.06em;
  text-transform:uppercase;
  white-space:nowrap;
}

@media(hover:hover) and (pointer:fine){
  .filter-btn:hover{
    transform:translateY(-1px);
    border-color:rgba(159,6,107,.34);
    box-shadow:0 7px 18px rgba(52,52,52,.08);
  }
  .event-card:hover{
    transform:translateY(-2px) scale(1.012);
    z-index:5;
    box-shadow:0 7px 18px rgba(52,52,52,.12),inset 0 0 0 1px rgba(255,255,255,.48);
  }
}
.filter-btn:active,
.event-card:active{transform:translateY(0) scale(.98)}

@media(max-width:900px){
  :root{
    --time-col:50px;
    --hour-height:50px;
  }
  .horaris-hero-grid{grid-template-columns:1fr;gap:28px}
  .horaris-note{max-width:520px}
  .filters-head{grid-template-columns:1fr;gap:10px}
  .filters-help{text-align:left}
  .day-head{font-size:9px}
  .event-card{left:3px;right:3px;padding:4px 5px;border-radius:7px}
  .event-name{font-size:9px}
  .event-time{font-size:8px}
  .horaris-cta-inner{grid-template-columns:1fr}
  .horaris-btn{justify-self:start}
}

/* MÒBIL: es manté tota la setmana visible, sense convertir-la en agenda. */
@media(max-width:640px){
  :root{
    --time-col:30px;
    --hour-height:58px;
    --schedule-radius:12px;
  }
  .wrap{width:min(100% - 30px,var(--max))}
  .horaris-hero{padding:30px 0 30px}
  .horaris-hero h1{font-size:48px}
  .horaris-hero .lead{font-size:17px;margin-top:16px}
  .horaris-note{
    padding:17px 18px;
    border-radius:16px;
  }
  .horaris-note strong{font-size:23px}
  .horaris-main{padding-bottom:42px}
  .horaris-wide{width:calc(100% - 12px)}
  .filters-head,
  .discipline-filters,
  .schedule-legend{
    width:calc(100% - 10px);
  }
  .filters-head h2{font-size:35px}
  .filters-help{font-size:10.5px}
  .discipline-filters{
    gap:5px;
    margin-bottom:9px;
  }
  .filter-btn{
    min-height:30px;
    padding:5px 8px;
    gap:5px;
    font-size:8.5px;
  }
  .filter-dot{width:7px;height:7px}
  .schedule-corner,
  .day-head{height:38px}
  .schedule-corner{
    font-size:6.5px;
    letter-spacing:0;
  }
  .day-head{
    font-size:8.5px;
    letter-spacing:.02em;
  }
  .day-head.is-today::after{
    display:none;
  }
  .day-full{display:none}
  .day-short{display:inline}
  .time-label{
    font-size:7px;
    font-weight:600;
  }
  .event-card{
    left:1.5px;
    right:1.5px;
    min-height:30px;
    border-radius:5px;
    padding:2px;
    gap:1px;
  }
  .event-time{
    font-size:6.7px;
    letter-spacing:-.02em;
  }
  .event-name{
    font-size:7.2px;
    line-height:1.08;
    letter-spacing:-.015em;
  }
  .schedule-legend{
    font-size:9px;
    align-items:flex-start;
  }
  .legend-mark{
    min-width:30px;
    height:21px;
    font-size:8px;
  }
  .horaris-cta{padding-bottom:48px}
  .horaris-cta-inner{gap:24px;padding-top:30px}
  .horaris-cta h2{font-size:37px}
}

@media(max-width:380px){
  :root{--time-col:27px}
  .event-name{font-size:6.7px}
  .event-time{font-size:6.2px}
  .filter-btn{font-size:8px;padding-inline:7px}
}

@media(prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .filter-btn,.event-card{transition:none}
}
