/* ===== CASE STUDY - SINGLE ===== */

body {
  background: var(--primary-color);
  overflow-x: hidden;
}

a {
    color: var(--secondary-color);
}

main {
  background: var(--primary-color);
  --glow-rgb: 249 198 61;
  --glow-size: 660px;
  --glow-alpha: 0.24;
}

.cs {
  color: var(--third-color);
  padding: 0;
}

/* HERO */
.cs__hero {
  display: flex;
  align-items: flex-end;
  min-height: 420px;
  padding: 60px 40px;
  background-color: var(--fourth-color);
  background-size: cover;
  background-position: center;
  border-radius: 0 0 20px 20px;
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.cs__hero::after {
  content: "";
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.75));
  position: absolute;
  inset: 0;
}

.cs__hero__image {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  position: absolute;
  inset: 0;
}

.cs__hero__inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.cs__hero__badge {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cs__hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--third-color);
}

.cs__hero__location {
  font-size: 1.1rem;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs__hero__location i {
  color: var(--secondary-color);
}

/* LAYOUT */
.cs__layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 50px;
  max-width: var(--max-content-width);
  margin: 50px auto 60px;
  padding: 0 40px;
  align-items: start;
}

/* CONTENT SECTIONS */
.cs__section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cs__section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cs__section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin: 0;
}

.cs__section p {
  font-weight: 400;
  line-height: 1.8;
  font-size: 1.05rem;
}

.cs__section strong {
  color: var(--secondary-color);
}

/* LISTS IN CONTENT */
.cs__section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cs__section ul li {
  position: relative;
  padding-left: 24px;
  line-height: 1.8;
  margin-bottom: 6px;
}

.cs__section ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  background: var(--secondary-color);
  border-radius: 50%;
}

/* TIMELINE BAR */
.cs__timeline-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 20px;
  padding: 30px 0 10px;
}

.cs__timeline-start,
.cs__timeline-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cs__timeline-flag {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--fourth-color);
  border: 2px solid var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--secondary-color);
  position: relative;
  z-index: 2;
}

.cs__timeline-flag--end {
  background: var(--secondary-color);
  color: var(--primary-color);
  box-shadow: 0 0 20px rgba(255, 207, 76, 0.4);
}

.cs__timeline-date {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
}

.cs__timeline-track {
  flex: 1;
  height: 4px;
  position: relative;
  margin: 0 -2px;
  align-self: flex-start;
  margin-top: 20px;
}

.cs__timeline-track-bg {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.cs__timeline-track-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--secondary-color), #ffd966);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(255, 207, 76, 0.3);
  transition: width 0.05s linear;
}

.cs__timeline-vehicle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--secondary-color);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 207, 76, 0.6);
  transition: left 0.05s linear;
  z-index: 3;
}

.cs__timeline-bar.is-complete .cs__timeline-flag--end {
  animation: timeline-pulse 1.5s ease-in-out infinite;
}

@keyframes timeline-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 207, 76, 0.4); }
  50% { box-shadow: 0 0 30px rgba(255, 207, 76, 0.7), 0 0 50px rgba(255, 207, 76, 0.2); }
}

/* QUOTE / REFERENCES */
.cs__quote {
  background: var(--section-background-color);
  border-left: 4px solid var(--secondary-color);
  border-radius: 0 20px 20px 0;
  padding: 30px 35px;
  position: relative;
  margin: 8px 0;
}

.cs__quote__icon {
  color: var(--secondary-color);
  font-size: 1.6rem;
  margin-bottom: 10px;
  opacity: 0.7;
}

.cs__quote p {
  font-style: italic;
  line-height: 1.8;
}

.cs__quote cite {
  display: block;
  margin-top: 16px;
  font-style: normal;
  font-weight: 700;
  color: var(--secondary-color);
  font-size: 0.95rem;
}

/* BUTTONS */
.cs__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: transparent;
  color: var(--third-color);
  border: 1px solid var(--secondary-color);
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  width: fit-content;
}

.cs__btn:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
  box-shadow: 0 0 20px rgba(255, 207, 76, 0.3);
  transform: translateX(4px);
}

/* GALLERY */
.cs__gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cs__gallery__item {
  appearance: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  aspect-ratio: 4/3;
  perspective: 600px;
}

.cs__gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

.cs__gallery__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  font-size: 1.5rem;
  color: var(--third-color);
  border-radius: 16px;
  pointer-events: none;
}

.cs__gallery__item:hover .cs__gallery__overlay,
.cs__gallery__item:focus-visible .cs__gallery__overlay {
  opacity: 1;
}

.cs__gallery__item:focus-visible {
  outline: 3px solid var(--secondary-color);
  outline-offset: 3px;
}

/* GALLERY - Swiper mode */
.cs__gallery-swiper {
  padding-bottom: 40px;
}

.cs__gallery-swiper .swiper-slide {
  width: 85%;
}

.cs__gallery-swiper .cs__gallery__item {
  aspect-ratio: 4/3;
}

.cs__gallery-swiper .cs__gallery__item img {
  border-radius: 16px;
}

.cs__gallery-swiper .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.3);
  opacity: 1;
}

.cs__gallery-swiper .swiper-pagination-bullet-active {
  background: var(--secondary-color);
}

/* SIDEBAR CARD */
.cs__sidebar {
  position: sticky;
  top: 100px;
}

.cs__card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cs__card__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cs__card__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cs__card__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cs__card__label i {
  color: var(--secondary-color);
  width: 14px;
  text-align: center;
}

.cs__card__value {
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cs__card__scope {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cs__card__scope li {
  position: relative;
  padding-left: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cs__card__scope li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  background: var(--secondary-color);
  border-radius: 50%;
}

.cs__card__scope li a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.cs__card__scope li a:hover {
  text-decoration: underline;
}

.cs__card__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  margin-top: 8px;
  background: var(--secondary-color);
  color: var(--primary-color);
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.cs__card__cta:hover {
  box-shadow:
    0 0 20px var(--secondary-color),
    0 0 15px var(--secondary-color);
  transform: scale(1.03);
}

/* LIGHTBOX */
.cs__lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
}

.cs__lightbox[hidden] {
  display: none;
}

.cs__lightbox__content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs__lightbox__content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}

.cs__lightbox__close,
.cs__lightbox__prev,
.cs__lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: var(--third-color);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 12px;
  transition: color 0.2s;
  z-index: 10;
}

.cs__lightbox__close:hover,
.cs__lightbox__prev:hover,
.cs__lightbox__next:hover {
  color: var(--secondary-color);
}

.cs__lightbox__close {
  top: 20px;
  right: 20px;
  font-size: 2rem;
}

.cs__lightbox__prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.cs__lightbox__next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.cs__lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ===== ARCHIVE ===== */

.cs-archive {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 40px 60px;
  color: var(--third-color);
  position: relative;
  overflow: clip;
  isolation: isolate;
}

.cs-archive::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 75%);
}

.cs-archive__hero {
  text-align: center;
  padding: 60px 0 40px;
  position: relative;
}

.cs-archive__hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--third-color);
}

.cs-archive__hero p {
  font-size: 1.15rem;
  max-width: 650px;
  margin: 0 auto;
  opacity: 0.75;
  line-height: 1.7;
}

/* GRID */
.cs-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.cs-archive__card {
  background: var(--section-background-color);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: var(--third-color);
  text-align: left;
  font: inherit;
  padding: 0;
  cursor: pointer;
  transition:
    box-shadow 0.3s ease-in-out,
    transform 0.3s ease-in-out,
    border-color 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cs-archive__card:hover,
.cs-archive__card:focus-visible {
  transform: translateY(-8px);
  border-color: rgba(249, 198, 61, 0.45);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(249, 198, 61, 0.25);
  outline: none;
}

.cs-archive__card__img {
  position: relative;
  height: 220px;
  overflow: hidden;
}

.cs-archive__card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease-in-out;
  border-radius: 0;
}

.cs-archive__card:hover .cs-archive__card__img img,
.cs-archive__card:focus-visible .cs-archive__card__img img {
  transform: scale(1.08);
}

.cs-archive__card__badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(249, 198, 61, 0.85);
  color: var(--primary-color);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 10px;
  z-index: 2;
}

.cs-archive__card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(249, 198, 61, 0.55) 100%);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 1;
}

.cs-archive__card:hover .cs-archive__card__overlay,
.cs-archive__card:focus-visible .cs-archive__card__overlay {
  opacity: 1;
}

.cs-archive__card__overlay__text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: var(--secondary-color);
  color: var(--primary-color);
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  transform: translateY(8px);
  transition: transform 0.3s ease-in-out;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.cs-archive__card:hover .cs-archive__card__overlay__text,
.cs-archive__card:focus-visible .cs-archive__card__overlay__text {
  transform: translateY(0);
}

.cs-archive__card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.cs-archive__card__body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--third-color);
  line-height: 1.4;
}

.cs-archive__card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.85rem;
  opacity: 0.6;
}

.cs-archive__card__meta i {
  color: var(--secondary-color);
  margin-right: 4px;
}

.cs-archive__card__excerpt {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.cs-archive__card__link {
  margin-top: auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--secondary-color);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(249, 198, 61, 0.35);
  transition: gap 0.2s ease-in-out, color 0.2s ease-in-out;
}

.cs-archive__card:hover .cs-archive__card__link,
.cs-archive__card:focus-visible .cs-archive__card__link {
  gap: 12px;
  color: #ffd966;
}

.cs-archive__empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.6;
  padding: 40px;
}

/* PAGINATION */
.cs-archive .nav-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.cs-archive .nav-links a,
.cs-archive .nav-links span {
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.cs-archive .nav-links a {
  background: var(--fourth-color);
  color: var(--third-color);
}

.cs-archive .nav-links a:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.cs-archive .nav-links .current {
  background: var(--secondary-color);
  color: var(--primary-color);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
  .cs__layout {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 0 20px;
  }

  .cs__sidebar {
    position: static;
    order: -1;
  }

  .cs-archive__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cs__hero {
    min-height: 320px;
    padding: 40px 20px;
  }

  .cs__hero h1 {
    font-size: 2rem;
  }

  .cs__layout {
    margin: 30px auto 40px;
  }

  .cs__section h2 {
    font-size: 1.5rem;
  }

  .cs__timeline-flag {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .cs__timeline-date {
    font-size: 0.75rem;
  }

  .cs__timeline-vehicle {
    width: 10px;
    height: 10px;
  }

  .cs__quote {
    padding: 20px;
  }

  .cs-archive {
    padding: 0 20px 40px;
  }

  .cs-archive__hero h1 {
    font-size: 2.2rem;
  }

  .cs-archive__grid {
    grid-template-columns: 1fr;
  }

  .cs__lightbox__prev {
    left: 8px;
  }

  .cs__lightbox__next {
    right: 8px;
  }
}

@media (max-width: 480px) {
  .cs__hero h1 {
    font-size: 1.6rem;
  }
}
