/* =========================================================
   SHAAGIRD REPORTS ARCHIVE
   Branded with Shaagird Teal (#299D8E) & Design System
   Matches Policies Page Layout with Shaagird Aesthetics
========================================================= */

:root {
  --report-teal: #299D8E;
  --report-teal-dark: #217F74;
  --report-teal-soft: #E7F5F2;
  --report-teal-light: #F0F7F5;
  --report-ink: #173B38;
  --report-text-muted: #5F716E;
  --report-border: #DCE9E6;
  --report-card-bg: #FFFFFF;
}

.m2s-reports-page {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 70px;
  padding: 0 clamp(16px, 3.5vw, 40px);
  color: var(--report-ink);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

.m2s-reports-page *,
.m2s-reports-page *::before,
.m2s-reports-page *::after {
  box-sizing: border-box;
}

/* Background subtle pattern */
.m2s-reports-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(41, 157, 142, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 157, 142, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 75% 20%, rgba(41, 157, 142, 0.08), transparent 32%),
    linear-gradient(180deg, #FFFFFF 0%, #F5FAF9 100%);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

/* Hero Panel */
.m2s-hero-panel {
  position: relative;
  width: 100%;
  margin: 28px auto 0;
  min-height: 220px;
  padding: clamp(28px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid var(--report-border);
  border-top: 5px solid var(--report-teal);
  border-radius: 12px;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.96), rgba(231, 245, 242, 0.88)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 20px 60px rgba(23, 59, 56, 0.08);
  backdrop-filter: blur(20px);
}

.m2s-hero-panel::after {
  content: "";
  position: absolute;
  right: clamp(24px, 5vw, 68px);
  top: 50%;
  transform: translateY(-50%) rotate(-6deg);
  width: 90px;
  height: 90px;
  border: 1px solid rgba(41, 157, 142, 0.2);
  border-radius: 50%;
  background:
    url("https://shaagird.org/shaagird-logo.svg") center / 56px 56px no-repeat,
    var(--report-teal-soft);
  box-shadow:
    0 16px 30px rgba(41, 157, 142, 0.18),
    inset 0 0 0 10px #FFFFFF,
    inset 0 0 0 12px rgba(41, 157, 142, 0.25);
  pointer-events: none;
}

.m2s-kicker {
  display: inline-block;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--report-teal);
}

.m2s-hero-panel h1 {
  max-width: calc(100% - 140px);
  margin: 0 0 12px;
  font-size: clamp(36px, 4.8vw, 64px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--report-ink);
}

.m2s-hero-panel p:not(.m2s-kicker) {
  max-width: min(1000px, calc(100% - 120px));
  margin: 0;
  color: #31504D;
  font-size: clamp(14px, 1.2vw, 15.5px);
  line-height: 1.7;
}

/* Report Cards Grid */
.m2s-report-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 28px !important;
  align-items: start;
  width: 100%;
  margin: 28px auto 0;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid var(--report-border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.75);
  box-shadow:
    0 24px 70px rgba(23, 59, 56, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
}

/* Individual Card */
.m2s-report-card {
  display: grid !important;
  grid-template-rows: auto auto auto 3px;
  align-content: start;
  align-self: start;
  gap: 12px;
  margin: 0 !important;
  padding-bottom: 8px;
  text-align: center;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.m2s-report-card:hover {
  transform: translateY(-8px);
}

/* Card title */
.m2s-report-title {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--report-ink);
  line-height: 1.35;
}

/* Bottom teal accent line indicator on hover */
.m2s-report-card::after {
  content: "";
  width: 44px;
  height: 3px;
  justify-self: center;
  border-radius: 999px;
  background: var(--report-teal);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.m2s-report-card:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Cover styling with realistic document sheen */
.m2s-report-cover {
  position: relative;
  display: block !important;
  width: 100% !important;
  aspect-ratio: 725 / 1024;
  overflow: hidden;
  margin: 0 !important;
  line-height: 0;
  border-radius: 8px;
  background: #E8ECEB;
  box-shadow:
    0 20px 36px rgba(23, 59, 56, 0.16),
    0 4px 12px rgba(23, 59, 56, 0.08);
  border: 1px solid rgba(23, 59, 56, 0.06);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.m2s-report-cover a {
  display: block;
  width: 100%;
  height: 100%;
}

.m2s-report-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.24) 0%, transparent 28%, transparent 70%, rgba(255, 255, 255, 0.12) 100%),
    linear-gradient(to bottom, transparent 72%, rgba(23, 59, 56, 0.18) 100%);
}

.m2s-report-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.m2s-report-card:hover .m2s-report-cover {
  transform: perspective(900px) rotateX(2deg);
  box-shadow:
    0 32px 55px rgba(23, 59, 56, 0.24),
    0 8px 18px rgba(41, 157, 142, 0.12);
}

.m2s-report-card:hover .m2s-report-cover img {
  filter: contrast(1.03) saturate(1.05);
  transform: scale(1.04);
}

/* Button Container */
.m2s-report-card .wp-block-buttons {
  display: flex !important;
  justify-content: center !important;
  margin: 4px 0 0 !important;
  padding: 0 !important;
}

.m2s-read-button {
  margin: 0 !important;
  padding: 0 !important;
  display: inline-block;
}

/* Button Pill with Arrow */
.m2s-read-button .wp-block-button__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 124px;
  min-height: 32px;
  overflow: hidden;
  padding: 0 14px !important;
  border: 1px solid rgba(41, 157, 142, 0.5);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--report-teal), var(--report-teal-dark)) !important;
  color: #FFFFFF !important;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow:
    0 8px 20px rgba(41, 157, 142, 0.28),
    0 0 0 2px rgba(41, 157, 142, 0.15);
  transition: all 0.25s ease;
}

.m2s-read-button .wp-block-button__link::after {
  content: "→";
  display: inline-grid;
  width: 16px;
  height: 16px;
  margin-left: 7px;
  place-items: center;
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--report-teal-dark);
  font-size: 10px;
  font-weight: 900;
  flex: 0 0 16px;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.m2s-read-button .wp-block-button__link:hover,
.m2s-report-card:hover .m2s-read-button .wp-block-button__link {
  background: #111111 !important;
  color: #FFFFFF !important;
  border-color: #111111;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.m2s-read-button .wp-block-button__link:hover::after,
.m2s-report-card:hover .m2s-read-button .wp-block-button__link::after {
  background: #FFFFFF;
  color: #111111;
  transform: translateX(3px);
}

/* =========================================================
   RESPONSIVE BREAKPOINTS
========================================================= */
@media (max-width: 1200px) {
  .m2s-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px !important;
  }
}

@media (max-width: 860px) {
  .m2s-hero-panel::after {
    display: none;
  }

  .m2s-hero-panel h1 {
    max-width: 100%;
  }

  .m2s-hero-panel p:not(.m2s-kicker) {
    max-width: 100%;
  }
}

@media (max-width: 580px) {
  .m2s-reports-page {
    padding: 0 14px;
    margin-bottom: 50px;
  }

  .m2s-hero-panel {
    padding: 24px 20px !important;
    margin-top: 18px;
  }

  .m2s-hero-panel h1 {
    font-size: 32px;
  }

  .m2s-report-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 16px;
  }

  .m2s-report-card {
    max-width: 320px;
    margin: 0 auto !important;
    width: 100%;
  }
}
