/* ==========================================================================
   Tunas Muda — Anggota pages (Notis, Manfaat, Muat Turun Borang)
   ========================================================================== */

/* Notis — notice gallery */
.tm-ag-notice {
  max-width: 724px;
  margin: 0 auto;
}

.tm-ag-notice__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: #5c6b7f;
}

.tm-ag-notice__meta time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--md-navy, #1d365c);
  background: rgba(42, 157, 143, 0.1);
}

.tm-ag-notice__title {
  margin: 0 0 1.75rem;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  color: var(--md-navy, #1d365c);
}

.tm-ag-notice__gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

.tm-ag-notice__figure {
  margin: 0;
  border-radius: var(--md-radius, 16px);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--md-shadow, 0 4px 28px rgba(12, 24, 41, 0.08));
  border: 1px solid var(--md-line, rgba(29, 54, 92, 0.12));
}

.tm-ag-notice__figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* Manfaat — carousel (WP page_id=3575 parity: fixed 16:9 + bg slides) */
.tm-ag-carousel-wrap {
  max-width: 960px;
  margin: 0 auto;
  /* NOTE: Keep page smooth-scroll from stealing horizontal swipe */
  touch-action: pan-y;
}

.tm-ag-swiper {
  position: relative;
  border-radius: var(--md-radius, 16px);
  overflow: hidden;
  background: var(--md-navy, #1d365c);
  box-shadow: var(--md-shadow, 0 4px 28px rgba(12, 24, 41, 0.08));
  border: 1px solid var(--md-line, rgba(29, 54, 92, 0.12));
  touch-action: pan-y;
  cursor: grab;
}

.tm-ag-swiper:active {
  cursor: grabbing;
}

.tm-ag-swiper .swiper-slide {
  /* NOTE: Same trick as WP custom CSS — fixed 16:9 frame, equal slide height */
  position: relative;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  background: var(--md-navy, #1d365c);
  box-sizing: border-box;
}

.tm-ag-slide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
}

.tm-ag-swiper .swiper-button-prev,
.tm-ag-swiper .swiper-button-next {
  width: 44px;
  height: 44px;
  z-index: 8;
  border-radius: 50%;
  background: rgba(29, 54, 92, 0.9);
  color: #fff;
  border: 1px solid rgba(42, 157, 143, 0.35);
  box-shadow: 0 4px 16px rgba(12, 24, 41, 0.2);
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
  pointer-events: auto;
}

.tm-ag-swiper .swiper-button-prev:after,
.tm-ag-swiper .swiper-button-next:after {
  font-size: 1rem;
  font-weight: 700;
}

.tm-ag-swiper .swiper-button-prev:hover,
.tm-ag-swiper .swiper-button-next:hover {
  background: var(--md-teal, #2a9d8f);
}

.tm-ag-swiper .swiper-button-prev:active,
.tm-ag-swiper .swiper-button-next:active {
  transform: scale(0.96);
}

.tm-ag-swiper .swiper-pagination {
  /* NOTE: WP hides 52 dots — status text below is enough */
  display: none;
}

.tm-ag-carousel__status {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5c6b7f;
}

.tm-ag-carousel__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  color: #5c6b7f;
  font-size: 0.9375rem;
}

.tm-ag-carousel__error {
  padding: 1.5rem;
  text-align: center;
  color: #8b3a3a;
  background: rgba(207, 46, 46, 0.06);
  border-radius: var(--md-radius, 16px);
}

/* Muat Turun Borang — accordion list */
.tm-ag-borang {
  max-width: 720px;
  margin: 0 auto;
}

.tm-ag-borang__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tm-ag-borang__item {
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--md-line, rgba(29, 54, 92, 0.12));
  box-shadow: var(--md-shadow, 0 4px 28px rgba(12, 24, 41, 0.08));
  overflow: hidden;
}

.tm-ag-borang__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.85rem 1.1rem;
  font-family: "Poppins", sans-serif;
  font-size: clamp(0.9375rem, 2.2vw, 1rem);
  font-weight: 600;
  color: var(--md-navy, #1d365c);
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease;
}

.tm-ag-borang__item summary::-webkit-details-marker {
  display: none;
}

.tm-ag-borang__item summary::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  font-size: 0.9rem;
  color: var(--md-teal, #2a9d8f);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.tm-ag-borang__item[open] summary {
  background: rgba(42, 157, 143, 0.06);
  border-bottom: 1px solid var(--md-line, rgba(29, 54, 92, 0.12));
}

.tm-ag-borang__item[open] summary::after {
  transform: rotate(180deg);
}

.tm-ag-borang__item summary:hover {
  background: rgba(42, 157, 143, 0.04);
}

.tm-ag-borang__downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1rem 1.1rem 1.15rem;
}

.tm-ag-borang__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--md-navy, #1d365c);
  text-decoration: none;
  background: #ebe4e3;
  border: 1px solid rgba(29, 54, 92, 0.08);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.tm-ag-borang__btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.tm-ag-borang__btn:hover,
.tm-ag-borang__btn:focus-visible {
  background: #ddd4d2;
  box-shadow: 0 4px 12px rgba(29, 54, 92, 0.1);
  color: var(--md-navy, #1d365c);
}

.tm-ag-borang__btn:active {
  transform: scale(0.98);
}

.notis-anggota-page.tm-theme-bg-page .tm-ag-notice__figure,
.manfaat-anggota-page.tm-theme-bg-page .tm-ag-swiper,
.muat-turun-borang-page.tm-theme-bg-page .tm-ag-borang__item {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (prefers-reduced-motion: reduce) {
  .tm-ag-borang__item summary::after {
    transition: none;
  }

  .tm-ag-swiper .swiper-button-prev,
  .tm-ag-swiper .swiper-button-next {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .notis-anggota-page.tm-theme-bg-page .tm-ag-notice__figure,
  .manfaat-anggota-page.tm-theme-bg-page .tm-ag-swiper,
  .muat-turun-borang-page.tm-theme-bg-page .tm-ag-borang__item {
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (max-width: 575.98px) {
  .tm-ag-swiper .swiper-button-prev,
  .tm-ag-swiper .swiper-button-next {
    width: 40px;
    height: 40px;
  }

  .tm-ag-borang__downloads {
    flex-direction: column;
  }

  .tm-ag-borang__btn {
    width: 100%;
  }
}
