/*
 Theme Name:   Fresh Blog Lite Child
 Description:  AirSOTA Real Estate Agent — Web App UI
 Author:       AirSOTA
 Template:     fresh-blog-lite
 Version:      3.0.0
*/

/* =============================================
   1. DESIGN SYSTEM — CSS Variables
   ============================================= */
:root {
  /* AirSOTA Brand Palette (from logo) */
  --brand-ice:    #dce8f3;
  --brand-light:  #a5c8e4;
  --brand-main:   #5b9bd5;
  --brand-deep:   #3a7bbf;
  --brand-dark:   #1c4568;
  --brand-navy:   #0f2d47;

  /* Semantic Colors */
  --color-exam:   #10b981;
  --color-agent:  #5b9bd5;
  --color-news:   #f59e0b;

  /* Light Theme */
  --bg-primary:       #f4f7fa;
  --bg-surface:       #ffffff;
  --bg-surface-hover: #f8fbff;
  --text-heading:     #0f172a;
  --text-body:        #334155;
  --text-muted:       #94a3b8;
  --border:           #e2e8f0;
  --border-hover:     #cbd5e1;

  /* Elevation */
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.08);
  --shadow-hover: 0 12px 32px rgba(27,75,119,0.12);

  /* Radius */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --header-height: 64px;
}

/* =============================================
   2. DARK MODE
   ============================================= */
[data-theme="dark"] {
  --bg-primary:       #0c1222;
  --bg-surface:       #162032;
  --bg-surface-hover: #1c2a40;
  --text-heading:     #f1f5f9;
  --text-body:        #cbd5e1;
  --text-muted:       #64748b;
  --border:           #1e3148;
  --border-hover:     #2d4a6a;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.2);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.5);
  --brand-main: #7cb8e8;
  --brand-dark: #a5c8e4;
}

/* =============================================
   3. GLOBAL RESETS & BASE
   ============================================= */
html {
  scroll-behavior: smooth;
}

body, html {
  background-color: var(--bg-primary) !important;
  color: var(--text-body) !important;
  transition: background-color 0.35s var(--ease-smooth),
              color 0.35s var(--ease-smooth) !important;
}

a {
  color: var(--brand-main);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--brand-deep);
}
[data-theme="dark"] a:hover {
  color: var(--brand-light);
}

/* =============================================
   4. STICKY HEADER — Glass Morphism
   ============================================= */
header.wp-block-template-part {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  background: rgba(255,255,255,0.82) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: background 0.3s, border-color 0.3s !important;
}
[data-theme="dark"] header.wp-block-template-part {
  background: rgba(12,18,34,0.85) !important;
}

header .wp-block-group.alignfull {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* Site Title */
.wp-block-site-title a {
  color: var(--brand-dark) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  font-size: 1.3rem !important;
  transition: color 0.3s;
}
[data-theme="dark"] .wp-block-site-title a {
  color: var(--brand-light) !important;
}

/* Site Tagline */
.wp-block-site-tagline {
  color: var(--text-muted) !important;
  font-size: 0.8rem !important;
}

/* Navigation Links */
.wp-block-navigation a {
  color: var(--text-body) !important;
  font-weight: 500;
  font-size: 0.9rem !important;
  transition: color 0.2s;
}
.wp-block-navigation a:hover {
  color: var(--brand-main) !important;
}

/* Subscribe Button */
.wp-block-button__link {
  background: var(--brand-main) !important;
  color: #fff !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 20px !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  transition: all 0.25s var(--ease-smooth) !important;
  border: none !important;
}
.wp-block-button__link:hover {
  background: var(--brand-deep) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* =============================================
   5. HERO SECTION (Section 1 / Cover Block)
   ============================================= */
.wp-block-cover {
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}

/* =============================================
   6. DASHBOARD CARD GRID — Post Loop
   ============================================= */
.wp-block-query {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  gap: 24px !important;
  list-style: none !important;
}

/* Individual Post Card */
.wp-block-post-template > .wp-block-post,
.wp-block-post-template > li {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.35s var(--ease-smooth) !important;
  display: flex !important;
  flex-direction: column !important;
}
.wp-block-post-template > .wp-block-post:hover,
.wp-block-post-template > li:hover {
  transform: translateY(-6px) !important;
  box-shadow: var(--shadow-hover) !important;
  border-color: var(--brand-main) !important;
}

/* Featured Image in Card */
.wp-block-post-featured-image {
  margin: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
}
.wp-block-post-featured-image img {
  transition: transform 0.5s var(--ease-smooth) !important;
}
.wp-block-post-template > .wp-block-post:hover .wp-block-post-featured-image img,
.wp-block-post-template > li:hover .wp-block-post-featured-image img {
  transform: scale(1.05) !important;
}

/* Post Title in Card */
.wp-block-post-title {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}
.wp-block-post-title a {
  color: var(--text-heading) !important;
  text-decoration: none !important;
}
.wp-block-post-title a:hover {
  color: var(--brand-main) !important;
}

/* Post Meta */
.wp-block-post-date,
.wp-block-post-terms {
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}
.wp-block-post-terms a {
  color: var(--brand-main) !important;
  font-weight: 600;
}

/* Post Excerpt */
.wp-block-post-excerpt {
  font-size: 0.88rem !important;
  color: var(--text-muted) !important;
  line-height: 1.5 !important;
}

/* =============================================
   7. PILLAR CATEGORY PAGES — Distinct UI
   ============================================= */

/* --- Exam Prep (祖母绿高亮) --- */
body.category-exam-prep .wp-block-post-template > li,
body.category-exam-prep .wp-block-post-template > .wp-block-post {
  border-top: 3px solid var(--color-exam) !important;
}
body.category-exam-prep .wp-block-post-template > li:hover,
body.category-exam-prep .wp-block-post-template > .wp-block-post:hover {
  border-color: var(--color-exam) !important;
  box-shadow: 0 12px 32px rgba(16,185,129,0.15) !important;
}
body.category-exam-prep .wp-block-post-terms a {
  color: var(--color-exam) !important;
}

/* --- Agent Resources (AirSOTA 蓝) --- */
body.category-agent-resources .wp-block-post-template > li,
body.category-agent-resources .wp-block-post-template > .wp-block-post {
  border-left: 4px solid var(--brand-main) !important;
}
body.category-agent-resources .wp-block-post-template > li:hover,
body.category-agent-resources .wp-block-post-template > .wp-block-post:hover {
  transform: translateX(4px) translateY(-4px) !important;
  border-color: var(--brand-deep) !important;
  box-shadow: 0 12px 32px rgba(59,123,191,0.15) !important;
}

/* --- Industry News (琥珀能量) --- */
body.category-industry-news .wp-block-post-template > li,
body.category-industry-news .wp-block-post-template > .wp-block-post {
  border-bottom: 3px solid var(--color-news) !important;
}
body.category-industry-news .wp-block-post-template > li:hover,
body.category-industry-news .wp-block-post-template > .wp-block-post:hover {
  border-color: var(--color-news) !important;
  box-shadow: 0 12px 32px rgba(245,158,11,0.15) !important;
}
body.category-industry-news .wp-block-post-terms a {
  color: var(--color-news) !important;
}

/* =============================================
   8. HOMEPAGE PILLAR HUB — Three Section Dashboard
   ============================================= */

/* Fix: WordPress FSE constrained layout limits content to 680px and left-aligns.
   We need to break out of it for the hub dashboard. */
body.page .wp-block-post-content.is-layout-constrained,
body.page .entry-content.is-layout-constrained {
  max-width: 100% !important;
}
body.page .wp-block-post-content.is-layout-constrained > .airsota-hub,
body.page .entry-content.is-layout-constrained > .airsota-hub {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Override the constrained layout centering rules */
body.page .wp-block-post-content.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Also ensure main container allows full width */
body.page main.is-layout-constrained {
  max-width: 100% !important;
}
body.page main.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Hide redundant page title "AirSOTA Hub" */
body.page .wp-block-post-title,
body.page .entry-title,
body.page h1.wp-block-post-title {
  display: none !important;
}

.airsota-hub {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.airsota-hub__hero {
  text-align: center;
  margin-bottom: 48px;
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--brand-ice), var(--bg-surface));
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}
[data-theme="dark"] .airsota-hub__hero {
  background: linear-gradient(135deg, var(--brand-navy), var(--bg-surface));
}
.airsota-hub__hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}
.airsota-hub__hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

/* Pillar Navigation Cards Row */
.airsota-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}
@media (max-width: 768px) {
  .airsota-pillars {
    grid-template-columns: 1fr;
  }
}

.airsota-pillar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s var(--ease-smooth);
  text-decoration: none !important;
  display: block;
  position: relative;
  overflow: hidden;
}
.airsota-pillar:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.airsota-pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  transition: height 0.3s;
}
.airsota-pillar:hover::before {
  height: 6px;
}

.airsota-pillar--exam::before  { background: var(--color-exam); }
.airsota-pillar--agent::before { background: var(--color-agent); }
.airsota-pillar--news::before  { background: var(--color-news); }

.airsota-pillar__icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
  display: block;
}
.airsota-pillar__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 6px;
}
.airsota-pillar__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.airsota-pillar__count {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
}
.airsota-pillar--exam .airsota-pillar__count  { background: var(--color-exam); }
.airsota-pillar--agent .airsota-pillar__count { background: var(--color-agent); }
.airsota-pillar--news .airsota-pillar__count  { background: var(--color-news); }

/* Recent Posts per Pillar Section */
.airsota-section {
  margin-bottom: 48px;
}
.airsota-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.airsota-section__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.airsota-section__title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.airsota-section--exam .dot  { background: var(--color-exam); }
.airsota-section--agent .dot { background: var(--color-agent); }
.airsota-section--news .dot  { background: var(--color-news); }

.airsota-section__more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-main) !important;
  transition: transform 0.2s;
}
.airsota-section__more:hover {
  transform: translateX(4px);
}

/* Mini Post List */
.airsota-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.airsota-post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.3s var(--ease-smooth);
}
.airsota-post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}
.airsota-post-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
}
.airsota-post-card__title a {
  color: var(--text-heading) !important;
}
.airsota-post-card__title a:hover {
  color: var(--brand-main) !important;
}
.airsota-post-card__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =============================================
   9. SINGLE POST ARTICLE
   ============================================= */
.wp-block-post-content {
  max-width: 740px !important;
  margin: 0 auto;
  color: var(--text-body);
  font-size: 1.05rem;
  line-height: 1.75;
}
.wp-block-post-content h2,
.wp-block-post-content h3 {
  color: var(--text-heading);
  margin-top: 2em;
}

/* =============================================
   10. FOOTER
   ============================================= */
footer.wp-block-template-part {
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border) !important;
  transition: background 0.3s, border-color 0.3s;
}
footer.wp-block-template-part * {
  color: var(--text-muted) !important;
}

/* =============================================
   11. SIDEBAR CLEANUP
   ============================================= */
.wp-block-template-part[data-slug="sidebar"] {
  background: transparent !important;
}

/* =============================================
   12. DARK/LIGHT TOGGLE BUTTON
   ============================================= */
.airsota-theme-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-heading);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: all 0.3s var(--ease-spring);
}
.airsota-theme-toggle:hover {
  transform: scale(1.12) rotate(15deg);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-main);
}

/* =============================================
   13. SCROLLBAR POLISH
   ============================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--brand-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-main);
}

/* =============================================
   14. RESPONSIVE BREAKPOINTS
   ============================================= */
@media (max-width: 768px) {
  .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
  .airsota-hub__hero h1 {
    font-size: 1.5rem;
  }
  header .wp-block-group.alignfull {
    padding: 8px 12px !important;
  }
}
