@import url("../font.css");

/* --- Variables --- */
:root {
    --bg-color: #100f0f;
    --green-color: #3a4b43;
    --text-color: #ffffff;
    --accent-color: #eccf9c;
    --secondary-text: #a0a0a0;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body,
html {
    width: 100%;
    max-width: 100vw;
    min-height: 100%;
    background-color: var(--green-color);
    color: var(--text-color);
    overflow-x: hidden;
}

#main {
    width: 100%;
    max-width: 100vw;
    position: relative;
    z-index: 2;
    background-color: var(--green-color);
    overflow-x: hidden;
}

/* --- Hero Section --- */
#services-hero {
    position: relative;
    width: 100%;
    max-width: 100vw;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: url(../images/home/hero-bg-green.webp) no-repeat center
        center/cover;
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 0%,
        black 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 0%,
        black 90%,
        transparent 100%
    );
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
}

.services-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.services-hero-content .tag {
    margin-bottom: 2.5rem;
}

.services-hero-content h1 {
    font-family: "didot-bold", serif;
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--accent-color);
    width: 80%;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.services-hero-content > p {
    /* font-family: "TheYearOfHandicrafts", serif; */
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    max-width: 750px;
    margin: 0 auto;
}

/* --- Services Section --- */
#services-section {
    width: 100%;
    padding: 4rem 0 8rem;
}

.services-container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 4rem;
    box-sizing: border-box;
}

/* Service Row */
.service-row {
    position: relative;
    padding: 2rem 0 0rem;
    height: 40rem;
}

.service-border-top,
.service-border-bottom {
    width: 100%;
    height: 1px;
    background: var(--accent-color);
    opacity: 0.3;
    position: absolute;
    top: 0;
    left: 0;
}

.service-border-bottom {
    top: auto;
    bottom: 0;
}

.service-content {
    display: grid;
    grid-template-columns: 20% 35% 38%;
    gap: 3rem;
    align-items: start;
}

/* Service Name Column */
.service-name {
    position: relative;
    transform: translateY(30px);
}

.service-number {
    display: block;
    font-family: "didot-bold", serif;
    font-size: 0.9rem;
    color: var(--accent-color);
    opacity: 0.5;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.service-name h2 {
    font-family: "didot-bold", serif;
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    color: var(--accent-color);
    line-height: 1;
    margin: 0;
}

/* Service Description Column */
.service-desc p {
    /* font-family: "TheYearOfHandicrafts", serif; */
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}

/* Sub-Services Column */
.service-subs {
    display: flex;
    flex-direction: column;
}

.sub-service-item {
    border-bottom: 1px solid rgba(236, 207, 156, 0.15);
    padding-bottom: 0.8rem;
}

.sub-service-item:last-child {
    border-bottom: none;
}

.sub-service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.sub-service-header:hover {
    padding-left: 0.5rem;
}

.sub-service-header span {
    /* font-family: "TheYearOfHandicrafts", serif; */
    font-size: 1.05rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.sub-service-header:hover span {
    color: var(--accent-color);
}

.expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 32px;
    height: 32px;
    position: relative;
    transition: transform 0.3s ease;
}

.expand-btn:hover {
    transform: scale(1.1);
}

.plus-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    transition: transform 0.4s ease;
}

.plus-icon::before,
.plus-icon::after {
    content: "";
    position: absolute;
    background: var(--accent-color);
    transition: all 0.3s ease;
}

.plus-icon::before {
    width: 16px;
    height: 2px;
    top: 7px;
    left: 0;
}

.plus-icon::after {
    width: 2px;
    height: 16px;
    left: 7px;
    top: 0;
}

.sub-service-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease;
}

.sub-service-content p {
    /* font-family: "TheYearOfHandicrafts", serif; */
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 0 0.5rem;
    margin: 0;
}

/* Hover expansion for desktop */
@media (min-width: 769px) {
    .sub-service-item:hover .sub-service-content {
        max-height: 500px;
        opacity: 1;
    }

    .sub-service-item:hover .plus-icon {
        transform: translate(-50%, -50%) rotate(45deg);
    }
}

/* Click expansion for mobile and desktop */
.sub-service-item.expanded .sub-service-content {
    max-height: 500px;
    opacity: 1;
}

.sub-service-item.expanded .plus-icon {
    transform: translate(-50%, -50%) rotate(45deg);
}

/* --- Featured Projects Section --- */
#featured-projects {
    width: 100%;
    max-width: 1600px;
    padding: 6rem 2rem 10rem;
    margin: 0 auto;
    box-sizing: border-box;
}

.featured-header {
    text-align: center;
    margin-bottom: 5rem;
}

.featured-header h2 {
    font-family: "didot-bold", serif;
    font-size: clamp(2rem, 3vw, 3rem);
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.featured-header p {
    /* font-family: "TheYearOfHandicrafts", serif; */
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.7);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
    align-items: start;
}

.project-item {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Grid Spans - Staggered layout with consistent row heights */
.project-item:nth-child(1) {
    grid-column: span 3;
}

.project-item:nth-child(2) {
    grid-column: span 1;
}

.project-item:nth-child(3) {
    grid-column: span 1;
}

.project-item:nth-child(4) {
    grid-column: span 3;
}

.project-image-wrapper {
    width: 100%;
    height: 400px;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.project-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-item:hover .project-image-wrapper img {
    transform: scale(1.08);
}

.project-info {
    padding: 0;
}

.project-info h3 {
    font-family: "didot-bold", serif;
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 0;
    line-height: 1.2;
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .service-content {
        grid-template-columns: 22% 33% 45%;
        gap: 2rem;
    }

    .service-name h2 {
        font-size: clamp(2rem, 3vw, 3rem);
    }
}

@media (max-width: 1024px) {
    .services-container {
        padding: 0 2rem;
    }

    .service-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .service-name {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }

    .service-number {
        margin-bottom: 0;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-item:nth-child(1),
    .project-item:nth-child(2),
    .project-item:nth-child(3),
    .project-item:nth-child(4) {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    #services-hero {
        height: 55vh;
    }

    .services-hero-content {
        padding: 0 1.5rem;
    }

    .hero-deco-svg {
        width: 100px;
        height: 100px;
    }

    .service-row {
        padding: 3rem 0;
        height: auto;
    }

    .services-container {
        padding: 0 1.5rem;
    }

    #featured-projects {
        padding: 4rem 1.5rem 6rem;
    }

    .featured-header {
        margin-bottom: 3rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-info h3 {
        font-size: 1.3rem;
    }
}

/* ==========================
   RTL (Arabic) Support
   ========================== */

/* RTL Typography Adjustments */
html[dir="rtl"] * {
    font-family: "din-next-regular", sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
    font-family: "TheYearOfHandicrafts", sans-serif !important;
    /* letter-spacing: 0; */
}

/* Hero Section RTL */
html[dir="rtl"] .services-hero-content {
    text-align: center;
}

html[dir="rtl"] .tag.revealed p {
    padding-bottom: 0;
}

html[dir="rtl"] .services-hero-content .tag img {
    /* margin-left: 0.5rem; */
    margin-right: 0;
}

/* Services Section RTL */
html[dir="rtl"] .service-content {
    direction: rtl;
}

html[dir="rtl"] .service-name {
    text-align: right;
}

html[dir="rtl"] .service-number {
    font-size: 1.1rem;
}

html[dir="rtl"] .service-desc p {
    text-align: right;
}

html[dir="rtl"] .sub-service-header:hover {
    padding-left: 0;
    padding-right: 0.5rem;
}

html[dir="rtl"] .sub-service-header span {
    text-align: right;
}

html[dir="rtl"] .sub-service-content p {
    text-align: right;
    line-height: 1.8;
}

/* Featured Projects RTL */
html[dir="rtl"] .featured-header {
    text-align: center;
}

html[dir="rtl"] .project-info {
    text-align: right;
}

html[dir="rtl"] .project-info h3 {
    text-align: right;
}

/* Mobile RTL adjustments */
@media (max-width: 1024px) {
}

/* Footer RTL */
html[dir="rtl"] #footer #fbtm {
    direction: rtl;
}

html[dir="rtl"] #footer #btmleft,
html[dir="rtl"] #footer #btmright {
    text-align: right;
}

html[dir="rtl"] #footer #btmright ul {
    text-align: right;
}

html[dir="rtl"] #footer #socials {
    direction: rtl;
}

html[dir="rtl"] #footer #socialtwo p {
    text-align: right;
}
