:root {
  --primary: #1e3a8a;
  --accent: #f97316;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
}

body {
  font-family: "Noto Sans TC", "Inter", sans-serif;
  color: var(--text-dark);
  background: #ffffff;
}

.hero-logo {
  width: 100%;
  height: 320px;
  background: url("/static/images/logo.jpg") center/contain no-repeat;
  background-color: #ffffff; /* Fallback color if logo has transparency or doesn't fill area */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hero-logo.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

.navbar {
  background: #e3f2fd;
  transition: all 0.3s ease;
}

.navbar.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar .btn-primary {
  background: var(--accent);
  border: none;
}

.page-wrapper {
  padding-top: 0;
}

.hero-section {
  padding: 80px 0;
  background: var(--bg-light);
}

.hero-content h1 {
  font-size: 42px;
  font-weight: 700;
}

.section {
  padding: 24px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 24px;
}

.category-card,
.case-card,
.about-card,
.contact-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  height: 100%;
}

.category-card {
  text-align: center;
}

.category-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.case-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

.case-card__body {
  padding-top: 12px;
}

.case-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.case-card:hover {
  transform: translateY(-4px);
  transition: transform 0.3s ease;
}

.text-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  color: var(--accent);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  justify-content: center;
}

@media (max-width: 767px) {
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 8px; /* For scrollbar */
    -webkit-overflow-scrolling: touch;
  }
  
  .filter-bar::-webkit-scrollbar {
    height: 4px;
  }
  
  .filter-bar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }

  .filter-label {
    display: none; /* Provide more space for buttons */
  }

  .filter-btn, .tag-btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

.filter-panel {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-group {
  flex: 1 1 240px;
}

.filter-label {
  font-weight: 600;
  color: var(--text-muted);
  align-self: center;
}

.pagination {
  margin-top: 32px;
}

.breadcrumb {
  margin-bottom: 12px;
}

.result-count {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 14px;
}

.case-gallery img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
}

.case-gallery__main {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-light);
  border-radius: 12px;
  margin-bottom: 0;
}

.case-gallery__main-button {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 12px;
  line-height: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.case-gallery__main-button:focus {
  outline: none;
}

.case-gallery__main-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.3);
}

.case-gallery__main-wrapper {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.gallery-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
}

.gallery-control.prev {
  left: 12px;
}

.gallery-control.next {
  right: 12px;
}

.case-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.case-gallery__thumbs img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0;
}

.thumb-button {
  display: block;
  width: 100%;
  border: 2px solid transparent;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
}

.thumb-button.active {
  border-color: var(--accent);
}

.pswp__img {
  object-fit: contain;
}

.case-specs {
  background: var(--bg-light);
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
}

.case-specs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.case-specs li {
  margin-bottom: 6px;
  color: var(--text-dark);
}

.case-tags span {
  display: inline-block;
  background: var(--bg-light);
  padding: 6px 10px;
  border-radius: 999px;
  margin-right: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.case-card__tags span {
  display: inline-block;
  background: var(--bg-light);
  padding: 4px 10px;
  border-radius: 999px;
  margin-right: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer {
  background: var(--bg-light);
  padding: 40px 0 20px;
  color: var(--text-muted);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 16px;
  text-align: center;
}

.sticky-contact {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #ffffff;
  border-top: 1px solid var(--border);
  z-index: 1000;
}

.sticky-contact__item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}
