:root{
  --space-blue:#003256;
  --space-blue-2:#0f4d6d;
  --space-bg:#DFE6E2;
  --space-paper:#F7F8F5;
  --space-white:#fff;
  --space-text:#153342;
  --space-muted:#6b7a80;
  --space-line:rgba(0,50,86,.13);
  --space-shadow:0 18px 55px rgba(0,50,86,.10);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:"IBM Plex Sans Thai","Bai Jamjuree",sans-serif;
  background:var(--space-bg);
  color:var(--space-text);
}
a{text-decoration:none}
.navbar{
  background:#fff;
  padding:11px 22px;
  box-shadow:0 1px 0 rgba(0,0,0,.06);
  z-index:60;
}
.navbar-brand img{max-height:72px}
.dropdown-toggle{
  cursor:pointer;
  font-size:30px;
  line-height:1;
  color:var(--space-blue);
}
.dropdown-toggle::after{display:none}
.dropdown-menu{
  right:0!important;
  left:auto!important;
  border:0;
  border-radius:12px;
  padding:10px;
  box-shadow:0 16px 45px rgba(0,0,0,.14);
  min-width:195px;
}
.dropdown-menu a{
  display:block;
  color:var(--space-blue);
  padding:10px 14px;
  border-radius:8px;
}
.dropdown-menu a:hover{background:#eef3f1}

.page-hero{
  background:
    radial-gradient(circle at 82% 35%,rgba(255,255,255,.13),transparent 22%),
    linear-gradient(135deg,#003256,#0a4467 62%,#2b6477);
  color:#fff;
  padding:76px 0 68px;
}
.page-hero.small{padding:58px 0 50px}
.eyebrow{
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.17em;
  text-transform:uppercase;
  opacity:.72;
  margin-bottom:12px;
}
.page-hero h1{
  font-size:clamp(2.6rem,6vw,5.5rem);
  font-weight:700;
  line-height:.95;
  margin:0;
}
.page-hero.small h1{font-size:clamp(2.3rem,5vw,4.4rem)}
.page-hero p{
  max-width:700px;
  font-size:1.06rem;
  line-height:1.75;
  margin:24px 0 0;
  opacity:.92;
}

.section{padding:68px 0}
.section + .section{padding-top:20px}
.section-head{
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:25px;
  margin-bottom:26px;
}
.section-head h2{
  margin:0;
  font-weight:650;
  font-size:clamp(2rem,4vw,3.25rem);
  color:var(--space-blue);
}
.section-head p{
  color:var(--space-muted);
  margin:8px 0 0;
}
.view-all{
  flex:none;
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding:11px 18px;
  border:1px solid var(--space-blue);
  border-radius:999px;
  color:var(--space-blue);
  font-weight:600;
  transition:.2s;
}
.view-all:hover{
  background:var(--space-blue);
  color:#fff;
}
.view-all .arrow{font-size:1.2rem}

.media-card{
  background:#fff;
  border-radius:17px;
  overflow:hidden;
  height:100%;
  border:1px solid rgba(0,50,86,.05);
  box-shadow:0 8px 30px rgba(0,50,86,.06);
  transition:.23s ease;
}
.media-card:hover{
  transform:translateY(-5px);
  box-shadow:var(--space-shadow);
}
.video-thumb{
  aspect-ratio:16/9;
  position:relative;
  overflow:hidden;
  cursor:pointer;
  background:linear-gradient(135deg,#164e68,#89a9aa);
}
.video-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:.35s;
}
.media-card:hover .video-thumb img{transform:scale(1.025)}
.video-thumb.placeholder::after{
  content:"THE SPACE";
  position:absolute;
  left:20px;
  bottom:17px;
  color:#fff;
  font-size:1rem;
  font-weight:650;
  letter-spacing:.11em;
  opacity:.85;
}
.play{
  width:61px;
  height:61px;
  border-radius:50%;
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  background:rgba(255,255,255,.94);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 25px rgba(0,0,0,.16);
  transition:.22s;
}
.video-thumb:hover .play{transform:translate(-50%,-50%) scale(1.08)}
.play::after{
  content:"";
  border-top:9px solid transparent;
  border-bottom:9px solid transparent;
  border-left:15px solid var(--space-blue);
  margin-left:4px;
}
.card-copy{padding:19px 21px 23px}
.card-kicker{
  display:flex;
  justify-content:space-between;
  gap:12px;
  color:var(--space-muted);
  font-size:.78rem;
  margin-bottom:8px;
}
.card-kicker b{
  color:var(--space-blue);
  letter-spacing:.07em;
  text-transform:uppercase;
}
.card-copy h3{
  color:var(--space-blue);
  font-size:1.15rem;
  line-height:1.45;
  margin:0 0 8px;
  font-weight:650;
}
.card-copy p{
  margin:0;
  color:var(--space-muted);
  font-size:.93rem;
  line-height:1.6;
}

.report-card{
  cursor:pointer;
  background:#fff;
  border-radius:17px;
  overflow:hidden;
  box-shadow:0 8px 30px rgba(0,50,86,.06);
  border:1px solid rgba(0,50,86,.05);
  height:100%;
  transition:.23s ease;
}
.report-card:hover{
  transform:translateY(-5px);
  box-shadow:var(--space-shadow);
}
.report-cover{
  aspect-ratio:3/4;
  background:
    linear-gradient(145deg,rgba(0,50,86,.94),rgba(41,104,120,.84)),
    #174e68;
  position:relative;
  overflow:hidden;
}
.report-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.report-cover.placeholder::before{
  content:"THE SPACE";
  position:absolute;
  top:26px;
  left:24px;
  color:#fff;
  font-weight:650;
  letter-spacing:.12em;
}
.report-cover.placeholder::after{
  content:"RESEARCH\A REPORT";
  white-space:pre;
  position:absolute;
  left:24px;
  bottom:28px;
  color:#fff;
  font-size:clamp(1.5rem,3vw,2.35rem);
  line-height:1;
  font-weight:700;
}
.report-copy{padding:18px 20px 22px}
.report-copy .report-sub{
  color:var(--space-muted);
  font-size:.82rem;
  margin-bottom:6px;
}
.report-copy h3{
  margin:0;
  color:var(--space-blue);
  font-size:1.08rem;
  line-height:1.45;
  font-weight:650;
}

.video-modal .modal-content{
  background:#000;
  border:0;
  border-radius:16px;
  overflow:hidden;
}
.video-modal .ratio iframe{border:0}
.modal-close{
  position:absolute;
  top:12px;
  right:12px;
  z-index:10;
  width:40px;
  height:40px;
  border-radius:50%;
  background:rgba(255,255,255,.9);
  border:0;
  font-size:1.25rem;
  line-height:1;
}

.report-modal .modal-dialog{
  max-width:1180px;
  width:calc(100% - 40px);
}

.report-modal .modal-content{
  position:relative;
  border:0;
  border-radius:22px;
  overflow:hidden;
  background:#f8faf8;
  box-shadow:0 28px 90px rgba(0,32,52,.24);
}

.report-modal-body{
  padding:0;
  height:min(86vh, 760px);
  max-height:86vh;
  overflow:hidden;
}

.report-detail{
  display:grid;
  grid-template-columns:minmax(360px,44%) minmax(0,1fr);
  height:100%;
  min-height:0;
  max-height:none;
  overflow:hidden;
}

/* PDF Preview — Desktop ซ้าย */
.report-preview-column{
  background:#d8e2df;
  min-width:0;
  min-height:0;
  height:100%;
  border-right:1px solid var(--space-line);
  overflow:hidden;
}

.report-preview-column iframe{
  display:block;
  width:100%;
  height:100%;
  min-height:0;
  border:0;
  background:#fff;
}

.report-preview-column.preview-unavailable{
  display:flex;
  align-items:center;
  justify-content:center;
}

.report-preview-column.preview-unavailable::after{
  content:"PDF Preview unavailable";
  color:var(--space-muted);
  font-size:.95rem;
}

.report-detail-content{
  padding:48px 48px 116px;
  min-width:0;
  min-height:0;
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  -webkit-overflow-scrolling:touch;
}

.report-detail-content .tag{
  display:inline-flex;
  padding:7px 12px;
  background:#e4ece9;
  border-radius:999px;
  color:var(--space-blue);
  font-size:.78rem;
  font-weight:650;
  margin-bottom:18px;
}

.report-detail-content h2{
  color:var(--space-blue);
  font-size:clamp(1.75rem,3vw,2.8rem);
  line-height:1.17;
  font-weight:700;
  margin:0 0 14px;
}

.report-detail-content .subtitle{
  color:var(--space-muted);
  margin:0 0 25px;
  font-size:1rem;
}

.report-detail-content .description{
  color:#53686f;
  font-size:1rem;
  line-height:1.85;
  white-space:pre-line;
}

/* Desktop actions เฉพาะฝั่งเนื้อหา */
.report-actionbar{
  position:absolute;
  left:44%;
  right:0;
  bottom:0;
  min-height:84px;
  background:rgba(255,255,255,.96);
  border-top:1px solid var(--space-line);
  backdrop-filter:blur(14px);
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  padding:14px 24px;
  z-index:8;
}

.action-btn{
  min-height:50px;
  border-radius:999px;
  padding:0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:650;
  border:1px solid var(--space-blue);
}

.action-btn.secondary{
  color:var(--space-blue);
  background:#fff;
}

.action-btn.primary{
  color:#fff;
  background:var(--space-blue);
}

.action-btn.disabled,
.mobile-download-btn.disabled{
  opacity:.45;
  pointer-events:none;
}

/* Mobile download bar ถูกซ่อนบน Desktop */
.mobile-download-bar{
  display:none;
}
.empty-box{
  text-align:center;
  padding:55px 20px;
  color:var(--space-muted);
  background:rgba(255,255,255,.35);
  border:1px dashed rgba(0,50,86,.18);
  border-radius:18px;
}
@media(max-width:767.98px){
  .navbar-brand img{max-height:58px}
  .page-hero{padding:54px 0 50px}
  .section{padding:50px 0}

  .section-head{
    align-items:flex-start;
    flex-direction:column;
    margin-bottom:20px;
  }

  .view-all{padding:9px 15px}

  .report-modal .modal-dialog{
    width:100%;
    margin:0;
    max-width:none;
    min-height:100%;
  }

  .report-modal .modal-content{
    min-height:100vh;
    border-radius:0;
  }

  .report-modal-body{
    height:auto;
    min-height:100vh;
    max-height:100vh;
    overflow-y:auto;
    overflow-x:hidden;
    padding-bottom:92px;
    -webkit-overflow-scrolling:touch;
  }

  /* มือถือ: ไม่แสดง PDF Preview */
  .report-detail{
    display:block;
    min-height:0;
    max-height:none;
  }

  .report-preview-column{
    display:none !important;
  }

  /* มือถือ: เนื้อหาอย่างเดียว */
  .report-detail-content{
    padding:72px 22px 36px;
    overflow:visible;
  }

  .report-detail-content h2{
    font-size:1.85rem;
    line-height:1.2;
  }

  .report-detail-content .description{
    font-size:.98rem;
    line-height:1.82;
  }

  /* ซ่อน Desktop action ทั้งหมด */
  .desktop-report-actions{
    display:none !important;
  }

  /* Mobile Bar: เหลือปุ่ม Download เพียงปุ่มเดียว */
  .mobile-download-bar{
    display:block;
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    padding:12px 16px max(12px, env(safe-area-inset-bottom));
    background:rgba(255,255,255,.97);
    border-top:1px solid var(--space-line);
    backdrop-filter:blur(14px);
    z-index:20;
  }

  .mobile-download-btn{
    width:100%;
    min-height:54px;
    border-radius:999px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--space-blue);
    color:#fff;
    font-weight:700;
    padding:0 18px;
  }

  .mobile-download-btn:hover{
    color:#fff;
  }

  .modal-close{
    position:fixed;
    top:14px;
    right:14px;
  }
}

