/* Import all CSS files */
@import url('blog.css');
@import url('contact.css');
@import url('costumes.css');
@import url('events.css');
@import url('gallery.css');
@import url('history.css');
@import url('home.css');
@import url('legal.css');
@import url('links.css');
@import url('movies.css');
@import url('playlist.css');
@import url('post.css');
@import url('traditions.css');

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Merriweather:wght@400;700&display=swap');

/* Global Halloween theme */
:root {
  /* Colors */
  --bg: #0a0a0a;
  /* deep black */
  --bg-alt: #111016;
  --text: #f8f0e0;
  /* bone white */
  --muted: #cbbfa9;
  --accent: #ff7518;
  /* pumpkin orange */
  --blood: #8b0000;
  /* blood red */
  --violet: #4a004a;
  /* dark purple */
  --ghoul: #004d00;
  /* eerie green */
  --ghost: #8ef6ff;
  /* highlight used in links */
  --card: #1a1714;
  --border: #2a2130;
  --glow: 0 0 24px rgba(255, 117, 24, 0.35);

  /* Typography */
  --font-display: 'Creepster', system-ui, -apple-system;
  --font-body: 'Merriweather', Georgia, 'Times New Roman', serif;

  /* Effects */
  --glass: rgba(10, 10, 10, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background:
    /* torn edge vignette */
    radial-gradient(1600px 800px at 0% -10%, rgba(139, 0, 0, 0.18), transparent 60%),
    radial-gradient(1200px 600px at 120% 0%, rgba(74, 0, 74, 0.18), transparent 60%),
    linear-gradient(180deg, #0a0a0a, #0a0a0a 40%, #111016);
}

/* subtle spider web pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 10% 15%, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px),
    radial-gradient(circle at 20% 35%, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px);
  background-size: 140px 140px, 180px 180px, 220px 220px;
  mix-blend-mode: overlay;
  filter: blur(.1px);
}

/* floating dust/ghost particles */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(3px 3px at 20% 30%, rgba(255, 255, 255, 0.08), transparent),
    radial-gradient(2px 2px at 60% 20%, rgba(255, 255, 255, 0.06), transparent),
    radial-gradient(2px 2px at 80% 70%, rgba(255, 255, 255, 0.05), transparent);
  animation: floatDust 30s linear infinite;
}

@keyframes floatDust {
  0% {
    transform: translateY(0);
    opacity: .9;
  }

  50% {
    transform: translateY(-20px);
    opacity: .7;
  }

  100% {
    transform: translateY(0);
    opacity: .9;
  }
}

a {
  color: var(--ghost);
  text-decoration: none;
  position: relative;
}

a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width .25s ease, left .25s ease;
}

a:hover::after {
  left: 0;
  width: 100%;
}

a:hover {
  color: #c1fbff;
  text-shadow: 0 0 10px rgba(142, 246, 255, 0.5);
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* Glassy header with bat accent */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: var(--glass);
  border-bottom: 1px solid var(--glass-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

/* Ensure proper spacing in mobile */
.nav > * {
  margin: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  font-family: var(--font-display);
  color: var(--accent);
  text-shadow: 0 0 12px rgba(255, 117, 24, 0.35);
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent) 0%, #ff9a4b 40%, #5a2400 60%);
  box-shadow: 0 0 0 2px #2a1a0f, var(--glow);
}

.brand::after {
  content: "🦇";
  margin-left: 8px;
  filter: drop-shadow(0 0 4px rgba(255, 117, 24, .5));
  animation: batBlink 6s ease-in-out infinite;
}

@keyframes batBlink {

  0%,
  96%,
  100% {
    opacity: 1
  }

  97% {
    opacity: .3
  }

  98% {
    opacity: 1
  }

  99% {
    opacity: .3
  }
}

/* Mobile menu toggle button */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 24px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  z-index: 101;
}

.menu-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(255, 117, 24, 0.25);
  transform: scale(1.05);
}

.menu-toggle:focus {
  outline: 2px dashed var(--ghost);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Desktop menu */
.menu {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
    align-items: center;
    position: relative;
  }
  
  .menu-toggle {
    display: block !important;
    order: 3;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid var(--accent);
    border-radius: 12px;
    color: var(--accent);
    font-size: 28px;
    transition: all 0.2s ease;
    cursor: pointer;
  }
  
  .menu-toggle:hover {
    background: rgba(255, 117, 24, 0.2);
    box-shadow: 0 0 20px rgba(255, 117, 24, 0.5);
    transform: scale(1.05);
  }
  
  .menu-toggle:active {
    transform: scale(0.95);
  }
  
  /* 重新设计移动端菜单，确保显示所有链接 */
  .menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    z-index: 999;
    display: none;
    padding: 20px;
    box-sizing: border-box;
  }
  
  .menu.open {
    display: block;
  }
  
  /* 导航链接容器 - 确保所有链接都能显示 */
  .menu > div {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 100%;
    overflow-y: auto;
    padding: 10px;
  }
  
  /* 导航链接样式 */
  .menu a {
    display: block;
    padding: 15px 20px;
    font-size: 16px;
    color: #fff;
    background: rgba(255, 117, 24, 0.1);
    border: 1px solid rgba(255, 117, 24, 0.3);
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s ease;
  }
  
  .menu a.active {
    color: #ff7518;
    background: rgba(255, 117, 24, 0.2);
    border-color: #ff7518;
    font-weight: 600;
  }
  
  .menu a:hover,
  .menu a:focus {
    color: #ff7518;
    border-color: #ff7518;
    background: rgba(255, 117, 24, 0.15);
  }
  
  /* 优化滚动条样式 */
  .menu > div::-webkit-scrollbar {
    width: 6px;
  }
  
  .menu > div::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
  }
  
  .menu > div::-webkit-scrollbar-thumb {
    background: #ff7518;
    border-radius: 3px;
  }
}

/* Desktop menu styles - outside media query */
@media (min-width: 769px) {
  .menu {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
  }
  
  .menu a {
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  }
  
  .menu a:hover {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(255, 117, 24, 0.25);
    transform: translateY(-1px);
  }
  
  .menu a:active,
  .menu a:focus {
    border-color: rgba(255, 117, 24, 0.45);
    background: rgba(255, 117, 24, 0.08);
    box-shadow: 0 0 18px rgba(255, 117, 24, 0.35);
    outline: none;
  }
  
  .menu a.active {
    border-color: var(--accent);
    background: rgba(255, 117, 24, 0.12);
    box-shadow: 0 0 18px rgba(255, 117, 24, 0.3);
    font-weight: 600;
  }
  
  .menu-toggle {
    display: none;
  }
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 40px;
}

.hero h1 {
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin: 0 0 12px;
  text-shadow: 0 6px 24px rgba(255, 117, 24, 0.35);
}

.hero p {
  margin: 0;
  color: var(--muted);
}

/* torn paper edges for sections */
.section {
  padding: 36px 0;
  position: relative;
}

.section::before,
.section::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 14px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, .06) 0 10%, transparent 40% 60%, rgba(255, 255, 255, .06) 90% 100%);
  filter: blur(2px);
  opacity: .25;
}

.section::before {
  top: 0;
}

.section::after {
  bottom: 0;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Parchment cards with burned edges */
.card {
  background: linear-gradient(180deg, rgba(248, 240, 224, 0.08), rgba(248, 240, 224, 0.05));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 117, 24, 0.35);
  box-shadow: 0 14px 40px rgba(255, 117, 24, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.card img,
.card iframe {
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.card iframe {
  aspect-ratio: 16 / 9;
}

.section {
  padding: 36px 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
}

.section p {
  color: var(--muted);
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: linear-gradient(0deg, rgba(10, 10, 18, 0.9), rgba(10, 10, 18, 0.6));
}

.footer .cols {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  padding: 26px 0;
}

.footer small {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 117, 24, 0.12);
  color: #ffd7b8;
  border: 1px solid rgba(255, 117, 24, 0.35);
  box-shadow: var(--glow);
}

.kicker {
  color: #ffb27a;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: .75rem;
}

.split {
  display: grid;
  gap: 24px;
  grid-template-columns: 1.3fr 1fr;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }
}

.list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
}

.table th,
.table td {
  border: 1px solid var(--border);
  padding: 10px;
}

.hr {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* 确保在split布局中hr元素正确对齐 */
.split > div .hr {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* 确保Tonight's Highlights卡片中的链接在底部对齐 */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card > p:last-child {
  margin-top: auto;
  padding-top: 12px;
}

figure {
  margin: 0;
}

/* scroll progress bar with pumpkin gradient */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--accent), #ff9a4b, #8b0000);
  box-shadow: 0 0 10px rgba(255, 117, 24, 0.6);
}

/* Animation set: bats, ghost float, typing */
.bat {
  position: fixed;
  top: 12vh;
  left: -40px;
  font-size: 18px;
  filter: drop-shadow(0 0 6px rgba(255, 117, 24, .3));
  animation: fly 18s linear infinite;
  opacity: .8;
}

.bat:nth-child(2) {
  top: 30vh;
  animation-duration: 22s;
  animation-delay: 4s;
}

.bat:nth-child(3) {
  top: 55vh;
  animation-duration: 26s;
  animation-delay: 8s;
}

@keyframes fly {
  from {
    transform: translateX(-10vw) translateY(-20px) rotate(0deg)
  }

  to {
    transform: translateX(110vw) translateY(20px) rotate(360deg)
  }
}

.ghost {
  position: fixed;
  right: 8vw;
  bottom: 10vh;
  font-size: 22px;
  opacity: .12;
  animation: ghostFloat 8s ease-in-out infinite;
}

@keyframes ghostFloat {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-14px)
  }
}

.typewriter {
  display: inline-block; 
  overflow: hidden;
  white-space: nowrap; 
  border-right: 2px solid var(--accent); 
  animation: typing 4s steps(24, end) 1, caret .75s step-end infinite; 
}

/* 移动端响应式设计，确保文字在小屏幕上可以换行 */
@media (max-width: 768px) {
  .typewriter {
    white-space: normal;
    overflow: visible;
    border-right: none;
    /* 移除打字动画，因为在换行文本上效果不佳 */
    animation: none;
  }
}

@keyframes typing {
  from {
    width: 0
  }

  to {
    width: 100%
  }
}

@keyframes caret {

  from,
  to {
    border-color: transparent
  }

  50% {
    border-color: var(--accent)
  }
}

/* Reduced motion support */
.reduce-motion *,
.reduce-motion::before,
.reduce-motion::after {
  animation: none !important;
  transition: none !important;
}

/* Accessibility: screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Accessibility: visible focus */
:focus-visible {
  outline: 2px dashed var(--ghost);
  outline-offset: 2px;
}

/* Utilities */
.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.mb-24 {
  margin-bottom: 24px;
}