/**
 * A4 Waxing Custom Styles
 * Design tokens extracted from Figma Make output
 */

body {
  -webkit-font-smoothing: auto !important;
  -moz-osx-font-smoothing: auto !important;
}

:root {
  /* Typography Variables */
  --a4-font-size-base: 16px;
  --a4-text-h1: 48px;
  --a4-text-h2: 36px;
  --a4-text-h3: 28px;
  --a4-text-h4: 22px;
  --a4-text-base: 16px;
  --a4-text-label: 12px;

  --a4-font-family-serif: 'Noto Serif TC', serif;
  --a4-font-family-sans: 'Noto Sans TC', sans-serif;

  --a4-font-weight-bold: 700;
  --a4-font-weight-medium: 500;
  --a4-font-weight-regular: 400;

  /* Color System */
  --a4-background: rgba(252, 241, 235, 1.00);
  --a4-foreground: rgba(92, 74, 66, 1.00);

  --a4-card: rgba(255, 255, 255, 1.00);
  --a4-card-foreground: rgba(92, 74, 66, 1.00);

  --a4-popover: rgba(255, 255, 255, 1.00);
  --a4-popover-foreground: rgba(92, 74, 66, 1.00);

  --a4-primary: rgba(200, 149, 108, 1.00);
  --a4-primary-foreground: rgba(255, 255, 255, 1.00);

  --a4-secondary: rgba(0, 0, 0, 0);
  --a4-secondary-foreground: rgba(200, 149, 108, 1.00);

  --a4-muted: rgba(232, 213, 200, 1.00);
  --a4-muted-foreground: rgba(139, 123, 116, 1.00);

  --a4-accent: rgba(168, 181, 160, 1.00);
  --a4-accent-foreground: rgba(255, 255, 255, 1.00);

  --a4-destructive: rgba(166, 5, 68, 1.00);
  --a4-destructive-foreground: rgba(255, 255, 255, 1.00);

  /* Border and Input */
  --a4-border: rgba(229, 213, 197, 1.00);
  --a4-input: rgba(0, 0, 0, 0);
  --a4-input-background: rgba(255, 255, 255, 1.00);
  --a4-ring: rgba(200, 149, 108, 1.00);

  /* Border Radius */
  --a4-radius: 8px;
  --a4-radius-button: 8px;
  --a4-radius-card: 12px;
  --a4-radius-badge: 24px;
  --a4-radius-sm: calc(var(--a4-radius) - 4px);
  --a4-radius-md: calc(var(--a4-radius) - 2px);
  --a4-radius-lg: var(--a4-radius);
  --a4-radius-xl: calc(var(--a4-radius) + 4px);

  /* Shadows */
  --a4-elevation-sm: 0px 2px 8px 0px rgba(0, 0, 0, 0.08);

  /* Sidebar/Dark Sections */
  --a4-sidebar: rgba(26, 26, 46, 1.00);
  --a4-sidebar-foreground: rgba(255, 255, 255, 1.00);
  --a4-sidebar-primary: rgba(200, 149, 108, 1.00);
  --a4-sidebar-primary-foreground: rgba(255, 255, 255, 1.00);
  --a4-sidebar-accent: rgba(168, 181, 160, 1.00);
  --a4-sidebar-accent-foreground: rgba(255, 255, 255, 1.00);
  --a4-sidebar-border: rgba(229, 213, 197, 1.00);
  --a4-sidebar-ring: rgba(200, 149, 108, 1.00);

  /* Chart Colors (for data visualization if needed) */
  --a4-chart-1: rgba(200, 149, 108, 1.00);
  --a4-chart-2: rgba(168, 181, 160, 1.00);
  --a4-chart-3: rgba(232, 196, 184, 1.00);
  --a4-chart-4: rgba(196, 160, 142, 1.00);
  --a4-chart-5: rgba(169, 127, 103, 1.00);

  /* Layout */
  --a4-max-width: 1440px;
}

/* Base Typography Styles */
body {
  font-family: var(--a4-font-family-sans);
  font-size: var(--a4-text-base);
  font-weight: var(--a4-font-weight-regular);
  color: var(--a4-foreground);
  background-color: var(--a4-background);
  line-height: 1.7;
}

h1, h2 {
  font-family: var(--a4-font-family-serif);
  font-weight: var(--a4-font-weight-bold);
  line-height: 1.4;
}

h3, h4 {
  font-family: var(--a4-font-family-serif);
  font-weight: var(--a4-font-weight-medium);
  line-height: 1.45;
}

h1 {
  font-size: var(--a4-text-h1);
}

h2 {
  font-size: var(--a4-text-h2);
}

h3 {
  font-size: var(--a4-text-h3);
}

h4 {
  font-size: var(--a4-text-h4);
}

p {
  font-family: var(--a4-font-family-sans);
  font-size: var(--a4-text-base);
  font-weight: var(--a4-font-weight-regular);
  line-height: 1.7;
}

label {
  font-family: var(--a4-font-family-sans);
  font-size: var(--a4-text-label);
  font-weight: var(--a4-font-weight-medium);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Container System */
.a4-container {
  max-width: var(--a4-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

@media (min-width: 640px) {
  .a4-container {
    padding-left: 48px;
    padding-right: 48px;
  }
}

@media (min-width: 1024px) {
  .a4-container {
    padding-left: 80px;
    padding-right: 80px;
  }
}

/* Button Styles */
.a4-button {
  font-family: var(--a4-font-family-sans);
  font-size: var(--a4-text-base);
  font-weight: var(--a4-font-weight-bold);
  line-height: 1.5;
  padding: 0.75rem 2rem;
  border-radius: var(--a4-radius-button);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.a4-button-primary {
  background-color: var(--a4-primary);
  color: var(--a4-primary-foreground);
}

.a4-button-primary:hover {
  background-color: #b8845f;
  color: var(--a4-primary-foreground);
}

.a4-button-secondary {
  background-color: transparent;
  color: var(--a4-secondary-foreground);
  border: 2px solid var(--a4-border);
}

.a4-button-secondary:hover {
  background-color: var(--a4-muted);
  color: var(--a4-secondary-foreground);
}

/* Card Styles */
.a4-card {
  background-color: var(--a4-card);
  color: var(--a4-card-foreground);
  border-radius: var(--a4-radius-card);
  box-shadow: var(--a4-elevation-sm);
  padding: 1.5rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --a4-text-h1: 36px;
    --a4-text-h2: 28px;
    --a4-text-h3: 22px;
    --a4-text-h4: 18px;
  }
}

@media (max-width: 640px) {
  :root {
    --a4-text-h1: 32px;
    --a4-text-h2: 24px;
    --a4-text-h3: 20px;
    --a4-text-h4: 16px;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--a4-primary);
}

.bg-primary {
  background-color: var(--a4-primary);
}

.bg-muted {
  background-color: var(--a4-muted);
}

/* ============================================================================
   Blocksy Header Customization
   ============================================================================ */

/* Header Container（排除 offcanvas，它也帶 .ct-header） */
header[data-id="header"],
.ct-header:not(#offcanvas) {
  background-color: var(--a4-card) !important;
  box-shadow: var(--a4-elevation-sm) !important;
  height: 72px !important;
}

.ct-header [data-row] {
  background-color: var(--a4-card) !important;
  min-height: 72px !important;
}

/* Logo */
.site-branding img {
  max-height: 48px !important;
}

/* Navigation Menu */
.ct-header nav[data-id="menu"] ul li a {
  color: var(--a4-foreground) !important;
  font-family: var(--a4-font-family-sans) !important;
  font-size: 16px !important;
  font-weight: var(--a4-font-weight-regular) !important;
  transition: color 0.2s ease !important;
}

.ct-header nav[data-id="menu"] ul li a:hover,
.ct-header nav[data-id="menu"] ul li.current-menu-item a {
  color: var(--a4-primary) !important;
}

/* Header Button (CTA) */
.ct-header .ct-button {
  background-color: var(--a4-primary) !important;
  color: var(--a4-primary-foreground) !important;
  border-radius: var(--a4-radius-button) !important;
  padding: 12px 32px !important;
  font-family: var(--a4-font-family-sans) !important;
  font-size: 16px !important;
  font-weight: var(--a4-font-weight-bold) !important;
  transition: opacity 0.2s ease !important;
}

.ct-header .ct-button:hover {
  opacity: 0.9 !important;
}

/* Mobile Menu */
.ct-header .ct-toggle-dropdown-desktop-ghost {
  color: var(--a4-foreground) !important;
}

.ct-header .mobile-menu {
  background-color: transparent !important;
}

.ct-header .mobile-menu a {
  color: var(--a4-foreground) !important;
  font-family: var(--a4-font-family-sans) !important;
}

/* ─── Offcanvas Panel Overrides ─────────────────────────────────────── */

/* Panel 全螢幕高度 — #offcanvas 同時帶 .ct-header 會被限制為 header 高度 */
#offcanvas.ct-panel {
  height: 100vh !important;
  height: 100dvh !important;
}

#offcanvas .ct-panel-inner {
  height: 100% !important;
  box-shadow: none !important;
}

/* 關閉按鈕 - 淺色背景上加邊框提升可見性 */
#offcanvas .ct-toggle-close {
  border: 1.5px solid var(--a4-foreground) !important;
  border-radius: 50% !important;
  padding: 6px !important;
}

/* Mobile menu nav 背景透明（由 panel 統一控制背景） */
[data-device="mobile"] .mobile-menu {
  background-color: transparent !important;
}

/* Mobile menu 連結 padding 與字重 */
#offcanvas .ct-menu-link {
  padding: 12px 16px !important;
  font-weight: var(--a4-font-weight-medium) !important;
}

/* Offcanvas 語言切換器 */
.a4-offcanvas-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 16px 16px;
  border-bottom: 1px solid var(--a4-muted);
  margin-bottom: 8px;
}

.a4-offcanvas-lang .a4-lang-btn {
  color: var(--a4-foreground);
  font-family: var(--a4-font-family-sans);
  font-size: 14px;
  font-weight: var(--a4-font-weight-medium);
  text-decoration: none;
  transition: color 0.2s ease;
}

.a4-offcanvas-lang .a4-lang-btn:hover {
  color: var(--a4-primary);
}

.a4-offcanvas-lang .a4-lang-divider {
  color: var(--a4-muted);
  font-size: 14px;
}

/* Offcanvas CTA Button */
.a4-offcanvas-cta {
  padding: 24px 16px;
  margin-top: auto;
}

.a4-offcanvas-cta-btn {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 16px !important;
  font-weight: var(--a4-font-weight-bold) !important;
  padding: 14px 32px !important;
}

/* ============================================================================
   Blocksy Footer Customization
   ============================================================================ */

/* Footer Container */
footer[data-id="footer"],
.ct-footer {
  background-color: var(--a4-sidebar) !important;
  border-top: 1px solid var(--a4-sidebar-border) !important;
  padding: 3rem 0 !important;
}

.ct-footer [data-row] {
  background-color: var(--a4-sidebar) !important;
}

/* Footer Headings */
.ct-footer h3,
.ct-footer h4,
.ct-footer .widget-title {
  color: var(--a4-sidebar-foreground) !important;
  font-family: var(--a4-font-family-serif) !important;
}

/* Footer Text */
.ct-footer p,
.ct-footer li,
.ct-footer a {
  color: rgba(255, 255, 255, 0.8) !important;
  font-family: var(--a4-font-family-sans) !important;
}

.ct-footer a:hover {
  color: var(--a4-primary) !important;
}

/* Footer Social Icons */
.ct-footer .ct-social-box a {
  background-color: var(--a4-primary) !important;
  color: white !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: opacity 0.2s ease !important;
}

.ct-footer .ct-social-box a:hover {
  opacity: 0.8 !important;
}

/* Copyright */
.ct-footer .copyright {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.875rem !important;
}

/* Responsive Adjustments */
@media (min-width: 640px) {
  footer[data-id="footer"],
  .ct-footer {
    padding: 4rem 0 !important;
  }
}

@media (min-width: 768px) {
  .site-branding img {
    max-height: 48px !important;
  }
}

/* ─── Language Switcher (Header Widget) ────────────────────────────────── */
.a4-lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--a4-muted);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 3px;
  margin-left: 0.5rem;
}

.a4-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-family: var(--a4-font-family-sans);
  font-size: 13px;
  font-weight: var(--a4-font-weight-bold);
  color: var(--a4-foreground);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  opacity: 0.6;
}

.a4-lang-btn:hover {
  opacity: 1;
}

.a4-lang-btn.is-active {
  background: var(--a4-primary);
  color: #FFFFFF;
  opacity: 1;
}

