/* ============================================================
   Utilities — 對齊 Bootstrap 5.3 命名與 spacing scale。
   未來若整體升級 BS5，可整批 drop-in，HTML class 名不用改。

   章節索引：
     §1 LAYOUT        display / flex / position / overflow / grid
     §2 SPACING       gap / margin / padding
     §3 SIZING        width / height
     §4 TYPOGRAPHY    text-align / wrap / size / line-height / fw / fst
     §5 COLOR         text / background（token-backed; see tokens.css）
     §6 BORDER        width / radius
     §7 MISC          a11y / pointer-events / object-fit
     §8 RESPONSIVE    所有 @media 變體集中於此

   spacing scale（與 BS5 一致）：
     0 = 0
     1 = 0.25rem (4px)
     2 = 0.5rem  (8px)
     3 = 1rem    (16px)
     4 = 1.5rem  (24px)
     5 = 3rem    (48px)
   ============================================================ */


/* ============================================================
   §1 · LAYOUT
   ============================================================ */

/* ----- Display ----- */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-grid { display: grid; }
.d-none { display: none; }

/* ----- Flex direction ----- */
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-column { flex-direction: column; }
.flex-column-reverse { flex-direction: column-reverse; }

/* ----- Flex wrap ----- */
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

/* ----- Flex grow / shrink / fill ----- */
.flex-grow-0 { flex-grow: 0; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-shrink-1 { flex-shrink: 1; }
.flex-fill { flex: 1 1 auto; }

/* ----- Justify content ----- */
.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.justify-content-evenly { justify-content: space-evenly; }

/* ----- Align items ----- */
.align-items-start    { align-items: flex-start; }
.align-items-end      { align-items: flex-end; }
.align-items-center   { align-items: center; }
.align-items-baseline { align-items: baseline; }
.align-items-stretch  { align-items: stretch; }

/* ----- Align self ----- */
.align-self-start { align-self: flex-start; }
.align-self-end { align-self: flex-end; }
.align-self-center { align-self: center; }
.align-self-stretch { align-self: stretch; }

/* ----- Position ----- */
.position-static { position: static; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* ----- Overflow ----- */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }

/* ----- Grid (BS5 minimal) -----
   只實作目前 markup 用到的 col 變體。caller 增加時再擴。
   gutter 用 BS5 預設 1.5rem（24px 總計、12px 每邊）。
   sm/md/lg col 變體在 §8 RESPONSIVE。 */
.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
}

/* Gutter（BS5；設定 --bs-gutter-x/-y 給 .row / .col-* 讀） */
.g-0  { --bs-gutter-x: 0;       --bs-gutter-y: 0; }
.g-1  { --bs-gutter-x: 0.25rem; --bs-gutter-y: 0.25rem; }
.g-2  { --bs-gutter-x: 0.5rem;  --bs-gutter-y: 0.5rem; }
.g-3  { --bs-gutter-x: 1rem;    --bs-gutter-y: 1rem; }
.g-4  { --bs-gutter-x: 1.5rem;  --bs-gutter-y: 1.5rem; }
.g-5  { --bs-gutter-x: 3rem;    --bs-gutter-y: 3rem; }

.gx-0 { --bs-gutter-x: 0; }
.gx-1 { --bs-gutter-x: 0.25rem; }
.gx-2 { --bs-gutter-x: 0.5rem; }
.gx-3 { --bs-gutter-x: 1rem; }
.gx-4 { --bs-gutter-x: 1.5rem; }
.gx-5 { --bs-gutter-x: 3rem; }

.gy-0 { --bs-gutter-y: 0; }
.gy-1 { --bs-gutter-y: 0.25rem; }
.gy-2 { --bs-gutter-y: 0.5rem; }
.gy-3 { --bs-gutter-y: 1rem; }
.gy-4 { --bs-gutter-y: 1.5rem; }
.gy-5 { --bs-gutter-y: 3rem; }

.col-12 {
  flex: 0 0 auto;
  padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
  padding-left:  calc(var(--bs-gutter-x, 1.5rem) * .5);
  margin-top: var(--bs-gutter-y, 0);
  width: 100%;
}


/* ============================================================
   §2 · SPACING
   ============================================================ */

/* ----- Gap ----- */
.gap-0 { gap: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.gap-5 { gap: 3rem; }

/* ----- Margin ----- */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 1rem; }
.m-4 { margin: 1.5rem; }
.m-5 { margin: 3rem; }
.m-auto { margin: auto; }

.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-3 { margin-left: 1rem; margin-right: 1rem; }
.mx-4 { margin-left: 1.5rem; margin-right: 1.5rem; }
.mx-5 { margin-left: 3rem; margin-right: 3rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mt-auto { margin-top: auto; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mb-auto { margin-bottom: auto; }

.ms-0 { margin-left: 0; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.ms-3 { margin-left: 1rem; }
.ms-4 { margin-left: 1.5rem; }
.ms-5 { margin-left: 3rem; }
.ms-auto { margin-left: auto; }

.me-0 { margin-right: 0; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.me-3 { margin-right: 1rem; }
.me-4 { margin-right: 1.5rem; }
.me-5 { margin-right: 3rem; }
.me-auto { margin-right: auto; }

/* ----- Padding ----- */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-4 { padding-bottom: 1.5rem; }
.pb-5 { padding-bottom: 3rem; }

.ps-0 { padding-left: 0; }
.ps-1 { padding-left: 0.25rem; }
.ps-2 { padding-left: 0.5rem; }
.ps-3 { padding-left: 1rem; }
.ps-4 { padding-left: 1.5rem; }
.ps-5 { padding-left: 3rem; }

.pe-0 { padding-right: 0; }
.pe-1 { padding-right: 0.25rem; }
.pe-2 { padding-right: 0.5rem; }
.pe-3 { padding-right: 1rem; }
.pe-4 { padding-right: 1.5rem; }
.pe-5 { padding-right: 3rem; }


/* ============================================================
   §3 · SIZING
   ============================================================ */

/* ----- Width / Height ----- */
.w-25 { width: 25%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.w-100 { width: 100%; }
.w-auto { width: auto; }

.h-25 { height: 25%; }
.h-50 { height: 50%; }
.h-75 { height: 75%; }
.h-100 { height: 100%; }
.h-auto { height: auto; }


/* ============================================================
   §4 · TYPOGRAPHY
   ============================================================ */

/* ----- Text alignment（BS5 logical 命名）-----
   注意：.text-center 已由 BS3 提供；BS3 也有 .text-left / .text-right，
   這裡只補 BS5 才有的 .text-start / .text-end，避免與 BS3 同名衝突。 */
.text-start { text-align: left; }
.text-end { text-align: right; }

/* ----- Text wrap（BS5） ----- */
.text-wrap   { white-space: normal; }
.text-nowrap { white-space: nowrap; }

/* ----- Font size ----- */
.fs-1 { font-size: 2.5rem; }
.fs-2 { font-size: 2rem; }
.fs-3 { font-size: 1.75rem; }
.fs-4 { font-size: 1.5rem; }
.fs-5 { font-size: 1.25rem; }
.fs-6 { font-size: 1rem; }
.fs-12 { font-size: 12px; }
.fs-14 { font-size: 14px; }
.fs-18 { font-size: 18px; }

/* ----- Line height（BS5） ----- */
.lh-1    { line-height: 1; }
.lh-sm   { line-height: 1.25; }
.lh-base { line-height: 1.5; }
.lh-lg   { line-height: 2; }

/* ----- Display headings（BS5；超大標題） ----- */
.display-1 { font-size: 5rem; }    /* 80px */
.display-2 { font-size: 4.5rem; }  /* 72px */
.display-3 { font-size: 4rem; }    /* 64px */
.display-4 { font-size: 3.5rem; }  /* 56px */
.display-5 { font-size: 3rem; }    /* 48px */
.display-6 { font-size: 2.5rem; }  /* 40px */

/* ----- Font weight ----- */
.fw-light { font-weight: 300; }
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

/* ----- Font style ----- */
.fst-normal { font-style: normal; }
.fst-italic { font-style: italic; }

/* ----- Text decoration ----- */
.text-decoration-none { text-decoration: none; }
.text-decoration-underline { text-decoration: underline; }
.text-decoration-line-through { text-decoration: line-through; }

/* ----- List ----- */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}


/* ============================================================
   §5 · COLOR & BACKGROUND
   ------------------------------------------------------------
   所有自訂色都 token-backed（see tokens.css）。
   命名空間：
     --tova-*  全站 brand
     --sc-*    Summer Camp 2026 活動專屬
   ============================================================ */

/* ----- Text color: BS5 standard ----- */
.text-white { color: #fff; }

/* ----- Text color: Tova brand（token-backed） ----- */
.text-tova-primary        { color: var(--tova-c-primary); }
.text-tova-primary-bright { color: var(--tova-c-primary-bright); }
.text-tova-body           { color: var(--tova-c-body); }
.text-tova-muted          { color: var(--tova-c-muted); }
.text-tova-strong         { color: var(--tova-c-strong); }
.text-tova-faint          { color: var(--tova-c-faint); }
.text-tova-meta           { color: var(--tova-c-meta); }
.text-tova-quiet          { color: var(--tova-c-quiet); }
.text-tova-info           { color: var(--tova-c-info); }
.text-tova-link           { color: var(--tova-c-link); }
.text-tova-accent         { color: var(--tova-c-accent); }
.text-tova-rating         { color: var(--tova-c-rating); }
.text-tova-danger         { color: var(--tova-c-danger); }
.text-tova-alert          { color: var(--tova-c-alert); }

/* ----- Text color: Summer Camp 2026 活動色票 ----- */
.text-ink     { color: var(--sc-c-ink); }
.text-sky     { color: var(--sc-c-sky); }
.text-lime    { color: var(--sc-c-lime); }
.text-pink    { color: var(--sc-c-pink); }

/* ----- Background: BS5 standard ----- */
.bg-transparent { background-color: transparent; }
.bg-white       { background-color: #fff; }

/* ----- Background: Tova brand（token-backed） ----- */
.bg-tova-primary { background-color: var(--tova-c-primary); }
.bg-tova-warning { background-color: var(--tova-c-warning); }
.bg-tova-surface { background-color: var(--tova-c-surface); }

/* ----- Background: Summer Camp 2026 活動色票 ----- */
.bg-sky-light { background-color: var(--sc-c-sky-light); }
.bg-forest    { background-color: var(--sc-c-forest); }
.bg-mint      { background-color: var(--sc-c-mint); }
.bg-lime-soft { background-color: var(--sc-c-lime-soft); }


/* ============================================================
   §6 · BORDER
   ============================================================ */

/* ----- Border width（BS5；.border 本身由 style.css 提供 1px solid，
   color 預設 currentColor，會自動繼承父層字色） ----- */
.border-1 { border-width: 1px; }
.border-2 { border-width: 2px; }
.border-3 { border-width: 3px; }
.border-4 { border-width: 4px; }
.border-5 { border-width: 5px; }

/* ----- Border radius ----- */
.rounded { border-radius: 0.375rem; }
.rounded-0 { border-radius: 0; }
.rounded-1 { border-radius: 0.25rem; }
.rounded-2 { border-radius: 0.375rem; }
.rounded-3 { border-radius: 0.5rem; }
.rounded-circle { border-radius: 50%; }
.rounded-pill { border-radius: 50rem; }


/* ============================================================
   §7 · MISC（a11y / interaction / object-fit）
   ============================================================ */

/* ----- Visually hidden（BS5；對應 BS3 的 .sr-only） ----- */
.visually-hidden {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Pointer events（BS5） ----- */
.pe-none { pointer-events: none; }
.pe-auto { pointer-events: auto; }

/* ----- Object fit ----- */
.object-fit-contain { object-fit: contain; }
.object-fit-cover { object-fit: cover; }
.object-fit-fill { object-fit: fill; }
.object-fit-scale { object-fit: scale-down; }
.object-fit-none { object-fit: none; }


/* ============================================================
   §8 · RESPONSIVE VARIANTS（BS5 breakpoints）
   ------------------------------------------------------------
   目前僅補需要的 utility。caller 增加時再擴。

   breakpoints:
     mobile-only  <  576px
     sm           ≥  576px
     md           ≥  768px
     lg           ≥  992px
     xl           ≥ 1200px
   ============================================================ */

/* mobile-only (< sm) */
@media (max-width: 567px) {
  .fs-mobile-12 { font-size: 12px; }
  .fs-mobile-18 { font-size: 18px; }
}

/* sm ↑ */
@media (min-width: 576px) {
  /* Display */
  .d-sm-none  { display: none; }
  .d-sm-block { display: block; }
  .d-sm-flex  { display: flex; }

  /* Padding */
  .pb-sm-4 { padding-bottom: 1.5rem; }

  /* Grid */
  .col-sm-6 {
    flex: 0 0 auto;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left:  calc(var(--bs-gutter-x, 1.5rem) * .5);
    margin-top: var(--bs-gutter-y, 0);
    width: 50%;
  }
}

/* md ↑ */
@media (min-width: 768px) {
  /* Display */
  .d-md-none  { display: none; }
  .d-md-block { display: block; }
  .d-md-flex  { display: flex; }

  /* Flex */
  .flex-md-row    { flex-direction: row; }
  .flex-md-column { flex-direction: column; }

  /* Align items */
  .align-items-md-start  { align-items: flex-start; }
  .align-items-md-center { align-items: center; }

  /* Margin */
  .mt-md-0 { margin-top: 0; }
  .ms-md-0 { margin-left: 0; }
  .me-md-0 { margin-right: 0; }

  /* Font size */
  .fs-md-6  { font-size: 1rem; }   /* 16px */
  .fs-md-18 { font-size: 18px; }

  /* Grid */
  .col-md-4 {
    flex: 0 0 auto;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left:  calc(var(--bs-gutter-x, 1.5rem) * .5);
    margin-top: var(--bs-gutter-y, 0);
    width: 33.33333333%;
  }
}

/* lg ↑ */
@media (min-width: 992px) {
  /* Margin */
  .mb-lg-0 { margin-bottom: 0; }
  .mb-lg-5 { margin-bottom: 3rem; }
  .me-lg-4 { margin-right: 1.5rem; }

  /* Flex */
  .flex-lg-row    { flex-direction: row; }
  .flex-lg-column { flex-direction: column; }

  /* Font size */
  .fs-lg-3 { font-size: 1.75rem; }   /* 28px */
  .fs-lg-4 { font-size: 1.5rem; }    /* 24px */
  .fs-lg-6 { font-size: 1rem; }      /* 16px (reset 用) */

  /* Display headings */
  .display-lg-4 { font-size: 3.5rem; }   /* 56px */
  .display-lg-5 { font-size: 3rem; }     /* 48px */
  .display-lg-6 { font-size: 2.5rem; }   /* 40px */

  /* Grid */
  .col-lg-3,
  .col-lg-4,
  .col-lg-8 {
    flex: 0 0 auto;
    padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    padding-left:  calc(var(--bs-gutter-x, 1.5rem) * .5);
    margin-top: var(--bs-gutter-y, 0);
  }
  .col-lg-3 { width: 25%; }
  .col-lg-4 { width: 33.33333333%; }
  .col-lg-8 { width: 66.66666667%; }
}

/* xl ↑ */
@media (min-width: 1200px) {
  /* Display */
  .d-xl-none  { display: none; }
  .d-xl-block { display: block; }
  .d-xl-flex  { display: flex; }

  /* Flex */
  .flex-xl-row    { flex-direction: row; }
  .flex-xl-column { flex-direction: column; }

  /* Align items */
  .align-items-xl-start  { align-items: flex-start; }
  .align-items-xl-center { align-items: center; }

  /* Gap */
  .gap-xl-4 { gap: 1.5rem; }
}
