/*
Theme Name: Christmas Almon
Theme URI: https://www.almoncheng.com
Author: Almon Cheng
Author URI: https://www.almoncheng.com
Description: 聖誕節主題 — 紅金綠聖誕配色＋全屏落雪效果。Christmas theme with falling snow, festive red/gold/green palette. 季節限定，過完聖誕可以隨時切換返 alvert。
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: christmas-almon
Tags: christmas, holiday, snow, one-column, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ===== 聖誕配色 =====
   深綠 deep green  : #0f3d2e
   聖誕紅 red       : #c1272d
   金 gold          : #d4a017
   奶油白 cream     : #faf5ec
   雪白 snow        : #ffffff
   ==================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans SC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  background: #0f3d2e;
  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::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  background: radial-gradient(10px at 10px 0, #f8fbff 99%, transparent) 0 0/20px 10px repeat-x;
}
/* 聖誕燈飾 — 金色小燈珠沿頂欄底部 */
.christmas-topbar::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 6px;
  background:
    radial-gradient(3px at 6px 3px, #f5c84c 99%, transparent) 0 0/24px 6px repeat-x,
    radial-gradient(3px at 18px 3px, #7dd3fc 99%, transparent) 0 0/24px 6px repeat-x;
  opacity: .85;
}

.site-header {
  background: #0f3d2e;
  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: #0b3d2e;
}
.site-title { font-size: 26px; margin: 0; line-height: 1.2; }
.site-title::before { content: '🎄 '; font-size: 20px; }
.site-title a { color: #faf5ec; font-family: 'Mountains of Christmas', '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: #14532d;
  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, #0b3d2e, #0f3d2e 60%, #123f2f);
  overflow: hidden;
}
/* Hero 頂部積雪波浪 */
.hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 12px;
  background:
    radial-gradient(12px at 12px 0, #f8fbff 99%, transparent) 0 0/24px 12px repeat-x,
    radial-gradient(8px at 30px 0, #f8fbff 99%, transparent) 0 0/48px 12px repeat-x;
  opacity: .9;
  pointer-events: none;
}
.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: 'Mountains of Christmas', '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%; transform: scaleX(-1); }
.hero-tree.right { right: 4%; }

/* ===== Sections ===== */
.section { padding: 70px 0; }
.section-title-wrap { text-align: center; margin-bottom: 40px; }
.section-title {
  font-family: 'Mountains of Christmas', '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: #14532d;
  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: #14532d;
  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: #14532d;
  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: #14532d;
  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: #0b3d2e;
  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; }
}
