:root {
    --bg-primary-950: rgb(15, 13, 46);
    --bg-primary-900: rgb(26, 22, 80);
    --bg-primary-500: rgb(38, 32, 110);
    --bg-primary-300: rgb(61, 57, 135);
}

body {
    font-family: "DotGothic16", "Press Start 2P", "Noto Sans HK", sans-serif;
}
/* Fonts */
.noto-sans-hk {
    font-family: "Noto Sans HK", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

.dotgothic16 {
    font-family: "DotGothic16", sans-serif;
    font-weight: 400;
    font-style: normal;
}

.press-start-2p {
    font-family: "Press Start 2P", system-ui;
    font-weight: 400;
    font-style: normal;
}

[x-cloak] {
    display: none !important;
}

main {
    background: var(--bg-primary-950);
}

.shadow {
    box-shadow: 5px 5px #00000073, inset 0 1px #ffffff1f;
}

/* Intl Tel Input */
.iti.iti--allow-dropdown.iti--show-flags.iti--inline-dropdown {
    width: 100%;
}

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

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

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

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

.note-editable {
    background-color: #fff;
}

/* 主頁搜尋：圖示方塊（勾選時著色 + 陰影） */
.home-filter-tile {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.home-filter-tile input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.home-filter-tile__box {
    aspect-ratio: 1 / 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.35rem;
    border-radius: 0.85rem;
    border: 1px solid rgb(100 116 139 / 0.35);
    background: rgb(15 23 42 / 0.45);
    color: rgb(148 163 184);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}

.home-filter-tile:active .home-filter-tile__box {
    transform: scale(0.96);
}

.home-filter-tile:focus-within .home-filter-tile__box {
    outline: 2px solid rgb(99 102 241 / 0.45);
    outline-offset: 2px;
}

.home-filter-tile__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    letter-spacing: 0.02em;
}

.home-filter-tile__label--goal {
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 0 0.125rem;
}

/* 六藝：紫系 */
.home-filter-tile--six:has(:checked) .home-filter-tile__box {
    border-color: rgb(167 139 250 / 0.85);
    background: linear-gradient(155deg, rgb(88 28 135 / 0.55), rgb(30 27 75 / 0.92));
    color: rgb(237 233 254);
    box-shadow:
        0 10px 28px rgb(0 0 0 / 0.45),
        0 0 0 1px rgb(167 139 250 / 0.35),
        0 0 24px rgb(139 92 246 / 0.28);
}

.home-filter-tile--six:has(:checked) .home-filter-tile__box svg {
    color: rgb(216 180 254);
    filter: drop-shadow(0 0 6px rgb(167 139 250 / 0.45));
}

/* 成長目標：玫紅系 */
.home-filter-tile--goal:has(:checked) .home-filter-tile__box {
    border-color: rgb(244 114 182 / 0.85);
    background: linear-gradient(155deg, rgb(157 23 77 / 0.5), rgb(30 27 75 / 0.92));
    color: rgb(252 231 243);
    box-shadow:
        0 10px 28px rgb(0 0 0 / 0.45),
        0 0 0 1px rgb(244 114 182 / 0.3),
        0 0 24px rgb(236 72 153 / 0.28);
}

.home-filter-tile--goal:has(:checked) .home-filter-tile__box svg {
    color: rgb(251 207 232);
    filter: drop-shadow(0 0 6px rgb(244 114 182 / 0.45));
}

/* 地區：青綠系 */
.home-filter-tile--region:has(:checked) .home-filter-tile__box {
    border-color: rgb(45 212 191 / 0.75);
    background: linear-gradient(155deg, rgb(17 94 89 / 0.55), rgb(30 27 75 / 0.92));
    color: rgb(204 251 241);
    box-shadow:
        0 10px 28px rgb(0 0 0 / 0.45),
        0 0 0 1px rgb(45 212 191 / 0.28),
        0 0 22px rgb(20 184 166 / 0.25);
}

.home-filter-tile--region:has(:checked) .home-filter-tile__box svg {
    color: rgb(153 246 228);
    filter: drop-shadow(0 0 6px rgb(45 212 191 / 0.4));
}

/* Header logo：搭配 Animate.css 的 animate__animated / animate__infinite，放大至 1.2 再收回 */
.animate__logoScale {
    animation-name: logoScaleBreathe;
    animation-duration: 2s;
    animation-timing-function: ease-in-out;
}

@keyframes logoScaleBreathe {
    0%,
    100% {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
}

/* 活動卡分類 badge：上下浮動 + 錯開 delay 形成波浪 */
@keyframes event-badge-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.event-badge-wave {
    will-change: transform;
    animation-name: event-badge-float;
    animation-duration: 3s;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

@media (prefers-reduced-motion: reduce) {
    .event-badge-wave {
        animation: none;
    }
}

/* 首頁最新文章 Swiper：slide 高度隨 blog-card 內容 */
.home-blogs-swiper .swiper-wrapper {
    align-items: stretch;
}

.home-blogs-swiper .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

/* 首頁最新文章 Swiper：左右箭頭 */
.home-blogs-swiper .home-blogs-nav {
    color: #fff;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: 0;
    top: 42%;
    transform: translateY(-50%);
    background: rgba(15, 11, 33, 0.5);
    border-radius: 9999px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 10;
}

.home-blogs-swiper .home-blogs-nav::after {
    font-size: 0.9rem;
    font-weight: 700;
}

.home-blogs-swiper .home-blogs-nav.swiper-button-prev {
    left: 0.25rem;
}

.home-blogs-swiper .home-blogs-nav.swiper-button-next {
    right: 0.25rem;
}

@media (min-width: 640px) {
    .home-blogs-swiper .home-blogs-nav.swiper-button-prev {
        left: 0.35rem;
    }

    .home-blogs-swiper .home-blogs-nav.swiper-button-next {
        right: 0.35rem;
    }
}

.home-blogs-swiper .swiper-button-disabled.home-blogs-nav {
    opacity: 0.25;
    pointer-events: none;
}

/* 機構詳情頁：相簿 Swiper + Lightbox 縮圖列 */
.team-gallery-swiper .swiper-wrapper {
    align-items: stretch;
}

.team-gallery-swiper .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

.team-gallery-swiper .team-gallery-nav {
    color: #fff;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: 0;
    top: 42%;
    transform: translateY(-50%);
    background: rgba(15, 11, 33, 0.5);
    border-radius: 9999px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 10;
}

.team-gallery-swiper .team-gallery-nav::after {
    font-size: 0.9rem;
    font-weight: 700;
}

.team-gallery-swiper .team-gallery-nav.swiper-button-prev {
    left: 0.25rem;
}

.team-gallery-swiper .team-gallery-nav.swiper-button-next {
    right: 0.25rem;
}

@media (min-width: 640px) {
    .team-gallery-swiper .team-gallery-nav.swiper-button-prev {
        left: 0.35rem;
    }

    .team-gallery-swiper .team-gallery-nav.swiper-button-next {
        right: 0.35rem;
    }
}

.team-gallery-swiper .swiper-button-disabled.team-gallery-nav {
    opacity: 0.25;
    pointer-events: none;
}