/* 案例內頁：Part 6.3 + floating CTA 延伸 */

.case-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 250, 245, 0.95);
  backdrop-filter: blur(10px);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--bg-warm);
}

.case-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-small);
}

.case-nav a {
  color: var(--cream-dark);
  text-decoration: none;
  letter-spacing: 0.1em;
}

.case-nav a:hover {
  color: var(--cream-deep);
}

.case-hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  max-height: 700px;
  overflow: hidden;
}

.case-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(45, 40, 35, 0.75) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-xl) 0;
  color: var(--text-white);
}

.case-hero-label {
  font-family: var(--font-english);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--cream-light);
  margin-bottom: var(--space-xs);
}

.case-hero-title {
  font-family: var(--font-heading);
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.case-info-bar {
  background: var(--bg-warm);
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--cream-light);
}

.case-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  text-align: center;
}

@media (min-width: 768px) {
  .case-info-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.case-info-label {
  font-family: var(--font-english);
  font-size: var(--text-caption);
  color: var(--text-light);
  letter-spacing: 0.25em;
  margin-bottom: 4px;
}

.case-info-value {
  font-size: var(--text-body);
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.case-gallery {
  padding: var(--space-2xl) 0;
  background: var(--bg-main);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1280px;
    margin: 0 auto;
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s;
  background: var(--bg-warm);
  aspect-ratio: 4 / 3;
}

.gallery-item.tall {
  aspect-ratio: 3 / 4;
}
.gallery-item.wide {
  aspect-ratio: 16 / 10;
}
.gallery-item.square {
  aspect-ratio: 1 / 1;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item:hover::after {
  content: "點擊放大";
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(45, 40, 35, 0.85);
  color: var(--text-white);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-caption);
  letter-spacing: 0.1em;
}

.case-notes {
  background: var(--bg-warm);
  padding: var(--space-2xl) 0;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .notes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.note-card {
  padding: var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--cream-deep);
}

.note-title {
  font-size: var(--text-h3);
  color: var(--text-main);
  margin-bottom: var(--space-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.note-body {
  font-size: var(--text-small);
  color: var(--text-medium);
  line-height: 1.9;
}

.case-navigator {
  background: var(--bg-main);
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--bg-warm);
}

.navigator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  max-width: 720px;
  margin: 0 auto;
}

.nav-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  background: var(--bg-warm);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.3s;
  text-align: center;
}

.nav-card:hover {
  background: var(--cream-light);
  transform: translateY(-4px);
}

.nav-card-label {
  font-family: var(--font-english);
  font-size: var(--text-caption);
  color: var(--text-light);
  letter-spacing: 0.25em;
  margin-bottom: var(--space-xs);
}

.nav-card-title {
  font-size: var(--text-body);
  color: var(--text-main);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 40, 35, 0.95);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-white);
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-counter {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-white);
  font-family: var(--font-number);
  font-size: var(--text-body);
  letter-spacing: 0.2em;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text-white);
  border-radius: var(--radius-full);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.lightbox-prev {
  left: 20px;
}
.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 640px) {
  .lightbox-prev,
  .lightbox-next {
    display: none;
  }
}

.case-page .floating-cta {
  z-index: 50;
}
