/* ============================================================
   EMSAR GROUP — Project detail pages (pages/emsar-rx, pages/derby)
   Gallery (main image + thumbnails) + description card.
   Loaded after main.css / group.css so these rules win.
   ============================================================ */

/* Project pages keep the flat black background of the homepage.
   The shared .page-header adds a tinted radial gradient; on project
   cards the user asked for plain black, so it is neutralised here. */
.page-header {
    background: var(--primary);
}

/* Project name is centred under the left-aligned breadcrumb */
.pr-title-center {
    text-align: center;
    color: #ffffff;
}

/* "RX" gets the brand gradient, the rest of the name stays white */
.pr-title-accent {
    background: linear-gradient(90deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* --- Gallery section --- */
.rx-gallery-section {
    padding: 40px 20px 60px;
    background: var(--primary);
}

.project-main-image {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 30px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
}

.project-main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: 550px;
}

/* prev / next buttons sitting on top of the main image */
/* frosted glass: the photo behind stays visible through the button */
.pr-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 1.8rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 5;
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    line-height: 1;
    user-select: none;
}

.pr-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
}

.pr-nav-btn:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
}

.pr-nav-prev {
    left: 16px;
}

.pr-nav-next {
    right: 16px;
}

/* thumbnail strip under the main image */
.pr-thumbs {
    display: flex;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    scroll-behavior: smooth;
}

.pr-thumbs::-webkit-scrollbar {
    display: none;
}

.pr-thumbs.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
}

.pr-thumb {
    flex: 0 0 auto;
    width: 96px;
    height: 64px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg);
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.pr-thumb:hover {
    opacity: 0.85;
}

/* the selected thumbnail is clearly outlined in blue, the rest stay dimmed */
.pr-thumb.is-active {
    opacity: 1;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45), 0 0 16px rgba(37, 99, 235, 0.55);
}

.pr-thumb:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    opacity: 1;
}

/* --- Description section --- */
.pr-desc-section {
    padding: 0 20px 80px;
    background: var(--primary);
}

.pr-desc-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
}

.pr-desc-title {
    text-align: center;
    color: #ffffff;
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    font-weight: 700;
    line-height: 1.45;
    margin-bottom: 28px;
}

.pr-desc-body p {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.pr-desc-body h3 {
    color: var(--text-main);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.pr-desc-body ul {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}

.pr-desc-body li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
}

.pr-desc-body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--secondary), var(--accent));
}

.pr-desc-body li strong {
    color: var(--text-main);
    font-weight: 600;
}

/* --- Responsive --- */

/* The gallery and description sit outside .container's own 20px side padding,
   so on small screens their horizontal padding is dropped to avoid stacking
   two paddings and squeezing the 900px cards. */
@media (max-width: 968px) {
    .rx-gallery-section,
    .pr-desc-section {
        padding-left: 0;
        padding-right: 0;
    }

    .rx-gallery-section {
        padding-top: 28px;
        padding-bottom: 44px;
    }

    .pr-desc-section {
        padding-bottom: 60px;
    }

    /* breadcrumb above a centred name reads better centred on phones */
    .page-header .breadcrumb {
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 16px;
        font-size: 0.82rem;
    }

    .pr-title-center {
        margin-bottom: 6px;
        letter-spacing: 0;
    }

    .project-main-image {
        margin-bottom: 20px;
        border-radius: 14px;
    }

    .project-main-image img {
        max-height: 380px;
    }

    .pr-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.25rem;
    }

    .pr-nav-prev {
        left: 8px;
    }

    .pr-nav-next {
        right: 8px;
    }

    .pr-thumb {
        width: 74px;
        height: 52px;
        -webkit-tap-highlight-color: transparent;
    }

    .pr-desc-card {
        padding: 26px 18px;
        border-radius: 14px;
    }

    .pr-desc-body h3 {
        font-size: 1.05rem;
        margin: 26px 0 10px;
    }

    .pr-desc-body p,
    .pr-desc-body li {
        overflow-wrap: break-word;
        word-break: break-word;
    }
}

@media (max-width: 480px) {
    .pr-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 1.05rem;
        border-width: 1px;
    }

    .project-main-image img {
        max-height: 260px;
    }

    .pr-thumb {
        width: 62px;
        height: 44px;
    }

    .pr-thumbs {
        gap: 8px;
    }

    .pr-desc-card {
        padding: 22px 14px;
    }

    .pr-desc-body li {
        padding-left: 18px;
        font-size: 0.94rem;
    }
}

/* --- galeriya videosu (esas çerçive) --- */
.project-main-image video.pr-main-video {
    width: 100%;
    height: auto;
    max-height: 550px;
    display: block;
    background: #000;
    margin: 0 auto;
    cursor: zoom-in;
}

.project-main-image img {
    cursor: zoom-in;
}

/* --- tam ekran lightbox (butun qalereya sedifeleri ucun) --- */
.emlb {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 5, 10, 0.68);
    /* arxada tam blur */
    backdrop-filter: blur(22px) saturate(0.85);
    -webkit-backdrop-filter: blur(22px) saturate(0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
}

.emlb.is-open {
    opacity: 1;
    visibility: visible;
}

.emlb-stage {
    display: flex;
    align-items: center;
    justify-content: center;
}

.emlb-stage img,
.emlb-stage video {
    max-width: 92vw;
    max-height: 86vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.emlb-x {
    position: fixed;
    top: 18px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.25s ease, transform 0.3s ease;
}

.emlb-x:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: rotate(90deg) scale(1.05);
}

.emlb-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.25s ease;
}

.emlb-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.emlb-prev {
    left: 20px;
}

.emlb-next {
    right: 20px;
}

.emlb-count {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    letter-spacing: 1px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.emlb-lock {
    overflow: hidden;
}

@media (max-width: 768px) {
    .emlb-arrow {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    .emlb-prev {
        left: 10px;
    }

    .emlb-next {
        right: 10px;
    }

    .emlb-x {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
    }
}

/* hidden atributu her zaman qalib gelir: esas cerdivede bir media gorunur */
.project-main-image img[hidden],
.project-main-image video[hidden] {
    display: none !important;
}

/* Tam adin alt satiri: "— Təhlükəsizlik ve isiqlandirma" kimi ikinci setr */
.pr-title-sub {
    /* basliqla yan-yana; desktopda boyuk, mobilda kichik qalir */
    display: inline;
    font-size: clamp(0.72rem, 3.4vw, 1.45rem);
    font-weight: 600;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 6px;
}

.pr-title-sub::before {
    content: '\2014\00a0';
    color: var(--text-muted);
}
