/* ===== Campus Life gallery (all classes scoped, no global resets) ===== */
.campus {
  --gap: 8px;
  --row-h: clamp(170px, 25vw, 320px);   /* everything scales from this */
  --radius: 18px;
  --accent: #c8102e;
  position: relative;
  padding: clamp(36px, 6vw, 80px) 0 clamp(24px, 4vw, 48px);
  background: #f6f8fb;
  overflow: hidden;
  font-family: 'Sora', system-ui, sans-serif;
}

.cl-wrap { position: relative; }

/* Slider with soft faded edges */
.cl-slider {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
.cl-slider.is-dragging { cursor: grabbing; }

.cl-row { height: var(--row-h); margin-bottom: var(--gap); overflow: hidden; }
.cl-row:last-child { margin-bottom: 0; }
.cl-track { display: flex; width: max-content; height: 100%; will-change: transform; }

/* Tiles */
.cl-tile {
  position: relative;
  flex: none;
  height: 100%;
  margin: 0 var(--gap) 0 0;      /* margin (not gap) so the loop is seamless */
  border-radius: var(--radius);
  overflow: hidden;
  background: #e4e4e4;
  isolation: isolate;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .45);
}
.cl-tile img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  pointer-events: none;
  transform: scale(1.001);
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
}
.cl-tile::after {                 /* hover tint */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(200,16,46,0) 40%, rgba(20,10,20,.55) 100%);
  opacity: 0; transition: opacity .4s;
}
.cl-tile:hover img { transform: scale(1.09); }
.cl-tile:hover::after { opacity: 1; }

.cl-zoom {
  position: absolute; z-index: 2; right: 14px; bottom: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: #111; font-size: 15px;
  transform: translateY(14px) scale(.7); opacity: 0;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.cl-tile:hover .cl-zoom { transform: none; opacity: 1; }

/* Unique shapes: narrow tiles become arches (top row up, bottom row flipped) */
.cl-row--1 .arch { border-radius: calc(var(--row-h) * .45) calc(var(--row-h) * .45) var(--radius) var(--radius); }
.cl-row--2 .arch { border-radius: var(--radius) var(--radius) calc(var(--row-h) * .45) calc(var(--row-h) * .45); }

/* Tile widths scale with row height → fully fluid */
.w-s  { width: calc(var(--row-h) * .90); }
.w-m  { width: calc(var(--row-h) * 1.45); }
.w-l  { width: calc(var(--row-h) * 1.95); }
.w-xl { width: calc(var(--row-h) * 1.60); }

/* Arrows */
.cl-arrow {
  position: absolute; top: 50%; z-index: 10;
  transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #111; font-size: 16px; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  transition: background .25s, color .25s, transform .25s;
}
.cl-arrow:hover { background: var(--accent); color: #fff; transform: translateY(-50%) scale(1.1); }
.cl-arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.cl-arrow--prev { left: clamp(8px, 2vw, 28px); }
.cl-arrow--next { right: clamp(8px, 2vw, 28px); }

.cl-hint {
  margin-top: 22px; text-align: center;
  font-size: 13px; letter-spacing: .04em; color: #777;
}
.cl-hint i { margin-right: 6px; color: var(--accent); }

/* ===== Lightbox ===== */
.cl-lb {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 8, 14, .93);
  opacity: 0; visibility: hidden;
  transition: opacity .3s, visibility .3s;
  font-family: 'Sora', system-ui, sans-serif;
}
.cl-lb.open { opacity: 1; visibility: visible; }
.cl-lb__img {
  max-width: 90vw; max-height: 84vh; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  transform: scale(.94); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.cl-lb.open .cl-lb__img { transform: none; }
.cl-lb__btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 17px;
  transition: background .2s;
}
.cl-lb__btn:hover { background: var(--accent, #c8102e); }
.cl-lb__close { top: 20px; right: 20px; }
.cl-lb__prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.cl-lb__next  { right: 20px; top: 50%; transform: translateY(-50%); }
.cl-lb__count {
  position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
  color: rgba(255, 255, 255, .7); font-size: 13px; letter-spacing: .08em;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .campus { --gap: 6px; --radius: 14px; }
  .cl-arrow { width: 44px; height: 44px; font-size: 14px; }
}
@media (max-width: 600px) {
  .campus { --row-h: 160px; --gap: 5px; --radius: 12px; }
  .cl-slider {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
  }
  .cl-arrow { width: 38px; height: 38px; font-size: 13px; }
  .cl-zoom { display: none; }
  .cl-lb__prev, .cl-lb__next { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cl-tile img, .cl-zoom, .cl-lb, .cl-lb__img { transition: none; }
}