/* ==========================================================================
   团子的成长日记 🍡 · print.css（纪念纪念版打印样式）
   视觉工程组
   —— 隐藏交互层 / 强制浅色高对比（浅色调色板复位见 base.css 末尾打印块） /
      展开筛选隐藏项 / 轮播平铺展开 / 分页控制
   说明：本文件零十六进制色值；正文黑用关键字 black，其余颜色全部 var()。
   ========================================================================== */

@media print {

  @page {
    margin: 12mm;
  }

  /* ---- 基底：白纸黑字，保留柔和底色由浏览器「背景图形」开关决定 ---- */
  html {
    scroll-behavior: auto;
    background: none;
  }

  body {
    background: white;
    color: black;                 /* 正文黑色确保打印清晰 */
    font-size: 11.5pt;
    line-height: 1.7;
    overflow: visible !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h1, h2, h3, h4, h5, h6,
  .hero-title, .section-title, .letter-body,
  .photo-caption, .tl-card p, .ms-detail {
    color: black;
  }

  a { text-decoration: none; }

  /* 全站去投影、去大圆角阴影，靠边框分层 */
  *, *::before, *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* ---- 隐藏交互层：导航 / FAB / 灯箱 / 进度条 / 筛选器等 ---- */
  .navbar,
  .nav-links,
  .nav-menu-btn,
  #scroll-progress,
  .scroll-progress,
  #fab-stack,
  .fab,
  #back-to-top,
  .back-to-top,
  #lightbox,
  .lb-stage,
  .lb-close, .lb-prev, .lb-next,
  #gallery-filters,
  .filter-btn,
  .carousel-btn,
  .carousel-dots,
  .skip-link,
  .scroll-hint,
  .hero-actions,          /* 分享/打印按钮在纸上无意义 */
  .footer-links,          /* 页脚动作链接同理 */
  .stars,                 /* 星点装饰不上纸 */
  .noscript-tip,
  .gallery-action {
    display: none !important;
  }

  /* ---- Hero：收起为页首名片 ---- */
  .hero {
    min-height: 0;
    padding: 0 0 18px;
    background: none;
    overflow: visible;
  }

  .hero::before,
  .hero::after,
  .hero-blob,
  .hero-blobs {
    display: none !important;   /* 云浪与漂移色块省墨 */
  }

  .avatar-wrap { animation: none; }
  .avatar-wrap::before { display: none; }
  .avatar {
    border-width: 4px;
    width: 108px;
    height: 108px;
    font-size: 52px;
    margin-inline: auto;
  }

  /* ---- 轮播：取消横向滚动，拍立得平铺成三列网格 ---- */
  .carousel-track {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    overflow: visible;
    scroll-snap-type: none;
    padding: 8px 0;
  }

  .carousel-slide {
    flex: 1 1 30%;
    min-width: 30%;
    min-height: 0;
    break-inside: avoid;
  }

  /* ---- 照片墙：展开所有筛选隐藏项 ---- */
  #gallery-grid .photo-card,
  #gallery-grid .photo-card[hidden],
  #gallery-grid .photo-card.hidden,
  #gallery-grid .photo-card.is-hidden,
  #gallery-grid .photo-card.filtered-out {
    display: block !important;
    animation: none !important;
  }

  .photo-frame { transform: none; break-inside: avoid; }

  /* ---- 时间线 / 里程碑 / 信箱：单列铺满、禁止卡片内断页 ---- */
  .timeline::before { left: 20px; transform: none; }

  .tl-item.left,
  .tl-item.right {
    left: 0;
    width: 100%;
    padding: 8px 4px 20px 60px;
    text-align: left;
    break-inside: avoid;
  }

  .tl-item.left .tl-dot,
  .tl-item.right .tl-dot { left: 0; right: auto; }

  .ms-card,
  .letter-card,
  .chart-card,
  .stat-chip,
  .summary-chip,
  .fam-card {
    break-inside: avoid;
    transform: none;
  }

  .chart-bars { height: 190px; }

  .bar-fill { transition: none; }   /* 直接以最终高度输出 */

  /* ---- 分区节奏与分页：重点章节各自起新页 ---- */
  .section {
    padding-block: 14px;
    break-inside: auto;
  }

  #timeline,
  #gallery,
  #milestones,
  #growth,
  #mailbox {
    break-before: page;
  }

  #home {
    break-after: avoid;
  }

  .section-header {
    margin-bottom: 16px;
    break-after: avoid;           /* 标题不孤悬页尾 */
  }

  /* ---- 页脚落款 ---- */
  .footer,
  .site-footer {
    padding: 40px 0 10px;
    background: none;
    border-top: 2px solid var(--line);
  }

  .footer::before,
  .footer::after,
  .site-footer::before,
  .site-footer::after {
    display: none;
  }

  .footer-copyright {
    color: var(--ink-2);
  }

  /* 锁定信件保持锁定语义，启封信完整呈现正文 */
  .letter-card.locked { filter: grayscale(.3); }
}
