/* ==========================================================================
   大溪國中紀念網站 - Base Styles (Global)
   ========================================================================== */

/* --- Font Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;700&family=Outfit:wght@400;700&display=swap');

/* --- CSS Variables (Base setup, overridden by themes) --- */
:root {
  --font-primary: 'Inter', 'Noto Sans TC', sans-serif;
  --font-secondary: 'Outfit', sans-serif;
  --bg-color: #ffffff;
  --text-main: #333333;
  --text-muted: #666666;
  --primary-color: #1a1a1a;
  --accent-color: #d4af37; /* Default accent (gold) */
  --card-bg: #f5f5f5;
  --border-color: #e0e0e0;
  --header-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #111111;
  --footer-text: #cccccc;
}

/* --- Resets --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-primary);
  background: var(--bg-gradient, var(--bg-color));
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.5s ease, color 0.5s ease;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header & Navigation --- */
header {
  position: sticky;
  top: 0;
  width: 100%;
  background: var(--header-bg, rgba(255, 255, 255, 0.7));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  z-index: 100;
  transition: all 0.5s ease;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo a {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo span.en {
  font-family: var(--font-secondary);
  font-size: 1rem;
  color: var(--accent-color);
  font-weight: 400;
}

.nav-menu {
  display: flex;
  gap: 30px;
}

.nav-menu a {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
  position: relative;
  padding: 5px 0;
  transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent-color);
}

.nav-menu a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

/* Theme Switcher */
.theme-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  padding: 8px 15px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.theme-controls::before {
  content: '風格切換:';
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-muted);
}

.theme-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.theme-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.theme-btn[data-theme="sepia"] { background: #f4ecd8; border-color: #cbbba0; }
.theme-btn[data-theme="brick"] { background: #e86a58; border-color: #ab4639; }
.theme-btn[data-theme="chalkboard"] { background: #26362b; border-color: #fce774; }
.theme-btn[data-theme="sky-grass"] { background: #e0f2fe; border-color: #16a34a; }
.theme-btn[data-theme="cloudy-blue"] { background: #f0f9ff; border-color: #38bdf8; }

.theme-btn.active {
  border-color: var(--accent-color) !important;
  transform: scale(1.15);
  box-shadow: 0 0 15px var(--accent-color);
}

/* --- Hero Section --- */
.hero {
  height: 70vh;
  min-height: 500px;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  animation: fadeInDown 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 50px 60px;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hero h1 {
  font-size: 4rem;
  letter-spacing: 6px;
  margin-bottom: 25px;
  text-shadow: 0 4px 15px rgba(0,0,0,0.8);
  font-weight: 700;
}

.hero p {
  font-size: 1.3rem;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  font-weight: 400;
}

/* --- Section Styling --- */
section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 50px;
  position: relative;
  color: var(--primary-color);
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
  margin: 20px auto 0;
}

/* --- Cards (Categories) --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid var(--border-color);
  text-align: center;
  padding-bottom: 25px;
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: var(--accent-color);
}

.card-icon {
  height: 150px;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 4rem;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.card p {
  color: var(--text-muted);
  padding: 0 20px 20px;
}

.btn {
  display: inline-block;
  padding: 10px 25px;
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--accent-color);
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.card:hover .btn, .btn:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

/* --- Footer --- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 40px 0;
  text-align: center;
  border-top: 3px solid var(--accent-color);
}

/* --- Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-menu { display: none; } /* Add hamburger later if needed */
  .hero h1 { font-size: 2.5rem; }
}
