/* ==========================================================================
   首頁（front page）版面編排 — 2026-10
   由子主題 functions.php 以 is_front_page() 條件載入，其他頁面唔會載入本檔。
   本檔只放「頁面版面」規則：色帶間距、置中、卡片、背景圖段落、FAQ 容器闊度。
   元件 CSS 已分開（2026-10 由本檔搬出，規則原封不動）：
     - Hero 輪播            → assets/css/carousel/hero.css
     - 支援的平台 carousel   → assets/css/carousel/platforms.css
    ⚠️ 部分規則用 :nth-child() 定位段落（**由 hero 數起：hero = 第 1 段**）；首頁新增／刪除段落、或者 hero 搬入／搬出內文，都要同步 ±1。
   ========================================================================== */

/* ==========================================================================
   首頁（front page）版面優化 — 2026-10
   全部規則以 .home 開頭，只影響首頁，其他頁面不受影響。
    ⚠️ 用 :nth-child() 定位段落（由 hero 數起）：如果日後喺首頁新增／刪除段落，次序會變，要同步改。
   ========================================================================== */

/* ── 1. 色帶之間唔再留白色空隙（每段之間原本有 19.2px margin）────────────── */
.home .entry-content > .wp-block-group.alignfull{margin-block-start:0!important;}

/* ── 2. 第 2 段（AI Agent 內容管理方案）：文字同按鈕置中 ──────────────────
   段數由 hero 數起（hero = 第 1 段）；2026-10 hero 搬入內文之後，本組 selector 已跟住 +1。 */
.home .entry-content > *:nth-child(2){text-align:center;}
.home .entry-content > *:nth-child(2) .wp-block-buttons{justify-content:center;}

/* 主按鈕：白底 + body text 深灰字 */
.home .entry-content > *:nth-child(2) .wp-block-button__link.has-background{
  background-color:#fff!important;color:var(--ug-fancy-text)!important;border:1px solid #fff!important;
}
.home .entry-content > *:nth-child(2) .wp-block-button__link.has-background:hover,
.home .entry-content > *:nth-child(2) .wp-block-button__link.has-background:focus{
  background-color:var(--ug-body-text)!important;color:#fff!important;border:1px solid var(--ug-body-text)!important;
}
/* WhatsApp 按鈕：外觀不變，hover / focus 同主按鈕一致 */
.home .entry-content > *:nth-child(2) .wp-block-button__link:not(.has-background):hover,
.home .entry-content > *:nth-child(2) .wp-block-button__link:not(.has-background):focus{
  background-color:var(--ug-body-text)!important;color:#fff!important;border-color:var(--ug-body-text)!important;
}

/* ── 3. 第 3 段（三項 AI Agent 方案一覽）：卡片去邊框、加 4:3 圖片 ─────── */
.home .entry-content > *:nth-child(3){text-align:center;--ug-card-image:url('https://hermes.hundredkitstudio.com/wp-content/uploads/2026/10/800x600-min.jpg');}
.home .entry-content > *:nth-child(3) .ug-card{
  text-align:left;border:none;padding:0!important;overflow:hidden;
}
/* 卡片內文字／按鈕保持原本 1.75rem 內距（因為 padding 移到子元素）*/
.home .entry-content > *:nth-child(3) .ug-card > *{padding-inline:1.75rem;}
.home .entry-content > *:nth-child(3) .ug-card > *:first-child{padding-block-start:1.75rem;}
.home .entry-content > *:nth-child(3) .ug-card > *:last-child{padding-block-end:1.75rem;}
/* 4:3 圖片位：full width、無 padding（圖片 URL 之後換成實際上載嘅圖）*/
.home .entry-content > *:nth-child(3) .ug-card::before{
  content:"";display:block;width:100%;aspect-ratio:4/3;
  background-color:var(--ug-surface);
  background-image:var(--ug-card-image,none);
  background-size:cover;background-position:center;background-repeat:no-repeat;
}

/* ── 4. 第 4 段（香港中小企為何需要內容管理幫手）：置中 + 背景圖 + 白字 ── */
.home .entry-content > *:nth-child(4){
  text-align:center;color:#fff!important;
  background-image:linear-gradient(rgba(0,0,0,.5),rgba(0,0,0,.5)),url('https://hermes.hundredkitstudio.com/wp-content/uploads/2026/10/1920x1080-min.jpg');
  background-size:cover;background-position:center;background-repeat:no-repeat;
}
.home .entry-content > *:nth-child(4) h2,
.home .entry-content > *:nth-child(4) h3,
.home .entry-content > *:nth-child(4) p,
.home .entry-content > *:nth-child(4) li,
.home .entry-content > *:nth-child(4) a{color:#fff!important;}
.home .entry-content > *:nth-child(4) h2{border-color:rgba(255,255,255,.5)!important;}

/* ── 5. 常見問題 accordion（WordPress 原生 core/details 區塊）────────────
   主題 style.css 已有基本外框（白底、圓角、邊框）同 summary 樣式，
   呢度只加指示箭咀、hover 同展開後嘅細節。 */
.home .entry-content .wp-block-details{transition:border-color .2s ease;}
.home .entry-content .wp-block-details:hover{border-color:var(--ug-primary);}
.home .entry-content .wp-block-details summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:1rem;}
.home .entry-content .wp-block-details summary::-webkit-details-marker{display:none;}
.home .entry-content .wp-block-details summary::after{
  content:"";flex:0 0 auto;width:.5rem;height:.5rem;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(45deg);transition:transform .2s ease;margin-top:-.2rem;
}
.home .entry-content .wp-block-details[open] summary::after{transform:rotate(-135deg);margin-top:.25rem;}
.home .entry-content .wp-block-details[open]{padding-bottom:1rem;}
.home .entry-content .wp-block-details > p:last-child{margin-block-end:0;}
@media (prefers-reduced-motion:reduce){
  .home .entry-content .wp-block-details,
  .home .entry-content .wp-block-details summary::after{transition:none;}
}
/* 點擊 accordion 標題後，瀏覽器／主題會畫焦點框：滑鼠點擊唔顯示，鍵盤操作保留提示 */
.home .entry-content .wp-block-details summary:focus{outline:none;}
.home .entry-content .wp-block-details summary:focus-visible{outline:2px solid var(--ug-focus);outline-offset:2px;}

/* ── 6. 常見問題段：容器闊度改 1000px ─────────────────────────────────────
   原本受限於全域 --wp--style--global--content-size（645px）→ 只放大本段。
   2026-10 改為用 :has() 認住含 accordion（core/details）嘅段落，
   唔再用 nth-child — 因為喺「支援的平台」之後新增咗 carousel 段落，
   原本嘅 :nth-child(6) 已經唔再指住常見問題。 */
.home .entry-content > .wp-block-group:has(.wp-block-details){--wp--style--global--content-size:1000px;}
