/* =========================================================
   Reports page (ข้อมูลเชิงลึก)
   Design source: Figma "AI Search Present - Final" node 3803:56335
   Year dropdown: node 3938:86835. Builds on ranking.css (pagination).
   ========================================================= */

.site-main > .reports-intro,
.site-main > .report-highlight,
.site-main > .reports-archive {
  width: min(1264px, calc(100% - 48px));
}

/* ---------- Intro ---------- */

.reports-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.reports-intro__title {
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.2;
  color: #000;
}

.reports-intro__desc {
  max-width: 1100px;
  font-size: clamp(1.125rem, 1rem + 0.8vw, 1.75rem);
  line-height: 1.43;
  color: #000;
  opacity: 0.8;
}

/* ---------- Highlight report ---------- */

.report-highlight {
  display: flex;
  gap: 60px;
  align-items: center;
}

.report-highlight__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.report-highlight__eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.75rem);
  font-weight: 500;
  line-height: 1.43;
}

.report-highlight__eyebrow span {
  color: transparent;
  background-image: var(--gradient-brand, linear-gradient(142deg, #1c73e9 38.87%, #2ac48b 88.955%));
  background-clip: text;
  -webkit-background-clip: text;
}

.report-highlight__flame {
  width: 32px;
  height: 32px;
}

.report-highlight__title {
  font-size: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  font-weight: 600;
  line-height: 1.27;
  color: #000;
}

.report-highlight__desc {
  font-size: clamp(1.125rem, 1rem + 0.9vw, 1.75rem);
  line-height: 1.43;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
}

.report-highlight__cover {
  position: relative;
  flex: 0 0 326px;
  height: 405px;
  overflow: hidden;
  border-radius: 24px;
}

.report-highlight__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Floating white pill over the cover art, as in Figma. */
.report-highlight__download {
  position: absolute;
  bottom: 24px;
  left: 50%;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 24px;
  border-radius: 84px;
  background: #fff;
  box-shadow: 0 8px 12px 6px rgba(0, 0, 0, 0.15), 0 4px 4px rgba(0, 0, 0, 0.3);
  font-size: 18px;
  font-weight: 600;
  color: #1e1e1e;
  transform: translateX(-50%);
  transition: transform var(--duration-fast) ease;
}

.report-highlight__download:hover {
  transform: translateX(-50%) translateY(-2px);
}

.report-highlight__download img {
  width: 24px;
  height: 24px;
}

/* ---------- Archive ---------- */

.reports-archive {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

/* ---------- Year filter dropdown ---------- */

/* Above the tiles: their hover transform creates a stacking context. */
.report-filter {
  position: relative;
  z-index: 10;
  align-self: flex-end;
}

.report-filter__toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 10px 20px;
  border: 1px solid rgba(28, 28, 28, 0.1);
  border-radius: 99px;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: #000;
  cursor: pointer;
}

/* Open state picks up the brand tint from the design. */
.report-filter__toggle[aria-expanded="true"] {
  border-color: transparent;
  background-image: linear-gradient(135deg, rgba(28, 115, 233, 0.15), rgba(42, 196, 139, 0.15));
}

.report-filter__chevron {
  width: 20px;
  height: 20px;
  transition: transform var(--duration-fast) ease;
}

.report-filter__toggle[aria-expanded="true"] .report-filter__chevron {
  transform: rotate(180deg);
}

/* display:flex would otherwise defeat the hidden attribute. */
.report-filter__menu[hidden] {
  display: none;
}

.report-filter__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 32px -4px rgba(111, 108, 143, 0.12), 0 3px 8px -2px rgba(92, 93, 164, 0.06);
}

.report-filter__option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.5;
  color: #000;
  cursor: pointer;
}

.report-filter__option:hover {
  background: var(--color-surface-soft);
}

.report-filter__option input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-brand-blue);
  cursor: pointer;
}

/* ---------- Report tiles ---------- */

.reports-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

.report-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 7px 23px #f4f5fc, 0 18px 23px rgba(244, 245, 252, 0.5);
  transition: transform var(--duration-fast) var(--ease-out);
}

.report-tile:hover {
  transform: translateY(-4px);
}

.report-tile__media {
  aspect-ratio: 393 / 361;
  overflow: hidden;
}

.report-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
}

.report-tile__title {
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.8125rem);
  font-weight: 600;
  line-height: 1.25;
  color: #090909;
}

.report-tile__desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: #757575;
}

.report-tile__download {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  align-self: flex-start;
  margin-top: 11px;
  padding: 11px 18px 11px 22px;
  border-radius: 76px;
  background-image: var(--gradient-brand, linear-gradient(135deg, #1c73e9 38.87%, #2ac48b 88.955%));
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  transition: transform var(--duration-fast) ease;
}

.report-tile__download:hover {
  transform: translateY(-2px);
}

.report-tile__download img {
  width: 22px;
  height: 22px;
}

.reports-archive__empty {
  padding: 40px 0;
  font-size: 20px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .report-highlight {
    flex-direction: column;
    gap: 32px;
  }

  .report-highlight__cover {
    flex: none;
    width: min(326px, 100%);
  }

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

@media (max-width: 640px) {
  .reports-archive__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-filter {
    align-self: flex-start;
  }

  .report-filter__menu {
    right: auto;
    left: 0;
  }
}
