/**
 * GYDCA — 全局样式
 * 设计变量、基础重置、全站头部/主导航/页脚与社交条、通用工具类。
 * 各页面专属模块样式请在各自 CSS（如 events.css、home.css）中编写。
 */

:root {
  /* 品牌色 */
  --sky: #3da5e8;
  --sky-deep: #1e8bc8;
  --navy: #0a2342;
  --navy-footer: #0d2847;

  /* 文本 */
  --text: #2d3748;
  --muted: #718096;
  --white: #fff;

  /* 布局 */
  --radius: 10px;
  --layout-max: 1480px;
  --layout-narrow: 1200px;

  /* 头部 */
  --topbar-gradient-start: #32c3f8;
  --topbar-gradient-end: #3374cd;
  --header-gradient-start: #32c3f8;
  --header-gradient-end: #3374cd;

  /* 首页点缀（参考主视觉稿） */
  --accent-green: #48c78e;
  --accent-green-deep: #2ea575;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

html {
  width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.site-head a,
.footer-main a,
.site-main a {
  color: inherit;
  text-decoration: none;
}

.site-main a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

button {
  font: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 版心容器（可选配合 HTML: <div class="container">） */
.container {
  width: 100%;
  max-width: var(--layout-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* —— 全站头部 / 页脚 / 社交条（各页与 includes 公共片段共用，原 events.css） —— */

.site-head {
  position: sticky;
  top: 0;
  z-index: 200;
}

.top-bar {
  background: linear-gradient(90deg, var(--topbar-gradient-start) 0%, var(--topbar-gradient-end) 100%);
  color: var(--white);
  font-size: 13px;
  padding: 8px 20px;
}

.top-bar-inner {
  max-width: 1480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.top-bar__address {
  flex: 1;
  text-align: right;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  margin-left: auto;
}

.top-bar__tel {
  white-space: nowrap;
  opacity: 0.95;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.lang-switch a {
  color: var(--white);
  opacity: 0.9;
  padding: 2px 4px;
}

.lang-switch a:hover {
  opacity: 1;
  text-decoration: underline;
}

.lang-switch a.is-current {
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  opacity: 1;
}

.lang-switch__sep {
  opacity: 0.65;
  user-select: none;
}

@media (max-width: 780px) {
  .top-bar-inner {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .top-bar__address {
    flex: none;
    width: 100%;
  }

  .top-bar__right {
    margin-left: 0;
  }
}

.site-header {
  background: linear-gradient(to left, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
  box-shadow: 0 4px 20px rgba(8, 30, 60, 0.25);
}

.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 0px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--white);
  flex-shrink: 0;
}

.brand-logo {
  flex-shrink: 0;
  color: var(--white);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.brand-logo img {
  display: block;
  width: 204px;
  height: 76px;
  object-fit: contain;
}

.brand-text {
  max-width: min(280px, 32vw);
}

.brand-name {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main-nav > a {
  padding: 8px 0;
  color: inherit;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.main-nav > a:hover {
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.nav-item {
  position: relative;
}

.nav-item--dropdown {
  align-self: stretch;
  display: flex;
  align-items: center;
}

.nav-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.nav-trigger:hover {
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

.nav-trigger.is-active {
  border-bottom-color: var(--white);
}

.nav-trigger.is-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  transform: translateY(4px);
  min-width: 220px;
  padding: 16px 18px 14px 20px;
  border-radius: 12px;
  background: rgba(46, 130, 186, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 50;
}

.nav-item--dropdown:hover .nav-dropdown,
.nav-item--dropdown:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown__connector {
  position: absolute;
  top: -10px;
  left: 10px;
  width: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.nav-dropdown__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
}

.nav-dropdown__body > a {
  color: var(--white);
  padding: 2px 0;
}

.nav-dropdown__body > a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav-dropdown__years {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.nav-dropdown__rail {
  width: 2px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1px;
  align-self: stretch;
  min-height: 3.2em;
}

.nav-dropdown__year-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-dropdown__year-list a {
  color: var(--white);
  padding: 0;
}

.nav-dropdown__year-list a:hover {
  text-decoration: underline;
}

.nav-dropdown__foot {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-dropdown__figure {
  display: block;
  opacity: 0.95;
  color: var(--white);
}

.nav-search {
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--white);
  flex-shrink: 0;
}

.nav-search:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* 日期/地点等行内 SVG 图标（活动列表、公共 Latest Events 等） */
.icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--sky);
}

.join-social-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  background: linear-gradient(90deg, #2563eb 0%, #6366f1 45%, #7c3aed 100%);
}

.join-social-bar a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #4338ca;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.join-social-bar a:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  background: #fff;
}

.join-social-bar svg {
  display: block;
}

.footer-main {
  background: linear-gradient(90deg, var(--topbar-gradient-start) 0%, var(--topbar-gradient-end) 100%);
  padding: 48px 24px 32px;
  text-align: center;
  position: relative;
}

.footer-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
}

.footer-deco__img {
  display: block;
  width: auto;
  max-width: min(720px, 55vw);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.floral {
  width: 72px;
  height: 24px;
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='white' stroke-width='1.2' viewBox='0 0 120 40'%3E%3Cpath d='M10 20 Q30 5 50 20 T90 20'/%3E%3Cpath d='M30 25 Q50 10 70 25'/%3E%3Ccircle cx='20' cy='18' r='3' fill='white'/%3E%3C/svg%3E") center/contain no-repeat;
}

.floral--mirror {
  transform: scaleX(-1);
}

.footer-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  line-height: 1.2;
}

.copyright {
  margin-top: 28px;
  padding: 0 16px;
  max-width: 100%;
  font-size: 26px;
  line-height: 1.5;
  color: rgba(255, 255, 255);
}

@media (max-width: 640px) {
  .main-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    max-width: min(100vw - 100px, 100%);
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .brand-text {
    max-width: 160px;
  }

  .brand-name {
    font-size: 9px;
  }
}
