/* 台灣五子棋協會新版首頁預覽：獨立樣式；高清主視覺版本，不修改既有共用 CSS */
:root {
  --tra-navy: #103642;
  --tra-navy-dark: #0b2b36;
  --tra-ink: #203743;
  --tra-muted: #72818a;
  --tra-gold: #b9965a;
  --tra-line: #e6e8e5;
  --tra-paper: #f8f8f5;
  --tra-card: #fff;
  --tra-mint: #e7f2ed;
  --tra-shadow: 0 10px 28px rgba(26, 48, 53, 0.065);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.tra-home {
  margin: 0;
  background: var(--tra-paper);
  color: var(--tra-ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
.tra-home a { color: inherit; text-decoration: none; }
.tra-home button { font: inherit; cursor: pointer; }
.tra-home a:focus-visible, .tra-home button:focus-visible {
  outline: 3px solid #d7af63;
  outline-offset: 3px;
}
.tra-shell { width: min(1410px, calc(100% - 88px)); margin-inline: auto; }

/* 頂部浮動導覽沿用 menu.html 的四大分類與原順序 */
.tra-site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 1000;
  background: rgba(12, 48, 60, 0.985);
  color: #f8f7f1;
  box-shadow: 0 3px 16px rgba(22, 40, 45, .14);
}
.tra-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
  justify-content: space-between;
}
.tra-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex-shrink: 0;
}
.tra-brand:hover { color: #fff; }
.tra-logo { display: block; width: 45px; height: 45px; flex-shrink: 0; }
.tra-brand-lines { display: flex; flex-direction: column; line-height: 1.15; gap: 5px; }
.tra-brand-name { white-space: nowrap; font-size: 21px; font-weight: 700; letter-spacing: .045em; }
.tra-brand-en { white-space: nowrap; font-family: Georgia, "Times New Roman", serif; font-size: 12px; letter-spacing: .095em; color: #d5d7d3; }
.tra-menu-host { align-self: stretch; display: flex; align-items: stretch; justify-content: center; flex: 1 1 auto; min-width: 0; }
.tra-menu-loading { align-self: center; font-size: 14px; color: #b9cac9; }
.tra-home #menu { height: 100%; width: 100%; display: flex; align-items: center; justify-content: flex-end; }
.tra-home #menu .menu-main,
.tra-home #menu .submenu { margin: 0; padding: 0; list-style: none; }
.tra-home #menu .menu-main { display: flex; align-items: stretch; gap: 22px; height: 100%; }
.tra-home #menu .menu-group { display: flex; align-items: stretch; position: relative; }
.tra-home #menu .menu-parent {
  border: 0; background: none; box-shadow: none; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 9px; padding: 0 13px;
  color: #f5f7f6; font-size: 17px; font-weight: 650; letter-spacing: .11em;
  border-bottom: 3px solid transparent;
  transition: border-color .17s, color .17s;
}
.tra-home #menu .menu-group:first-child .menu-parent { color: #f3d39a; border-bottom-color: #c7a26b; }
.tra-home #menu .menu-parent:hover,
.tra-home #menu .menu-group.menu-open .menu-parent,
.tra-home #menu .menu-group:focus-within .menu-parent { color: #f4d7aa; }
.tra-home #menu .menu-arrow {
  display: block; width: 7px; height: 7px;
  border-bottom: 1.6px solid currentColor; border-right: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .16s;
}
.tra-home #menu .menu-group.menu-open .menu-arrow,
.tra-home #menu .menu-group:hover .menu-arrow { transform: translateY(2px) rotate(225deg); }
/* 導覽下拉：暖紙色、細金線與棋盤視覺一致，僅作用於新版首頁 */
.tra-home #menu .submenu {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  width: max-content;
  min-width: 128px;
  max-width: min(90vw, 220px);
  padding: 9px 7px 8px;
  background: linear-gradient(145deg, rgba(255,254,250,.99), rgba(247,247,242,.99));
  color: var(--tra-ink);
  border: 1px solid rgba(194,183,161,.45);
  border-top: 2px solid #c5a36b;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 20px 40px rgba(9,36,41,.19), inset 0 1px 0 rgba(255,255,255,.94);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}
.tra-home #menu .submenu::before {
  content: "";
  display: block;
  width: 30px;
  height: 2px;
  margin: 1px 0 7px 13px;
  background: linear-gradient(to right, #b48c51, rgba(180,140,81,0));
}
.tra-home #menu .menu-group:hover .submenu,
.tra-home #menu .menu-group:focus-within .submenu,
.tra-home #menu .menu-group.menu-open .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.tra-home #menu .submenu li + li {
  border-top: 1px solid rgba(41,78,78,.075);
}
.tra-home #menu .submenu a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 9px;
  border-radius: 8px;
  color: #294750;
  font-size: 16px;
  font-weight: 550;
  letter-spacing: .055em;
  white-space: nowrap;
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.tra-home #menu .submenu a::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border: 1.2px solid #b99b6c;
  transform: rotate(45deg);
  opacity: .85;
}
.tra-home #menu .submenu a:hover,
.tra-home #menu .submenu a:focus-visible {
  color: #0e4e52;
  background-color: #e7f0eb;
  box-shadow: inset 3px 0 0 #b99a65;
}
.tra-menu-toggle { display: none; border: 1px solid #607c84; border-radius: 8px; padding: 9px 10px; background: none; color: #fff; }
.tra-menu-toggle svg { display: block; }

/* 主視覺：完整高解析攝影橫幅，標題維持清晰的可選取文字 */
.tra-hero {
  position: relative;
  isolation: isolate;
  min-height: 390px;
  overflow: hidden;
  background: #faf8f3;
}
.tra-hero .tra-hero-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
}
.tra-hero .tra-hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}
.tra-hero-inner {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  padding-block: 48px 84px;
}
.tra-hero-copy { max-width: 790px; position: relative; z-index: 2; }
.tra-overline { margin: 0 0 18px; font: 600 12px/1.4 system-ui,sans-serif; letter-spacing: .43em; color: #577c86; }
.tra-hero-title { margin: 0; font-family: "Noto Serif TC", "Source Han Serif TC", "Songti TC", "PMingLiU", serif; font-weight: 800; letter-spacing: .075em; font-size: clamp(40px, 4.8vw, 70px); line-height: 1.28; color: #0c2933; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.tra-hero-subtitle { margin: 15px 0 0; max-width: 660px; color: #374c55; font-size: clamp(16px, 1.5vw, 19px); letter-spacing: .075em; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.tra-hero-rule { display: block; width: 54px; height: 3px; margin-top: 26px; background: var(--tra-gold); }
/* 雙欄資訊：沿用 home-info.js 的現有 ID 和資料來源 */
.tra-news-grid {
  position: relative; z-index: 2; margin-top: -52px;
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  align-items: start; gap: 18px;
}
.tra-news-card {
  min-width: 0; padding: 22px 26px 19px;
  background: rgba(255, 255, 255, .9); border: 1px solid var(--tra-line);
  border-radius: 13px; box-shadow: var(--tra-shadow);
}
.tra-news-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 8px; min-height: 38px;
}
.tra-news-heading h2 {
  display: flex; align-items: center; gap: 11px;
  margin: 0; color: #21404b; font-weight: 760; font-size: 24px; letter-spacing: .085em;
}
.tra-news-heading h2::before { content: ""; display: inline-block; height: 28px; width: 5px; border-radius: 5px; background: var(--tra-gold); }
.tra-home .home-info-more {
  min-height: auto; flex: 0 0 auto; padding: 5px 2px; margin: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1.4; color: #356679;
}
.tra-home .home-info-more:hover { text-decoration: underline; text-underline-offset: 4px; color: #184a59; }
.tra-home .home-info-more[hidden] { display: none !important; }
.tra-home .home-info-more:disabled { opacity: .55; cursor: progress; }
.tra-home .home-info-table {
  border-spacing: 0; border-collapse: collapse; width: 100%; table-layout: fixed; background: transparent;
}
.tra-home .home-info-table td { padding: 11px 8px; border-bottom: 1px solid #ebedeb; font-size: 16px; vertical-align: middle; background: transparent; }
.tra-home .home-info-table tr:last-child td { border-bottom: 0; }
.tra-home .home-info-table tbody tr:hover td { background: #f6f9f7; }
.tra-home .home-info-date {
  width: 111px;
  padding: 6px 12px 6px 0;
  color: #98733f;
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tra-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  width: 88px;
  padding: 6px 3px;
  background: #faf8f4;
  border-radius: 9px;
  line-height: 1.15;
}
.tra-date-year {
  color: #7a8689;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .035em;
}
.tra-date-month-day {
  color: #a4793e;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tra-home .home-info-title, .tra-home .home-info-content {
  overflow-wrap: anywhere; color: #35454d; line-height: 1.65;
}
.tra-home .home-info-title a, .tra-home .home-info-content a { color: #2c404b; font-weight: 570; }
.tra-home .home-info-title a:hover, .tra-home .home-info-content a:hover { color: #0f7376; text-decoration: underline; text-underline-offset: 3px; }
.tra-home .home-info-featured a { color: #9d6b33; font-weight: 700; }
.tra-home .home-info-empty { color: #7c888a; text-align: center; padding-block: 22px; }

/* 底部簡約，避免與四個快捷入口重複連結 */
.tra-footer { margin-top: 32px; background: #103540; color: #e9efec; }
.tra-footer-inner { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.tra-footer-brand { display: flex; gap: 10px; align-items: center; }
.tra-footer-brand .tra-logo { width: 35px; height: 35px; }
.tra-footer-names { display: flex; flex-direction: column; line-height: 1.35; }
.tra-footer-names strong { font-size: 16px; letter-spacing: .03em; }
.tra-footer-names small { font-size: 13px; opacity: .8; font-family: Georgia, serif; }
.tra-footer-copy { font-size: 13px; color: #c5d5d7; }
.tra-to-top { display: grid; place-items: center; width: 39px; height: 39px; flex-shrink: 0; border: 1px solid #537783; border-radius: 50%; background: transparent; color: #ebf0ef; }
.tra-to-top:hover { background: #27525b; }

@media (max-width: 1170px) {
  .tra-shell { width: min(100% - 48px, 1410px); }
  .tra-header-inner { gap: 12px; }
  .tra-brand-name { font-size: 19px; }
  .tra-brand-en { font-size: 10px; }
  .tra-home #menu .menu-main { gap: 6px; }
  .tra-home #menu .menu-parent { font-size: 16px; padding-inline: 10px; }
}
@media (max-width: 850px) {
  .tra-shell { width: min(100% - 32px, 720px); }
  .tra-header-inner { min-height: 64px; }
  .tra-logo { width: 38px; height: 38px; }
  .tra-brand-name { font-size: 17px; }
  .tra-brand-en { font-size: 10px; }
  .tra-menu-toggle { display: block; margin-left: auto; }
  .tra-menu-host {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    align-self: auto; background: #103642; padding: 0 16px 15px;
    border-top: 1px solid #345763; box-shadow: 0 20px 24px rgba(0,0,0,.16);
  }
  .tra-site-header.nav-open .tra-menu-host { display: block; }
  .tra-home #menu { display: block; }
  .tra-home #menu .menu-main { flex-direction: column; gap: 0; }
  .tra-home #menu .menu-group { display: block; border-bottom: 1px solid #355762; }
  .tra-home #menu .menu-parent {
    width: 100%; height: 53px; display: flex; justify-content: space-between;
    padding: 0 7px; border-bottom: 0; font-size: 17px;
  }
  .tra-home #menu .menu-group:first-child .menu-parent { border-bottom: 0; }
  .tra-home #menu .submenu {
    position: static;
    width: 100%;
    min-width: 0;
    padding: 0 0 10px 10px;
    transform: none;
    box-shadow: none;
    border: 0;
    background: transparent;
    border-radius: 0;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .tra-home #menu .submenu::before { display: none; }
  .tra-home #menu .submenu li + li { border-top: 0; }
  .tra-home #menu .menu-group.menu-open .submenu,
  .tra-home #menu .menu-group:focus-within .submenu { display: block; }
  .tra-home #menu .submenu a {
    color: #dce9e8;
    font-size: 16px;
    padding: 10px 15px;
    background: transparent;
  }
  .tra-home #menu .submenu a::before { border-color: #c5a36b; }
  .tra-home #menu .submenu a:hover,
  .tra-home #menu .submenu a:focus-visible { background: #28515b; color: #fff; }
  .tra-hero, .tra-hero-inner { min-height: 320px; }
  .tra-hero-inner { padding: 45px 0 74px; }
  .tra-hero-title { font-size: clamp(36px, 6.3vw, 56px); }
  .tra-hero .tra-hero-art img { object-position: 63% 35%; opacity: .85; }
  .tra-news-grid { grid-template-columns: 1fr; margin-top: -38px; }
}
@media (max-width: 520px) {
  .tra-shell { width: calc(100% - 28px); }
  .tra-brand-name { font-size: 16px; }
  .tra-brand-en { font-size: 9px; letter-spacing: .015em; }
  .tra-brand { gap: 9px; }
  .tra-hero, .tra-hero-inner { min-height: 308px; }
  .tra-hero-inner { padding-top: 44px; padding-bottom: 70px; }
  .tra-overline { font-size: 10px; letter-spacing: .22em; }
  .tra-hero-title { font-size: clamp(33px, 8.5vw, 44px); letter-spacing: .045em; }
  .tra-hero-subtitle { font-size: 15px; max-width: 320px; }
  .tra-news-card { padding: 17px 15px 14px; }
  .tra-news-heading h2 { font-size: 20px; }
  .tra-news-heading h2::before { height: 23px; }
  .tra-home .home-info-table td { padding: 10px 3px; font-size: 15px; }
  .tra-home .home-info-date { width: 87px; padding: 6px 7px 6px 0; }
  .tra-date-badge { width: 76px; min-height: 47px; padding: 5px 2px; }
  .tra-date-month-day { font-size: 18px; }
  .tra-date-year { font-size: 11px; }
  .tra-footer-inner { flex-wrap: wrap; padding-block: 17px; gap: 12px; }
  .tra-footer-copy { order: 3; width: 100%; }
  .tra-to-top { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tra-home #menu .submenu, .tra-home #menu .menu-arrow { transition: none; }
}
