/* 案例展示页样式。
   来源：设计稿 caye-website(2026-08-20) case-studies.html 的第二个 style 块，
   从「Case Studies」分节起到文件末尾（含它自己的响应式规则）。
   本文件手工维护，不由 build_*_final_pages.py 生成 —— 生成器不碰它。
   只在 /about/case-studies.html 与 /en/about/case-studies.html 加载。 */

/* ===== Case Studies ===== */
/* 原型这里有一整段 `body.cases-page .nav {...}`：首屏之上导航透明、文字白，
   滚动后变白底黑字。骨架里的 `dark-hero` 主题本来就是这个行为（.nav 默认
   透明 + 白字，.nav.scrolled 转白底 #111），所以那段没有搬过来——多一套
   并行机制，将来改导航就得记得改两处。本页在视图里声明 pageTheme=dark-hero。 */

/* Hero */
    .cases-hero { position: relative; width: 100vw; height: 100vh; min-height: 640px; overflow: hidden; background: #111; }
    .cases-hero-media { position: absolute; inset: 0; }
    .cases-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .cases-hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.18) 45%, rgba(0,0,0,0.72) 100%); }
    .cases-hero-content { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 clamp(1rem, 1.5vw, 1.5rem) clamp(1.75rem, 3.5vw, 3rem); max-width: 1500px; width: 100%; margin: 0 auto; color: #fff; text-align: left; }
    .cases-hero-eyebrow { font-family: var(--font-sans); font-size: clamp(.78rem, 1vw, .9rem); letter-spacing: .28em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: .9rem; }
    .cases-hero-title { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 .9rem; color: #fff; white-space: nowrap; text-shadow: 0 2px 20px rgba(0,0,0,.4); }
    .cases-hero-sub { font-family: var(--font-sans); font-size: clamp(1rem, 1.4vw, 1.18rem); line-height: 1.6; margin: 0; color: rgba(255,255,255,0.92); white-space: nowrap; text-shadow: 0 1px 14px rgba(0,0,0,.45); }

    /* Cards grid */
    .cases-section { padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 10vw, 9rem); }
    .cases-section .container { max-width: 1900px; margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 4rem); }
    .cases-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 560px)); justify-content: center; gap: clamp(2.2rem, 4vw, 3.5rem) clamp(1.5rem, 2.4vw, 2.4rem); }

    /* Pagination (same style as news page) */
    .cs-pagination { max-width: 1900px; margin: 64px auto 0; display: flex; flex-direction: column; align-items: center; gap: 18px; }
    .cs-page-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
    .cs-page-btn { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; background: #ffffff; border: 1px solid rgba(0,0,0,0.15); border-radius: 0; font-family: inherit; font-size: 13px; font-weight: 500; color: #111111; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
    .cs-page-btn:hover:not(:disabled) { background: #111111; color: #ffffff; border-color: #111111; }
    .cs-page-btn.active { background: #111111; color: #ffffff; border-color: #111111; }
    .cs-page-btn:disabled { opacity: 0.35; cursor: not-allowed; }
    .cs-page-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; font-size: 13px; color: rgba(0,0,0,0.5); }
    .cs-page-info { font-size: 13px; font-weight: 500; color: rgba(0,0,0,0.55); }

    .cases-card { display: block; text-decoration: none; color: inherit; cursor: pointer; transition: transform .4s cubic-bezier(.25,.1,.25,1); }
    .cases-card:hover { transform: translateY(-4px); }
    .cases-card-image { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #f3f3f3; border-radius: 0; }
    .cases-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s cubic-bezier(.25,.1,.25,1); }
    .cases-card:hover .cases-card-image img { transform: scale(1.04); }
    .cases-card-meta { padding: 1.2rem 0 0; text-align: left; }
    .cases-card-type { font-family: var(--font-sans); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; font-weight: 500; }
    .cases-card-name { font-family: var(--font-sans); font-weight: 600; font-size: clamp(1.05rem, 1.4vw, 1.18rem); color: var(--text-primary); margin: 0; letter-spacing: -0.005em; }

    /* Lightbox (centered white card) */
    .cs-lightbox { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.5); padding: 24px; }
    .cs-lightbox.open { display: flex; }
    .cs-lightbox-card { position: relative; background: #fff; width: min(920px, 94vw); max-height: 90vh; box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
    .cs-lightbox-imgwrap { position: relative; background: #f3f3f3; display: flex; align-items: center; justify-content: center; }
    .cs-lightbox-img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
    .cs-lightbox-caption { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 22px 22px; }
    .cs-lightbox-caption-text { flex: 1; min-width: 0; }
    .cs-lightbox-type { font-family: var(--font-sans); font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; font-weight: 500; }
    .cs-lightbox-name { font-family: var(--font-sans); font-weight: 600; font-size: 1.05rem; color: #111; }
    .cs-lightbox-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border: 1px solid rgba(0,0,0,.18); background: rgba(255,255,255,.6); color: rgba(0,0,0,.7); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background .2s, color .2s, border-color .2s; backdrop-filter: blur(4px); }
    .cs-lightbox-close:hover { background: #fff; color: #000; border-color: rgba(0,0,0,.35); }
    .cs-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 56px; height: 84px; border: none; background: transparent; color: rgba(255,255,255,.82); font-size: 42px; font-weight: 300; line-height: 1; cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: color .2s; }
    .cs-lightbox-nav:hover { color: var(--accent); }
    .cs-lightbox-prev { left: 14px; }
    .cs-lightbox-next { right: 14px; }
    .cs-lightbox-counter { font-size: 13px; letter-spacing: .12em; color: rgba(0,0,0,.45); white-space: nowrap; }

    @media (max-width: 980px) {
      .cases-hero { height: 78vh; min-height: 520px; }
      .cases-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 640px) {
      .cases-hero { height: 70vh; min-height: 480px; }
      .cases-grid { grid-template-columns: 1fr; gap: 2rem; }
    }

/* ---------- 集成补充（原型之外） ---------- */

/* iOS Safari 用收起地址栏后的高度解析 100vh，首屏会比实际可见区域高一截，
   标题正好压在下边缘。100svh 才是首次绘制时的诚实高度；100vh 留在前面
   给不认识 svh 的旧引擎兜底。骨架里的 .hero 已这么处理，.cases-hero 是
   另一个类，得单独写一遍。 */
.cases-hero { height: 100vh; height: 100svh; }

/* 原型给标题和副标题写死了 nowrap。桌面端行得通（英文短、留白足），
   手机上中文标题会直接顶出屏幕——RC10 修过一整轮同类问题。
   ≤900px 允许折行，桌面端不变。 */
@media (max-width: 900px) {
    .cases-hero-title, .cases-hero-sub { white-space: normal; }
}

/* 类型标签留空时（后台还没填「连锁咖啡」这类分类）不占位，
   否则卡片标题上方会空出一行。 */
.cases-card-type:empty, .cs-lightbox-type:empty { display: none; }

/* 一条案例都没有时给一句话，而不是一片空白——内容初始化没跑或全被停用时
   这一页会走到这里。 */
.cases-empty { text-align: center; color: rgba(17,17,17,.55); font-size: 15px; padding: 40px 0; }


/* 分页按钮在设计稿里是 40×40，低于 44px 触控下限（mobile_audit.py 会报）。
   新闻列表的同款分页在 RC10 就按 ≤768px 提到 44px 了，这里跟同一条规矩，
   桌面端保持设计稿的 40px 不变。 */
@media (max-width: 768px) {
    .cs-page-btn, .cs-page-ellipsis { min-width: 44px; height: 44px; }
}
