/*
Tooplate 2117 Infinite Loop
https://www.tooplate.com/view/2117-infinite-loop

Work 页面专属样式（work.html）
公共部分（字体 / 基础 / 导航栏 / 公共响应式）见 css/common.css
*/

/* ========== 通用工具类 ========== */
.tm-font-big {
  font-size: 1.25rem;
}

/* ========== Hero ========== */
#home,
#infinite {
  background-color: #ffffff;
  height: 100vh;      /* 固定为正好一屏 */
  min-height: 100vh;
  overflow: hidden;   /* 内容超出时裁切，保证区块高度不被撑高 */
  position: relative;
}

@media (min-height: 600px) and (min-width: 1920px) {
  #home,
  #infinite {
    background-size: cover;
  }
}

@media (min-height: 830px) {
  #home,
  #infinite {
    background-position: center -210px;
  }
}

@media (min-height: 680px) and (max-height: 829px) {
  #home,
  #infinite {
    background-position: center -300px;
  }
}

@media (min-height: 500px) and (max-height: 679px) {
  #home,
  #infinite {
    background-position: center -400px;
  }
}

@media (max-height: 499px) {
  #home,
  #infinite {
    background-position: center -450px;
  }
}

.tm-hero-text-container {
  width: 100%;
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 68px;   /* 避免文案被固定导航栏遮挡 */
  padding-bottom: 16px;
}

.tm-hero-text-container-inner {
  text-align: left;
}

.tm-hero-title {
  font-family: "DINPro Bold", "Inter Medium", "Raleway", sans-serif;
  font-size: 8rem;
  color: #000000;
}

.tm-hero-subtitle {
  font-size: 1.125rem;
  color: #000000;
  line-height: 1.35;
}

/* 左上角分类目录（文字取自 img/examples 下的目录名），上下排列。
   左缘与下方轮播首图左缘对齐：轮播首图左缘 = 容器内容左缘 + .tm-gallery-item 的
   margin-left(20px)，所以这里用同样的 20px 左边距；字体与行高沿用原左上角文案 */
.tm-cat-list {
  margin: 0 0 1rem 20px;
  padding: 0;
  list-style: none;
  font-size: 1.125rem;
  color: #000000;
  line-height: 1.35;
}

/* 左上角分类目录按钮：点选切换；
   默认颜色见正文（继承 .tm-cat-list 的 #000），未选中 #707070，选中 #000 */
.tm-cat-list .tm-cat-link {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: #707070; /* 未选中：灰色 */
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

/* 鼠标划过：浅灰底（沿用导航 hover 的 #f0f0f0，保持整站一致） */
.tm-cat-list .tm-cat-link:hover {
  background-color: #f0f0f0;
}

/* 鼠标点中后去掉浏览器/系统自带的黑色焦点框：
   选中态已用「黑 vs 灰」颜色区分，无需再画外框 */
.tm-cat-list .tm-cat-link:focus,
.tm-cat-list .tm-cat-link:active {
  outline: none;
  box-shadow: none;
}

.tm-cat-list .tm-cat-link.is-active {
  color: #000000; /* 选中：黑色 */
}

@media (max-height: 480px) {
  .tm-hero-text-container {
    padding-top: 90px;
    padding-bottom: 0;
  }
}

/* ========== 轮播与图片动效 / Gallery ========== */
.tm-section-desc {
  max-width: 650px;
  width: 100%;
  font-size: 0.9rem;
}

.tm-gallery-container {
  padding-top: 0;
  padding-bottom: 40px;
}

.tm-gallery-item {
  margin: 0 20px;
}

.tm-gallery-item img {
  width: 100%;
  max-height: calc(100vh - 375px); /* 高度随视口自适应，保证一屏内放得下轮播 */
  object-fit: cover;               /* 高度受限时按比例裁切，铺满不拉伸 */
}

/* 分类筛选后的封面：固定四列，项目不足一行时从左侧开始排列。 */
#infinite .tm-gallery.tm-gallery--grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

#infinite .tm-gallery--grid > a {
  display: block;
  min-width: 0;
}

#infinite .tm-gallery--grid .tm-gallery-item {
  float: none;
  width: 100%;
  margin: 0;
}

#infinite .tm-gallery--grid .tm-gallery-item img {
  max-height: none;
  height: auto;
  object-fit: contain;
}

/* 网格可能包含多行，允许页面向下滚动查看完整内容。 */
#infinite.has-gallery-grid {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

/* 左上角分类目录尽量上移，贴近固定导航栏下沿（导航栏高 56px，见 css/common.css）。
   只作用于 Work 页；上移的 12px 由下面轮播留白补回，图片位置不受影响 */
#infinite .tm-hero-text-container {
  padding-top: 56px;
}

/* Work 页轮播与首页严格对齐（首页对应规则见 home.css：
   #home .tm-container-gallery / #home .tm-gallery-item img）：
   1) 轮播上方留白 —— 首页 74px，加上文案上移的 12px（补偿上面 padding-top 56px），
      再扣掉左上角分类目录（含 All 共 5 行）比首页「两行文案」多出的高度
      （多 3 行 × 1.125rem × 1.35 = 4.55625rem），
      这样左上角文字上移后，图片 top / bottom 仍与首页完全一致；
   2) 图片高度上限 calc(100vh - 415px) —— 与首页相同，保证图片 bottom 一致。
   两条规则都用 #infinite 限定，只作用于 Work 页，不会影响首页 */
#infinite .tm-container-gallery {
  padding-top: calc(86px - 4.55625rem);
}

#infinite .tm-gallery-item img {
  max-height: calc(100vh - 415px);
}

.slick-dots {
  bottom: -65px;
}

.slick-dots li {
  margin: 0 13px;
}

.slick-dots li button:hover:before,
.slick-dots li button:focus:before,
.slick-dots li.slick-active button:before {
  opacity: 1;
  color: #3ba0dd;
}

.slick-dots li button:before {
  font-size: 18px;
}

.tm-container-gallery {
  padding-top: 24px;
}

.tm-hero-title-gallery {
  text-align: left;
  line-height: 0.95;
  margin-bottom: 0;
}

/* Hover Effect */
/* Common style */
.grid figure {
  position: relative;
  float: left;
  overflow: hidden;
  background: #3085a3;
  text-align: center;
  cursor: pointer;
}

.grid figure img {
  position: relative;
  display: block;
  min-height: 100%;
  max-width: 100%;
  opacity: 0.8;
}

.grid figure figcaption {
  padding: 2em;
  color: #fff;
  text-transform: uppercase;
  font-size: 1.25em;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.grid figure figcaption::before,
.grid figure figcaption::after {
  pointer-events: none;
}

.grid figure figcaption,
.grid figure figcaption > a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.grid figure figcaption > a {
  z-index: 1000;
  text-indent: 200%;
  white-space: nowrap;
  font-size: 0;
  opacity: 0;
}

.grid figure h2 {
  word-spacing: -0.15em;
  font-size: 0.9em;
  font-weight: 300;
}

.grid figure h2 span {
  font-weight: 600;
}

.grid figure h2,
.grid figure p {
  margin: 0;
}

.grid figure p {
  letter-spacing: 1px;
  font-size: 68.5%;
}

/*---------------*/
/***** Honey *****/
/*---------------*/
figure.effect-honey {
  background: #4a3753;
  max-width: none;
}

figure.effect-honey img {
  opacity: 1;
  -webkit-transition: opacity 0.35s;
  transition: opacity 0.35s;
}

figure.effect-honey:hover img {
  opacity: 0.4;
}

figure.effect-honey figcaption::before {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
  background: #38C;
  content: "";
  -webkit-transform: translate3d(0, 10px, 0);
  transform: translate3d(0, 10px, 0);
}

figure.effect-honey h2 {
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 1em 1.5em;
  width: 100%;
  text-align: left;
  -webkit-transform: translate3d(0, -30px, 0);
  transform: translate3d(0, -30px, 0);
}

figure.effect-honey h2 i {
  font-style: normal;
  opacity: 0;
  -webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
  transition: opacity 0.35s, transform 0.35s;
  -webkit-transform: translate3d(0, -30px, 0);
  transform: translate3d(0, -30px, 0);
}

figure.effect-honey figcaption::before,
figure.effect-honey h2 {
  -webkit-transition: -webkit-transform 0.35s;
  transition: transform 0.35s;
}

figure.effect-honey:hover figcaption::before,
figure.effect-honey:hover h2,
figure.effect-honey:hover h2 i {
  opacity: 1;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

/* ========== Work 专属 / Work ========== */
/* Work 区：BIGFISH 图片移除后，用同尺寸占位块保留原有空间 */
.tm-hero-logo-placeholder {
  width: 640px;
  max-width: 100%;
  aspect-ratio: 3000 / 644; /* 与原图 3000x644 同比例，高度随宽度自适应 */
  margin-bottom: 20px;
}

/* 图片放大浏览层需高于 Bootstrap modal */
.mfp-wrap {
  z-index: 2100;
}
.mfp-bg {
  z-index: 2090;
}

/* 案例弹框标题 Tab 选中态 */
#lightbox-cases .modal-header {
  flex-wrap: wrap;
}
#lightbox-cases .nav-tabs {
  border-bottom: none;
}
#lightbox-cases .nav-tabs .nav-link {
  color: #000000;
  border: none;
  padding: 0.5rem 1.2rem;
}
#lightbox-cases .nav-tabs .nav-link:hover,
#lightbox-cases .nav-tabs .nav-link:focus {
  color: #3496d8;
  border: none;
}
#lightbox-cases .nav-tabs .nav-link.active {
  color: #3496d8;
  border: none;
  border-bottom: 2px solid #3496d8;
  background: transparent;
}

/* 案例弹框：宽度按屏幕高度推算，使封面最多 2 行、每行最多 5 张且正好铺满视口、无需滚动 */
#lightbox-cases .modal-dialog {
  width: min(calc(100vh * 1.875 - 240px), 92vw);
  max-width: min(calc(100vh * 1.875 - 240px), 92vw);
  margin: 0.5rem auto;
}

#lightbox-cases .modal-body {
  padding: 0.25rem 0.75rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
}

#lightbox-cases .modal-body .tab-pane .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
}

/* 每行最多 5 格：9 张图即为 5+4 两行 */
#lightbox-cases .modal-body .tab-pane .col-6,
#lightbox-cases .modal-body .tab-pane .col-md-4 {
  flex: 0 0 calc((100% - 3rem) / 5);
  max-width: calc((100% - 3rem) / 5);
  padding: 0;
  margin: 0;
}

/* 弹框封面提示可点击放大 */
#lightbox-cases .tab-pane img {
  cursor: zoom-in;
}

/* 每格封面 3:4 竖版（宽:高 = 3:4），宽度随列宽自适应 */
#lightbox-cases .modal-body .tab-pane img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
  background-color: #f0f0f0;
}

@media (max-width: 767.98px) {
  #lightbox-cases .modal-dialog {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  /* 小屏改两列，图片更大更易读 */
  #lightbox-cases .modal-body .tab-pane .col-6,
  #lightbox-cases .modal-body .tab-pane .col-md-4 {
    flex-basis: calc((100% - 0.75rem) / 2);
    max-width: calc((100% - 0.75rem) / 2);
  }
}

/* ===== 案例大图查看器：点击弹框封面后浏览同目录（不含 cover）图片 ===== */
#case-viewer {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 3000; /* 高于 Bootstrap modal(1050) */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s;
}

#case-viewer.is-open {
  visibility: visible;
  opacity: 1;
}

.case-viewer-bg {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.93);
  cursor: zoom-out;
}

.case-viewer-body {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 96px;
}

.case-viewer-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
}

.case-viewer-meta {
  margin-top: 14px;
  color: #ccc;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.case-viewer-project {
  color: #fff;
  font-size: 0.95rem;
}

.case-viewer-type {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ddd;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 2px 10px;
}

.case-viewer-close {
  position: absolute;
  top: 10px;
  right: 22px;
  z-index: 3;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.case-viewer-close:hover {
  opacity: 1;
}

.case-viewer-nav {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.case-viewer-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.case-viewer-prev {
  left: 26px;
}

.case-viewer-next {
  right: 26px;
}

@media (max-width: 767.98px) {
  .case-viewer-body {
    padding: 60px 46px;
  }
  .case-viewer-img {
    max-height: calc(100vh - 220px);
  }
  .case-viewer-prev {
    left: 8px;
  }
  .case-viewer-next {
    right: 8px;
  }
}

/* ========== 响应式 / Responsive ========== */
@media (min-width: 1200px) {
  .tm-container-gallery {
    max-width: calc(100% - 130px);
  }

  .tm-hero-text-container {
    max-width: calc(100% - 130px);
  }
}

@media (max-width: 480px) {
  .tm-gallery-container {
    max-width: 220px;
    margin-left: auto;
    margin-right: auto;
  }

  .slick-dots li {
    margin: 0 8px;
  }

  .tm-gallery-item {
    margin: 0;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  #infinite .tm-gallery.tm-gallery--grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #infinite .tm-gallery.tm-gallery--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  #infinite .tm-gallery.tm-gallery--grid {
    grid-template-columns: 1fr;
  }
}
