.custom-gallery-page { padding-top: var(--hdr-height); }
.gallery-hero {
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 70px;
    align-items: center;
    padding-top: 120px;
    padding-bottom: 90px;
}
.gallery-hero .section-title { font-size: clamp(52px, 9vw, 94px); margin-bottom: 22px; }
.gallery-hero .section-subtitle { max-width: 680px; margin-bottom: 34px; }
.gallery-hero-actions, .custom-order-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.gallery-principle-card {
    border: 1px solid var(--border-color-hover);
    background: linear-gradient(145deg, rgba(245,197,66,.09), rgba(0,126,135,.07));
    border-radius: 22px;
    padding: 38px;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.gallery-principle-card h2 { font-family: var(--font-heading); font-size: 27px; line-height: 1.15; margin: 12px 0 16px; }
.gallery-principle-card p { color: var(--text-secondary); font-size: 15px; }
.gallery-principle-points { display: grid; gap: 12px; margin-top: 24px; color: var(--text-primary); font-family: var(--font-ui); font-size: 13px; }
.gallery-principle-points span::first-letter { color: var(--accent-success); }
.gallery-preview-note {
    padding: 22px 26px;
    max-width: calc(var(--max-width) - 48px);
    display: flex;
    gap: 20px;
    align-items: flex-start;
    border: 1px solid rgba(245,197,66,.32);
    background: rgba(245,197,66,.055);
    border-radius: 14px;
}
.gallery-preview-note strong { flex: 0 0 auto; color: var(--accent-primary); font-family: var(--font-ui); font-size: 12px; letter-spacing: .08em; }
.gallery-preview-note p { color: var(--text-secondary); font-size: 14px; }
.gallery-projects-section { padding-top: 90px; }
.gallery-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: -12px 0 42px; }
.gallery-filter {
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,.02);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 10px 17px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}
.gallery-filter:hover { color: var(--text-primary); border-color: var(--border-color-hover); }
.gallery-filter.active { background: var(--accent-primary); border-color: var(--accent-primary); color: var(--text-on-primary); }
.custom-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.custom-gallery-card {
    background: rgba(21,21,25,.78);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}
.custom-gallery-card:hover { transform: none; border-color: var(--border-color-hover); }
.custom-gallery-image-wrap { position: relative; aspect-ratio: 1 / 1; background: #0d0e13; overflow: hidden; }
.custom-gallery-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--transition-normal); }
.custom-gallery-image-wrap:hover img { transform: scale(1.035); }
.permission-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 2;
    background: rgba(11,11,13,.82);
    border: 1px solid rgba(86,194,113,.45);
    color: var(--accent-success);
    padding: 7px 10px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    backdrop-filter: blur(10px);
}
.custom-gallery-card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.gallery-category { color: var(--accent-secondary); font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.custom-gallery-card h2 { font-family: var(--font-heading); font-size: 23px; line-height: 1.15; margin: 9px 0 11px; }
.custom-gallery-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 18px; }
.gallery-project-like-row { display:flex; justify-content:flex-start; margin:0 0 18px; }
.gallery-lower-like { min-width:54px; }
.gallery-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; }
.gallery-view-button { padding: 11px 14px; font-size: 11px; }
.gallery-text-link { color: var(--accent-primary); font-family: var(--font-ui); font-size: 11px; font-weight: 700; text-align: right; }
.gallery-text-link:hover { color: var(--accent-primary-hover); }
.gallery-bottom-cta {
    margin-bottom: 100px;
    padding: 58px;
    border: 1px solid var(--border-color-hover);
    border-radius: 22px;
    background: linear-gradient(120deg, rgba(0,126,135,.11), rgba(245,197,66,.07));
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 50px;
    align-items: center;
}
.gallery-bottom-cta h2 { font-family: var(--font-heading); font-size: clamp(30px, 4vw, 44px); line-height: 1.12; margin-bottom: 12px; }
.gallery-bottom-cta p { color: var(--text-secondary); max-width: 720px; }
.gallery-cart-link { display: grid; place-items: center; }
body.modal-open { overflow: hidden; }
.gallery-modal-overlay { z-index: 399; }
.gallery-project-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -46%) scale(.97);
    width: min(1000px, calc(100vw - 36px));
    max-height: min(760px, calc(100dvh - 36px));
    overflow: auto;
    background: var(--gradient-dark);
    border: 1px solid var(--border-color-hover);
    border-radius: 22px;
    z-index: 400;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, .9fr);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    box-shadow: 0 35px 90px rgba(0,0,0,.68);
}
.gallery-project-modal.active { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.gallery-modal-close { position: absolute; top: 16px; right: 16px; z-index: 4; width: 40px; height: 40px; font-size: 24px; }
.gallery-modal-image-wrap { min-height: 500px; background: #0d0e13; }
.gallery-modal-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.gallery-modal-copy { padding: 58px 44px 44px; display: flex; flex-direction: column; justify-content: center; }
.gallery-modal-copy h2 { font-family: var(--font-heading); font-size: clamp(32px, 5vw, 50px); line-height: 1.05; margin: 12px 0 20px; }
.gallery-modal-copy > p { color: var(--text-secondary); }
.gallery-permission-line { display: grid; gap: 5px; padding: 18px 0; margin: 24px 0 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
.gallery-permission-line span { color: var(--text-muted); font-family: var(--font-ui); font-size: 10px; letter-spacing: .08em; }
.gallery-permission-line strong { color: var(--accent-success); font-size: 14px; }
.gallery-reproduction-note { font-size: 13px; margin: 18px 0 26px; }
.gallery-modal-actions { display: flex; align-items: center; gap: 14px; }
.gallery-modal-actions .btn { flex: 1; }
@media (max-width: 1024px) {
    .gallery-hero { grid-template-columns: 1fr; gap: 35px; min-height: auto; }
    .gallery-principle-card { max-width: 720px; }
    .custom-gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .gallery-project-modal { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .gallery-hero { padding-top: 90px; padding-bottom: 60px; }
    .gallery-hero .section-title { font-size: clamp(46px, 16vw, 72px); }
    .gallery-preview-note { margin-left: 18px; margin-right: 18px; flex-direction: column; gap: 8px; }
    .custom-gallery-grid { grid-template-columns: 1fr; }
    .gallery-bottom-cta { grid-template-columns: 1fr; padding: 34px 26px; gap: 28px; }
    .gallery-project-modal { display: block; }
    .gallery-modal-image-wrap { min-height: 0; aspect-ratio: 1 / .82; }
    .gallery-modal-copy { padding: 30px 24px 28px; }
    .gallery-modal-actions { align-items: stretch; flex-direction: column; }
    .gallery-modal-like { width: 100%; justify-content: center; }
}
@media (max-width: 520px) {
    .gallery-hero-actions .btn { width: 100%; }
    .gallery-card-actions { align-items: stretch; flex-direction: column; }
    .gallery-view-button { width: 100%; }
    .gallery-text-link { text-align: center; padding: 8px; }
    .permission-badge { max-width: calc(100% - 78px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* =======================================================
   v5.9.18 — CUSTOM GALLERY IMAGE FRAME
   Uses the same slightly portrait, edge-to-edge image format
   as the homepage product cards.
======================================================= */
.custom-gallery-image-wrap {
    aspect-ratio: 1 / 1.08;
    background: #0b0d0f;
}

.custom-gallery-image-wrap img,
.gallery-modal-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}


/* deep mobile-width containment: Gallery */
@media (max-width: 600px) {
    .custom-gallery-page,
    .gallery-hero,
    .gallery-hero > *,
    .gallery-hero-copy,
    .gallery-principle-card,
    .gallery-projects-section,
    .custom-gallery-grid,
    .custom-gallery-card,
    .custom-gallery-card-body,
    .gallery-bottom-cta,
    .gallery-bottom-cta > *,
    .gallery-project-modal,
    .gallery-modal-copy,
    .gallery-modal-actions {
        min-width: 0;
        max-width: 100%;
    }
    .custom-gallery-page { overflow-x: clip; }
    .gallery-hero { width: 100%; padding-inline: 16px; gap: 26px; }
    .gallery-hero-copy { width: 100%; overflow: hidden; }
    .gallery-hero .section-title { max-width: 100%; font-size: clamp(34px, 10.5vw, 44px); overflow-wrap: anywhere; }
    .gallery-hero .section-subtitle { max-width: 100%; font-size: 14px; line-height: 1.55; }
    .gallery-principle-card { width: 100%; padding: 26px 20px; border-radius: 18px; overflow: hidden; }
    .gallery-principle-card h2 { display: flex; width: 100%; max-width: 100%; min-width: 0; align-items: flex-start; font-size: 22px; line-height: 1.1; }
    .gallery-principle-card h2 > span,
    .gallery-principle-points .icon-label > span,
    .gallery-principle-card p { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    .gallery-principle-card p { font-size: 14px; line-height: 1.55; }
    .gallery-principle-points { width: 100%; min-width: 0; font-size: 12px; }
    .gallery-principle-points .icon-label { display: flex; width: 100%; min-width: 0; align-items: flex-start; }
    .gallery-projects-section { padding-inline: 16px; }
    .gallery-bottom-cta { width: calc(100% - 32px); margin-inline: 16px; padding: 28px 20px; }
    .gallery-bottom-cta h2 { font-size: clamp(26px, 8vw, 34px); overflow-wrap: anywhere; }
    .gallery-bottom-cta .btn { width: 100%; max-width: 100%; }
    .gallery-project-modal { width: calc(100vw - 24px); }
}


/* deliberate mobile gallery display rhythm. */
@media (max-width: 600px) {
    .gallery-hero .section-title,
    .gallery-projects-section .section-title,
    .gallery-bottom-cta h2 {
        overflow-wrap: normal;
        word-break: normal;
        text-wrap: balance;
    }
    .gallery-hero .section-title {
        font-size: clamp(30px, 8.8vw, 36px);
        line-height: .96;
        letter-spacing: -.035em;
    }
    .gallery-occasion-title {
        display: flex;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        align-items: center;
        justify-content: center;
        gap: 10px;
        font-size: clamp(28px, 8.3vw, 33px);
        line-height: .95;
        letter-spacing: -.035em;
        text-align: center;
    }
    .gallery-occasion-title > .ui-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
    .gallery-occasion-copy {
        display: block;
        min-width: 0;
        max-width: calc(100% - 2rem);
    }
    .gallery-occasion-copy > span {
        display: block;
        max-width: 100%;
    }
    .gallery-projects-section .section-subtitle {
        max-width: 32rem;
        font-size: 15px;
        line-height: 1.55;
    }
}
@media (max-width: 380px) {
    .gallery-occasion-title { font-size: 28px; }
}

/* mobile Gallery icon rhythm and semantic success accents. */
.gallery-principle-points span::first-letter { color: inherit; }

@media (max-width: 600px) {
    .gallery-principle-points .icon-label {
        gap: 11px;
    }
    .gallery-principle-points .ui-icon {
        margin-top: 1px;
    }

    .gallery-occasion-title {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    .gallery-occasion-title > .ui-icon {
        width: 1.35rem;
        height: 1.35rem;
        margin: 0 auto;
    }
    .gallery-occasion-copy {
        max-width: 100%;
        width: 100%;
    }
}

/* Custom Gallery media/proof selector */
.gallery-modal-media-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem;
    padding: .6rem 1rem 0;
}
.gallery-modal-media-nav[hidden] { display: none !important; }
.gallery-modal-media-button {
    appearance: none;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: var(--text-secondary);
    padding: .45rem .7rem;
    font: 700 .66rem/1 var(--font-ui);
    letter-spacing: .04em;
    cursor: pointer;
}
.gallery-modal-media-button.active { border-color: var(--accent-secondary); color: var(--text-primary); background: rgba(0,126,135,.08); }
.gallery-tiktok-proof {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 1rem 0;
    padding: .75rem .9rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    background: rgba(255,255,255,.025);
}
.gallery-tiktok-proof[hidden] { display: none !important; }
.gallery-tiktok-proof:hover { border-color: var(--accent-secondary); }
.gallery-tiktok-mark { font-size: 1.5rem; }
.gallery-tiktok-proof span:last-child { display:grid; gap:.2rem; }
.gallery-tiktok-proof strong { font: 700 .7rem/1.2 var(--font-ui); letter-spacing:.06em; }
.gallery-tiktok-proof small { color: var(--text-secondary); font-size:.7rem; }
