/* Rushda Elementor Widgets — Elementor editor + frontend overrides */

/* ================================================================
   CONTACT FORM WIDGET — matches PHP demo approved design
   ================================================================ */

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 64px;
    align-items: start;
    margin-top: 32px;
}

.contact-heading {
    font-family: "Work Sans", sans-serif;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 300;
    color: #000;
    margin: 0 0 20px;
    line-height: 1.2;
}

.contact-intro {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    color: #1a1a1a;
    margin-bottom: 24px;
}

/* Sidebar info */
.contact-side-info {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding-top: 8px;
}

.contact-side-block h3 {
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #6b6b6b;
    margin: 0 0 6px;
}

.contact-side-block a,
.contact-side-block span {
    font-size: 0.85rem;
    font-weight: 300;
    color: #000;
    text-decoration: none;
    line-height: 1.6;
}

.contact-side-block a:hover {
    color: #6b6b6b;
}

/* Form card */
.contact-form {
    margin: 56px 0 0;
    max-width: 760px;
    padding: 34px;
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 22px 70px rgba(26, 26, 26, 0.06);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.form-group {
    position: relative;
    margin-bottom: 26px;
}

.form-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #000;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 15px 16px;
    font-family: "Work Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #000;
    background: rgba(245, 242, 237, 0.58);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #6b6b6b;
    background: rgba(245, 242, 237, 0.86);
    box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.14);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(0, 0, 0, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 160px;
}

/* Native select hidden, custom select shown */
.native-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    width: 100%;
    min-height: 52px;
    padding: 15px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-family: "Work Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: rgba(26, 26, 26, 0.72);
    background: rgba(245, 242, 237, 0.58);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
    border-color: #6b6b6b;
    background: rgba(245, 242, 237, 0.86);
}

.custom-select-trigger:focus-visible {
    outline: none;
    border-color: #6b6b6b;
    box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.18);
}

.custom-select-trigger .lni {
    flex: 0 0 auto;
    font-size: 13px;
    color: #1a1a1a;
    transition: transform 0.3s ease, color 0.3s ease;
}

.custom-select.open .custom-select-trigger .lni {
    transform: rotate(180deg);
    color: #6b6b6b;
}

.custom-select.has-value .custom-select-trigger {
    color: #000;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 80;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    background: #fffaf3;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 18px 45px rgba(26, 26, 26, 0.14);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.custom-select.open .custom-select-options {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-select-options button {
    width: 100%;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: "Work Sans", sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.35;
    color: #1a1a1a;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    transition: color 0.25s ease, background 0.25s ease;
}

.custom-select-options button:hover,
.custom-select-options button:focus-visible {
    color: #000;
    background: rgba(196, 168, 130, 0.14);
    outline: none;
}

.custom-select-options button[aria-selected="true"] {
    color: #000;
    background: rgba(196, 168, 130, 0.2);
}

.custom-select-options button[aria-selected="true"]::after {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    margin-left: 12px;
    background: #6b6b6b;
    border-radius: 50%;
}

/* Submit button */
.form-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 15px 48px;
    font-family: "Work Sans", sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #fff;
    background: #000;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.form-submit:hover {
    background: #6b6b6b;
}

.form-actions {
    margin-top: 8px;
}

/* Contact page responsive */
@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 24px;
    }
}

/* ================================================================
   STATS COUNTER WIDGET — matches PHP demo approved design
   ================================================================ */

.about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 40px;
    padding-top: 32px;
}

.about-stats .stat-block {
    border-top: 0;
    text-align: left;
}

.stat-number {
    font-family: "Work Sans", sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: #6b6b6b;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.stat-label {
    font-family: "Work Sans", sans-serif;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #1a1a1a;
    margin-top: 6px;
}

/* Inside content grid context — add top border */
.inner-content .stat-block {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 24px;
}

/* Ensure widgets render properly in Elementor canvas */
.elementor-widget-rushda_portfolio_grid .container,
.elementor-widget-rushda_projects_archive .project-archive {
    width: 100%;
}

/* Make sure Elementor doesn't constrain our full-width layouts */
.elementor-element.elementor-widget-rushda_portfolio_grid {
    max-width: 100% !important;
}

/* Project cards — ensure visibility (theme.js sets this too, but Elementor needs it immediately) */
.elementor-widget-rushda_portfolio_grid .project-card {
    visibility: visible !important;
    border-bottom: none !important;
}

/* Projects Archive — scoped hover images */
.archive-side-image {
    position: fixed;
    width: 25vw;
    height: 60vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 5;
    overflow: hidden;
}

.archive-side-image.active {
    opacity: 1;
}

.archive-side-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-side-left {
    left: 5vw;
    top: 20vh;
}

.archive-side-right {
    right: 5vw;
    top: 20vh;
}

/* Project archive list */
.project-archive {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 6vw 80px;
    position: relative;
}

.project-archive-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 500px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.project-archive-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.project-archive-item a {
    display: block;
    padding: 14px 0;
    text-decoration: none;
    color: #000;
    position: relative;
    overflow: hidden;
}

.project-archive-name {
    font-family: "Work Sans", sans-serif;
    font-size: 0.92rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: block;
}

.project-archive-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    position: absolute;
    inset: 0;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-archive-meta span {
    font-family: "Work Sans", sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6b6b6b;
}

/* Hover: name fades out + slides up, meta fades in */
.elementor-widget-rushda_projects_archive .project-archive-item a:hover .project-archive-name {
    opacity: 0;
    transform: translateY(-8px);
}

.elementor-widget-rushda_projects_archive .project-archive-item a:hover .project-archive-meta {
    opacity: 1;
}

/* Non-widget context fallback */
.project-archive-item a:hover .project-archive-name {
    opacity: 0;
    transform: translateY(-8px);
}

.project-archive-item a:hover .project-archive-meta {
    opacity: 1;
}

/* Override any Elementor link transitions on archive items */
.elementor-widget-rushda_projects_archive .project-archive-item a {
    transition: none !important;
    border-bottom: none !important;
    text-decoration: none !important;
}

.elementor-widget-rushda_projects_archive .project-archive-name {
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.elementor-widget-rushda_projects_archive .project-archive-meta {
    transition: opacity 0.3s ease !important;
}

/* Hide side images on mobile */
@media (max-width: 768px) {
    .archive-side-image {
        display: none;
    }

    .project-archive {
        padding: 80px 5vw 60px;
        min-height: auto;
    }

    .project-archive-item a {
        padding: 16px 0;
    }

    .project-archive-name {
        position: relative;
    }

    .project-archive-meta {
        position: relative;
        opacity: 1;
        pointer-events: auto;
        margin-top: 4px;
    }

    .project-archive-item a:hover .project-archive-name {
        opacity: 1;
        transform: none;
    }
}

/* Elementor editor tweaks — ensure our classes aren't overridden */
.elementor-editor-active .fullscreen-menu {
    display: none !important;
}

.elementor-editor-active .top-nav {
    position: relative !important;
}


/* ================================================================
   CAROUSEL WIDGET
   ================================================================ */

.rew-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
}

.rew-carousel-viewport {
    overflow: hidden;
    width: 100%;
}

.rew-carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.rew-carousel-slide {
    flex: 0 0 auto;
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

.rew-carousel-slide.active {
    opacity: 1;
}

/* Multi-slide: all visible slides get full opacity */
.rew-carousel--multi .rew-carousel-slide.in-view {
    opacity: 1;
}

.rew-carousel-slide-inner {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.rew-carousel-slide-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.rew-carousel-slide-inner a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Caption */
.rew-carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 2rem 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
    color: #fff;
    font-family: "Work Sans", sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-align: center;
}

/* Arrows */
.rew-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    transition: background 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.rew-carousel:hover .rew-carousel-arrow {
    opacity: 1;
}

.rew-carousel-arrow:hover {
    background: #000;
    color: #fff;
}

.rew-carousel-prev { left: 16px; }
.rew-carousel-next { right: 16px; }

/* Dots */
.rew-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 1rem 0 0.5rem;
}

.rew-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #000;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease;
}

.rew-carousel-dot.active {
    background: #000;
}

.rew-carousel-dot:hover {
    background: #666;
}

/* Mobile arrows always visible */
@media (max-width: 768px) {
    .rew-carousel-arrow {
        opacity: 1;
        width: 40px;
        height: 40px;
    }
    .rew-carousel-prev { left: 8px; }
    .rew-carousel-next { right: 8px; }
}


/* ================================================================
   GALLERY LIGHTBOX WIDGET
   ================================================================ */

.rew-gallery {
    width: 100%;
}

.rew-gallery-grid {
    display: grid;
    gap: 8px;
    width: 100%;
}

/* Column overrides via data attribute (set by JS) */
.rew-gallery[data-columns="2"] { --rew-cols: 2; }
.rew-gallery[data-columns="3"] { --rew-cols: 3; }
.rew-gallery[data-columns="4"] { --rew-cols: 4; }

.rew-gallery-grid {
    grid-template-columns: repeat(var(--rew-cols, 3), 1fr);
}

.rew-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.rew-gallery-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.rew-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.5s ease;
}

.rew-gallery-item:hover .rew-gallery-thumb img {
    transform: scale(1.04);
}

/* Overlay caption */
.rew-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.rew-gallery-item:hover .rew-gallery-overlay {
    opacity: 1;
}

.rew-gallery-overlay-text {
    color: #fff;
    font-family: "Work Sans", sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
}

/* Below-image caption */
.rew-gallery-caption {
    padding: 0.6rem 0 0.2rem;
    font-family: "Work Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    color: #333;
}

/* ── Lightbox ─────────────────────────────────────────────────── */

/* Masonry layout — CSS columns */
.rew-gallery--masonry .rew-gallery-grid {
    display: block;
    column-count: var(--rew-cols, 3);
    column-gap: 8px;
}

.rew-gallery--masonry .rew-gallery-item {
    break-inside: avoid;
    margin-bottom: 8px;
    display: inline-block;
    width: 100%;
}

.rew-gallery--masonry .rew-gallery-thumb {
    aspect-ratio: auto !important;
    height: auto;
}

.rew-gallery--masonry .rew-gallery-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.rew-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}

.rew-lightbox.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.rew-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
}

.rew-lightbox-content {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rew-lightbox-image-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rew-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    object-position: center center;
    display: block;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.rew-lightbox-img.loaded {
    opacity: 1;
}

/* Close button */
.rew-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 10;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    padding: 8px;
}

.rew-lightbox-close:hover {
    opacity: 1;
}

/* Lightbox arrows */
.rew-lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.rew-lightbox-arrow:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
}

.rew-lightbox-prev { left: 20px; }
.rew-lightbox-next { right: 20px; }

/* Info bar */
.rew-lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.rew-lightbox-counter {
    font-family: "Work Sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

.rew-lightbox-caption {
    font-family: "Work Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0.06em;
    color: #fff;
}

/* Mobile lightbox */
@media (max-width: 768px) {
    .rew-lightbox-arrow {
        width: 40px;
        height: 40px;
    }
    .rew-lightbox-prev { left: 10px; }
    .rew-lightbox-next { right: 10px; }
    .rew-lightbox-info {
        padding: 1rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    .rew-gallery[data-columns="3"],
    .rew-gallery[data-columns="4"] {
        --rew-cols: 2;
    }

    .rew-gallery--masonry .rew-gallery-grid {
        column-count: 2 !important;
    }
}
