/* =============================================================
 * 포트폴리오 넷플릭스형 화면 전용 (2026-10-15)
 * 근거: 설계_포트폴리오개편_20261014.md §4-5 — 포트폴리오 페이지만 다크 네이비.
 * body.pf-dark 범위에서만 적용되므로 다른 페이지·메인 포트폴리오 섹션에는 영향 없음.
 * CI: 블루 #386BB3 / 그린 #7ABC5D / 딥블루 #213E67 / 다크네이비 #0F213D
 * ============================================================= */

body.pf-dark {
  --pf-bg: #0F213D;
  --pf-panel: #213E67;
  --pf-line: rgba(255, 255, 255, .12);
  --pf-text: #f3f6fb;
  --pf-muted: #a9b7cc;
  --pf-accent: #386BB3;
  --pf-green: #7ABC5D;
  background: var(--pf-bg);
  color: var(--pf-text);
}
body.pf-dark main { background: var(--pf-bg); }
body.pf-dark .pf-spacer { background: var(--pf-bg); }

.pf-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 공통 버튼 */
.pf-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 15px/1.2 var(--font-family); text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s;
}
.pf-btn .material-symbols-outlined { font-size: 20px; }
.pf-btn--light  { background: #fff; color: #0F213D; }
.pf-btn--light:hover { background: #e9eef6; }
.pf-btn--accent { background: var(--pf-accent); color: #fff; }
.pf-btn--accent:hover { background: #2f5c9c; }
.pf-btn--ghost  { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.35); }
.pf-btn--ghost:hover { background: rgba(255,255,255,.16); }
.pf-btn:focus-visible, .pf-card:focus-visible, .pf-chip:focus-visible, .pf-hero-dot:focus-visible {
  outline: 3px solid var(--pf-green); outline-offset: 2px;
}

.pf-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(122, 188, 93, .18); color: #b9e3a5;
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
}

/* ── 히어로 ─────────────────────────────────── */
.pf-hero {
  position: relative; height: clamp(360px, 46vw, 620px); overflow: hidden; background: #000;
}
.pf-hero-slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .8s ease, visibility .8s;
}
.pf-hero-slide.is-active { opacity: 1; visibility: visible; }
.pf-hero-bg, .pf-hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.pf-hero-video { opacity: 0; transition: opacity .6s; }
.pf-hero-video.is-playing { opacity: 1; }
.pf-hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(15,33,61,.92) 0%, rgba(15,33,61,.6) 38%, rgba(15,33,61,0) 70%),
    linear-gradient(0deg, var(--pf-bg) 0%, rgba(15,33,61,0) 30%);
}
.pf-hero-text {
  position: absolute; left: 0; right: 0; bottom: clamp(48px, 7vw, 96px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
}
.pf-hero-title {
  margin: 0; max-width: 640px; color: #fff;
  font-size: clamp(24px, 3.4vw, 44px); line-height: 1.25; font-weight: 700;
  letter-spacing: -.02em; word-break: keep-all;
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.pf-hero-desc {
  margin: 0; max-width: 560px; color: #dbe3ef; font-size: 16px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-hero-meta { margin: 0; color: var(--pf-muted); font-size: 14px; }
.pf-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pf-hero-dots {
  position: absolute; left: 0; right: 0; bottom: 20px; display: flex; gap: 8px;
}
.pf-hero-dot {
  width: 28px; height: 4px; border: 0; border-radius: 2px; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.35);
}
.pf-hero-dot.is-active { background: #fff; }

/* ── 필터 칩 ─────────────────────────────────── */
.pf-chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; padding-bottom: 6px;
}
.pf-chip {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--pf-line);
  color: #d5deea; text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .2s, color .2s;
}
.pf-chip:hover { background: rgba(255,255,255,.08); }
.pf-chip.is-active { background: #fff; color: #0F213D; border-color: #fff; }

/* ── 줄(rows) ─────────────────────────────────── */
.pf-rows { padding: 10px 0 8px; }
.pf-row { padding: 18px 0 6px; }
.pf-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.pf-row-title {
  margin: 0; color: #fff; font-size: clamp(17px, 1.6vw, 21px); font-weight: 700; letter-spacing: -.01em;
}
.pf-row-count { color: var(--pf-muted); font-weight: 500; font-size: .8em; margin-left: 4px; }
.pf-row-more { color: #9fbbe6; font-size: 14px; text-decoration: none; white-space: nowrap; }
.pf-row-more:hover { color: #fff; }

.pf-strip-wrap { position: relative; }
.pf-strip {
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-left: var(--pf-pad);
  padding: 4px var(--pf-pad) 14px;
  scrollbar-width: none;
  --pf-pad: max(var(--spacing-lg, 24px), calc((100vw - 1200px) / 2 + var(--spacing-lg, 24px)));
}
.pf-strip::-webkit-scrollbar { display: none; }
.pf-strip-item { flex: 0 0 auto; scroll-snap-align: start; }

.pf-card {
  display: block; width: clamp(220px, 22vw, 300px); color: var(--pf-text); text-decoration: none;
  border-radius: 8px;
}
.pf-card--portrait { width: clamp(140px, 14vw, 190px); }
.pf-card-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: var(--pf-panel);
}
.pf-card--portrait .pf-card-thumb { aspect-ratio: 9 / 16; }
.pf-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease;
}
.pf-card:hover .pf-card-thumb img, .pf-card.is-open .pf-card-thumb img { transform: scale(1.05); }
.pf-card.is-open .pf-card-thumb { box-shadow: 0 0 0 3px var(--pf-green); }
/* 아이콘 폰트 CSS(.material-symbols-outlined{display:inline-block})가 나중에 로드돼 덮어쓰므로 선택자를 한 단계 구체화(2026-10-15) */
.pf-card .pf-card-play {
  position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(15,33,61,.75); color: #fff; font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s;
  padding-left: 1px;   /* 삼각형은 무게중심이 왼쪽이라 1px 보정 */
}
.pf-card:hover .pf-card-play, .pf-card:focus-visible .pf-card-play { opacity: 1; }
.pf-card-title {
  display: block; margin-top: 8px; font-size: 14px; font-weight: 500; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-card-meta { display: block; margin-top: 2px; color: var(--pf-muted); font-size: 12px; }

.pf-arrow {
  position: absolute; top: 4px; bottom: 50px; z-index: 2; width: 44px; border: 0; cursor: pointer;
  color: #fff; background: rgba(15,33,61,.72); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.pf-arrow .material-symbols-outlined { font-size: 34px; }
.pf-arrow--prev { left: 0; border-radius: 0 8px 8px 0; }
.pf-arrow--next { right: 0; border-radius: 8px 0 0 8px; }
.pf-strip-wrap:hover .pf-arrow, .pf-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .pf-arrow { display: none !important; } }

/* ── 상세 패널 ─────────────────────────────────── */
.pf-panel { padding: 4px 0 18px; animation: pfIn .35s ease-out; }
@keyframes pfIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pf-panel-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px;
  background: var(--pf-panel); border-radius: 12px; padding: 22px;
  max-width: calc(1200px - 2 * var(--spacing-lg, 24px));
}
.pf-panel-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.25); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pf-panel-media { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.pf-panel-media.is-portrait { aspect-ratio: 9 / 16; max-height: 70vh; justify-self: center; width: auto; height: 70vh; }
.pf-panel-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-panel-play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.92); color: #0F213D; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pf-panel-play .material-symbols-outlined { font-size: 40px; }
.pf-panel-play[hidden] { display: none; }
.pf-panel-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-right: 30px; }
.pf-panel-badges { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pf-panel-title { margin: 0; color: #fff; font-size: 22px; line-height: 1.35; letter-spacing: -.01em; word-break: keep-all; }
.pf-panel-meta {
  margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px;
}
.pf-panel-meta dt { color: var(--pf-muted); }
.pf-panel-meta dd { margin: 0; color: #e6ecf5; }
.pf-panel-desc { margin: 4px 0 0; color: #d3dcea; font-size: 15px; line-height: 1.65; }
.pf-panel-desc:empty { display: none; }
.pf-panel .pf-panel-desc { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.pf-panel .pf-panel-desc:empty { display: none; }
.pf-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pf-panel-blog { color: #b9e3a5; font-size: 14px; text-decoration: none; margin-top: 2px; }
.pf-panel-blog:hover { text-decoration: underline; }

/* ── 그리드(전체보기·필터) ─────────────────────── */
.pf-gridview { padding-top: 18px; padding-bottom: 40px; }
.pf-back { margin: 0 0 6px; }
.pf-back a { color: #9fbbe6; text-decoration: none; font-size: 14px; }
.pf-grid-title { color: #fff; font-size: 24px; margin: 0 0 18px; }
.pf-grid-title span { color: var(--pf-muted); font-size: 16px; font-weight: 500; }
body.pf-dark .portfolio-item { background: var(--pf-panel); box-shadow: none; }
.pf-grid-more {
  display: inline-block; margin-top: 8px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.6);
}

/* ── 함께한 곳 · CTA ─────────────────────────── */
.pf-clients { padding-top: 34px; padding-bottom: 10px; }
.pf-client-list {
  list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 10px;
}
.pf-client-list li {
  padding: 6px 12px; border: 1px solid var(--pf-line); border-radius: 6px; color: #d5deea; font-size: 14px;
}
.pf-client-list li span { color: var(--pf-muted); font-size: 12px; margin-left: 2px; }
.pf-cta { padding: 56px 0 72px; }
.pf-cta .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--pf-line); padding-top: 40px; }
.pf-cta-text { margin: 0; color: #fff; font-size: 20px; font-weight: 600; word-break: keep-all; }

/* ── 모바일 ─────────────────────────────────── */
@media (max-width: 768px) {
  .pf-hero { height: 78vw; min-height: 380px; }
  .pf-hero-shade {
    background: linear-gradient(0deg, var(--pf-bg) 0%, rgba(15,33,61,.75) 45%, rgba(15,33,61,.1) 100%);
  }
  .pf-hero-desc { display: none; }
  .pf-btn { padding: 9px 14px; font-size: 14px; }
  .pf-card { width: 64vw; }
  .pf-card--portrait { width: 38vw; }
  .pf-strip { --pf-pad: 16px; gap: 8px; }
  .pf-panel-inner { grid-template-columns: 1fr; gap: 14px; padding: 14px; margin: 0 12px; }
  .pf-panel-body { padding-right: 0; }
  .pf-panel-title { font-size: 19px; }
  .pf-cta-text { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-hero-slide, .pf-card-thumb img, .pf-panel { transition: none; animation: none; }
}

/* ── 작품 상세(portfolio_view.php) ─────────────── */
.pf-view-wrap { padding-top: 20px; padding-bottom: 24px; }
.pf-crumbs { font-size: 13px; color: var(--pf-muted); margin-bottom: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-crumbs a { color: #9fbbe6; text-decoration: none; }
.pf-crumbs a:hover { color: #fff; }
.pf-view-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.pf-view-grid.is-portrait { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
.pf-player {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000;
}
.pf-player.is-portrait { aspect-ratio: 9 / 16; }
.pf-player img, .pf-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.pf-player-btn {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: #0F213D; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); transition: transform .2s;
}
.pf-player-btn:hover { transform: scale(1.06); }
.pf-player-btn .material-symbols-outlined { font-size: 50px; }
.pf-gallery { display: grid; gap: 10px; }
.pf-gallery img { width: 100%; border-radius: 10px; display: block; }
.pf-view-info { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 110px; }
.pf-view-title {
  margin: 0; color: #fff; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.35; letter-spacing: -.02em; word-break: keep-all;
}
.pf-view-blog {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-top: 8px;
  padding: 14px 16px; border-radius: 10px; background: var(--pf-panel); color: #fff; text-decoration: none;
}
.pf-view-blog:hover { background: #2a4b7a; }
.pf-view-blog-label { font-size: 12px; font-weight: 700; color: #0F213D; background: var(--pf-green); border-radius: 4px; padding: 2px 8px; }
.pf-view-blog-title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.pf-view .pf-row { padding-top: 34px; }
@media (max-width: 900px) {
  .pf-view-grid, .pf-view-grid.is-portrait { grid-template-columns: 1fr; gap: 18px; }
  .pf-view-info { position: static; }
  .pf-view-grid.is-portrait .pf-view-media { max-width: 360px; width: 100%; margin: 0 auto; }
}
