﻿/* ══════════════════════════════════════════════════════════════
   交大動畫社 — Shared Stylesheet
   所有頁面共用的樣式，從 index.html 抽取統一管理
   ══════════════════════════════════════════════════════════════ */

/* ── Global Reset ── */
* { border-radius: 0 !important; }
html { scroll-behavior: smooth; }
/* 移除 font-feature-settings: 'palt' 以避免全形標點符號被壓縮成半形寬度 */

/* ── Circular avatar override ── */
.avatar-circle { border-radius: 50% !important; }

/* ── Gallery cell ── */
.gallery-item { position: relative; overflow: hidden; cursor: pointer; transition: box-shadow 0.5s ease; }
.gallery-item img {
  filter: none;
  transition: transform 0.5s ease;
}
.gallery-item:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  z-index: 1;
}
.gallery-item:hover img {
  transform: scale(1.08);
}
/* Zoom icon on hover */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.92);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23C41E3A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></svg>');
  background-size: 28px 28px;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}
.gallery-item:hover::after { opacity: 1; }

/* ── Lightbox modal ── */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-backdrop.active { opacity: 1; pointer-events: auto; }
.lightbox-card {
  position: relative;
  background: #fff;
  max-width: 900px; width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}
html.dark .lightbox-card { background: #1a1a1a; }
.lightbox-card img {
  display: block; width: 100%; height: auto;
}
.lightbox-info {
  padding: 1.5rem 2rem 2rem;
}
.lightbox-title {
  font-size: 1.25rem; font-weight: 700;
  color: #1A1A1A;
}
html.dark .lightbox-title { color: #E5E5E5; }
.lightbox-date {
  font-size: 0.75rem; color: #999;
  margin-top: 0.25rem;
  font-family: 'Inter', sans-serif;
}
.lightbox-desc {
  font-size: 0.875rem; color: rgba(26,26,26,0.55);
  line-height: 1.85; margin-top: 0.75rem;
}
html.dark .lightbox-desc { color: rgba(229,229,229,0.55); }
.lightbox-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: rgba(0,0,0,0.5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; cursor: pointer;
  transition: background 0.2s ease;
  z-index: 1; border: none; line-height: 1;
}
.lightbox-close:hover { background: rgba(0,0,0,0.75); }

/* ── Button: outline → fill ── */
.btn-fill {
  position: relative; overflow: hidden; z-index: 1;
  border: 2px solid #C41E3A; color: #C41E3A;
  transition: color 0.35s ease;
}
.btn-fill::before {
  content: ''; position: absolute; inset: 0;
  background: #C41E3A; z-index: -1;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.btn-fill:hover::before { transform: scaleX(1); }
.btn-fill:hover { color: #fff; }

/* ── Nav link underline ── */
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute;
  bottom: -2px; left: 0; width: 0; height: 2px;
  background: #C41E3A; transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link.active::after { width: 100%; }

/* ── Join-step connector ── */
.step-line { position: relative; }
.step-line::before {
  content: ''; position: absolute;
  left: 15px; top: 36px; bottom: -12px;
  width: 1px; background: rgba(255,255,255,0.2);
}
.step-line:last-child::before { display: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F9F9F9; }
::-webkit-scrollbar-thumb { background: #ccc; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* ══════════════════════════════════════════════════════════════
   Dark Mode
   ══════════════════════════════════════════════════════════════ */
html.dark { color-scheme: dark; }

/* Backgrounds */
html.dark .bg-white { background-color: #111 !important; }
html.dark .bg-off-white { background-color: #181818 !important; }
html.dark .bg-white\/95 { background-color: rgba(17,17,17,0.95) !important; }

/* Text */
html.dark .text-dark { color: #E5E5E5 !important; }
html.dark .text-dark\/70 { color: rgba(229,229,229,0.7) !important; }
html.dark .text-dark\/55 { color: rgba(229,229,229,0.55) !important; }
html.dark .text-dark\/40 { color: rgba(229,229,229,0.4) !important; }
html.dark .text-dark\/\[0\.04\] { color: rgba(255,255,255,0.04) !important; }
html.dark .text-mid { color: #999 !important; }

/* Borders */
html.dark .border-gray-200 { border-color: rgba(255,255,255,0.08) !important; }
html.dark .border-gray-100 { border-color: rgba(255,255,255,0.06) !important; }
html.dark .border-dark\/10 { border-color: rgba(255,255,255,0.08) !important; }
html.dark .border-b-dark\/10 { border-bottom-color: rgba(255,255,255,0.08) !important; }
html.dark .md\:border-r-dark\/10 { border-right-color: rgba(255,255,255,0.08) !important; }

/* Gallery grid gap simulation */
html.dark .bg-dark\/10 { background-color: rgba(255,255,255,0.08) !important; }

/* Mobile menu */
html.dark #mobileMenu { background-color: #111 !important; border-color: rgba(255,255,255,0.06) !important; }
html.dark #ml1, html.dark #ml2, html.dark #ml3 { background-color: #E5E5E5 !important; }

/* Officer avatar border */
html.dark .avatar-circle { border-color: rgba(255,255,255,0.1) !important; }

/* Map iframe in dark mode */
html.dark #contact iframe { filter: invert(0.9) hue-rotate(180deg); }

/* Dark scrollbar */
html.dark ::-webkit-scrollbar-track { background: #111; }
html.dark ::-webkit-scrollbar-thumb { background: #444; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #666; }

/* Theme toggle hover */
.theme-toggle { cursor: pointer; }

/* Dark mode: make toggle button more visible */
html.dark .theme-toggle { color: rgba(229,229,229,0.7) !important; }
html.dark .theme-toggle:hover { color: rgba(229,229,229,1) !important; }

/* ══════════════════════════════════════════════════════════════
   Sub-page specific: page header banner
   ══════════════════════════════════════════════════════════════ */
.page-hero {
  padding-top: 4rem; /* account for fixed nav */
}
