/* ================================================
   RUI GE ENTERPRISE - Project Details Page Styles
   WordPress Elementor Compatible Stylesheet
   ================================================ */

:root {
    --color-primary: #0a0a0a;
    --color-white: #ffffff;
    --color-gray-dark: #333333;
    --color-gray-mid: #777777;
    --color-gray-light: #f8f8f8;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --font-serif: 'DM Serif Display', serif;
    --ease-premium: cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- GLOBAL RESET (scoped to .rg-project-page) --- */
.rg-project-page {
    font-family: var(--font-main);
    color: var(--color-primary);
    line-height: 1.8;
    overflow-x: hidden;
}

.rg-project-page * {
    box-sizing: border-box;
}

.rg-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 60px;
}

/* ================================================
   HERO SECTION
   ================================================ */
.rg-hero {
    height: 90vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #000;
}

.rg-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.8;
    transform: scale(1.1);
    animation: rgSlowZoom 20s linear infinite alternate;
}

@keyframes rgSlowZoom {
    to {
        transform: scale(1.2);
    }
}

.rg-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
}

.rg-hero-content {
    position: relative;
    z-index: 10;
    color: white;
    padding-left: 80px;
    width: 100%;
}

.rg-hero-tagline {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 12px;
    margin-bottom: 20px;
    opacity: 0;
    filter: blur(10px);
    animation: rgOpticalReveal 1.5s var(--ease-premium) forwards;
    animation-delay: 0.5s;
    color: white;
}

.rg-hero-title {
    font-size: clamp(4rem, 10vw, 7.5rem) !important;
    font-weight: 900 !important;
    line-height: 0.9 !important;
    text-transform: uppercase;
    margin-bottom: 20px !important;
    color: white !important;
    font-family: var(--font-heading) !important;
}

.rg-hero-title .line-1 {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    filter: blur(15px);
    animation: rgOpticalReveal 2s var(--ease-premium) forwards;
    animation-delay: 0.7s;
}

.rg-hero-title .line-2 {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    filter: blur(15px);
    animation: rgOpticalReveal 2s var(--ease-premium) forwards;
    animation-delay: 0.9s;
    font-family: var(--font-serif) !important;
    font-weight: 400 !important;
    font-style: italic;
    text-transform: none;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7) !important;
}

@keyframes rgOpticalReveal {
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* --- Bottom Glass Stats Bar --- */
.rg-hero-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    opacity: 0;
    animation: rgFadeIn 1.5s ease forwards;
    animation-delay: 1.5s;
}

.rg-stat-group {
    display: flex;
    gap: 80px;
}

.rg-hero-stat {
    color: white;
}

.rg-hero-stat .val {
    display: block;
    font-size: 2.2rem;
    font-family: var(--font-serif);
    line-height: 1;
}

.rg-hero-stat .lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
}

.rg-scroll-hint {
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 4px;
}

.rg-scroll-line {
    width: 80px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.rg-scroll-line::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    animation: rgLineMove 2s infinite;
}

@keyframes rgLineMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes rgFadeIn {
    to { opacity: 1; }
}

/* ================================================
   PROJECT OVERVIEW SECTION
   ================================================ */
.rg-project-overview {
    padding: 140px 0 50px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
}

.rg-overview-text h3,
.rg-overview-text .elementor-heading-title {
    font-size: 0.8rem !important;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--color-gray-mid);
    margin-bottom: 30px;
}

.rg-overview-text p,
.rg-overview-text .elementor-widget-text-editor p {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 40px;
    color: var(--color-primary);
}

.rg-overview-text .rg-desc-sub p,
.rg-overview-text .rg-desc-sub .elementor-widget-text-editor p {
    font-size: 1rem;
    color: var(--color-gray-mid);
}

.rg-spec-list {
    list-style: none;
    border-top: 1px solid #eee;
    padding: 0;
    margin: 0;
}

.rg-spec-list li {
    padding: 25px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.rg-spec-list .label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--color-gray-mid);
}

.rg-spec-list .value {
    font-weight: 600;
}

.rg-spec-list .value.completed {
    color: #2ecc71;
}

/* ================================================
   BEFORE/AFTER TRANSFORMATION SECTION
   ================================================ */
.rg-transformation-section {
    padding: 120px 0;
    background-color: var(--color-gray-light);
}

.rg-transformation-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 100px;
    align-items: center;
}

.rg-transformation-content {
    text-align: left;
}

.rg-transformation-content h2,
.rg-transformation-content .elementor-heading-title {
    font-family: var(--font-serif) !important;
    font-size: 3.5rem !important;
    font-weight: 400 !important;
    line-height: 1.1 !important;
    margin-bottom: 25px;
}

.rg-transformation-content p {
    color: var(--color-gray-mid);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 30px;
}

.rg-interactive-label {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rg-interactive-label span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 600;
}

.rg-interactive-label .rg-line {
    width: 40px;
    height: 1px;
    background: #000;
}

/* --- Comparison Slider --- */
.rg-comparison-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
    --position: 50%;
}

.rg-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rg-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rg-before-image {
    z-index: 1;
}

.rg-after-image {
    z-index: 2;
    width: 100%;
    clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

.rg-slider-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: ew-resize;
    opacity: 0;
    margin: 0;
}

.rg-slider-line {
    position: absolute;
    top: 0;
    left: var(--position);
    width: 2px;
    height: 100%;
    background: white;
    z-index: 5;
    pointer-events: none;
    transform: translateX(-50%);
}

.rg-slider-button {
    position: absolute;
    top: 50%;
    left: var(--position);
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    z-index: 6;
    pointer-events: none;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.rg-slider-button i {
    color: var(--color-primary);
    font-size: 0.9rem;
}

.rg-label-before,
.rg-label-after {
    position: absolute;
    bottom: 20px;
    padding: 6px 15px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 7;
    pointer-events: none;
}

.rg-label-after {
    left: 20px;
}

.rg-label-before {
    right: 20px;
}

/* ================================================
   MASONRY GALLERY
   ================================================ */
.rg-gallery-header {
    margin: 60px 0;
    text-align: center;
}

.rg-gallery-header h2,
.rg-gallery-header .elementor-heading-title {
    font-family: var(--font-serif) !important;
    font-size: 3rem !important;
    font-weight: 400 !important;
}

.rg-gallery-header .rg-line {
    width: 40px;
    height: 1px;
    background: #000;
    margin: 20px auto;
}

.rg-masonry {
    column-count: 3;
    column-gap: 30px;
    padding-bottom: 100px;
}

.rg-masonry-item {
    break-inside: avoid;
    margin-bottom: 30px;
    overflow: hidden;
    background: var(--color-gray-light);
    cursor: pointer;
}

.rg-masonry-item img {
    width: 100%;
    transition: transform 1.2s var(--ease-premium);
}

.rg-masonry-item:hover img {
    transform: scale(1.05);
}

/* ================================================
   FOOTER CTA
   ================================================ */
.rg-footer-cta {
    background: var(--color-primary);
    color: white;
    padding: 150px 0;
    text-align: center;
}

.rg-footer-cta h2,
.rg-footer-cta .elementor-heading-title {
    font-family: var(--font-serif) !important;
    font-size: clamp(3rem, 6vw, 5rem) !important;
    margin-bottom: 40px;
    font-weight: 400 !important;
    color: white !important;
}

.rg-btn-premium {
    display: inline-block;
    padding: 20px 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.8rem;
    transition: 0.4s;
}

.rg-btn-premium:hover {
    background: white;
    color: black;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1200px) {
    .rg-transformation-grid {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }

    .rg-transformation-content {
        text-align: center;
        max-width: 600px;
        margin: 0 auto;
    }

    .rg-comparison-wrapper {
        aspect-ratio: 16/9;
        max-width: 900px;
        margin: 0 auto;
    }
}

@media (max-width: 1024px) {
    .rg-hero-content {
        padding-left: 40px;
    }

    .rg-hero-bottom-bar {
        padding: 30px 40px;
        flex-direction: column;
        gap: 30px;
    }

    .rg-project-overview {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .rg-masonry {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .rg-container {
        padding: 0 30px;
    }

    .rg-masonry {
        column-count: 1;
    }

    .rg-hero-title {
        font-size: 3.5rem !important;
    }

    .rg-stat-group {
        gap: 30px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .rg-transformation-content h2,
    .rg-transformation-content .elementor-heading-title {
        font-size: 2.5rem !important;
    }
}

/* ================================================
   ELEMENTOR OVERRIDES
   Ensures Elementor editor widgets inherit our styles
   ================================================ */
.elementor-editor-active .rg-hero-bg {
    animation: none;
}

.elementor-editor-active .rg-hero-title .line-1,
.elementor-editor-active .rg-hero-title .line-2,
.elementor-editor-active .rg-hero-tagline,
.elementor-editor-active .rg-hero-bottom-bar {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
}

/* Make Elementor Image widgets inside our sections behave correctly */
.rg-masonry-item .elementor-widget-image img,
.rg-image-container .elementor-widget-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
