/* =========================================================
   projects.css — หน้าตาหน้าต่างรายละเอียดโครงการ (ใช้ในหน้า projects.html)
   ========================================================= */

.card.clickable { cursor: pointer; }
.card-more { background: none; border: 0; padding: 8px 0 0; font: inherit; font-weight: 700; color: var(--navy); text-align: left; cursor: pointer; margin-top: auto; }
.card-more:hover { color: var(--orange-text); }
body.no-scroll { overflow: hidden; }

.pm { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(7, 28, 58, 0.88); }
.pm.open { display: flex; animation: pm-fade 0.25s ease; }
.pm-panel {
  position: relative; width: min(1100px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--white); border-top: 6px solid var(--orange); border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  animation: pm-up 0.35s ease;
}
.pm-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--navy); color: var(--white); font-size: 24px; cursor: pointer;
}
.pm-media { background: var(--navy-dark); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.pm-main { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.pm-media .placeholder { color: #C8D4E4; background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.3); }
.pm-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pm-thumbs button { padding: 0; border: 3px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; overflow: hidden; }
.pm-thumbs button.active { border-color: var(--orange); }
.pm-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; opacity: 0.75; }
.pm-thumbs button.active img, .pm-thumbs button:hover img { opacity: 1; }

.pm-info { padding: clamp(24px, 3vw, 40px); padding-top: 56px; display: flex; flex-direction: column; gap: 14px; }
.pm-info h2 { font-size: clamp(22px, 2.4vw, 30px); }
.pm-details { margin: 6px 0 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.pm-details > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pm-details dt { font-size: 14px; color: var(--muted); }
.pm-details dd { margin: 0; font-weight: 700; font-size: 16px; }
.pm-text { color: var(--ink); }
.pm-actions .btn { margin-top: 4px; }
.pm-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; }
.pm-nav button { min-height: 44px; padding: 8px 14px; border: 2px solid var(--line); background: var(--white); border-radius: var(--radius); font: inherit; font-size: 15px; font-weight: 700; color: var(--navy); cursor: pointer; }
.pm-nav button:hover { border-color: var(--navy); }

@media (max-width: 820px) {
  .pm { padding: 0; align-items: stretch; }
  .pm-panel { grid-template-columns: 1fr; max-height: 100vh; border-radius: 0; }
  .pm-info { padding-top: 24px; }
}

@keyframes pm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pm-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pm.open, .pm-panel { animation: none; } }
