/* =========================================================
 * today.css  (CLEAN FINAL v20260117_03)
 * - 오늘의 가족 큐레이션 전용 (가능한 한 .page-today 스코프)
 * - 웹 슬라이드쇼(ss-*) / 비디오 모달(vid-*) 포함
 * - 오버레이 중앙정렬 + 최대폭 1200px
 * - 모바일: 좌우 여백 최소화 + 비디오(원하면) 화면 꽉 채우기
 * ========================================================= */

/* -----------------------------
 * Base
 * ----------------------------- */
.page-today .today-wrap{
  padding: 18px 0 22px;
}
.page-today .card{
  border-radius: 16px;
  overflow: hidden;
}

/* -----------------------------
 * HERO (상단 흰 카드)  ✅ 높이 압축 포함(최근 수정 반영)
 * ----------------------------- */
.page-today .today-hero{
  padding: 12px 16px 10px; /* 기존 16px → 압축 */
}

.page-today .today-hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ✅ today.php 구조( today-titlebox > h1 ) 정확히 타겟 */
.page-today .today-titlebox > h1{
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 24px;  /* 요청값 */
  font-weight: 900;
  letter-spacing: -0.3px;
  color: #0f172a;
}

/* (혹시 다른 템플릿에서 today-header를 쓰는 경우도 커버) */
.page-today .today-header h1,
.page-today .today-hero h1{
  font-size: 20px;
  line-height: 24px;
  margin: 0 0 4px;
  font-weight: 900;
}

.page-today .today-phrase{
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 500;
  font-style: italic;
  color: rgba(15, 23, 42, 0.75);
}

.page-today .today-sub,
.page-today .today-subrow{
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.35;
}

.page-today .today-subrow{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-today .badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.20);
  color: #1e40af;
  font-size: 12px;
  font-weight: 900;
}

.page-today .seed{
  font-size: 12px;
  font-weight: 800;
  color: rgba(15,23,42,.55);
}

/* actions */
.page-today .today-actions{
  display:flex;
  gap: 6px; /* 최근 수정 반영 */
  align-items:center;
  flex-wrap: wrap;
}

.page-today .tbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 7px 12px;  /* 최근 수정 반영 */
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background: #fff;
  color: #0f172a;
  text-decoration:none;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  transition: background .12s ease, transform .06s ease;
}
.page-today .tbtn:hover{ background:#f8fafc; }
.page-today .tbtn:active{ transform: translateY(1px); }

.page-today .tbtn.primary{
  background:#eff6ff;
  border-color: rgba(37,99,235,.18);
  color:#1d4ed8;
}
.page-today .tbtn.primary:hover{ background:#e0efff; }

/* volume slider (옵션) */
.page-today .audio-ui{
  display:flex;
  align-items:center;
  gap: 10px;
}
.page-today #bgmVol{ width: 140px; }

/* -----------------------------
 * FILTER TABS
 * ----------------------------- */
.page-today .today-filters{
  margin-top: 12px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-today .today-filters .tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  text-decoration:none;
  font-weight: 900;
  font-size: 12px;
  color: rgba(15,23,42,.75);
}

.page-today .today-filters .tab.is-on{
  background:#0f172a;
  border-color:#0f172a;
  color:#fff;
}

/* -----------------------------
 * GRID
 * ----------------------------- */
.page-today .today-grid-card{
  padding: 12px;
}
.page-today .today-empty{
  padding: 20px 12px;
  text-align:center;
  font-weight: 900;
  color: rgba(15,23,42,.55);
}

.page-today .today-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.page-today .today-item{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.page-today .today-thumb{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background-size: cover;
  background-position: center;
  background-color: #f1f5f9;
  cursor: pointer;
  overflow:hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.page-today .today-thumb:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15,23,42,.14);
}

.page-today .today-tag{
  position:absolute;
  left:10px;
  top:10px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(15,23,42,.10);
  font-size: 11px;
  font-weight: 900;
  color: rgba(15,23,42,.78);
  backdrop-filter: blur(6px);
}

.page-today .today-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.page-today .today-alt{
  font-size: 12px;
  font-weight: 900;
  color: rgba(15,23,42,.75);
  max-width: 360px;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-today .today-meta-actions{
  display:flex;
  gap: 8px;
  align-items:center;
}

.page-today .iconlink{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,23,42,.12);
  background:#fff;
  color:#0f172a;
  text-decoration:none;
  font-weight: 900;
  font-size: 12px;
  cursor:pointer;
}
.page-today .iconlink:hover{ background:#f8fafc; }

/* -----------------------------
 * (옵션) 사진 위 문구
 * ----------------------------- */
.page-today .photo-caption{
  position: absolute;
  top: 12px;
  left: 18px;
  right: 18px;
  max-width: 520px;
  line-height: 1.25;
  color: rgba(255,255,255,.92);
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.page-today .photo-caption-title{
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 4px;
}

/* -----------------------------
 * Responsive (grid)
 * ----------------------------- */
@media (max-width: 980px){
  .page-today .today-grid{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px){
  .page-today .today-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .page-today .today-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-today .today-alt{ max-width: 220px; }
}
@media (max-width: 480px){
  .page-today .today-actions{ width:100%; }
  .page-today .tbtn{ flex:1; }
  .page-today .today-alt{ max-width: 180px; }
}

/* =========================================================
 * Slideshow Overlay (ss-*)  ✅ 중앙정렬 + 최대폭 1200
 * ========================================================= */
.page-today .ss-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2,6,23,.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.page-today .ss-overlay.is-on{ display:flex; }

.page-today .ss-stage{
  width: min(1200px, 94vw);
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.page-today .ss-frame{
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #0b1220;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.12);
}

.page-today .ss-img{
  position:absolute;
  inset:0;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 900ms ease;
  will-change: opacity;
}
.page-today .ss-img.is-on{ opacity: 1; }

.page-today .ss-bar{
  position:absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255,255,255,.88);
  font-weight: 700;
}

.page-today .ss-caption{ font-size: 13px; opacity: .92; }

.page-today .ss-close{
  border:0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,.12);
  color:#fff;
  cursor:pointer;
}

.page-today .ss-link{
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  color:#fff;
  background:rgba(0,0,0,.25);
  backdrop-filter: blur(6px);
}
.page-today .ss-link:hover{ background:rgba(0,0,0,.35); }

@media (max-width: 760px){
  .page-today .ss-overlay{ padding: 10px; }
  .page-today .ss-stage{ width: min(1200px, 98vw); }
  .page-today .ss-frame{ border-radius: 14px; }
}

/* =========================================================
 * Video Modal (vid-*)  ✅ 최대폭 1200 + 중앙정렬
 * ========================================================= */
.page-today .vid-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
}
.page-today .vid-overlay.is-on{ display:flex; }

.page-today .vid-stage{
  width: min(1200px, 94vw);
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
}

.page-today .vid-card{
  width: 100%;
  background:#0b1220;
  border-radius:18px;
  padding:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
}

.page-today .vid-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.page-today .vid-title{
  color:#e5e7eb;
  font-weight:800;
}

.page-today .vid-close{
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.72);
  font-weight: 900;
  cursor:pointer;
  padding:8px 12px;
  border-radius: 999px;
}
@media (hover:hover){
  .page-today .vid-close:hover{
    background: rgba(255,255,255,.18);
    color:#fff;
    border-color: rgba(255,255,255,.26);
  }
}

.page-today .vid-card video{
  width: 100%;
  height: auto;
  display:block;
  background:#000;
  border-radius: 14px;
}

/* 하단 버튼(3개) 기본 */
.page-today .vid-actions{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

/* ✅ 버튼 톤다운(요청 반영) */
.page-today .vid-actions .tbtn{
  background: rgba(255,255,255,.10) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  color: rgba(255,255,255,.72) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
@media (hover:hover){
  .page-today .vid-actions .tbtn:hover{
    background: rgba(255,255,255,.18) !important;
    border-color: rgba(255,255,255,.26) !important;
    color: rgba(255,255,255,1) !important;
    transform: translateY(-1px);
  }
  .page-today .vid-actions .tbtn:active{ transform: translateY(0); }
}

/* 테블릿/모바일: “화면 꽉” 느낌 옵션 */
@media (max-width: 980px){
  .page-today .vid-overlay{ padding: 10px; }
  .page-today .vid-stage{ width: min(1200px, 98vw); }
  .page-today .vid-card{ border-radius: 14px; }

  /* ✅ 꽉 채우기 느낌(원치 않으면 아래 3줄 삭제하면 됨) */
  .page-today .vid-card video{
    height: calc(100vh - 120px);
    object-fit: cover;
  }
}

/* 모바일: 버튼 자동 숨김/탭 시 표시 (JS에서 .is-on 토글) */
@media (hover:none) and (pointer:coarse){
  .page-today .vid-actions{
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .page-today .vid-actions.is-on{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .page-today .vid-actions{ justify-content: center; }
  .page-today .vid-actions .tbtn{ flex: 1 1 auto; min-width: 0; }
}

@media (max-width: 480px){
  .page-today .vid-card video{
    height: calc(100vh - 100px);
  }
}

/* =========================================================
 * Layout width policy
 * - PC: 전체 래퍼 max 1440
 * - 모바일: 좌우 여백 최소화(화면 꽉)
 * ========================================================= */
@media (min-width: 1024px){
  .page-today .today-wrap{
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px){
  .page-today .today-wrap{
    padding-left: 6px;
    padding-right: 6px;
  }
  .page-today .card{ border-radius: 12px; }

  .page-today .vid-stage,
  .page-today .ss-stage{
    width: 100vw;
    max-width: 100vw;
  }

  .page-today .vid-card,
  .page-today .ss-frame{
    border-radius: 10px;
  }
}

/* =========================================================
 * Mobile Bottom Tab Bar (옵션)
 * ✅ 전역 오염 방지: .page-today 스코프로 한정
 * ========================================================= */
@media (max-width: 640px){
  .page-today .mobile-tabbar{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(15,23,42,.08);
    display: flex;
    justify-content: space-around;
    z-index: 3000;
  }

  .page-today .mobile-tabbar .tab{
    flex: 1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap: 4px;
    text-decoration:none;
    color: rgba(15,23,42,.55);
    font-size: 11px;
    font-weight: 700;
    min-height: 48px;
  }

  .page-today .mobile-tabbar .tab-icon{
    font-size: 22px;
    line-height: 1;
    opacity: .85;
  }

  .page-today .mobile-tabbar .tab.is-on{ color: #2563eb; }
  .page-today .mobile-tabbar .tab.is-on .tab-icon{ opacity: 1; }

  .page-today .mobile-tabbar .tab.more{
    background:none;
    border:0;
    cursor:pointer;
  }
}

