html {
  scroll-behavior: smooth;
}

/* Shared microinteraction styles */
.card-hover {
  transition: transform 0.45s cubic-bezier(.22, 1, .36, 1), box-shadow 0.45s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.6s cubic-bezier(.22, 1, .36, 1);
}

.img-zoom:hover img {
  transform: scale(1.06);
}

.btn-glow {
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.btn-glow:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(250, 204, 21, 0.4);
}

nav {
  transition: background 0.35s ease, box-shadow 0.35s ease !important;
}

.nav-scrolled {
  background: rgba(15, 23, 42, 0.97) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
}

.social-icon {
  transition: transform 0.3s ease, background 0.3s ease !important;
}

.social-icon:hover {
  transform: translateY(-3px) rotate(-5deg);
}

.footer-link {
  position: relative;
  display: inline-block;
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #f5d000;
  transition: width 0.3s ease;
}

.footer-link:hover::after {
  width: 100%;
}

/* Gallery-specific masonry */
.masonry-grid {
  column-count: 1;
  column-gap: 1rem;
}

.masonry-item {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .masonry-grid {
    column-count: 3;
  }
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-card:hover img {
  transform: scale(1.05);
}

/* Trabas Merdeka page */
.tm-page {
  color: #1a243c;
}

.tm-hero-overlay {
  background:
    linear-gradient(to right, rgba(3, 15, 39, 0.75), rgba(3, 15, 39, 0.45)),
    linear-gradient(to top, rgba(2, 10, 28, 0.75), rgba(2, 10, 28, 0.08));
}

.tm-hero-shell {
  background: linear-gradient(to bottom, rgba(4, 17, 42, 0.22), rgba(4, 17, 42, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 22px 22px 28px;
}

.tm-count-box {
  background: #0e4f9f;
  border-radius: 14px;
  min-width: 96px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tm-count-box strong {
  font-family: "Anton", sans-serif;
  font-size: 40px;
  line-height: 1;
  color: #ffd700;
  letter-spacing: 1px;
}

.tm-count-box span {
  font-family: "Bebas Neue", sans-serif;
  font-size: 20px;
  color: #dbe9fb;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.tm-current-registered {
  margin-top: 12px;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(2, 11, 30, 0.5);
}

.tm-current-label {
  font-family: "Inter", sans-serif;
  color: #d8e6ff;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}

.tm-current-registered strong {
  font-family: "Anton", sans-serif;
  color: #ffd700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.8px;
}

.tm-current-unit {
  font-family: "Bebas Neue", sans-serif;
  color: #d8e6ff;
  font-size: 20px;
  text-transform: uppercase;
}

.tm-mini-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
  color: #2c5c9f;
  background: #f4f6fa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease;
}

.tm-mini-btn:hover {
  background: #e8eef8;
}

.tm-map-panel {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid #dbe2ea;
  background:
    radial-gradient(circle at 20% 40%, rgba(168, 179, 194, 0.15), transparent 48%),
    radial-gradient(circle at 75% 25%, rgba(168, 179, 194, 0.18), transparent 38%),
    linear-gradient(135deg, #eef2f6 0%, #e4e9ef 100%);
}

.tm-map-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image:
    linear-gradient(0deg, rgba(59, 73, 95, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 73, 95, 0.3) 1px, transparent 1px);
  background-size: 58px 58px;
}

.tm-map-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.58), transparent 35%);
}

.tm-route-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tm-checkpoint {
  position: absolute;
  bottom: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dce5f0;
  border-radius: 12px;
  padding: 12px 14px;
}

.tm-checkpoint strong {
  display: block;
  color: #164f92;
  font-family: "Bebas Neue", sans-serif;
  font-size: 26px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tm-checkpoint span {
  color: #5f6f84;
  font-family: "Inter", sans-serif;
  font-size: 14px;
}

.tm-checkpoint-1 {
  left: 22px;
}

.tm-checkpoint-2 {
  left: 240px;
}

.tm-table-wrap {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #dbe4ef;
}

.tm-table-wrap th {
  background: #0f4e96;
  color: #fff;
  text-transform: uppercase;
  font-family: "Bebas Neue", sans-serif;
  font-size: 30px;
  letter-spacing: 0.8px;
  padding: 16px;
  text-align: left;
}

.tm-table-wrap td {
  color: #34475f;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  padding: 16px;
  border-top: 1px solid #e4e8ef;
}

.tm-table-wrap tbody tr td:first-child {
  font-weight: 700;
  color: #1a243c;
}

.tm-yellow-ring {
  position: absolute;
  top: -56px;
  right: 24px;
  color: rgba(210, 160, 0, 0.4);
  font-family: "Anton", sans-serif;
  font-size: 180px;
  line-height: 1;
  pointer-events: none;
}

@media (max-width: 900px) {
  .tm-hero-shell {
    border-radius: 16px;
    padding: 18px 14px 22px;
  }

  .tm-count-box {
    min-width: 80px;
    padding: 12px 10px;
  }

  .tm-count-box strong {
    font-size: 32px;
  }

  .tm-count-box span {
    font-size: 16px;
  }

  .tm-current-label {
    font-size: 11px;
  }

  .tm-current-registered strong {
    font-size: 21px;
  }

  .tm-current-unit {
    font-size: 15px;
  }

  .tm-checkpoint-2 {
    left: 170px;
  }

  .tm-table-wrap {
    overflow-x: auto;
  }

  .tm-table-wrap table {
    min-width: 760px;
  }

  .tm-yellow-ring {
    font-size: 120px;
    top: -20px;
  }
}

@media (max-width: 640px) {
  .tm-map-panel {
    min-height: 360px;
  }

  .tm-current-registered {
    display: flex;
    margin-top: 14px;
    gap: 6px;
    padding: 9px 12px;
  }

  .tm-checkpoint {
    padding: 8px 10px;
  }

  .tm-checkpoint strong {
    font-size: 18px;
  }

  .tm-checkpoint span {
    font-size: 12px;
  }

  .tm-checkpoint-1 {
    left: 12px;
    bottom: 16px;
  }

  .tm-checkpoint-2 {
    left: 155px;
    bottom: 16px;
  }
}
