:root{
  --ag-dark:#2B363F;
  --ag-orange:#F9481E;
  --ag-orange-hover:#D93A16;
  --ag-green:#A1B928;
  --ag-green-hover:#8FAA23;
  --ag-blue:#3A56C1;
  --ag-purple:#5A3793;
  --ag-bg:#F6F7FB;
  --ag-border:#E6E8EC;
  --ag-white:#FFFFFF;

  --font-zh:
    "Noto Sans TC",
    "Source Han Sans TC",
    "思源黑體 TC",
    "Microsoft JhengHei",
    sans-serif;

  --font-en:
    "Open Sans",
    Arial,
    sans-serif;
}

/* =========================
   GLOBAL
========================= */

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  overflow-x:hidden;
  background:#fff;
  color:var(--ag-dark);
  font-family:var(--font-zh);
}

img{
  max-width:100%;
}

a{
  text-decoration:none;
}

/* =========================
   TOP BAR
========================= */

.topbar{
  width:100%;
  padding:.25rem .75rem;
  background:var(--ag-dark);
}

.topbar a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
  text-decoration:none;
}

.topbar img{
  width:auto;
  height:1.5rem;
  max-height:1.5rem;
  display:block;
  object-fit:contain;
}

.topbar a + a{
  margin-left:.4rem;
}

/* =========================
   NAVBAR
========================= */

.navbar{
  width:100%;
  min-height:88px;
  display:flex;
  align-items:center;
  flex-wrap:nowrap;
  padding:0;
  background:#fff;
  border-bottom:1px solid var(--ag-border);
}

.navbar .container-fluid{
  width:100%;
  min-height:88px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:nowrap;
  padding:10px 18px;
}

.navbar-brand{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  margin:0 28px 0 0;
  padding:0;
}

.navbar-brand img{
  width:280px;
  max-width:280px;
  height:auto;
  max-height:68px;
  display:block;
  object-fit:contain;
}


.navbar-collapse{
  flex:1 1 auto;
  min-width:0;
}

.navbar-nav{
  width:100%;
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-end;
  gap:3px;
  margin:0;
  padding:0;
}

.navbar-nav .nav-item{
  flex:0 0 auto;
  display:flex;
  align-items:center;
}

.navbar-nav .btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--ag-dark);
  background:transparent;
  border:0;
  border-radius:999px;
  padding:.72rem .78rem;
  font-family:var(--font-zh);
  font-size:.88rem;
  font-weight:700;
  line-height:1.4;
  white-space:nowrap;
  transition:
    color .25s ease,
    background-color .25s ease,
    transform .25s ease;
}

.navbar-nav .btn:hover,
.navbar-nav .btn:focus{
  color:#fff;
  background:var(--ag-purple);
  transform:translateY(-1px);
}

/* 課程介紹 active */

.navbar-nav .btn-life{
  color:#fff;
  background:var(--ag-purple) !important;
}

.navbar-nav .btn-life:hover,
.navbar-nav .btn-life:focus{
  color:#fff !important;
  background:var(--ag-purple-hover) !important;
}

/* Hamburger */
.navbar-toggler{
  display:none;
  flex:0 0 auto;
  margin-left:auto;
  padding:.6rem;
  background:transparent;
  border:0;
}

.navbar-toggler:focus{
  box-shadow:none;
}

.navbar-toggler span{
  display:block;
  width:30px;
  height:3px;
  background:var(--ag-dark) !important;
  transition:.25s ease;
}

.navbar-toggler span:not(:first-child){
  margin-top:5px;
}

/* =========================
   PROGRAMS SECTION
========================= */

.classes-compare{
  width:100%;
  padding:88px 40px 100px;
  background:#fff;
}

.compare-title{
  max-width:900px;
  margin:0 auto 64px;
  padding:0 16px;
  text-align:center;
}

.compare-title h1{
  margin:0;
  color:var(--ag-dark);
  font-family:var(--font-en);
  font-style:italic;
  font-weight:800;
  font-size:clamp(2.2rem, 3.2vw, 3.2rem);
  line-height:.95;
  letter-spacing:.025em;
  text-align:center;
}

.compare-title h1 span{
  display:block;
  margin-top:.08em;
  color:var(--ag-orange);
  font-size:.82em;
  line-height:1;
}

.compare-title p{
  max-width:720px;
  margin:24px auto 0;
  color:var(--ag-dark);
  font-size:1.05rem;
  line-height:1.9;
}

/* =========================
   THREE-COLUMN GRID
========================= */

.compare-grid{
  width:100%;
  max-width:1280px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  align-items:stretch;
  gap:28px;
}

/* =========================
   COURSE CARD
========================= */

.course-card{
  min-width:0;
  height:100%;
  display:flex;
  flex-direction:column;
  padding:34px 28px 36px;
  background:#fff;
  border:1px solid rgba(43,54,63,.14);
  border-radius:24px;
  text-align:center;
  box-shadow:0 18px 45px rgba(43,54,63,.08);
  transition:
    transform .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.course-card:hover{
  transform:translateY(-6px);
  border-color:rgba(249,72,30,.25);
  box-shadow:0 26px 64px rgba(43,54,63,.13);
}

/* 標題 */
.course-card h2{
  min-height:68px;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0;
  color:var(--ag-dark);
  font-family:var(--font-en);
  font-style:italic;
  font-weight:800;
  font-size:clamp(1.45rem, 2vw, 1.75rem);
  line-height:1.18;
  text-align:center;
}

/* 中文副標 */
.course-card .subtitle{
  min-height:28px;
  margin:8px 0 24px;
  color:var(--ag-orange);
  font-size:1rem;
  font-weight:800;
  line-height:1.5;
  text-align:center;
}

/* =========================
   COURSE SELECT
========================= */

/* 課程選擇框 */
.course-select{
  width:100%;
  min-height:64px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;

  margin:0 0 24px;
  padding:16px 18px;

  color:var(--ag-dark);
  background:#fff;

  border:3px solid var(--ag-purple);
  border-radius:9px;

  font-family:var(--font-zh);
  font-size:1rem;
  font-weight:800;
  line-height:1.5;
  text-align:left;

  cursor:pointer;
  appearance:none;

  transition:
    color .25s ease,
    background-color .25s ease,
    border-color .25s ease,
    border-radius .25s ease;
}


/* 滑鼠移入：紫底白字 */
.course-select:hover{
  color:#fff;
  background:var(--ag-purple);
  border-color:var(--ag-purple);
}


/* 鍵盤焦點：維持白底 */
.course-select:focus{
  color:var(--ag-dark);
  background:#fff;
  border-color:var(--ag-purple);

  outline:2px solid rgba(90,55,147,.22);
  outline-offset:2px;
}


/* 右側加號 */
.course-select-icon{
  flex:0 0 auto;

  color:var(--ag-green);

  font-family:Arial,sans-serif;
  font-size:1.55rem;
  font-weight:400;
  line-height:1;

  transition:
    color .25s ease,
    transform .25s ease;
}


/* hover 時加號變白 */
.course-select:hover .course-select-icon{
  color:#fff;
}


/* focus 時維持綠色 */
.course-select:focus .course-select-icon{
  color:var(--ag-green);
}


/* =========================
   OPEN STATE
========================= */

/* 展開後按鈕維持白底 */
.course-card.is-open .course-select{
  margin-bottom:0;

  color:var(--ag-dark);
  background:#fff;
  border-color:var(--ag-purple);

  border-radius:9px 9px 0 0;
  outline:none;
}


/* 展開後只有 hover 才變紫色 */
.course-card.is-open .course-select:hover{
  color:#fff;
  background:var(--ag-purple);
}


/* 展開後加號旋轉為 × */
.course-card.is-open .course-select-icon{
  color:var(--ag-green);
  transform:rotate(45deg);
}


/* 展開狀態 hover 時，圖示變白 */
.course-card.is-open .course-select:hover .course-select-icon{
  color:#fff;
}


/* =========================
   COURSE LIST
========================= */

.course-class-list{
  display:none;

  width:100%;
  margin:0 0 24px;
  padding:0;

  overflow:hidden;

  background:#fff;
  border:3px solid var(--ag-purple);
  border-top:0;
  border-radius:0 0 9px 9px;
}


/* 顯示課程清單 */
.course-card.is-open .course-class-list{
  display:block;
}


/* 每一個課程選項 */
.course-class-item{
  width:100%;
  min-height:54px;

  display:flex;
  align-items:center;

  margin:0;
  padding:14px 18px;

  color:var(--ag-dark);
  background:#fff;

  border:0;
  border-bottom:1px solid var(--ag-border);
  border-radius:0;

  box-sizing:border-box;

  font-family:var(--font-zh);
  font-size:.95rem;
  font-weight:700;
  line-height:1.5;
  text-align:left;
  text-decoration:none;

  transition:
    color .2s ease,
    background-color .2s ease;
}


/* 最後一個選項不需要底線 */
.course-class-item:last-child{
  border-bottom:0;
}


/* 整行 hover：紫底白字 */
.course-class-item:hover,
.course-class-item:focus{
  color:#fff;
  background:var(--ag-purple);
  outline:none;
}

/* 圖片 */
.course-image{

    width:100%;

    margin:28px 0;

    border-radius:22px;

    overflow:hidden;

    background:none;

    box-shadow:0 10px 30px rgba(0,0,0,.08);

    padding:0;
}

.course-image img{

    display:block;

    width:100%;

    aspect-ratio:4 / 3;

    object-fit:cover;

    transition:.35s ease;
}

.course-card:nth-child(1) .course-image img{
  object-position:center center;
}

.course-card:nth-child(2) .course-image img{
  object-position:center center;
}

.course-wellness img,
.course-card:nth-child(3) .course-image img{
  object-position:center top;
}

/* 介紹文字 */
.course-card .desc{
  margin:0;
  color:var(--ag-dark);
  font-size:1rem;
  line-height:1.9;
  text-align:left;
}

/* 清單 */
.course-card ul{
  margin:24px 0 0;
  padding-left:1.25rem;
  color:var(--ag-dark);
  font-size:1rem;
  line-height:1.8;
  text-align:left;
}

.course-card li{
  margin-bottom:.35rem;
}

/* 按鈕 */
.course-btn{
  min-width:128px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  margin-top:auto;
  padding:13px 30px;
  color:#fff;
  background:var(--ag-orange);
  border-radius:999px;
  font-size:1rem;
  font-weight:800;
  line-height:1.4;
  text-decoration:none;
  transition:
    background-color .25s ease,
    color .25s ease,
    transform .25s ease;
}

.course-card ul + .course-btn{
  margin-top:30px;
}

.course-btn:hover,
.course-btn:focus{
  color:#fff;
  background:var(--ag-purple);
  transform:translateY(-2px);
}

/* =========================
   CTA
========================= */

.cta{
  width:100%;
  padding:80px 40px;
  color:#fff;
  background:var(--ag-dark);
  text-align:center;
}

.cta h2{
  margin:0;
  font-family:var(--font-en);
  font-style:italic;
  font-weight:800;
  font-size:clamp(2.4rem, 4vw, 3rem);
}

.cta p{
  margin:20px 0 0;
  line-height:1.8;
}

.cta a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:25px;
  padding:14px 36px;
  color:#fff;
  background:var(--ag-orange);
  border-radius:999px;
  font-weight:800;
  text-decoration:none;
  transition:
    background-color .25s ease,
    transform .25s ease;
}

.cta a:hover{
  color:#fff;
  background:var(--ag-green);
  transform:translateY(-2px);
}

/* =========================
   FOOTER
========================= */

.footer{
  width:100%;
  padding:24px 40px;
  color:#fff;
  background:var(--ag-blue);
  font-family:var(--font-en);
}

.footer-inner{
  width:100%;
  max-width:1180px;
  min-height:72px;
  margin:0 auto;
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:32px;
}

.footer-logo{
  display:flex;
  align-items:center;
}

.footer-logo a{
  display:flex;
  align-items:center;
}

.footer-logo img{
  width:220px;
  height:auto;
  max-width:100%;
  display:block;
  object-fit:contain;
}

.footer-copy{
  color:#fff;
  font-size:.92rem;
  line-height:1.5;
  text-align:center;
  white-space:nowrap;
}

.footer-social{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:18px;
}

.footer-social a{
  width:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  transition:
    opacity .25s ease,
    transform .25s ease;
}

.footer-social img{
  width:26px !important;
  height:26px !important;
  max-width:26px !important;
  max-height:26px !important;
  display:block;
  object-fit:contain;
}

.footer-social a:hover{
  opacity:.8;
  transform:translateY(-2px);
}

/* =========================
   SMALL DESKTOP
========================= */

@media(max-width:1100px){

  .classes-compare{
    padding-right:24px;
    padding-left:24px;
  }

  .compare-grid{
    gap:18px;
  }

  .course-card{
    padding:28px 20px 32px;
  }

  .course-card h2{
    font-size:1.4rem;
  }

  .course-select{
    padding:14px;
    font-size:.94rem;
  }

  .navbar .container-fluid{
    padding-right:12px;
    padding-left:12px;
  }

  .navbar-brand{
    margin-right:14px;
  }

  .navbar-brand img{
    width:235px;
    max-width:235px;
  }

  .navbar-nav .btn{
    padding:.68rem .5rem;
    font-size:.79rem;
  }
}

/* =========================
   TABLET / MOBILE NAVBAR
========================= */

@media(max-width:991.98px){

  .navbar{
    min-height:92px;
    flex-wrap:wrap;
  }

  .navbar .container-fluid{
    min-height:92px;
    flex-wrap:wrap;
    padding:10px 18px;
  }

  .navbar-brand{
    flex:0 1 auto;
    max-width:calc(100% - 64px);
    margin:0;
    padding:0;
  }

  .navbar-brand img{
    width:auto;
    max-width:76vw;
    max-height:76px;
    display:block;
    object-fit:contain;
  }

  .navbar-toggler{
    flex:0 0 auto;
    width:46px;
    height:46px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    margin:0 0 0 12px;
    padding:8px;
    background:transparent;
    border:0;
  }

  .navbar-toggler:focus{
    box-shadow:none;
  }

  .navbar-toggler span{
    display:block;
    width:30px;
    height:3px;
    background:var(--ag-orange);
  }

  .navbar-toggler span:not(:first-child){
    margin-top:5px;
  }

  .navbar-collapse{
    flex:0 0 100%;
    width:100%;
    margin-top:12px;
  }

  .navbar-nav{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    margin:0;
    padding:8px 0 18px;
  }

  .navbar-nav .nav-item{
    width:100%;
  }

  .navbar-nav .btn{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    padding:.8rem 1rem;
    font-size:.95rem;
    font-weight:700;
    border-radius:8px;
    text-align:left;
  }

  .navbar-nav .btn-life{
    color:#fff;
  }
}

/* =========================
   MOBILE
========================= */

@media(max-width:768px){

  .classes-compare{
    padding:64px 0 74px;
  }

  .compare-title{
    margin-bottom:44px;
    padding:0 24px;
  }

  .compare-title h1{
    font-size:clamp(2.6rem, 13vw, 3.6rem);
    line-height:.95;
    letter-spacing:0;
  }

  .compare-title h1 span{
    font-size:.78em;
  }

  .compare-title p{
    margin-top:22px;
    font-size:1rem;
    line-height:1.8;
  }

  /* 手機左右滑動 */
  .compare-grid{
    display:flex;
    width:100%;
    max-width:none;
    gap:18px;
    padding:0 24px 18px;
    overflow-x:auto;
    overscroll-behavior-inline:contain;
    scroll-padding-left:24px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }

  .compare-grid::-webkit-scrollbar{
    height:5px;
  }

  .compare-grid::-webkit-scrollbar-track{
    background:transparent;
  }

  .compare-grid::-webkit-scrollbar-thumb{
    background:rgba(43,54,63,.18);
    border-radius:999px;
  }

  .course-card{
    flex:0 0 min(84vw, 360px);
    scroll-snap-align:start;
    padding:28px 22px 32px;
    border-radius:22px;
  }

  .course-card:hover{
    transform:none;
  }

  .course-card h2{
    min-height:auto;
    font-size:1.65rem;
  }

  .course-card .subtitle{
    min-height:auto;
    margin-bottom:22px;
  }

  .course-select{
    min-height:72px;
    margin-bottom:24px;
    padding:14px 16px;
  }

.course-image{
    margin-bottom:28px;
    overflow:hidden;
    border-radius:20px;
}

.course-image img{
    display:block;
    width:100%;
    height:auto;
}

  .course-card .desc{
    font-size:1rem;
    line-height:1.9;
  }

  .course-card ul{
    font-size:1rem;
  }

  .cta{
    padding:70px 24px;
  }

  .footer{
    padding:34px 22px 40px;
  }

  .footer-inner{
    min-height:auto;
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:18px;
    text-align:center;
  }

  .footer-logo img{
    width:190px;
  }

  .footer-copy{
    font-size:.88rem;
    line-height:1.6;
    white-space:normal;
  }

  .footer-social{
    width:100%;
    justify-content:center;
    gap:22px;
  }

  .footer-social a{
    width:40px;
    height:40px;
  }

  .footer-social img{
    width:28px !important;
    height:28px !important;
    max-width:28px !important;
    max-height:28px !important;
  }
}

/* =========================
   VERY SMALL MOBILE
========================= */

@media(max-width:420px){

  .navbar .container-fluid{
    padding-right:12px;
    padding-left:12px;
  }

  .navbar-brand{
    max-width:calc(100% - 60px);
  }

  .navbar-brand img{
    max-width:76vw;
  }

  .compare-title h1{
    font-size:clamp(2.35rem, 12.5vw, 3rem);
  }

  .course-card{
    flex-basis:86vw;
  }

  .course-card h2{
    font-size:1.5rem;
  }

  .course-select{
    font-size:.95rem;
  }
}
/* ========================================
   DYNAMIC COURSE CONTENT
======================================== */

.course-information {
  padding-top: 24px;
}

.selected-course-name {
  margin: 0 0 16px;

  color: var(--ag-dark-blue, #243547);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.45;
}

.course-information .desc {
  margin: 0;

  color: var(--ag-muted, #657586);
  font-size: 16px;
  line-height: 1.9;

  white-space: pre-line;
}


/* 課程圖片 */

.course-image {
  width: 100%;
  margin-top: 18px;
  overflow: hidden;

  background: #f2f4f7;
  border-radius: 18px;
}

.course-image img {
  display: block;

  width: 100%;
  height: 430px;

  object-fit: cover;
  object-position: center;

  opacity: 1;

  transition:
    opacity 0.25s ease,
    transform 0.45s ease;
}

.course-image img.is-changing {
  opacity: 0;
}

.course-card:hover .course-image img {
  transform: scale(1.02);
}


/* Select */

.course-select-wrap {
  position: relative;
}

.course-select {
  width: 100%;
  min-height: 54px;
  padding: 0 48px 0 16px;

  color: var(--ag-dark-blue, #243547);
  font-size: 15px;
  font-weight: 700;

  background: #ffffff;
  border: 2px solid #5d3aa8;
  border-radius: 9px;

  cursor: pointer;
  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.course-select:focus {
  border-color: #f05a28;

  box-shadow:
    0 0 0 4px rgba(240, 90, 40, 0.12);
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1024px) {

  .course-image img {
    height: 360px;
  }

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 767px) {

  .selected-course-name {
    font-size: 20px;
  }

  .course-information .desc {
    font-size: 15px;
    line-height: 1.8;
  }

  .course-image img {
    height: 300px;
  }

}


/* 小型手機 */

@media (max-width: 420px) {

  .course-image img {
    height: 250px;
  }

}
