/*
Theme Name: Mid-Autumn Almon
Theme URI: https://www.almoncheng.com
Author: Almon Cheng
Author URI: https://www.almoncheng.com
Description: 中秋節主題 — 深藍夜空＋大月亮＋燈籠＋月餅，金色月光微粒緩緩飄落。Mid-Autumn theme with full moon, lanterns, mooncakes and drifting golden moonlight particles. 季節限定，過完中秋可以隨時切換返 alvert 或其他 theme。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: midautumn-almon
Tags: mid-autumn, festival, moon, lantern, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===== 中秋配色 =====
   夜空藍 night blue  : #0d1f3c
   燈籠紅 red         : #c1272d
   月光金 gold        : #d4a017
   奶油白 cream       : #faf5ec
   月色月白 moon      : #fdf3d8
   ==================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans SC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: #0d1f3c;
  color: #faf5ec;
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: #d4a017; text-decoration: none; }
a:hover { color: #f5c84c; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== 落雪 canvas（全屏，唔阻礙 click/scroll） ===== */
#snow-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9999;
  pointer-events: none;
}

/* ===== Header ===== */
.christmas-topbar {
  position: relative;
  background: linear-gradient(90deg, #c1272d, #a31e23);
  color: #fff;
  text-align: center;
  padding: 14px 10px 8px;
  font-size: 14px;
  letter-spacing: 1px;
  border-bottom: 2px solid #d4a017;
}
.christmas-topbar span { display: inline-block; }
/* 聖誕燈飾 — 紅綠黃三色燈珠（識行識閃），深色電線托底等紅色燈都突出 */
.christmas-topbar::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 8px;
  background-color: rgba(15, 25, 15, .55);
  background-image:
    /* 光暈層 */
    radial-gradient(5px at 6px 4px, rgba(245,200,76,.5), transparent 90%),
    radial-gradient(5px at 18px 4px, rgba(255,93,93,.5), transparent 90%),
    radial-gradient(5px at 30px 4px, rgba(253,243,216,.5), transparent 90%),
    /* 燈珠層：金 紅 月白 */
    radial-gradient(3px at 6px 4px, #f5c84c 99%, transparent),
    radial-gradient(3px at 18px 4px, #ff5d5d 99%, transparent),
    radial-gradient(3px at 30px 4px, #fdf3d8 99%, transparent);
  background-size: 36px 8px;
  animation: lights-run 1.8s linear infinite;
}
/* 三色燈珠一齊由左行去右 — 36px = 一個金紅月白週期，無縫循環 */
@keyframes lights-run {
  0%   { background-position: 0 0; opacity: 1; }
  25%  { opacity: .55; }
  50%  { background-position: 18px 0; opacity: 1; }
  75%  { opacity: .55; }
  100% { background-position: 36px 0; opacity: 1; }
}

.site-header {
  background: #0d1f3c;
  border-bottom: 3px solid #d4a017;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding .site-logo img { max-height: 52px; width: auto; }
/* custom logo（而家係 1600×1600 favicon）— 限尺寸 + 金色聖誕圈 */
.site-branding .custom-logo {
  max-height: 46px;
  width: auto;
  border-radius: 50%;
  border: 2px solid #d4a017;
  box-shadow: 0 0 0 3px rgba(212,160,23,.25), 0 2px 10px rgba(0,0,0,.35);
  background: #0a1a33;
}
.site-title { font-size: 26px; margin: 0; line-height: 1.2; }
.site-title::before { content: '🏮 '; font-size: 18px; }
.site-title a { color: #faf5ec; font-family: 'Ma Shan Zheng', 'Noto Sans SC', cursive; letter-spacing: 1px; }
.site-description { margin: 0; font-size: 13px; color: #d4a017; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
  display: block;
  padding: 10px 16px;
  color: #faf5ec;
  font-weight: 500;
  border-radius: 6px;
  transition: background .2s, color .2s;
}
.main-nav a:hover,
.main-nav li.current-menu-item > a {
  background: #c1272d;
  color: #fff;
}
.main-nav .sub-menu {
  position: absolute;
  top: 100%; left: 0;
  background: #1a2f52;
  min-width: 200px;
  border: 1px solid #d4a017;
  border-radius: 8px;
  display: none;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.4);
}
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { padding: 8px 12px; border-radius: 4px; }

/* Mobile menu */
.menu-toggle {
  display: none;
  background: #c1272d;
  color: #fff;
  border: none;
  font-size: 22px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .header-inner { flex-wrap: wrap; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav .sub-menu { position: static; display: none; box-shadow: none; }
  .main-nav li.open > .sub-menu { display: block; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  text-align: center;
  padding: 100px 20px 110px;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(212,160,23,.18), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(193,39,45,.22), transparent 50%),
    linear-gradient(180deg, #0a1a33, #0d1f3c 60%, #122a4a);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.9) 2px, transparent 3px),
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.8) 2px, transparent 3px),
    radial-gradient(circle at 25% 82%, rgba(255,255,255,.7) 2px, transparent 3px),
    radial-gradient(circle at 70% 78%, rgba(255,255,255,.85) 2px, transparent 3px),
    radial-gradient(circle at 92% 60%, rgba(255,255,255,.75) 2px, transparent 3px);
  background-size: 260px 240px;
  opacity: .5;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; }
.hero-icon { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.hero h1 {
  font-family: 'Ma Shan Zheng', 'Noto Sans SC', cursive;
  font-size: clamp(40px, 7vw, 84px);
  margin: 0 0 6px;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0,0,0,.45);
  letter-spacing: 2px;
}
.hero .hero-sub {
  font-size: clamp(18px, 3vw, 26px);
  color: #f5c84c;
  margin: 0 0 18px;
  font-weight: 600;
}
.hero .hero-desc { max-width: 640px; margin: 0 auto 28px; color: #e8e0d0; font-size: 16px; }
.btn-christmas {
  display: inline-block;
  background: linear-gradient(180deg, #d4a017, #b8860b);
  color: #fff;
  font-weight: 700;
  padding: 13px 34px;
  border-radius: 50px;
  font-size: 16px;
  letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3);
  transition: transform .2s, box-shadow .2s;
}
.btn-christmas:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.4); color: #fff; }
.btn-christmas.red { background: linear-gradient(180deg, #d43d44, #a31e23); }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* 聖誕樹裝飾 → 中秋燈籠 + 月餅 */
.hero-tree {
  position: absolute;
  bottom: -10px;
  font-size: 130px;
  line-height: 1;
  opacity: .5;
  z-index: 1;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.35));
}
.hero-tree.left { left: 4%; }
.hero-tree.right { right: 4%; }

/* 大月亮 — 右上角，帶光暈同表面坑紋 */
.hero-moon {
  position: absolute;
  top: 46px;
  right: 7%;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fffdf0 0%, #fdf3d8 35%, #f5dd9d 70%, #e8c46a 100%);
  box-shadow:
    0 0 60px 18px rgba(253, 243, 216, .35),
    0 0 140px 55px rgba(253, 243, 216, .12);
  z-index: 1;
  animation: moon-glow 4s ease-in-out infinite alternate;
}
.hero-moon::before,
.hero-moon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(214, 178, 110, .38);
}
.hero-moon::before { width: 26px; height: 26px; top: 30%; left: 24%; }
.hero-moon::after {
  width: 15px; height: 15px; top: 58%; left: 52%;
  box-shadow: 22px -14px 0 -3px rgba(214, 178, 110, .30);
}
@keyframes moon-glow {
  from { box-shadow: 0 0 50px 14px rgba(253,243,216,.28), 0 0 120px 40px rgba(253,243,216,.10); }
  to   { box-shadow: 0 0 70px 22px rgba(253,243,216,.42), 0 0 160px 60px rgba(253,243,216,.14); }
}

/* 頂欄燈籠 — 左右搖擺，似掛住喺度 */
.lantern {
  display: inline-block;
  font-size: 24px;
  line-height: 1;
  margin: 0 8px;
  vertical-align: middle;
  transform-origin: top center;
  animation: lantern-sway 2.4s ease-in-out infinite;
}
.lantern.right { animation-delay: 1.2s; }
@keyframes lantern-sway {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}

/* ===== Sections ===== */
.section { padding: 70px 0; }
.section-title-wrap { text-align: center; margin-bottom: 40px; }
.section-title {
  font-family: 'Ma Shan Zheng', 'Noto Sans SC', cursive;
  font-size: clamp(28px, 4.5vw, 44px);
  color: #f5c84c;
  margin: 0 0 6px;
}
.section-sub { color: #cfc7b5; font-size: 15px; margin: 0; }

/* ===== Blog grid ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }

.card {
  background: #1a2f52;
  border: 1px solid rgba(212,160,23,.35);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(0,0,0,.35); }
.card-thumb img { width: 100%; height: 200px; object-fit: cover; display: block; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 19px; margin: 0 0 8px; }
.card-title a { color: #faf5ec; }
.card-title a:hover { color: #f5c84c; }
.card-excerpt { color: #cfc7b5; font-size: 14.5px; margin: 0 0 14px; flex: 1; }
.card-meta { font-size: 13px; color: #d4a017; }
.card-meta time { color: #cfc7b5; }

/* ===== Single / Page ===== */
.content-area { padding: 60px 0; }
.single-post-card {
  background: #1a2f52;
  border-radius: 16px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(212,160,23,.3);
}
.entry-title { font-size: clamp(26px, 4vw, 40px); color: #f5c84c; margin: 0 0 10px; }
.entry-meta { color: #d4a017; font-size: 14px; margin-bottom: 24px; }
.entry-content { color: #efe9db; font-size: 16px; }
.entry-content h1, .entry-content h2, .entry-content h3 { color: #f5c84c; }
.entry-content a { text-decoration: underline; }
.entry-content img { border-radius: 10px; }
.wp-caption { max-width: 100%; }
.wp-caption-text { color: #cfc7b5; font-size: 13px; text-align: center; }
blockquote {
  border-left: 4px solid #d4a017;
  margin: 20px 0;
  padding: 10px 20px;
  background: rgba(212,160,23,.08);
  border-radius: 0 8px 8px 0;
}

/* ===== Sidebar ===== */
.layout-with-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 36px; }
@media (max-width: 900px) { .layout-with-sidebar { grid-template-columns: 1fr; } }
.widget-area .widget {
  background: #1a2f52;
  border: 1px solid rgba(212,160,23,.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}
.widget-title { color: #f5c84c; font-size: 18px; margin: 0 0 14px; border-bottom: 2px solid rgba(212,160,23,.4); padding-bottom: 10px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 5px 0; border-bottom: 1px dashed rgba(212,160,23,.2); }
.widget li:last-child { border-bottom: none; }
.widget a { color: #efe9db; }
.widget a:hover { color: #f5c84c; }

/* ===== Footer ===== */
.site-footer {
  background: #092b20;
  border-top: 3px solid #d4a017;
  margin-top: 60px;
}
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding: 50px 20px 30px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) { .footer-widgets { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .footer-widgets { grid-template-columns: 1fr; } }
.footer-widget .widget-title { color: #f5c84c; }
.footer-widget .widget { color: #cfc7b5; font-size: 14.5px; margin-bottom: 24px; }
.footer-widget .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-widget .widget li { padding: 4px 0; }
.footer-widget .widget a { color: #cfc7b5; }
.footer-widget .widget a:hover { color: #f5c84c; }
.footer-bottom {
  background: #062118;
  text-align: center;
  padding: 16px 20px;
  color: #a8b8ae;
  font-size: 14px;
}
.footer-bottom a { color: #d4a017; }

/* ===== Pagination ===== */
.pagination { text-align: center; margin-top: 40px; }
.pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  background: #1a2f52;
  border: 1px solid rgba(212,160,23,.4);
  border-radius: 6px;
  color: #faf5ec;
}
.pagination .current { background: #c1272d; border-color: #c1272d; color: #fff; }

/* ===== 404 ===== */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 h1 { font-family: 'Mountains of Christmas', cursive; font-size: 60px; color: #f5c84c; }

/* ===== 表單 ===== */
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(212,160,23,.4);
  border-radius: 8px;
  background: #0a1a33;
  color: #faf5ec;
  font-size: 15px;
}
input:focus, textarea:focus { outline: 2px solid #d4a017; }
button, input[type="submit"], .wp-block-button__link {
  background: #c1272d;
  color: #fff;
  border: none;
  padding: 12px 26px;
  border-radius: 50px;
  font-size: 15px;
  cursor: pointer;
  transition: background .2s;
}
button:hover, input[type="submit"]:hover { background: #a31e23; }

/* ===== 減慢動畫偏好 ===== */
@media (prefers-reduced-motion: reduce) {
  #snow-canvas { display: none; }
  .christmas-topbar::after { animation: none; }
  .lantern { animation: none; }
  .hero-moon { animation: none; }
}
