:root {
    --primary: #cd6715;
    --accent: #185778;
    --accent-dark: #124a66;
    --bg: #f1f1f1;
    --text: #111111;
    --text-muted: rgba(17, 17, 17, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.38);
    --glass-border: rgba(255, 255, 255, 0.72);
    --section-x: clamp(1.5rem, 5vw, 5rem);
    --section-x-left: clamp(1.5rem, 5vw, 9rem);
    --max-width: 1120px;
    --narrow-width: 760px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: "Noto Sans TC", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-main {
    min-height: 50vh;
}

/* ── Navbar（同步官網 Navbar.jsx）── */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 99999;
    background-color: transparent;
}

.nav-bar__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-bar__logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.nav-bar__end {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.nav-links__item {
    transform: translateX(0);
    opacity: 1;
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.25s ease;
}

.nav-links__item.is-collapsed {
    transform: translateX(72px);
    opacity: 0;
    pointer-events: none;
}

.nav-links__link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    text-decoration: none;
    font-size: calc(0.95rem + 2px);
    letter-spacing: 0.05em;
    font-weight: 400;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.nav-bar.dark-text .nav-links__link,
.nav-bar.dark-text .nav-links__link--disabled {
    color: var(--primary);
}

.nav-links__link--disabled {
    cursor: default;
    user-select: none;
}

.nav-links__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-links__link:hover .nav-links__dot,
.nav-links__link--disabled:hover .nav-links__dot,
.nav-links__dot.is-visible {
    opacity: 1;
}

.nav-toggle {
    display: inline-flex;
    flex-shrink: 0;
    width: 0;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    color: var(--primary);
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.45);
    pointer-events: none;
    margin-left: 0;
    transition:
        width 0.28s ease,
        border-color 0.18s ease,
        opacity 0.25s ease,
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        margin-left 0.28s ease;
}

.nav-toggle.is-visible {
    width: 42px;
    border: 1px solid rgba(205, 103, 21, 0.35);
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    margin-left: 0.5rem;
}

.burger {
    position: relative;
    width: 18px;
    height: 12px;
    display: block;
}

.burger::before,
.burger::after,
.burger > span {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition:
        transform 0.22s ease,
        top 0.22s ease,
        opacity 0.18s ease;
}

.burger::before { top: 0; }
.burger > span { top: 5px; }
.burger::after { top: 10px; }

.burger[data-open="true"]::before {
    top: 5px;
    transform: rotate(45deg);
}

.burger[data-open="true"] > span {
    opacity: 0;
}

.burger[data-open="true"]::after {
    top: 5px;
    transform: rotate(-45deg);
}

/* 全螢幕選單 */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-overlay[hidden] {
    display: none !important;
}

.menu-reveal {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: #fff;
    clip-path: circle(0 at var(--menu-x, calc(100% - 5rem)) var(--menu-y, 2.5rem));
}

.menu-overlay.is-open .menu-reveal {
    animation: menuCircleReveal 0.72s cubic-bezier(0.33, 1, 0.38, 1) forwards;
}

@keyframes menuCircleReveal {
    0% {
        clip-path: circle(0 at var(--menu-x) var(--menu-y));
        background: #fff;
    }
    58% {
        clip-path: circle(150vmax at var(--menu-x) var(--menu-y));
        background: #fff;
    }
    100% {
        clip-path: circle(150vmax at var(--menu-x) var(--menu-y));
        background: var(--bg);
    }
}

.menu-close {
    position: absolute;
    top: 2rem;
    right: 5rem;
    z-index: 2;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    color: rgba(17, 17, 17, 0.85);
    font-size: 2.4rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.menu-overlay.is-open .menu-close {
    animation: menuFadeIn 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.menu-close:hover {
    color: var(--primary);
    transform: scale(1.05);
}

.menu-inner {
    position: relative;
    z-index: 1;
    min-height: 100%;
    padding: 6.5rem 5rem 3.5rem;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(2rem, 6vw, 5.5rem);
    align-items: start;
}

.menu-projects-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: lowercase;
    color: rgba(17, 17, 17, 0.55);
    text-decoration: none;
    opacity: 0;
    transition: color 0.2s ease;
}

.menu-overlay.is-open .menu-projects-heading {
    animation: menuSlideUpLeft 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

.menu-projects-heading:hover {
    color: var(--primary);
}

.menu-project-list {
    display: flex;
    flex-direction: column;
    gap: 1.45rem;
}

.menu-project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    transition: transform 0.25s ease;
}

.menu-overlay.is-open .menu-project-card:nth-child(1) {
    animation: menuSlideUpLeft 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

.menu-overlay.is-open .menu-project-card:nth-child(2) {
    animation: menuSlideUpLeft 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both;
}

.menu-project-card:hover {
    transform: translateY(-2px);
}

.menu-project-image-wrap {
    height: 140px;
    width: auto;
    max-width: min(320px, 100%);
    aspect-ratio: 2002 / 1376;
    border-radius: 6px;
    border: 1px solid rgba(17, 17, 17, 0.06);
    overflow: hidden;
}

.menu-project-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.menu-project-title {
    margin-top: 0.65rem;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(17, 17, 17, 0.9);
}

.menu-project-desc {
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
    line-height: 1.52;
    letter-spacing: 0.03em;
    color: rgba(17, 17, 17, 0.52);
    max-width: 320px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-right {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 10rem);
}

.menu-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.menu-nav-item {
    border-bottom: 1px solid rgba(17, 17, 17, 0.1);
    opacity: 0;
}

.menu-overlay.is-open .menu-nav-item:nth-child(1) { animation: menuSlideInRight 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both; }
.menu-overlay.is-open .menu-nav-item:nth-child(2) { animation: menuSlideInRight 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both; }
.menu-overlay.is-open .menu-nav-item:nth-child(3) { animation: menuSlideInRight 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.36s both; }
.menu-overlay.is-open .menu-nav-item:nth-child(4) { animation: menuSlideInRight 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.42s both; }

.menu-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    text-decoration: none;
    color: rgba(17, 17, 17, 0.78);
    font-size: calc(clamp(1.1rem, 1.85vw, 1.55rem) + 2px);
    font-weight: 400;
    letter-spacing: 0.06em;
    transition: color 0.2s ease;
}

.menu-nav-link--disabled {
    cursor: default;
    user-select: none;
}

.menu-nav-link--active {
    color: var(--primary);
}

.menu-nav-link .menu-arrow {
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-nav-link:hover {
    color: var(--primary);
}

.menu-nav-link:hover .menu-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.menu-footer {
    margin-top: auto;
    padding-top: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.35rem;
    opacity: 0;
}

.menu-overlay.is-open .menu-footer {
    animation: menuSlideInRight 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

.menu-social {
    display: flex;
    align-items: center;
    gap: 1.35rem;
}

.menu-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: rgba(17, 17, 17, 0.72);
    transition: color 0.2s ease, transform 0.2s ease;
}

.menu-social__link:hover {
    color: var(--primary);
    transform: translateY(-1px);
}

.menu-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
    text-align: right;
}

.menu-contact a {
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    color: rgba(17, 17, 17, 0.62);
    text-decoration: none;
    transition: color 0.2s ease;
}

.menu-contact a:hover {
    color: var(--primary);
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: scale(0.92) rotate(-8deg); }
    to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes menuSlideUpLeft {
    from { opacity: 0; transform: translate3d(-18px, 14px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes menuSlideInRight {
    from { opacity: 0; transform: translate3d(22px, 0, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .menu-overlay.is-open .menu-reveal,
    .menu-overlay.is-open .menu-close,
    .menu-overlay.is-open .menu-projects-heading,
    .menu-overlay.is-open .menu-project-card,
    .menu-overlay.is-open .menu-nav-item,
    .menu-overlay.is-open .menu-footer {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 968px) {
    .nav-bar {
        padding: 1.5rem 2rem;
    }

    .nav-bar__logo img {
        height: 42px;
    }

    .nav-links {
        display: none;
    }

    .nav-toggle {
        width: 42px;
        border: 1px solid rgba(205, 103, 21, 0.35);
        opacity: 1;
        transform: scale(1);
        pointer-events: auto;
        margin-left: 0;
    }

    .menu-inner {
        padding: 5.5rem 1.5rem 2.5rem;
        grid-template-columns: 1fr;
        gap: 2.75rem;
    }

    .menu-left {
        order: 2;
    }

    .menu-right {
        order: 1;
        min-height: auto;
    }

    .menu-close {
        top: 1.25rem;
        right: 1.5rem;
        font-size: 2rem;
    }

    .menu-footer {
        align-items: flex-start;
        padding-top: 2rem;
    }

    .menu-contact {
        align-items: flex-start;
        text-align: left;
    }
}

/* Hero — 參考 Form.jsx */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 280px;
    max-height: 520px;
    overflow: hidden;
}

.post-template .hero {
    height: 42vh;
    min-height: 220px;
    max-height: 380px;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero__cat {
    position: absolute;
    right: clamp(1.25rem, 4vw, 3.5rem);
    bottom: clamp(1.5rem, 4vh, 3rem);
    width: clamp(100px, 16vw, 200px);
    height: auto;
    pointer-events: none;
    z-index: 2;
}

.hero__content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 6.5rem var(--section-x) 5rem var(--section-x-left);
    pointer-events: none;
}

.hero__title {
    margin: 0;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: clamp(2rem, 7vw, 4.25rem);
    line-height: 1.1;
    color: var(--primary);
    max-width: 16ch;
}

.post-template .hero__title {
    font-size: clamp(1.75rem, 5vw, 3rem);
    max-width: 20ch;
}

.hero__subtitle {
    margin: 0.65rem 0 0;
    font-size: clamp(calc(0.95rem + 2px), calc(2vw + 2px), calc(1.1rem + 2px));
    letter-spacing: 0.2em;
    color: var(--accent);
}

/* Content */
.content-area {
    position: relative;
    z-index: 1;
    margin-top: -2.5rem;
    padding: 0 var(--section-x) 4.5rem;
}

.content-area__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.content-area__inner--narrow {
    max-width: var(--narrow-width);
}

.tag-description {
    margin: 0 0 2rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* Post grid + glass cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.5rem;
}

.post-card {
    border-radius: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    box-shadow:
        0 12px 40px rgba(17, 17, 17, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 18px 48px rgba(17, 17, 17, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.post-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card__body {
    padding: 1.35rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
}

.post-card__tag {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
}

.post-card__title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.35;
    color: var(--text);
}

.post-card__excerpt {
    margin: 0;
    font-size: 0.92rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    line-height: 1.75;
    flex: 1;
}

.post-card__meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: rgba(17, 17, 17, 0.45);
    letter-spacing: 0.06em;
}

/* Single post */
.post-single__header {
    margin-bottom: 1.5rem;
}

.post-single__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: rgba(17, 17, 17, 0.5);
}

.post-single__tag {
    color: var(--accent);
    font-weight: 600;
}

.post-single__feature {
    margin: 0 0 2rem;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(17, 17, 17, 0.08);
}

.post-single__content {
    padding: 2rem 2.25rem;
    border-radius: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px) saturate(1.2);
    -webkit-backdrop-filter: blur(22px) saturate(1.2);
    box-shadow:
        0 12px 40px rgba(17, 17, 17, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.gh-content {
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    color: rgba(17, 17, 17, 0.85);
}

.gh-content h2,
.gh-content h3 {
    color: var(--accent);
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 2rem 0 0.75rem;
}

.gh-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.gh-content img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

.post-single__author {
    margin-top: 2rem;
}

.author-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(17, 17, 17, 0.08);
}

.author-card__avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.author-card__name {
    margin: 0;
    font-weight: 700;
    color: var(--accent);
}

.author-card__bio {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination a,
.pagination .page-number {
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--primary);
    border-radius: 999px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.9rem;
    transition: background 0.25s ease, color 0.25s ease;
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
}

/* Footer */
.site-footer {
    padding: 3rem var(--section-x) 2.5rem;
    border-top: 1px solid rgba(17, 17, 17, 0.14);
    background: var(--bg);
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.site-footer__brand {
    margin: 0;
    font-weight: 700;
    color: var(--accent);
}

.site-footer__copy {
    margin: 0;
}

.site-footer__home {
    color: var(--primary);
    font-weight: 600;
}

.site-footer__home:hover {
    color: var(--accent-dark);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

/* Ghost 內建卡片與編輯器內容 */
.gh-content .kg-card {
    margin: 2rem 0;
}

.gh-content figure.kg-card {
    margin-left: 0;
    margin-right: 0;
}

.gh-content .kg-image-card img {
    width: 100%;
    border-radius: 0.75rem;
}

@media (max-width: 968px) {
    .hero {
        height: 40vh;
        min-height: 220px;
        max-height: 320px;
    }

    .hero__cat {
        right: 1.5rem;
        bottom: 0.75rem;
        width: clamp(64px, 20vw, 96px);
    }

    .hero__content {
        padding: 5rem 1.5rem 2rem;
    }

    .content-area {
        margin-top: -1.5rem;
        padding-bottom: 3.5rem;
    }

    .post-single__content {
        padding: 1.5rem 1.25rem;
    }

    .site-footer__inner {
        flex-direction: column;
        text-align: center;
    }
}
