.custom-gallery-page { padding-top: var(--hdr-height); }
.gallery-page-container {
    width: min(calc(100% - 48px), var(--max-width));
    max-width: var(--max-width);
    margin-inline: auto;
}
.gallery-hero {
    min-height: auto;
    padding-top: clamp(34px, 5vw, 58px);
    padding-bottom: 22px;
}
.gallery-hero-copy { max-width: 760px; }
.gallery-hero .section-title { font-size: clamp(38px, 5vw, 58px); margin-bottom: 12px; }
.gallery-hero .section-subtitle { max-width: 680px; margin-bottom: 0; }
.gallery-hero-actions, .custom-order-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.gallery-projects-section { padding-top: 0; }
.gallery-filters { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px; margin: 0 0 24px; }
.gallery-filter {
    border: 1px solid var(--border-color);
    background: rgba(247,244,236,.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; align-items: start; }
.custom-gallery-card { min-width: 0; }
.custom-gallery-card:hover { transform: none; }
.custom-gallery-image-wrap { aspect-ratio: 1 / 1; }
.custom-gallery-image-wrap .gallery-card-image-button { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.custom-gallery-image-wrap .card-img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: none; }
.custom-gallery-image-wrap:hover .card-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(0,126,135,.45);
    color: var(--accent-success);
    padding: 7px 10px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    backdrop-filter: blur(10px);
}
.custom-gallery-card-body { align-items: center; gap: 18px; }
.custom-gallery-card-copy { min-width: 0; display: grid; gap: 5px; }
.custom-gallery-card .card-title { margin: 0; font-family: var(--font-body); font-size: 16px; font-weight: 700; line-height: 1.25; }
.custom-gallery-card .card-meta { display: block; color: var(--text-secondary); font-family: var(--font-ui); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.custom-gallery-card-tools { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.gallery-lower-like { min-width: 54px; }
.gallery-text-link { color: var(--accent-primary); font-family: var(--font-ui); font-size: 12px; font-weight: 700; white-space: nowrap; }
.gallery-text-link:hover { color: var(--accent-primary-hover); }
@media (max-width: 520px) {
    .custom-gallery-card-body { align-items: stretch; }
    .custom-gallery-card-tools { width: 100%; margin-left: 0; justify-content: space-between; }
}
.gallery-info-section {
    margin-top: clamp(52px, 7vw, 86px);
    margin-bottom: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}
.gallery-principle-card,
.gallery-order-info {
    border: 1px solid var(--border-color-hover);
    background: var(--surface-flat);
    border-radius: 22px;
    padding: 34px;
    box-shadow: 0 24px 70px rgba(11,11,13,.22);
}
.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-order-info { display: flex; flex-direction: column; justify-content: center; gap: 24px; background: rgba(247,244,236,.018); }
.gallery-order-info .custom-order-deposit-note { margin: 0; }
.gallery-bottom-cta {
    margin-bottom: 100px;
    padding: 50px;
    border: 1px solid var(--border-color-hover);
    border-radius: 22px;
    background: var(--surface-flat);
    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; }
/* Custom Gallery routed detail reuses the Ready Designs product-page layout and media mechanics. */
.custom-gallery-detail-page[hidden] { display: none !important; }
.gallery-permission-value { color: var(--accent-success); }
.gallery-reproduction-note {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 22px 0 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}
.gallery-project-actions { display: flex; align-items: center; gap: 14px; margin-top: auto; }
.gallery-project-actions .btn { flex: 1; }
.gallery-project-like { flex: 0 0 auto; }

@media (max-width: 1024px) {
    .custom-gallery-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .gallery-info-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .gallery-page-container { width: min(calc(100% - 32px), var(--max-width)); }
    .gallery-hero { padding-top: 34px; padding-bottom: 18px; }
    .gallery-hero .section-title { font-size: clamp(34px, 10vw, 46px); }
    .gallery-projects-section { padding-top: 12px; }
    .custom-gallery-grid { grid-template-columns: 1fr; }
    .gallery-principle-card, .gallery-order-info { padding: 28px 24px; }
    .gallery-bottom-cta { grid-template-columns: 1fr; padding: 34px 26px; gap: 28px; }
}
@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% - 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 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-info,
    .gallery-project-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%; }
}


/* 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%;
    }
}

.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(247,244,236,.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; }
