/* Official /harmony.php — Gallery Long Wall (does not remove legacy grid CSS) */

.harmony-long-wall {
    --hlw-canvas: 790px;
    --hlw-paper: #fffcf8;
    --hlw-ink: #1c1a19;
    --hlw-muted: #8a8580;
    --hlw-line: #d8d2c8;
    --hlw-accent: #a89a7a;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    color: var(--hlw-ink);
}

/* Outer shell: full available width so the 790px canvas centers in the viewport */
body:has(.harmony-long-wall) {
    background:
        radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255, 220, 230, 0.28), transparent 65%),
        linear-gradient(180deg, #f7f5f2 0%, #f3eee8 50%, #f7f5f2 100%);
}

body:has(.harmony-long-wall) .guest-main {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 48px;
    overflow-x: hidden;
    background: transparent;
}

/* Category switch — normal document flow under guest navbar (no overlay) */
.hlw-category-bar {
    position: static;
    z-index: auto;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    background: rgba(255, 252, 248, 0.96);
    border-bottom: 1px solid var(--hlw-line);
    box-sizing: border-box;
}

.hlw-category-bar__inner {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 790px;
    margin: 0 auto;
    padding: 12px 16px;
    box-sizing: border-box;
}

@media (max-width: 820px) {
    .hlw-category-bar__inner {
        padding: 10px 12px;
        gap: 8px;
    }
}

.hlw-category-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 132px;
    padding: 10px 18px;
    border: 1px solid var(--hlw-line);
    background: transparent;
    color: var(--hlw-muted);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.hlw-category-tab__zh {
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.hlw-category-tab__en {
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.hlw-category-tab.is-active {
    border-color: var(--hlw-ink);
    color: var(--hlw-ink);
    background: #fff;
}

.hlw-category-tab:focus-visible {
    outline: 1px solid var(--hlw-accent);
    outline-offset: 3px;
}

.hlw-stage {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hlw-canvas[hidden] {
    display: none !important;
}

.hlw-canvas {
    width: var(--hlw-canvas);
    max-width: var(--hlw-canvas);
    flex-shrink: 0;
    /* Top gap to category bar ≈ 20–30px; keep side/bottom paper padding */
    padding: 24px 48px 56px;
    background: var(--hlw-paper);
    border: 1px solid rgba(216, 210, 200, 0.7);
    box-shadow: 0 18px 48px rgba(28, 26, 25, 0.06);
    transform-origin: top center;
    box-sizing: border-box;
}

.hlw-hero {
    text-align: center;
    padding: 0 0 56px;
    margin: 0;
}

.hlw-hero__index {
    margin: 0 0 24px;
    font-size: 0.68rem;
    letter-spacing: 0.36em;
    color: var(--hlw-muted);
}

.hlw-hero__brand {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.4rem;
    font-weight: 500;
    letter-spacing: 0.42em;
    line-height: 1;
}

/* Rule + contacts as one unit, centered on the same axis as BBW.
   Brand uses letter-spacing (trailing gap); nudge group left by half that gap
   so the visual centers match without changing the BBW title styles. */
.hlw-hero__mid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    margin: 22px auto 24px;
    padding: 0 4px;
    box-sizing: border-box;
    transform: translateX(calc(3.4rem * -0.21));
}

.hlw-hero__mid-spacer {
    display: none;
}

.hlw-hero__rule {
    flex: 0 0 1px;
    width: 1px;
    height: 94px;
    margin: 0;
    background: var(--hlw-accent);
}

.hlw-hero__contacts {
    list-style: none;
    flex: 0 0 auto;
    margin: 0;
    padding: 2px 0;
    text-align: left;
    box-sizing: border-box;
    max-width: min(100%, 280px);
}

.hlw-hero__contact {
    display: grid;
    grid-template-columns: 5.4em auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: 0;
    margin: 0;
    padding: 1px 0;
    font-size: 0.6rem;
    line-height: 1.45;
    letter-spacing: 0.04em;
    color: var(--hlw-ink);
}

.hlw-hero__contact + .hlw-hero__contact {
    margin-top: 1px;
}

.hlw-hero__contact-label {
    color: var(--hlw-muted);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.hlw-hero__contact-sep {
    color: var(--hlw-muted);
    padding: 0 0.2em 0 0.05em;
}

.hlw-hero__contact-value {
    min-width: 0;
    overflow-wrap: anywhere;
    letter-spacing: 0.03em;
    color: var(--hlw-ink);
}

.hlw-hero__title {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.42em;
    font-weight: 500;
}

.hlw-hero__sub {
    margin: 14px 0 0;
    font-size: 0.82rem;
    color: var(--hlw-muted);
}

.hlw-region {
    width: 100%;
    padding-bottom: 24px;
}

.hlw-region--welfare {
    margin-top: 0;
    padding-top: 8px;
}

.hlw-region__head {
    text-align: center;
    padding: 8px 16px 48px;
}

.hlw-region__eyebrow {
    margin: 0 0 12px;
    font-size: 0.68rem;
    letter-spacing: 0.4em;
    color: var(--hlw-accent);
}

.hlw-region__label {
    margin: 0 0 10px;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    color: var(--hlw-accent);
    text-transform: uppercase;
}

.hlw-region__title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    letter-spacing: 0.32em;
    font-weight: 500;
}

.hlw-region__rule {
    display: flex;
    justify-content: center;
    margin: 18px 0 14px;
}

.hlw-region__rule span {
    display: block;
    width: 72px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hlw-accent), transparent);
}

.hlw-region__note {
    margin: 0;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: var(--hlw-muted);
}

.hlw-region-break {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 56px 24px 64px;
    padding: 28px 0;
}

.hlw-region-break__line {
    display: block;
    flex: 1;
    max-width: 180px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hlw-line), transparent);
}

.hlw-region-break__mark {
    color: var(--hlw-accent);
    font-size: 0.75rem;
    letter-spacing: 0;
}

.hlw-section {
    width: 100%;
}

.hlw-block {
    width: 100%;
}

.hlw-block--trio {
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 36px;
    padding: 8px 8px 56px;
    align-items: start;
}

.hlw-trio__side {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding-top: 48px;
}

.hlw-block--wide {
    padding: 8px 0 48px;
}

.hlw-block--duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 8px 24px 64px;
    align-items: start;
}

.hlw-block--duo .hlw-slot:first-child {
    padding-top: 32px;
}

.hlw-empty {
    text-align: center;
    padding: 36px 16px 48px;
    color: var(--hlw-muted);
    letter-spacing: 0.12em;
}

.hlw-slot {
    margin: 0;
    padding: 0;
}

.hlw-frame {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: #eeeae4;
    cursor: zoom-in;
    overflow: hidden;
}

.harmony-long-wall--no-lightbox .hlw-frame,
.hlw-frame--static {
    cursor: default;
}

.hlw-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hlw-frame--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: default;
    border: 1px dashed var(--hlw-line);
    background: transparent;
    color: var(--hlw-muted);
    letter-spacing: 0.16em;
    font-size: 0.75rem;
}

.hlw-frame:focus-visible {
    outline: 1px solid var(--hlw-accent);
    outline-offset: 6px;
}

.hlw-slot--1 .hlw-frame { aspect-ratio: 3 / 4; }
.hlw-slot--2 .hlw-frame { aspect-ratio: 4 / 5; }
.hlw-slot--3 .hlw-frame { aspect-ratio: 3 / 4; }
.hlw-slot--4 .hlw-frame { aspect-ratio: 16 / 9; }
.hlw-slot--5 .hlw-frame { aspect-ratio: 3 / 4; }
.hlw-slot--6 .hlw-frame { aspect-ratio: 4 / 5; }

.hlw-caption {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: var(--hlw-muted);
    text-transform: uppercase;
}

.hlw-caption--right {
    flex-direction: row-reverse;
    text-align: right;
}

.hlw-caption__no {
    color: var(--hlw-ink);
    font-weight: 500;
}

.hlw-text {
    padding: 24px 56px 48px;
}

.hlw-text--center {
    text-align: center;
    padding: 40px 40px 48px;
}

.hlw-text__kicker {
    margin: 0 0 16px;
    font-size: 0.68rem;
    letter-spacing: 0.4em;
    color: var(--hlw-accent);
}

.hlw-text__body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    line-height: 1.7;
    font-weight: 400;
}

.hlw-divider {
    display: flex;
    justify-content: center;
    padding: 8px 0 40px;
}

.hlw-divider span {
    display: block;
    width: 48px;
    height: 1px;
    background: var(--hlw-line);
}

.hlw-footer {
    margin-top: 24px;
    padding-top: 28px;
    border-top: 1px solid var(--hlw-line);
    text-align: center;
}

.hlw-footer p {
    margin: 0;
    font-size: 0.64rem;
    letter-spacing: 0.32em;
    color: var(--hlw-muted);
}

/* Resource hero banner: sibling of .hlw-stage — follows wall width, never drives it.
   Do NOT use fixed 790px layout width here (that expands the page and shifts the wall). */
.hlw-resource-banner {
    position: static;
    width: 100%;
    max-width: min(100%, var(--hlw-canvas));
    min-width: 0;
    margin: 0 auto 48px;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Only collapse trailing space between wall end (ENDING) and the resource banner.
   Do not touch inter-module gap / ending internal design. */
.harmony-long-wall:has([data-hlw-resource-banner]) .hlw-canvas {
    padding-bottom: 0;
}

.harmony-long-wall:has([data-hlw-resource-banner]) .hlw-modules {
    padding-bottom: 0;
}

.harmony-long-wall:has([data-hlw-resource-banner]) .hlw-footer {
    display: none;
}

.hlw-resource-banner .hero-banner {
    width: 100%;
    max-width: 100%;
}

.hlw-resource-banner .hero-banner__track {
    width: 100%;
    max-width: 100%;
}

.hlw-lightbox {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hlw-lightbox[hidden] {
    display: none !important;
}

.hlw-lightbox__backdrop {
    position: absolute;
    inset: 0;
    border: none;
    background: rgba(20, 18, 16, 0.88);
    cursor: pointer;
}

.hlw-lightbox__image {
    position: relative;
    z-index: 1;
    max-width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    object-fit: contain;
}

.hlw-lightbox__close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top, 0px));
    right: 16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

body.hlw-lightbox-open {
    overflow: hidden;
}

@media (max-width: 820px) {
    /* Shell only — do not reflow Long Wall / module template internals.
       Fixed 790px canvas is scaled by JS to the viewport width. */
    body:has(.harmony-long-wall) .guest-main {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden;
    }

    .harmony-long-wall {
        overflow-x: hidden;
    }

    .hlw-stage {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
}
