/* Campus TV — ewctv.org */

:root {
  --bg: #0d0f14;
  --surface: #161a22;
  --border: #2a3140;
  --text: #e8eaef;
  --text-muted: #8b92a3;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --radius: 12px;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-sans-zh: "Noto Sans TC", "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-wide {
  max-width: 900px;
}

.container-full {
  max-width: 1200px;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.lang-btn {
  padding: 0.35rem 0.6rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.lang-btn:first-child {
  border-radius: 6px 0 0 6px;
  border-right-width: 0;
}

.lang-btn:last-child {
  border-radius: 0 6px 6px 0;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active,
.lang-btn[aria-pressed="true"] {
  color: var(--text);
  background: var(--surface);
  border-color: var(--accent);
}

body.lang-zh {
  font-family: var(--font-sans-zh);
}

/* Language toggle: show only active language */
body.lang-en .lang-zh {
  display: none !important;
}

body.lang-zh .lang-en {
  display: none !important;
}

body.lang-zh .lang-zh {
  display: inline !important;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header .nav {
  display: flex;
  gap: 1.5rem;
}

.site-header .nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.site-header .nav a:hover {
  color: var(--text);
}

.header-ig {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.header-ig:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-with-photo {
  padding: 0 0 3rem;
  position: relative;
}

.hero-photo-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 42vh;
  overflow: hidden;
  background: var(--surface);
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-with-photo .hero-content {
  padding-top: 2rem;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-tagline {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  color: var(--text-muted);
}

.hero-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 2.5rem 0;
}

.section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.section p,
.section-desc {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.section-desc {
  margin-bottom: 1.25rem;
}

/* Tools */
.tools {
  padding-bottom: 4rem;
}

.tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tool-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
}

.tool-link:hover {
  background: rgba(255, 255, 255, 0.03);
}

.tool-card:has(.tool-link:hover) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.tool-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tool-title {
  font-weight: 600;
  font-size: 1rem;
}

.tool-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: auto;
  margin-right: 0.5rem;
}

.tool-arrow {
  color: var(--accent);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-placeholder {
  padding: 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0.7;
}

.tool-placeholder .tool-desc {
  margin-left: auto;
  margin-right: 0;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* Team / members — gallery style (20–40 members) */
.team-section {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.team-section .container-full {
  margin-left: auto;
  margin-right: auto;
}

.team-intro {
  margin: 0 auto 1.5rem;
  max-width: 36em;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.member-gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.member-tile {
  text-align: center;
}

.member-tile .member-photo {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.member-tile .member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Random / fun pics & videos */
.fun-section {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.fun-section .container-full {
  margin-left: auto;
  margin-right: auto;
}

.fun-desc {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* 左右滑動 horizontal scroll — 容納更多相 */
.fun-row {
  position: relative;
  margin: 0 -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.fun-row + .fun-row {
  margin-top: 0.75rem;
}

.fun-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  scroll-behavior: smooth;
}

.fun-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* 左右邊緣 fade out */
.fun-row::before,
.fun-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  z-index: 2;
  pointer-events: none;
}

.fun-row::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), rgba(13, 15, 20, 0));
}

.fun-row::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), rgba(13, 15, 20, 0));
}

.fun-scroll .fun-item {
  flex: 0 0 auto;
  width: 200px;
  min-width: 200px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  scroll-snap-align: start;
}

.fun-scroll .fun-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-ig {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-ig:hover {
  color: var(--text);
}

/* Responsive */
@media (max-width: 1100px) {
  .member-gallery {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 900px) {
  .member-gallery {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  .member-gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

}

@media (max-width: 520px) {
  .member-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .fun-scroll .fun-item {
    width: 160px;
    min-width: 160px;
  }

  .tool-link,
  .tool-placeholder {
    flex-wrap: wrap;
  }

  .tool-desc {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.25rem;
    padding-left: 2.5rem;
  }

  .tool-placeholder .tool-desc {
    padding-left: 2.5rem;
  }
}
