/* ==========================================================================
   Regulations Sections Styles
   Contains styles for:
   1. Standard Regulations Section (.regulations)
   2. Key Regulations Timeline Section (.key-regulations-section)
   ========================================================================== */

/* Base fixes */
body {
  overflow-x: hidden;
}

/* ==========================================================================
   1. Standard Regulations Section (.regulations)
   ========================================================================== */

.regulations {
  position: relative;
  padding: 96px 0;
  background-color: #e9ebef;
  color: #213361;
  overflow: hidden;
}

/* Background blob */
.regulations::before {
  content: "";
  position: absolute;
  top: 571px;
  left: 400px;
  z-index: 0;
  width: 1121px;
  height: 744px;
  background-color: rgba(82, 71, 231, 0.14);
  border-radius: 50%;
  filter: blur(400px);
  pointer-events: none;
}

.regulations .container {
  position: relative;
  z-index: 1;
  max-width: 1456px;
  margin: 0 auto;
  padding: 0 15px;
}

.regulations__header {
  margin-bottom: 48px;
  text-align: left;
}

.regulations__title {
  margin: 0;
  color: #213361;
  font-weight: 700;
  font-size: 2.125rem;
  font-family: "Inter", sans-serif;
  letter-spacing: -1.8px;
}

.regulations__subtitle {
  margin: 0;
  color: rgba(33, 51, 97, 0.5);
  font-size: 20px;
  font-family: "Inter", sans-serif;
}

.regulations__card {
  max-width: 1456px;
  margin: 0 auto;
  padding: 46px 50px;
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow: 0px 4px 12px 0px rgba(142, 152, 168, 0.06);
}

.regulations__content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-start;
}

.regulations__content > * {
  flex: 1;
}

.regulations__card-title {
  margin: 0 0 18px 0;
  color: #213361;
  font-weight: 600;
  font-size: 24px;
  font-family: "Inter", sans-serif;
  line-height: 1.21;
}

.regulations__text {
  margin: 0 0 30px 0;
  color: #213361;
  font-size: 16px;
  font-family: "Inter", sans-serif;
  line-height: 1.6;
}

.regulations__text p {
  margin: 0 0 1em 0;
}

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

/* --- Responsive Styles (Standard Regulations) --- */
@media (max-width: 1200px) {
  .regulations__content {
    flex-direction: column;
    gap: 30px;
  }
  .regulations__card {
    padding: 40px 30px;
  }
}

@media (max-width: 768px) {
  .regulations {
    padding: 60px 0 40px;
  }
  .regulations__header {
    margin-bottom: 60px;
  }
  .regulations__title {
    font-size: 32px;
  }
  .regulations__subtitle {
    font-size: 18px;
  }
  .regulations__card {
    padding: 30px 20px;
  }
  .regulations__card-title {
    font-size: 22px;
  }
  .regulations__text {
    font-size: 15px;
  }
}

/* ==========================================================================
   2. Key Regulations Timeline Section (.key-regulations-section)
   ========================================================================== */

.key-regulations-section {
  padding: 36px 0 20px;
  background: #e9ebef;
}

/* --- Header & Layout --- */
.key-regulations-section .section__header {
  padding: 0;
}

.key-regulations-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.key-regulations-header__title {
  margin: 0 0 0.5rem;
}

.key-regulations-header__subtitle {
  margin: 0;
}

/* --- Timeline Container --- */
.timeline-wrapper {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.key-regulations-content__timeline {
  position: relative;
  display: flex;
  gap: 20px;
  padding: 20px 0;
  transform: translateX(0);
  will-change: transform;
}

.key-regulations-content__timeline-item {
  flex-shrink: 0;
}

/* --- Timeline Card --- */
.key-regulation-card {
  width: 360px;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0px 4px 12px 0px rgba(142, 152, 168, 0.06);
  display: flex;
  flex-direction: column;
}

.key-regulation-card__year {
  padding: 20px 0;
  background: #213361;
  color: #ffffff;
  text-align: center;
  border-radius: 24px 24px 0 0;
}

.key-regulation-card__year span {
  color: #ffffff;
  font-weight: 600;
  font-size: 30px;
  font-family: "Inter", sans-serif;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.key-regulation-card__content {
  padding: 0;
}

/* --- Regulation Entry Item --- */
.key-regulation-entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 24px;
  border-bottom: 1px solid #ededed;
  transition: background-color 0.3s ease;
}

.key-regulation-entry:last-child {
  border-bottom: none;
}

.key-regulation-entry:hover {
  background-color: #f8f9fa;
}

.key-regulation-entry__icon {
  flex-shrink: 0;
  width: 6px;
  height: 11px;
  margin-top: 0.4rem;
  color: rgba(33, 51, 97, 0.5);
}

.key-regulation-entry__text {
  flex: 1;
  color: #213361;
  font-weight: 500;
  font-size: 14px;
  font-family: "Inter", sans-serif;
  line-height: 1.55;
  letter-spacing: -0.01em;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

/* Highlighted (Link) Entries */
.key-regulation-entry--highlighted {
  background-color: #ffffff;
}

.key-regulation-entry--highlighted .key-regulation-entry__text {
  color: #c747e7;
}

.key-regulation-entry--highlighted .key-regulation-entry__icon {
  color: rgba(33, 51, 97, 0.5);
}

a.key-regulation-entry {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.key-regulation-entry:hover {
  background-color: #f8f9fa;
}

/* Entries Wrapper for Max-Height Collapse */
.key-regulation-card__entries-wrapper {
  position: relative;
  /* max-height is set dynamically by JS based on content measurement */
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
}

.key-regulation-card__entries-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

/* .is-expanded max-height is set inline by JS for precise animation */
.key-regulation-card__entries-wrapper.is-expanded::after {
  opacity: 0;
  pointer-events: none;
}

.key-regulation-card__entries-wrapper.no-overflow::after {
  display: none;
}

.key-regulation-card__show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  background-color: transparent;
  border: none;
  border-top: 1px solid #ededed;
  color: #c747e7;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.key-regulation-card__show-more:hover {
  background-color: #f8f9fa;
}

.key-regulation-card__show-more[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* --- Timeline Pagination --- */
.key-regulations-content {
  position: relative;
}

.timeline-wrapper {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding: 0 84px; /* Space for the buttons on both sides */
  z-index: 1; /* Keep cards below pagination */
}

.key-regulations-header__pagination {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  max-width: 1456px;
  margin: 0 auto;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 12px;
  z-index: 20;
  pointer-events: none;
  padding: 0 15px;
}

.key-regulations__pagination-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  color: #213361;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
}

.key-regulations__pagination-button:first-of-type {
  background: rgba(33, 51, 97, 0.65);
  border-color: rgba(33, 51, 97, 0.3);
  color: #fff;
}

.key-regulations__pagination-button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.05);
}

.key-regulations__pagination-button:first-of-type:hover:not(:disabled) {
  background: rgba(33, 51, 97, 0.95);
}

.key-regulations__pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Responsive Styles (Timeline) --- */
@media (max-width: 768px) {
  .key-regulations-section {
    padding: 28px 0 20px;
  }
  .key-regulations-header {
    flex-direction: column;
    gap: 20px;
  }
  .key-regulations-header__title {
    margin-bottom: 0.375rem;
  }
  .timeline-wrapper {
    padding: 0 44px;
  }
  .key-regulations__pagination-button {
    width: 40px;
    height: 40px;
  }
  .key-regulations-content__timeline {
    gap: 16px;
    padding: 16px 0;
  }
  .key-regulation-card {
    width: 340px;
  }
  .key-regulation-card__year span {
    font-size: 27px;
  }
  .key-regulation-entry__text {
    font-size: 13px;
    line-height: 1.5;
  }
}

@media (max-width: 480px) {
  .key-regulations-content__timeline {
    gap: 12px;
    padding: 12px 0;
  }
  .key-regulation-card {
    width: 300px;
  }
  .key-regulation-card__year span {
    font-size: 24px;
  }
  .key-regulation-entry {
    padding: 15px 18px;
  }
}
