/* css/components.css */

/* =========================================
   Admin Visibility Control (مخفی‌سازی المان‌های ادمین)
   ========================================= */
.admin-only {
    display: none !important;
}

body.admin-mode .admin-only {
    display: flex !important;
}

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

/* =========================================
   Buttons (دکمه‌ها)
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 4px; /* گوشه‌های کمی گرد برای مینیمالیسم */
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal, 0.3s ease);
    text-align: center;
    border: 1px solid transparent;
}

.btn--primary {
    background-color: var(--color-accent);
    color: #fff;
}

.btn--primary:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3); /* سایه همرنگ دکمه */
}

.btn--outline {
    background-color: transparent;
    color: var(--color-text-main);
    border-color: var(--color-text-main);
}

.btn--outline:hover {
    background-color: var(--color-text-main);
    color: var(--color-bg-main);
}

.btn--outline-light {
    background-color: transparent;
    color: #fff;
    border-color: #fff;
}

.btn--outline-light:hover {
    background-color: #fff;
    color: #000;
}

/* =========================================
   Portfolio Cards (کارت‌های نمونه‌کار)
   ========================================= */
.card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* کلاسی که جاوااسکریپت برای ظاهر شدن کارت اضافه می‌کند */
.card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.card__image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* نسبت تصویر 4:3 */
    overflow: hidden;
}

.card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card__content {
    padding: var(--space-lg);
}

.card__category {
    font-size: 12px;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-sm);
    display: block;
}

.card__title {
    font-size: 20px;
    color: var(--color-text-main);
    margin-bottom: var(--space-sm);
}

/* افکت هاور فقط در دسکتاپ اجرا شود تا در موبایل گیر نکند */
@media (hover: hover) {
    .card:hover .card__img {
        transform: scale(1.05);
    }
}

/* =========================================
   Project Admin Actions (دکمه‌های ادمین روی کارت پروژه‌ها)
   ========================================= */
.project-admin-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.btn-glass {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    font-size: 16px;
    padding: 0;
}

.btn-glass.btn-edit-project:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.btn-glass.btn-delete-project:hover {
    background: rgba(255, 59, 48, 0.85);
    border-color: rgba(255, 59, 48, 1);
    transform: scale(1.1);
}

.project-admin-actions button {
    pointer-events: auto;
}

/* =========================================
   Contact Box Component (بخش یکپارچه تماس با ما)
   ========================================= */
.contact-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 3rem 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
}

.contact-info { margin-bottom: 32px; }

.contact-name {
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    font-weight: 800;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #b3b3b3;
}

#contact-desc {
    font-size: 1.1rem;
    color: #777777;
    margin-bottom: 2rem;
}

.contact-number-display {
    font-size: 40px;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: 2px;
}

.contact-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.contact-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 250px;
    padding: 15px 35px;
    border: none;
    border-radius: 12px;
    background: var(--color-accent, #c9a36a);
    color: #000000;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 2px;
    direction: ltr;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.contact-btn:hover {
    background: #d4b27c;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(201, 163, 106, 0.3);
}

.contact-btn.success {
    background-color: #4caf50 !important;
    color: #ffffff !important;
    border-color: #4caf50 !important;
    transform: translateY(0);
    box-shadow: none;
    font-size: 1.1rem;
    letter-spacing: normal;
}

@media (max-width: 480px) {
    .contact-number-display { font-size: 32px; }
    .contact-actions { flex-direction: column; }
    .contact-btn { width: 100%; }
}

/* ========================================================
   Project Overlay & Gallery
   ======================================================== */
.project-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color, #fff);
    z-index: 99999 !important;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.project-overlay.is-open {
    transform: translateY(0);
}

.project-overlay__close {
    position: absolute; top: 20px; right: 20px;
    background: rgba(0,0,0,0.1); border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer; z-index: 10;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 5% 60px;
}

.project-gallery img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    transition: transform 0.3s ease;
}

.project-gallery img:hover {
    transform: scale(1.02);
}

/* ========================================================
   LUXURY SERVICES CARDS
   ======================================================== */
.luxury-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.luxury-card {
    position: relative;
    height: 420px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.luxury-card__bg {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.luxury-card__overlay {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    transition: background 0.5s ease;
}

.luxury-card__content {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 2.5rem 2rem;
    color: #fff;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.luxury-card__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transform: translateY(20px);
    transition: transform 0.5s ease;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.luxury-card__line {
    width: 50px;
    height: 2px;
    background-color: var(--color-accent, #cda274);
    margin-bottom: 1rem;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.luxury-card__desc {
    font-size: 0.95rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

@media (hover: hover) {
    .luxury-card:hover .luxury-card__bg { transform: scale(1.08); }
    .luxury-card:hover .luxury-card__overlay { background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,0.3) 100%); }
    .luxury-card:hover .luxury-card__title { transform: translateY(0); }
    .luxury-card:hover .luxury-card__line { transform: scaleX(1); }
    .luxury-card:hover .luxury-card__desc { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   MODALS Z-INDEX FIX (جلوگیری از افتادن مودال زیر سایر عناصر)
   ======================================================== */
.modal, 
.modal-container,
[id*="Modal"] {
    z-index: 99999 !important;
}

.modal-overlay,
.modal-backdrop,
.overlay {
    z-index: 99998 !important;
}

/* ========================================================
   Admin Modal (پنجره پاپ‌آپ ادمین)
   ======================================================== */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease; /* سریع‌تر شدن ظاهر شدن پس‌زمینه */
    overscroll-behavior: contain;
    will-change: opacity; /* شتاب‌دهنده سخت‌افزاری */
}

.admin-modal.is-open,
.admin-modal.is-active {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal-content {
    width: min(720px, 92vw);
    max-height: 85vh;
    background: #ffffff;
    border-radius: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; 
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    transform: translateY(20px) scale(0.98);
    /* تغییر از all به ویژگی‌های خاص برای جلوگیری از لگ */
    transition: transform 0.2s ease-out, opacity 0.2s ease-out; 
    will-change: transform, opacity; /* شتاب‌دهنده سخت‌افزاری */
    position: relative;
    z-index: 100000; 
    direction: rtl;
}

.admin-modal-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 8px; 
    height: 110px;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    border-radius: 10px 10px 0 0; 
    z-index: 5;
    pointer-events: none;
}

.admin-modal.is-open .admin-modal-content,
.admin-modal.is-active .admin-modal-content {
    transform: translateY(0) scale(1);
}

.admin-modal-content h2 { display: none; }

.close-modal {
    position: absolute;
    top: 14px; left: 20px; 
    font-size: 40px; 
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    color: #88888d; 
    transition: 0.2s;
    z-index: 10;
    background: transparent;
    border: none;
    font-family: inherit;
}

.close-modal:hover { color: #ef4444; }

.submit-btn {
    position: absolute;
    top: 18px; left: 60px; 
    z-index: 10; margin: 0;
    padding: 8px 20px; 
    background: transparent; 
    color: #c59d5f; 
    font-size: 15px; 
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #c59d5f; 
    border-radius: 6px; 
    width: fit-content;
    white-space: nowrap; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.submit-btn:hover {
    background: #c59d5f; 
    color: #ffffff; 
}

/* Forms inside Modal */
#addProjectForm,
#heroEditForm,
#service-form,
#admin-article-form,
#contactEditForm {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    direction: ltr; 
    padding: 95px 24px 80px 24px; 
    height: 100%;
}

#service-form > *,
#admin-article-form > *,
#contactEditForm > * {
    direction: rtl;
}

#addProjectForm::-webkit-scrollbar, #heroEditForm::-webkit-scrollbar, #admin-article-form::-webkit-scrollbar, #contactEditForm::-webkit-scrollbar { width: 6px; }
#addProjectForm::-webkit-scrollbar-track, #heroEditForm::-webkit-scrollbar-track, #admin-article-form::-webkit-scrollbar-track, #contactEditForm::-webkit-scrollbar-track { background: transparent; margin: 24px 0; }
#addProjectForm::-webkit-scrollbar-thumb, #heroEditForm::-webkit-scrollbar-thumb, #admin-article-form::-webkit-scrollbar-thumb, #contactEditForm::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 10px; }
#addProjectForm::-webkit-scrollbar-thumb:hover, #heroEditForm::-webkit-scrollbar-thumb:hover, #admin-article-form::-webkit-scrollbar-thumb:hover, #contactEditForm::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }

.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 13px; color: #52525b; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 14px 16px; border-radius: 12px;
    border: 1px solid #e4e4e7; background: #ffffff;
    color: #27272a; font-family: inherit; font-size: 14px; transition: 0.2s ease;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: #a1a1aa; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: #c59d5f; background: #ffffff; outline: none;
    box-shadow: 0 0 0 4px rgba(197, 157, 95, 0.15);
}

/* Custom File Upload */
.file-upload-wrapper {
    display: flex; align-items: center; gap: 12px;
    background: #ffffff; border: 1px dashed #d4d4d8; 
    padding: 10px; border-radius: 12px; transition: 0.3s ease;
}
.file-upload-wrapper:hover { border-color: #c59d5f; background: #ffffff; }
.hidden-file-input { display: none; }
.custom-file-button {
    background-color: #f4f4f5; border: 1px solid #e4e4e7;
    color: #3f3f46; padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: 0.2s ease; white-space: nowrap; 
}
.custom-file-button:hover { background-color: #e4e4e7; color: #18181b; }
.custom-file-name { font-size: 13px; color: #71717a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

@media (max-width: 768px) {
    .admin-modal { align-items: flex-end; }
    .admin-modal-content { 
        width: 100%; 
        max-height: 85vh; 
        border-radius: 14px 14px 0 0; 
        /* تغییر زمان انیمیشن به 0.2s برای باز شدن فوری */
        animation: modalSlideUp 0.2s ease-out forwards; 
    }
    .admin-modal-content::before { border-radius: 14px 14px 0 0; }
    .spec-grid { grid-template-columns: 1fr; }
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


/* =========================================
   Login Modal
   ========================================= */
#loginModal {
    display: flex !important; align-items: center !important; justify-content: center !important;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); z-index: 9999;
}
#loginModal:not(.is-active) { display: none !important; }
#loginModal .login-content {
    width: 90% !important; max-width: 400px !important; margin: 0 auto !important;
    padding: 40px 30px !important; border-radius: 12px; text-align: center;
    background: #fff; box-shadow: 0 10px 40px rgba(0,0,0,0.2); position: relative; box-sizing: border-box;
}
#loginModal .close-modal { display: none !important; }
#loginModal h2 { margin-bottom: 25px; font-size: 1.5rem; color: #2c3e50; font-weight: bold; }
#loginForm { display: flex; flex-direction: column; gap: 15px; width: 100%; box-sizing: border-box; }
#loginForm input {
    width: 100%; box-sizing: border-box !important; padding: 12px 15px; border: 1px solid #ccc;
    border-radius: 8px; font-family: inherit; font-size: 1rem; background-color: #ffffff;
    color: #333; direction: ltr; transition: all 0.3s ease;
}
#loginForm input::-webkit-input-placeholder, #loginForm input::-moz-placeholder, #loginForm input::placeholder {
    direction: rtl; text-align: right; color: #777 !important; -webkit-text-fill-color: #777 !important;
    opacity: 1 !important; font-family: inherit !important; font-weight: 500 !important; letter-spacing: normal !important;
}
#loginForm input:focus {
    outline: none; border-color: var(--color-accent); background-color: #fff;
    box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}
#loginForm .submit-btn {
    display: block; position: relative !important; left: auto !important; right: auto !important; top: auto !important;
    align-self: center; width: 100%; max-width: 200px; margin: 0 auto !important;
    padding: 12px 20px; border-radius: 8px; font-size: 1.1rem; font-weight: bold;
    background-color: var(--color-accent); color: #ffffff; border: none; cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease; order: 3; 
}
#loginForm .form-group:nth-child(1) { order: 1; }
#loginForm .form-group:nth-child(2) { order: 2; }
#loginForm .submit-btn:hover { background-color: var(--color-accent-hover); transform: translateY(-2px); }
.login-error {
    color: #e74c3c; background: #fdf0ed; padding: 10px; border-radius: 8px;
    margin-top: 15px; font-size: 0.9rem; font-weight: bold; display: none;
}

/* ========================================================
   SERVICES TIMELINE (بخش خدمات به سبک تایم‌لاین)
   ======================================================== */
.editorial-services { padding: var(--section-padding-desktop) 0; background-color: var(--color-bg-main); }
.editorial-services__container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.editorial-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 4rem; text-align: center; position: relative; color: var(--color-text-main); }
.editorial-services__list { position: relative; padding: 20px 0; }
.editorial-services__list::before {
    content: ''; position: absolute; top: 0; right: 50px; width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, var(--color-accent), transparent);
}
.editorial-service-item { display: flex; align-items: flex-start; margin-bottom: 60px; position: relative; transition: all 0.4s ease; }
.editorial-service-item:last-child { margin-bottom: 0 !important; }

.service-number {
    width: 100px; height: 100px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: var(--color-accent); border: 1px solid var(--color-accent);
    background: var(--color-bg-main); border-radius: 50%; z-index: 2; transition: all 0.5s ease;
}
.editorial-service-item:hover .service-number { background: var(--color-accent); color: #fff; box-shadow: 0 0 20px rgba(184, 134, 11, 0.4); }
.service-content { margin-right: 40px; padding-top: 15px; }
.service-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 15px; color: var(--color-text-main); }
.service-text { font-size: 1.1rem; line-height: 1.8; color: var(--color-text-muted, #666); max-width: 600px; }

@media (max-width: 768px) {
    .editorial-services__list::before { right: 30px; }
    .service-number { width: 60px; height: 60px; font-size: 1.1rem; }
    .service-content { margin-right: 20px; padding-top: 5px; }
    .service-title { font-size: 1.3rem; }
    .service-text { font-size: 0.95rem; }
}

/* =========================================
   مراحل طراحی و اجرا (Brand Values)
========================================= */
.brand-values-container { 
    display: flex; 
    flex-direction: column; 
    gap: 3rem; 
    padding: 0rem 0; 
    width: 100%; 
    margin-bottom: 10rem; /* این خط برای ایجاد فاصله از پایین اضافه شد */
}

@media (min-width: 768px) { 
    .brand-values-container { 
        display: grid; 
        grid-template-columns: repeat(3, 1fr); 
        gap: 2rem; 
        /* در صورت نیاز به فاصله متفاوت در دسکتاپ، می‌توانید اینجا مقدار margin-bottom را تغییر دهید */
    } 
}
.brand-value-item { display: flex; align-items: stretch; position: relative; text-align: right; }
.brand-value-item:last-child { margin-bottom: 0 !important; }

.value-number {
    font-size: 3.5rem; font-weight: 200; color: var(--color-accent); line-height: 0.8; font-family: serif;
    flex-shrink: 0; margin-right: 1.5rem; margin-left: 1.5rem; padding-top: 4px;
}
.content-wrapper { border-right: 2px solid #e0e0e0; padding-right: 1.5rem; display: flex; flex-direction: column; justify-content: flex-start; gap: 0.5rem; width: 100%; }
.value-title { font-size: 1.3rem; font-weight: 800; color: var(--color-text-main, #333); margin: 0; line-height: 1.4; }
.value-desc { font-size: 1rem; line-height: 1.8; color: #666666; margin: 0; }
.admin-actions { display: flex; gap: 1rem; margin-bottom: 0.5rem; }

/* ========================================================
   ARTICLES PAGE & CARDS
   ======================================================== */
.article-card.is-visible { opacity: 1; transform: translateY(0); }
.article-card-image { width: 100%; height: 200px; object-fit: cover; transition: transform 0.5s ease; }
.article-card:hover .article-card-image { transform: scale(1.05); }
.article-card-content { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.article-card-title { font-size: 1.25rem; font-weight: 700; color: #2c3e50; margin: 0; }
.article-card-excerpt { font-size: 0.95rem; color: #666; line-height: 1.6; margin-bottom: 15px; }

#view-articles { width: 100%; min-height: 100vh; background-color: var(--color-bg-main, #ffffff); padding-top: var(--section-padding-desktop); padding-bottom: var(--section-padding-desktop); }
.articles-layout { display: grid; grid-template-columns: 1fr; gap: 30px; max-width: 1400px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 992px) {
    .articles-layout { grid-template-columns: 350px 1fr; align-items: start; }
    .articles-list { position: sticky; top: 120px; height: calc(100vh - 150px); overflow-y: auto; padding-left: 15px; }
    .articles-list::-webkit-scrollbar { width: 4px; }
    .articles-list::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 10px; }
}

/* ========================================================
   ARTICLE DETAIL (نمایش مقاله)
   ======================================================== */
.article-detail {
    background: #ffffff; border-radius: 16px; padding: 40px; box-shadow: 0 15px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03); opacity: 0; transform: translateY(20px);
    animation: fadeUpArticle 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeUpArticle { to { opacity: 1; transform: translateY(0); } }

.btn-back-articles {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: transparent;
    color: var(--color-accent); border: 1px solid var(--color-accent); border-radius: 8px;
    font-size: 0.95rem; font-weight: 600; cursor: pointer; margin-bottom: 25px; transition: all 0.3s ease;
}
.btn-back-articles:hover { background: var(--color-accent); color: #fff; transform: translateX(5px); }
@media (min-width: 992px) { .btn-back-articles { display: none; } }

.article-detail__title { font-size: 2.2rem; font-weight: 800; color: #111111; line-height: 1.4; margin-bottom: 30px; }
.article-detail__hero { width: 100%; margin-bottom: 40px; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.article-detail__hero-image { width: 100%; max-height: 500px; object-fit: cover; display: block; transition: transform 0.6s ease; }
.article-detail__hero:hover .article-detail__hero-image { transform: scale(1.02); }
.article-detail__content { max-width: 800px; margin: 0 auto; }
.article-detail__content p { font-size: 1.1rem; line-height: 2.2; color: #333333; margin-bottom: 2rem; text-align: justify; word-wrap: break-word; }
.article-detail__content p:first-of-type::first-letter { font-size: 4.5rem; font-weight: 900; color: var(--color-accent, #cda434); float: right; margin-left: 15px; line-height: 0.8; padding-top: 8px; font-family: serif; }

@media (max-width: 768px) {
    #view-articles { padding-top: var(--section-padding-mobile); padding-bottom: var(--section-padding-mobile); }
    .article-detail { padding: 25px 20px; border-radius: 12px; }
    .article-detail__title { font-size: 1.6rem; }
    .article-detail__hero-image { max-height: 250px; }
    .article-detail__content p { font-size: 1rem; line-height: 2; }
}

/* ========================================================
   EDITORIAL INDEX LAYOUT (فهرست مطالب)
   ======================================================== */
.articles-container { 
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    border-top: 1px solid rgba(150, 150, 150, 0.2); 
    
    margin-top: 0rem;    /* فاصله از بالای کل لیست */
    margin-bottom: 10rem; /* فاصله از پایین کل لیست */
}
.editorial-item { display: grid; grid-template-columns: 80px 1fr 50px; align-items: center; padding: 2.5rem 0; border-bottom: 1px solid rgba(150, 150, 150, 0.2); text-decoration: none; color: inherit; transition: all 0.4s ease; position: relative; }
.editorial-meta { font-size: 1.1rem; opacity: 0.5; font-family: monospace; }
.editorial-title { font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 300; margin: 0; transition: color 0.4s ease; line-height: 1.3; }
.editorial-cta { display: flex; justify-content: flex-end; opacity: 0.4; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.editorial-cta svg { width: 28px; height: 28px; }
.editorial-item:hover { background-color: rgba(255, 255, 255, 0.02); }
.editorial-item:hover .editorial-title { color: var(--color-accent); }
.editorial-item:hover .editorial-cta { opacity: 1; color: var(--color-accent); transform: translate(-8px, -8px); }

/* دکمه‌های ادمین در چیدمان ادیتوریال */
.admin-actions-inline {
    position: absolute; right: 20px; top: 50%; display: flex; gap: 12px; opacity: 0; visibility: hidden;
    transform: translateY(-50%) translateX(10px); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); z-index: 10;
}
.editorial-item:hover .admin-actions-inline { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
.admin-actions-inline button {
    width: 42px !important; height: 42px !important; border-radius: 50% !important; background: rgba(135, 130, 125, 0.9) !important;
    backdrop-filter: blur(5px) !important; -webkit-backdrop-filter: blur(5px) !important; border: none !important;
    display: flex !important; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important; padding: 0 !important;
}
.admin-actions-inline button svg { width: 20px !important; height: 20px !important; stroke: #ffffff !important; fill: none !important; stroke-width: 2 !important; stroke-linecap: round; stroke-linejoin: round; transition: all 0.3s ease; }
.admin-actions-inline button:hover { background: rgba(160, 155, 150, 1) !important; transform: scale(1.1) !important; }
.admin-actions-inline button[onclick*="delete"]:hover, .admin-actions-inline button[class*="delete"]:hover, .admin-actions-inline button:first-child:hover { background: rgba(231, 76, 60, 0.9) !important; transform: scale(1.1) !important; }

/* HOVER IMAGE REVEAL */
.hover-reveal-img {
    position: fixed; top: 0; left: 0; width: 280px; height: 380px; object-fit: cover; pointer-events: none; opacity: 0;
    transform: translate(-50%, -50%) scale(0.8); transition: opacity 0.4s ease, transform 0.4s ease; z-index: 100;
    border-radius: 4px; box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2); will-change: top, left, transform;
}
.editorial-item:hover .hover-reveal-img { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 768px) {
    .editorial-item { grid-template-columns: 1fr 40px; padding: 1.5rem 0; gap: 1rem; }
    .editorial-meta { grid-column: 1 / -1; margin-bottom: -1rem; font-size: 0.9rem; }
    .editorial-title { font-size: 1.4rem; font-weight: 400; }
    .admin-actions-inline { position: static; opacity: 1; visibility: visible; transform: none; margin-top: 15px; grid-column: 1 / -1; justify-content: flex-end; }
    .hover-reveal-img { display: none !important; }
}

/* =========================================
   Minimal & Visible Load More Button
   ========================================= */
.minimal-load-wrapper { display: flex; justify-content: center; margin-top: 0rem; margin-bottom: 0rem; width: 100%; }
.minimal-load-btn {
    background: transparent; border: none; color: #868686; font-family: inherit; font-size: 1rem;
    font-weight: 500; cursor: pointer; display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 10px 20px; opacity: 1; transition: transform 0.3s ease, color 0.3s ease;
}
.minimal-load-btn:hover { transform: translateY(-4px); color: var(--color-accent, #cd9d5f); }
.minimal-load-btn .ml-line { width: 40px; height: 2px; background-color: var(--color-accent, #cd9d5f); transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 2px; }
.minimal-load-btn:hover .ml-line { width: 100%; }

/* =========================================
   Minimal Section Titles
   ========================================= */
.section-title-minimal {
    position: relative; width: 100%; height: 500px; display: flex; justify-content: center;
    align-items: center; margin-top: 00px; margin-bottom:00px;
}
.section-title-minimal::before {
    content: ""; position: absolute; width: 1px; height: 100%; background: #d0d0d0;
    left: 50%; top: 0; transform: translateX(-50%); opacity: 0.8; z-index: 1;
}
.section-title-minimal span {
    position: relative; background: var(--color-bg-main, #ffffff); padding: 0 30px; font-family: inherit;
    font-size: clamp(32px, 5vw, 56px); font-weight: 800; color: var(--color-accent, #c6a45c); z-index: 2;
}
#portfolio .section-title-minimal::after {
    content: "▼"; position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
    font-size: 16px; color: #d0d0d0; opacity: 0.8; background: var(--color-bg-main, #ffffff); padding: 5px 10px; z-index: 2; border-radius: 50%;
}

/* =========================================
   تنظیمات ریسپانسیو و یکسان‌سازی فاصله سکشن‌ها
   ========================================= */

/* کلاس عمومی سکشن برای دسکتاپ */
.section {
    padding-top: var(--section-padding-desktop);
    padding-bottom: var(--section-padding-desktop);
}

@media (max-width: 768px) {
    /* استفاده از متغیر موبایل برای تمام سکشن‌ها */
    .section { 
        padding-top: var(--section-padding-mobile) !important; 
        padding-bottom: var(--section-padding-mobile) !important; 
    }
    .editorial-services { 
        padding: var(--section-padding-mobile) 0 !important; 
    }
    
    .section-title-minimal {
        height: 85vh !important; min-height: 85vh; display: flex; flex-direction: column;
        justify-content: center; align-items: center; margin-bottom: 5vh !important; margin-top: 5vh !important; text-align: center;
    }
    #portfolio { scroll-margin-top: 70px; position: relative; background-color: var(--color-bg-main, #ffffff); z-index: 2; }
    #portfolio .section-title-minimal::after { bottom: 25vh; font-size: 14px; opacity: 0.9; }
}
/* =========================================
   Articles Section Title Override حفظ و نگهداری
   ========================================= */
#articles .section-title-minimal {
    height: 150px; margin-top: 0px; margin-bottom: 0px;
    /* ممکن است برای خط افقی بخواهید ارتفاع (height) را کمتر کنید، مثلا 80px */
}

#articles .section-title-minimal::before {
    content: ""; 
    position: absolute; 
    width: 100%;       /* عرض 100 درصد برای خط افقی */
    height: 1px;       /* ضخامت 1 پیکسل برای خط */
    background: #d0d0d0;
    top: 50%;          /* قرارگیری در وسط ارتفاع */
    left: 0; 
    transform: translateY(-50%); /* تنظیم دقیق خط در مرکز عمودی */
    opacity: 0.8; 
    z-index: 1;
}

#articles .section-title-minimal span {
    position: relative; background: var(--color-bg-main, #ffffff); padding: 0 30px; font-family: inherit;
    font-size: clamp(32px, 5vw, 56px); font-weight: 800; color: var(--color-accent, #c6a45c); z-index: 2;
}

@media (max-width: 768px) {
    #articles .section-title-minimal {
        height: 150px !important; min-height: auto; margin-top: 1vh !important; margin-bottom: 0vh !important;
    }
}
/* =========================================
   Services Section Title Override تعهد ما به شما
   ========================================= */
#services .section-title-minimal {
    height: 150px; 
    margin-top: 0px; 
    margin-bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#services .section-title-minimal::before {
    content: ""; 
    position: absolute; 
    width: 100%;       /* ایجاد خط افقی */
    height: 1px;       /* ضخامت خط */
    background: #d0d0d0;
    top: 50%;          /* قرارگیری در وسط ارتفاع */
    left: 0; 
    transform: translateY(-50%); 
    opacity: 0.8; 
    z-index: 1;
}

#services .section-title-minimal span {
    position: relative; 
    background: var(--color-bg-main, #ffffff); 
    padding: 0 30px; 
    font-family: inherit;
    font-size: clamp(32px, 5vw, 56px); 
    font-weight: 800; 
    color: var(--color-accent, #c6a45c); 
    z-index: 2;
}

@media (max-width: 768px) {
    #services .section-title-minimal {
        height: 100px !important; 
        min-height: auto; 
        margin-top: 10vh !important; 
        margin-bottom: 2vh !important;
    }
}
/* =========================================
   بخش تماس با ما
   ========================================= */

/* تنظیمات کلی بخش */
#contact {
  position: relative;
  padding: 5rem 0; /* فاصله از بالا و پایین */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- دکمه ویرایش ادمین --- */
#contact .project-admin-actions {
  position: absolute;
  top: 20px;
  right: 5%;
  z-index: 50;
  display: none; /* این بخش توسط جاوااسکریپت برای ادمین فعال می‌شود */
}

#contact #edit-contact-btn {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: var(--color-accent, #d4af37);
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* سایه ملایم */
}

#contact #edit-contact-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px); /* حرکت ظریف به بالا هنگام هاور */
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

/* --- ساختار تیتر و دکمه --- */
#contact .section-title-minimal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px; /* فاصله بین متن و دکمه */
  position: relative;
  text-align: center;
}

/* --- باکس سفید دور شماره --- */
#contact .contact-actions {
  z-index: 2;
  background: #ffffff;
  padding: 10px 20px;
  border-radius: 12px;
  /* در صورت تمایل می‌توانید خط زیر را از کامنت در بیاورید تا سایه زیبایی به باکس بدهد */
  /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); */
}

/* --- استایل اصلی دکمه شماره تماس --- */
#contact .contact-btn {
  color: #000000;
  font-weight: bold;
  font-size: 1.5rem;
  padding: 10px 25px;
  letter-spacing: 2px;
  border: 2px solid var(--color-accent, #c6a45c);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease; /* انیمیشن نرم برای تغییر رنگ */
}

/* --- افکت رفتن موس روی دکمه (جایگزین onmouseover) --- */
#contact .contact-btn:hover {
  background: var(--color-accent, #c6a45c);
  color: #ffffff;
  box-shadow: 0 5px 15px rgba(198, 164, 92, 0.3); /* درخشش همرنگ دکمه */
}

/* --- کلاس مخفی کننده --- */
.hidden-elements {
  display: none !important;
}

/* --- واکنش‌گرایی برای موبایل --- */
@media (max-width: 768px) {
  #contact .contact-btn {
    font-size: 1.2rem;
    padding: 8px 15px;
  }
  
  #contact .section-title-minimal {
    gap: 20px;
  }
}
/* ========================================================
   MOBILE PERFORMANCE OPTIMIZATION (Version 1)
   فقط برای موبایل – بدون تغییر در دسکتاپ
   ======================================================== */

@media (max-width: 768px) {

  /* حذف blur های سنگین */
  .btn-glass,
  .admin-modal,
  .admin-modal-content::before,
  .admin-actions-inline button,
  #loginModal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* سبک‌تر کردن shadow ها */
  .card,
  .luxury-card,
  .article-detail,
  .project-gallery img {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  }

  .admin-modal-content {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
  }

  /* جلوگیری از transition های سنگین */
  .card,
  .luxury-card,
  .luxury-card__bg,
  .luxury-card__desc,
  .luxury-card__overlay,
  .article-card-image,
  .editorial-item,
  .editorial-title,
  .editorial-cta,
  .contact-btn,
  .btn {
    transition: transform 0.25s ease, opacity 0.25s ease !important;
  }

  /* حذف hover animation در موبایل */
  .luxury-card:hover .luxury-card__bg,
  .luxury-card:hover .luxury-card__overlay,
  .luxury-card:hover .luxury-card__title,
  .luxury-card:hover .luxury-card__line,
  .luxury-card:hover .luxury-card__desc,
  .article-card:hover .article-card-image,
  .editorial-item:hover .editorial-title,
  .editorial-item:hover .editorial-cta {
    transform: none !important;
    opacity: inherit !important;
  }

  /* سبک‌تر شدن reveal کارت‌ها */
  .card {
    transform: translateY(20px);
  }

  /* جلوگیری از repaint زیاد در اسکرول */
  .card,
  .luxury-card,
  .article-card,
  .editorial-item {
    will-change: transform, opacity;
  }

  /* بهینه‌سازی overlay پروژه */
  .project-overlay {
    transition: transform 0.3s ease;
  }

}
