/* ─── Gallery Page (gp-) — Light + Dark + bilingual ─── */

.page-gallery {
    --gp-bg: #f9f7f2;
    --gp-bg-soft: #f3efe8;
    --gp-text: #2c302e;
    --gp-text-soft: rgba(44, 48, 46, 0.62);
    --gp-accent: #b08d57;
    --gp-accent-bright: #c4872a;
    --gp-line: rgba(176, 141, 87, 0.35);
    --gp-card: #fff;
    --gp-shadow: rgba(44, 48, 46, 0.08);
    --gp-tile-bg: #ece7df;
}

html[data-theme="dark"] .page-gallery {
    --gp-bg: #0a0b0a;
    --gp-bg-soft: #121411;
    --gp-text: #eae6df;
    --gp-text-soft: rgba(234, 230, 223, 0.58);
    --gp-accent: #e8942a;
    --gp-accent-bright: #f0a840;
    --gp-line: rgba(232, 148, 42, 0.35);
    --gp-card: rgba(22, 23, 21, 0.94);
    --gp-shadow: rgba(0, 0, 0, 0.4);
    --gp-tile-bg: #1a1b19;
}

.page-gallery .site-main--gallery {
    padding: 0;
    min-height: auto;
}

.gp {
    background: var(--gp-bg);
    color: var(--gp-text);
}

.gp-wrap {
    width: min(1180px, calc(100% - 80px));
    margin: 0 auto;
}

.gp-section {
    position: relative;
}

.gp-label-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.gp-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--gp-accent);
}

.gp-label-line {
    width: 36px;
    height: 1px;
    background: var(--gp-accent);
    transform-origin: left center;
}

html[dir="rtl"] .gp-label-line {
    transform-origin: right center;
}

.gp-heading {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 400;
    line-height: 1.12;
    margin: 0;
    color: var(--gp-text);
}

.gp-heading em {
    font-style: italic;
    color: var(--gp-accent);
}

html[lang="fa"] .gp-heading {
    font-family: var(--font-display);
}

html[lang="fa"] .gp-heading em {
    font-style: normal;
}

/* Hero */
.gp-hero {
    position: relative;
    min-height: clamp(520px, 82vh, 860px);
    display: flex;
    align-items: center;
    padding: calc(96px + env(safe-area-inset-top, 0px)) 0 80px;
    overflow: hidden;
    isolation: isolate;
}

.gp-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: var(--gp-bg-soft);
    background-image: var(--gp-hero-bg);
    background-size: cover;
    background-position: 68% center;
    transform: scale(1.04);
}

html[dir="rtl"] .gp-hero__bg {
    background-position: 32% center;
}

.gp-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        105deg,
        rgba(249, 247, 242, 0.94) 0%,
        rgba(249, 247, 242, 0.78) 42%,
        rgba(249, 247, 242, 0.18) 68%,
        transparent 100%
    );
}

html[data-theme="dark"] .gp-hero__overlay {
    background: linear-gradient(
        105deg,
        rgba(10, 11, 10, 0.94) 0%,
        rgba(10, 11, 10, 0.78) 42%,
        rgba(10, 11, 10, 0.2) 68%,
        transparent 100%
    );
}

html[dir="rtl"] .gp-hero__overlay {
    background: linear-gradient(
        -105deg,
        rgba(249, 247, 242, 0.94) 0%,
        rgba(249, 247, 242, 0.78) 42%,
        rgba(249, 247, 242, 0.18) 68%,
        transparent 100%
    );
}

html[data-theme="dark"][dir="rtl"] .gp-hero__overlay {
    background: linear-gradient(
        -105deg,
        rgba(10, 11, 10, 0.94) 0%,
        rgba(10, 11, 10, 0.78) 42%,
        rgba(10, 11, 10, 0.2) 68%,
        transparent 100%
    );
}

.gp-hero__inner {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 80px));
    margin: 0 auto;
}

.gp-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.55fr);
    gap: 48px;
    align-items: center;
}

.gp-hero__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(48px, 6vw, 76px);
    font-weight: 400;
    line-height: 1.02;
    margin: 0 0 16px;
    color: var(--gp-text);
}

html[lang="fa"] .gp-hero__title {
    font-family: var(--font-display);
}

.gp-hero__subtitle {
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gp-accent);
    margin: 0 0 20px;
}

.gp-hero__desc {
    font-size: 15px;
    line-height: 1.75;
    color: var(--gp-text-soft);
    max-width: 480px;
    margin: 0 0 32px;
}

.gp-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px 14px 18px;
    border-radius: 999px;
    background: var(--gp-accent-bright);
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gp-hero__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(196, 122, 44, 0.28);
}

.gp-hero__cta-icon svg {
    width: 18px;
    height: 18px;
}

html[dir="rtl"] .gp-hero__cta-icon svg {
    transform: scaleX(-1);
}

/* Showcase */
.gp-showcase {
    padding: 72px 0 88px;
}

.gp-intro-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 32px;
    background: var(--gp-card);
    border-radius: 20px;
    padding: 44px 48px;
    box-shadow: 0 24px 64px var(--gp-shadow);
    margin-bottom: 36px;
}

.gp-intro__subtitle {
    font-size: 14px;
    line-height: 1.75;
    color: var(--gp-text-soft);
    max-width: 520px;
    margin: 16px 0 0;
}

.gp-counter {
    text-align: right;
    font-family: 'Cormorant Garamond', serif;
    color: var(--gp-text-soft);
    font-size: 14px;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

html[dir="rtl"] .gp-counter {
    text-align: left;
}

.gp-counter__current {
    display: block;
    font-size: clamp(40px, 5vw, 56px);
    font-weight: 300;
    line-height: 1;
    color: var(--gp-accent);
}

/* Bento grid */
.gp-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(200px, 228px);
    gap: 14px;
}

.gp-tile {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    cursor: pointer;
    isolation: isolate;
    background: var(--gp-tile-bg);
    min-height: 200px;
    transition: box-shadow 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.gp-tile:nth-child(1) { grid-column: 1 / span 7; grid-row: span 2; }
.gp-tile:nth-child(2) { grid-column: 8 / span 5; }
.gp-tile:nth-child(3) { grid-column: 8 / span 5; }
.gp-tile:nth-child(4) { grid-column: 1 / span 4; }
.gp-tile:nth-child(5) { grid-column: 5 / span 4; }
.gp-tile:nth-child(6) { grid-column: 9 / span 4; }

.gp-tile::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    pointer-events: none;
    z-index: 4;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.gp-tile.is-active {
    transform: translateY(-2px);
    box-shadow: 0 20px 48px var(--gp-shadow);
}

.gp-tile.is-active::after {
    border-color: rgba(196, 135, 42, 0.65);
    box-shadow: inset 0 0 0 1px rgba(196, 135, 42, 0.2);
}

.gp-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s ease;
}

.gp-tile:hover img,
.gp-tile.is-active img {
    transform: scale(1.05);
    filter: brightness(0.94);
}

.gp-tile__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 22px 24px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 72%);
    transform: translateY(6px);
    opacity: 0.88;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gp-tile:hover .gp-tile__overlay,
.gp-tile.is-active .gp-tile__overlay {
    opacity: 1;
    transform: translateY(0);
}

.gp-tile__num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--gp-accent-bright);
    margin-bottom: 6px;
}

.gp-tile__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 400;
    color: #fff;
    margin: 0 0 4px;
}

html[lang="fa"] .gp-tile__title {
    font-family: var(--font-display);
}

.gp-tile__desc {
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.gp-tile__shine {
    position: absolute;
    top: 0;
    left: -80%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    z-index: 3;
    pointer-events: none;
    opacity: 0;
}

.gp-tile__expand {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--gp-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

html[dir="rtl"] .gp-tile__expand {
    right: auto;
    left: 14px;
}

.gp-tile__expand svg {
    width: 16px;
    height: 16px;
}

.gp-tile:hover .gp-tile__expand,
.gp-tile.is-active .gp-tile__expand {
    opacity: 1;
    transform: scale(1);
}

/* Footer */
.gp-footer {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 24px;
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--gp-line);
}

.gp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 28px;
}

.gp-tag {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gp-text-soft);
}

.gp-tag em {
    color: var(--gp-accent);
    font-style: normal;
}

.gp-dots {
    display: flex;
    gap: 8px;
}

.gp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(176, 141, 87, 0.28);
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.gp-dot.is-active {
    background: var(--gp-accent);
    transform: scale(1.25);
}

.gp-nav {
    display: flex;
    gap: 10px;
}

.gp-nav__btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--gp-line);
    background: var(--gp-card);
    color: var(--gp-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gp-nav__btn:hover {
    background: var(--gp-accent);
    border-color: var(--gp-accent);
    color: #fff;
}

.gp-nav__btn svg {
    width: 18px;
    height: 18px;
}

html[dir="rtl"] .gp-nav__btn svg {
    transform: scaleX(-1);
}

/* Banner */
.gp-banner {
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    padding: 80px 0;
    overflow: hidden;
    isolation: isolate;
}

.gp-banner__bg {
    position: absolute;
    inset: 0;
    background-image: var(--gp-banner-bg);
    background-size: cover;
    background-position: center;
    transform: scale(1.06);
}

.gp-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(44, 48, 46, 0.82), rgba(44, 48, 46, 0.55));
}

html[data-theme="dark"] .gp-banner__overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.62));
}

.gp-banner__inner {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

.gp-banner__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 400;
    margin: 0 0 14px;
}

html[lang="fa"] .gp-banner__title {
    font-family: var(--font-display);
}

.gp-banner__desc {
    font-size: 15px;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto;
    opacity: 0.88;
}

/* Lightbox */
.gp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.gp-lightbox[hidden] {
    display: none;
}

.gp-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 11, 10, 0.88);
    backdrop-filter: blur(8px);
}

.gp-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 16px;
    background: var(--gp-card);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}

.gp-lightbox__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[dir="rtl"] .gp-lightbox__close {
    right: auto;
    left: 14px;
}

.gp-lightbox__close svg {
    width: 18px;
    height: 18px;
}

.gp-lightbox__img {
    width: 100%;
    max-height: 68vh;
    object-fit: cover;
    display: block;
}

.gp-lightbox__caption {
    padding: 24px 28px 28px;
}

.gp-lightbox__title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    margin: 0 0 8px;
    color: var(--gp-text);
}

html[lang="fa"] .gp-lightbox__title {
    font-family: var(--font-display);
}

.gp-lightbox__text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--gp-text-soft);
    margin: 0;
}

/* Responsive — hero only; gp-showcase in page-gallery-responsive.css */
@media (max-width: 960px) {
    .gp-hero__grid {
        grid-template-columns: 1fr;
    }

    .gp-hero__aside {
        display: none;
    }
}

@media (max-width: 600px) {
    .gp-wrap {
        width: calc(100% - 40px);
    }

    .gp-hero__inner {
        width: calc(100% - 40px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .gp-tile,
    .gp-tile img,
    .gp-hero__cta {
        transition: none;
    }
}
