/* css/layout.css */

/* =========================================
   Base & Utilities
   ========================================= */
/* ساختار پایه کانتینر برای تمام سکشن‌ها */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* اگر JS غیرفعال بود، همه چیز را بدون انیمیشن فورا نمایش بده */
.no-js .reveal-up,
.no-js .card {
    opacity: 1 !important;
    transform: none !important;
}

/* =========================================
   Header & Navigation
   ========================================= */
.header { position: fixed; top: 0; left: 0; width: 100%; height: 90px; z-index: 1000; background-color: transparent; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.header.is-scrolled { height: 70px; background-color: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); }
.header__container { max-width: 1400px; margin: 0 auto; padding: 0 var(--space-md); display: flex; justify-content: space-between; align-items: center; height: 100%; }

/* ===== Header Logo Layout ===== */
.header__logo {
  display: flex;
  align-items: center;
  gap: 10px; 
  text-decoration: none;
  font-size: clamp(20px, 3vw, 24px); 
  font-weight: 800; 
  letter-spacing: -0.5px; 
  z-index: 1001;
}

.logo-img {
  height: 40px; 
  width: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .logo-img {
    height: 30px; 
  }
}

/* پنهان کردن منوی اصلی در موبایل (چون فقط منوی چسبنده پایین نمایش داده می‌شود) */
.nav { display: none; }
.nav__list { display: flex; flex-direction: column; text-align: center; gap: var(--space-xl); }
.nav__link { font-size: 20px; font-weight: 600; transition: color var(--transition-fast); }
.nav__link:hover { color: var(--color-accent); }
.header__action { display: none; }
.mobile-only-link { display: block; }

@media (min-width: 768px) {
    .nav { all: unset; display: block; }
    .nav__list { flex-direction: row; gap: var(--space-lg); }
    .nav__link { font-size: 15px; font-weight: 500; opacity: 0.8; }
    .mobile-only-link { display: none; }
    .header__action { display: block; }
}

/* =========================================
   Editorial Hero Section
   ========================================= */
.hero-editorial {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: flex-end;
    padding: var(--space-2xl) var(--space-lg);
    padding-bottom: 15vh;
    overflow: hidden;
}

.hero-editorial__bg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    transform: scale(1.05);
}

.hero-editorial__overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 2;
}

.hero-editorial__content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    color: #ffffff;
}

.hero-editorial__title {
    font-size: clamp(36px, 8vw, 72px);
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: var(--space-md);
    letter-spacing: -1px;
}

.hero-editorial__title span {
    font-weight: 600;
}

.hero-editorial__subtitle {
    font-size: clamp(16px, 3vw, 20px);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.btn-editorial {
    display: inline-block;
    padding: 14px 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #fff;
    border-bottom: 1px solid var(--color-accent);
    transition: var(--transition-normal);
}

.btn-editorial:hover {
    color: var(--color-accent);
}

/* =========================================
   Editorial Portfolio Section
   ========================================= */
.editorial-portfolio {
    background-color: var(--color-bg-main);
    padding: 0px 0 0 0 0;
}

.editorial-portfolio__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.editorial-portfolio__header {
    margin-bottom: 80px;
    text-align: right;
}

.editorial-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 300;
    color: var(--color-text-main);
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.editorial-desc {
    font-size: 16px;
    color: var(--color-text-muted);
    font-weight: 300;
}

.editorial-list {
    display: flex;
    flex-direction: column;
    gap: 120px;
}

.editorial-item {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.editorial-item__img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background-color: #f5f5f5;
}

.editorial-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-item:hover .editorial-item__img {
    transform: scale(1.03);
}

.editorial-item__content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.editorial-item__title {
    font-size: 24px;
    font-weight: 400;
    color: var(--color-text-main);
    letter-spacing: -0.5px;
}

.editorial-item__meta {
    font-size: 13px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editorial-item__meta .dot {
    color: var(--color-accent);
}

@media (min-width: 768px) {
    .editorial-item__img-wrapper {
        aspect-ratio: 16 / 9;
    }
    .editorial-item:nth-child(even) .editorial-item__img-wrapper {
        width: 80%;
        margin: 0 auto;
    }
}

/* =========================================
   Bottom Navigation (Mobile App-Like Menu)
   ========================================= */
@media (max-width: 768px) {    
    body {
        padding-bottom: calc(75px + env(safe-area-inset-bottom));
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    z-index: 9999;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.03);
}

@media (min-width: 769px) {
    .bottom-nav { display: none; }
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #888;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease, stroke 0.3s ease;
}

.bottom-nav__item:hover,
.bottom-nav__item.is-active {
    color: var(--color-accent, #007bff);
}

.bottom-nav__item.is-active svg {
    stroke: var(--color-accent, #007bff);
    transform: translateY(-2px);
}

.bottom-nav__item.admin-add-btn {
    position: relative;
    color: transparent !important;
}

.bottom-nav__item.admin-add-btn .admin-fab {
    background-color: var(--color-accent, #000);
    color: #fff;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 5px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    border: 4px solid #fff;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bottom-nav__item.admin-add-btn .admin-fab svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    margin-bottom: 0;
}

.bottom-nav__item.admin-add-btn:active .admin-fab {
    transform: scale(0.9);
}

/* =========================================
   Services Grid
   ========================================= */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

/* =========================================
   Editorial Services Section
   ========================================= */
.editorial-services {
    background-color: var(--color-bg-main);
    padding: 100px 0;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.editorial-services__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.editorial-services__list {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
}

.editorial-service-item {
    display: flex;
    gap: 24px;
    padding: 40px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: background-color 0.4s ease;
}

.editorial-service-item:first-child {
    border-top: 1px solid rgba(0,0,0,0.08);
}

.editorial-service-item:hover {
    background-color: rgba(0,0,0,0.01);
}

.service-number {
    font-size: 22px;
    font-weight: 300;
    color: var(--color-accent);
    min-width: 45px;
    font-family: serif;
}

.service-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-title {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: -0.5px;
    color: var(--color-text-main);
}

.service-text {
    font-size: 15px;
    font-weight: 300;
    color: var(--color-text-muted);
    line-height: 1.8;
}

/* =========================================
   Editorial Contact Section
   ========================================= */
.editorial-contact {
    background-color: #ffffff;
    padding: 120px 0 160px 0;
    text-align: center;
}

.editorial-contact__container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.editorial-contact__title {
    font-size: clamp(36px, 7vw, 64px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -1px;
    color: var(--color-text-main);
    margin-bottom: 24px;
}

.editorial-contact__subtitle {
    font-size: 16px;
    font-weight: 300;
    color: var(--color-text-muted);
    margin-bottom: 48px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.editorial-contact__actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.btn-editorial-solid {
    display: inline-block;
    font-size: 15px;
    padding: 16px 32px;
    background-color: var(--color-text-main);
    color: var(--color-bg-main);
    text-decoration: none;
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition-normal);
}

.btn-editorial-solid:hover {
    background-color: var(--color-accent);
}

.btn-editorial-outline {
    display: inline-block;
    font-size: 15px;
    padding: 15px 32px;
    background-color: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-text-main);
    text-decoration: none;
    width: 100%;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition-normal);
}

.btn-editorial-outline:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

@media (min-width: 768px) {
    .editorial-service-item {
        flex-direction: row;
        align-items: center;
        gap: 80px;
    }
    .service-number {
        font-size: 32px;
    }
    .service-title {
        min-width: 250px;
    }
    .editorial-contact__actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* =========================================
   SPA Views & Project Details
   ========================================= */
.view-hidden {
    display: none !important;
}
.view-active {
    display: block;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Project Details Hero - Pure Minimal */
.editorial-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    margin-bottom: 3rem;
    overflow: hidden;
}

.editorial-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* =========================================
   Lightbox Styles
   ========================================= */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 300;
}

.project-gallery img {
    cursor: zoom-in;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    transition: opacity 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* =========================================
   Sections Global Padding
   ========================================= */
.section {
  padding: 0vh 0;
}
#hero{ scroll-margin-top: 100vh;}
#portfolio{ scroll-margin-top: 100vh;}
#services{ scroll-margin-top: 10vh;}
#articles{ scroll-margin-top: 8vh;}
#contact {
    scroll-margin-top: 2vh; 
}

/* ========================================================
   MOBILE PERFORMANCE OPTIMIZATION – layout.css (Version 2)
   فقط موبایل، بدون تغییر دسکتاپ
   ======================================================== */

@media (max-width: 768px) {

  /* ۱. سبک کردن هدر در موبایل */
  .header {
    transition:
      background-color 0.3s cubic-bezier(0.16, 1, 0.3, 1),
      box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .header.is-scrolled {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
  }

  /* ۲. کمی ساده‌تر کردن hero در موبایل */
  .hero-editorial {
    height: 90vh;
    padding-bottom: 12vh;
  }
}
.mobile-toggle {
    display: none !important;
}
html, body {
    background-color: #FFFFFF !important;
    color: #1A1A1A !important;
}

