/*
Theme Name: Midelz Design Studio
Theme URI: https://example.com
Author: Midelz
Author URI: https://example.com
Description: قالب سفارشی وردپرس برای Midelz Design Studio. بخش پروژه‌ها (Projects) از نوع پست سفارشی «نمونه‌کار» (portfolio) و بخش وبلاگ (Blog) از آخرین نوشته‌های سایت تغذیه می‌شوند.
Version: 1.0
Text Domain: midelz
*/

    /* لود فونت Montserrat از فایل داخلی در صورت عدم دسترسی به گوگل */
    @font-face {
      font-family: 'Montserrat-Local';
      src: url('images/fonts/Montserrat-Bold.ttf') format('truetype'),
           url('images/fonts/Montserrat-Regular.ttf') format('truetype');
      font-weight: normal;
      font-style: normal;
    }

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

    html {
      scroll-behavior: smooth;
    }

    body {
      min-height: 100vh;
      font-family: 'Segoe Print', 'Comic Sans MS', cursive, sans-serif;
      color: #3d103f;
      overflow-x: hidden;
      position: relative;
    }

    .hero-section {
      min-height: 100vh;
      background: url('images/background.jpg') no-repeat center center/cover;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      position: relative;
    }

    #loader-wrapper {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: #000000;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      transition: opacity 0.5s ease, visibility 0.5s ease;
    }

    .loader-gif {
      width: 180px;
      height: auto;
      margin-bottom: 20px;
      object-fit: contain;
    }

    .loader-text {
      color: #bcbcbc;
      font-size: 1rem;
      letter-spacing: 1px;
      font-family: Montserrat, sans-serif;
    }

    .loader-text::after {
      content: '';
      display: inline-block;
      width: 24px;
      text-align: left;
      animation: dotsAnimation 1.5s infinite steps(4);
    }

    @keyframes dotsAnimation {
      0% { content: ''; }
      25% { content: '.'; }
      50% { content: '..'; }
      75% { content: '...'; }
    }

    .loader-hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    header {
      width: 100%;
      padding: 25px 0 30px;
      position: relative;
      background: linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 100%);
      z-index: 10;
      overflow: hidden;
    }

    .lang-toggle {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 30px;
      font-size: 1.1rem;
      font-weight: bold;
      color: #3d103f;
      text-decoration: none;
      transition: all 0.3s ease;
      border-bottom: 2px solid transparent;
      padding-bottom: 2px;
      z-index: 10;
      display: flex;
      align-items: center;
    }

    .lang-toggle:hover,
    .lang-toggle:active {
      color: #ffffff;
      border-bottom: 2px solid #ffffff;
    }

    /* منوی همبرگری رسپانسیو سمت راست با استایلی مشابه en */
    .menu-toggle {
      display: none;
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 30px;
      background: none;
      border: none;
      cursor: pointer;
      z-index: 20;
      padding: 0;
      padding-bottom: 2px;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      font-weight: bold;
      color: #3d103f;
      text-decoration: none;
      font-family: 'Montserrat', sans-serif;
      text-transform: lowercase;
      border-bottom: 2px solid transparent;
      transition: all 0.3s ease;
    }

    .menu-toggle:hover,
    .menu-toggle:active {
      color: #ffffff;
      border-bottom: 2px solid #ffffff;
    }

    .menu-toggle-svg {
      height: 24px;
      width: auto;
      display: block;
      filter: brightness(0) invert(1);
    }

    .menu-toggle-text {
      display: inline;
    }

    .mobile-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(10, 12, 22, 0.95);
      z-index: 999;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding: 0 10%;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .mobile-overlay.active {
      opacity: 1;
      visibility: visible;
    }

    .close-btn {
      position: absolute;
      top: 25px;
      right: 30px;
      background: none;
      border: none;
      color: #ffffff;
      font-size: 2rem;
      cursor: pointer;
      font-family: Arial, sans-serif;
    }

    .mobile-nav-links {
      display: flex;
      flex-direction: column;
      gap: 30px;
      align-items: flex-start;
    }

    .mobile-nav-item {
      display: flex;
      align-items: center;
      text-decoration: none;
      position: relative;
      padding-bottom: 5px;
    }

    .mobile-nav-svg {
      height: 45px;
      width: auto;
      display: block;
      transition: transform 0.3s ease, filter 0.3s ease;
      filter: brightness(0) invert(1);
    }

    .mobile-nav-text {
      color: #ffffff;
      font-size: 2rem;
      font-weight: bold;
      font-family: 'Segoe Print', 'Comic Sans MS', cursive, sans-serif;
      transition: color 0.3s ease;
    }

    .mobile-nav-item::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0;
      height: 3px;
      background-color: #7b1fa2;
      border-radius: 2px;
      transition: width 0.3s ease;
    }

    .mobile-nav-item:hover .mobile-nav-text {
      color: #7b1fa2;
    }

    .mobile-nav-item:hover .mobile-nav-svg {
      transform: scale(1.08);
      filter: none;
    }

    .mobile-nav-item:hover::after {
      width: 100%;
    }

    .mobile-lang-toggle {
      color: #ffffff;
      font-size: 2rem;
      font-weight: bold;
      font-family: 'Segoe Print', 'Comic Sans MS', cursive, sans-serif;
      text-decoration: none;
      margin-top: 10px;
      transition: color 0.3s ease;
    }

    .mobile-lang-toggle:hover {
      color: #7b1fa2;
    }

    .site-container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 20px;
      width: 100%;
    }

    /* --- نوار ناوبری دسکتاپ --- */
    .nav-container {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      position: relative;
      min-height: 60px;
    }

    .logo-container {
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      text-align: left;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      z-index: 2;
    }

    .logo-img {
  height: 60px;
  width: auto;
  min-width: 120px; /* جلوگیری از 0 شدن عرض */
  display: block;
  object-fit: contain;
}

    .logo-fallback-container {
      display: none;
      background: transparent;
      padding: 0;
      border: none;
      box-shadow: none;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;
    }

    .logo-title {
      font-size: 1.8rem;
      font-weight: bold;
      color: #ffffff;
      line-height: 1;
      font-family: 'Segoe Print', 'Comic Sans MS', cursive, sans-serif;
    }

    .logo-subtitle {
      font-size: 1.1rem;
      color: #ffffff;
      margin-top: 2px;
      font-family: 'Segoe Print', 'Comic Sans MS', cursive, sans-serif;
    }

    .nav-center-group {
      display: flex;
      gap: 30px;
      align-items: center;
      justify-content: center;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }

    .nav-item {
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      position: relative;
      padding-bottom: 4px;
    }

    .nav-item::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0;
      height: 2px;
      background-color: #3d103f;
      transition: width 0.3s ease-in-out;
    }

    .nav-item:hover::after {
      width: 100%;
    }

    .nav-svg {
      height: 22px;
      width: auto;
      display: block;
      transition: transform 0.3s ease;
    }

    .nav-item:hover .nav-svg {
      transform: scale(1.05);
    }

    .nav-text {
      color: #3d103f;
      font-size: 1.1rem;
      font-weight: bold;
      transition: color 0.3s ease;
    }

    .nav-item:hover .nav-text {
      color: #7b1fa2;
    }

    .main-content {
      flex: 1;
      display: flex;
      align-items: flex-end;
      padding-bottom: 100px;
      position: relative;
      z-index: 5;
    }

    .content-container {
      max-width: 480px;
    }

   .content-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  min-height: 250px; /* جلوگیری از 0 شدن ارتفاع */
  display: block;
  filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.5));
}
    .text-box {
      color: #ffffff;
      text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
      font-size: 1.3rem;
      line-height: 1.6;
    }

    .text-box h2 {
      font-size: 1.8rem;
      margin-bottom: 10px;
    }

    .text-box .quote-author {
      margin-top: 10px;
      font-weight: bold;
    }

    .slider-wrapper {
      position: relative;
      display: flex;
      align-items: center;
      width: 100%;
    }

    .scroll-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 42px;
      height: 42px;
      background-color: #ffffff;
      color: #3d103f;
      border: 1px solid rgba(0, 0, 0, 0.15);
      border-radius: 50%;
      font-size: 1.2rem;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 10;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
      transition: all 0.25s ease;
      user-select: none;
    }

    .scroll-btn:hover {
      background-color: #3d103f;
      color: #ffffff;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    }

    .scroll-btn.left {
      left: -20px;
    }

    .scroll-btn.right {
      right: -20px;
    }

    /* ABOUT SECTION */
    .about-section {
      background-color: #0b1d3a;
      padding: 90px 0;
      font-family: 'Montserrat', sans-serif;
      position: relative;
      color: #ffffff;
      box-shadow: inset 0 15px 15px -10px rgba(0, 0, 0, 0.2);
    }

    .about-header {
      margin-bottom: 50px;
      text-align: left;
    }

    .about-main-title {
      font-size: 2.2rem;
      color: #ffffff;
      font-weight: 700;
      line-height: 1.2;
    }

    .about-steps-container {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      max-width: 1100px;
      margin: 0 auto;
    }

    .about-step-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      flex: 1;
      max-width: 180px;
      position: relative;
    }

    .about-circle-wrapper {
      width: 110px;
      height: 110px;
      border-radius: 50%;
      background-color: #050d1a;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 25px;
      box-shadow: 0 8px 20px rgba(0,0,0,0.3);
      position: relative;
      cursor: default;
    }

    .about-circle-wrapper img.main-img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
    }

    /* دایره هوور در سمت راست-پایین */
    .about-hover-circle {
      position: absolute;
      top: 45px;
      left: 65px;
      width: 90px;
      height: 90px;
      border-radius: 50%;
      overflow: hidden;
      border: 2px solid #ffffff;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
      opacity: 0;
      visibility: hidden;
      transform: scale(0.5);
      transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease, visibility 0.25s ease;
      pointer-events: none;
      z-index: 20;
    }

    .about-circle-wrapper:hover .about-hover-circle {
      opacity: 1;
      visibility: visible;
      transform: scale(1);
    }

    .about-hover-circle img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .about-step-title {
      font-size: 1.1rem;
      font-weight: 700;
      margin-bottom: 8px;
    }

    .about-step-desc {
      font-size: 0.85rem;
      line-height: 1.4;
      color: rgba(255, 255, 255, 0.8);
    }

    .about-step-desc a {
      color: #3b82f6;
      text-decoration: underline;
    }

    .about-arrow-wrapper {
      margin-top: 45px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .about-arrow-svg {
      width: 40px;
      height: 12px;
      fill: none;
      stroke: rgba(255, 255, 255, 0.4);
      stroke-width: 2;
    }

    /* SVG Titles Style */
    .section-title-svg {
      height: 40px;
      width: auto;
      display: block;
      filter: brightness(0) invert(1);
    }

    .section-title-svg-dark {
      height: 40px;
      width: auto;
      display: block;
      filter: brightness(0);
    }

    /* PROJECTS SECTION */
    .projects-section {
      background-color: #ffffff;
      padding: 60px 0;
      position: relative;
      box-shadow: inset 0 15px 15px -10px rgba(0, 0, 0, 0.05);
    }

    .projects-header {
      margin-bottom: 35px;
      text-align: left;
    }

    .projects-main-title {
      font-size: 2.2rem;
      color: #1a1a1a;
      font-weight: 700;
      line-height: 1.2;
    }

    .projects-grid {
      display: flex;
      justify-content: flex-start;
      gap: 30px;
      overflow-x: auto;
      padding: 10px 5px;
      scrollbar-width: none;
      -ms-overflow-style: none;
      cursor: grab;
      user-select: none;
      touch-action: pan-x pan-y;
    }

    .projects-grid:active {
      cursor: grabbing;
    }

    .projects-grid::-webkit-scrollbar {
      display: none;
    }

    .project-card {
      background: #ffffff;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      width: 280px;
      min-width: 280px;
      flex-shrink: 0;
      text-decoration: none;
      cursor: pointer;
      transition: transform 0.3s ease;
    }

    .project-card:hover {
      transform: translateY(-4px);
    }

    .project-img-wrapper {
      width: 100%;
      height: 350px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 15px;
      overflow: hidden;
      border-radius: 8px;
    }

    .project-img-wrapper img {
      max-width: 100%;
      max-height: 100%;
      width: auto;
      height: auto;
      object-fit: contain;
      transition: transform 0.3s ease;
    }

    .project-card:hover .project-img-wrapper img {
      transform: scale(1.03);
    }

    .project-title {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 1.15rem;
      font-weight: bold;
      color: #222222;
      margin-bottom: 10px;
      border-bottom: 1px solid #eeeeee;
      padding-bottom: 8px;
      width: 100%;
      transition: color 0.3s ease, border-color 0.3s ease;
    }

    .project-card:hover .project-title {
      color: #7b1fa2;
      border-bottom-color: #7b1fa2;
    }

    .project-desc {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 0.85rem;
      color: #444444;
      line-height: 1.4;
    }

    /* BLOG SECTION */
    .blog-section {
      background-color: #f7f9fc;
      padding: 60px 0 70px;
      position: relative;
      box-shadow: inset 0 15px 15px -10px rgba(0, 0, 0, 0.05);
      font-family: 'Montserrat', sans-serif;
    }

    .blog-header {
      margin-bottom: 35px;
      text-align: left;
    }

    .blog-main-title {
      font-size: 2.2rem;
      color: #1a1a1a;
      font-weight: 700;
      line-height: 1.2;
    }

    .blog-grid {
      display: flex;
      justify-content: flex-start;
      gap: 25px;
      overflow-x: auto;
      padding: 15px 5px;
      scrollbar-width: none;
      -ms-overflow-style: none;
      cursor: grab;
      user-select: none;
      touch-action: pan-x pan-y;
    }

    .blog-grid:active {
      cursor: grabbing;
    }

    .blog-grid::-webkit-scrollbar {
      display: none;
    }

    .blog-card {
      background: #ffffff;
      border-radius: 12px;
      border: 1px solid #eaedf3;
      display: flex;
      flex-direction: column;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
      width: 320px;
      min-width: 320px;
      flex-shrink: 0;
      overflow: hidden;
      font-family: 'Montserrat', sans-serif;
    }

    .blog-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    }

    .blog-card-light-blue {
      background: #f0f9ff;
      border: 1.5px solid #baebff;
    }

    .blog-card-light-blue .blog-card-title {
      color: #0f172a;
    }

    .blog-card-light-blue .blog-card-desc {
      color: #475569;
    }

    .blog-card-light-blue .blog-card-footer {
      color: #0f172a;
      border-top-color: transparent;
    }

    .blog-card-img-wrapper {
      width: 100%;
      height: 200px;
      overflow: hidden;
      background-color: #f0f3f8;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .blog-card-img-wrapper img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.4s ease;
    }

    .blog-card:hover .blog-card-img-wrapper img {
      transform: scale(1.05);
    }

    .blog-card-body {
      padding: 22px 20px 18px;
      display: flex;
      flex-direction: column;
      flex: 1;
      text-align: left;
    }

    .blog-card-title-link {
      text-decoration: none;
      margin-bottom: 12px;
      display: inline-block;
    }

    .blog-card-title {
      font-family: 'Montserrat', sans-serif;
      font-size: 0.95rem;
      font-weight: 600;
      color: #1e293b;
      line-height: 1.4;
      transition: color 0.25s ease;
    }

    .blog-card-title-link:hover .blog-card-title {
      color: #2563eb;
    }

    .blog-card-desc {
      font-family: 'Montserrat', sans-serif;
      font-size: 0.88rem;
      color: #64748b;
      line-height: 1.5;
      margin-bottom: 20px;
      flex: 1;
    }

    .blog-card-footer {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #3b82f6;
      font-size: 0.82rem;
      font-weight: 600;
      padding-top: 12px;
      border-top: 1px solid #f1f5f9;
    }

    .blog-date-icon {
      width: 16px;
      height: 16px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    /* CONTACT SECTION */
    .contact-section {
      background-color: #e0e0e0;
      padding: 80px 0;
      color: #2b2b2b;
      position: relative;
      box-shadow: inset 0 15px 15px -10px rgba(0, 0, 0, 0.05);
    }

    .contact-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 30px;
    }

    .contact-col-left,
    .contact-col-right {
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .contact-col-center {
      flex: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
    }

    .contact-handwritten-img,
    .contact-illustration-img {
      max-width: 100%;
      height: auto;
      display: block;
      object-fit: contain;
    }

    .contact-center-text {
      font-family: 'Georgia', serif;
      font-size: 1.85rem;
      line-height: 1.5;
      color: #262626;
      margin-bottom: 30px;
      max-width: 600px;
    }

    .social-links {
      display: flex;
      gap: 25px;
      align-items: center;
      margin-bottom: 40px;
    }

    .social-links a {
      color: #000000;
      text-decoration: none;
      transition: transform 0.2s ease, opacity 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .social-links a:hover {
      transform: translateY(-3px);
      opacity: 0.7;
    }

    .social-links img {
      width: 28px;
      height: 28px;
      display: block;
    }

    .social-fallback-svg {
      width: 28px;
      height: 28px;
      fill: #000000;
    }

    .privacy-notice {
      font-family: 'Georgia', serif;
      font-size: 0.95rem;
      color: #333333;
    }

    .privacy-notice a {
      color: #333333;
      text-decoration: underline;
    }

    /* FOOTER SECTION */
    .footer-section {
      background-color: #ffffff;
      padding: 35px 0;
      font-family: 'Montserrat', 'Montserrat-Local', Arial, sans-serif;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 2.5px;
      color: #000000;
    }

    .footer-container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 20px;
    }

    .footer-links {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 25px;
    }

    .footer-links a,
    .footer-links span {
      color: #000000;
      text-decoration: none;
      text-transform: uppercase;
      transition: opacity 0.3s ease;
    }

    .footer-links a:hover {
      opacity: 0.6;
    }

    .footer-credits {
      text-transform: uppercase;
      letter-spacing: 2.5px;
    }

    /* دکمه فلش بازگشت به بالا */
    .back-to-top {
      position: fixed;
      bottom: 25px;
      right: 25px;
      width: 45px;
      height: 45px;
      background-color: #3d103f;
      color: #ffffff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
      z-index: 99;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    }

    .back-to-top.visible {
      opacity: 1;
      visibility: visible;
    }

    .back-to-top:hover {
      background-color: #7b1fa2;
      transform: translateY(-3px);
    }

    .back-to-top svg {
      width: 20px;
      height: 20px;
      fill: #ffffff;
    }

    @media (max-width: 900px) {
      .contact-container {
        flex-direction: column;
        gap: 30px;
      }

      .about-steps-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
      }

      .about-arrow-wrapper {
        display: none;
      }
    }

    @media (max-width: 768px) {
      header {
        padding-top: 20px;
      }

      .menu-toggle {
        display: flex;
      }

      .lang-toggle {
        display: none;
      }

      .nav-center-group {
        display: none;
      }

      .nav-container {
        justify-content: flex-start;
      }

      .logo-container {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
      }

      .logo-img {
        max-height: 45px;
      }

      .main-content {
        justify-content: center;
        text-align: center;
        padding-bottom: 60px;
      }

      .scroll-btn.left {
        left: -10px;
      }

      .scroll-btn.right {
        right: -10px;
      }

      .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
      }
      
      .footer-links {
        justify-content: center;
        gap: 15px;
      }

      .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
      }
    }

    @media (max-width: 650px) {
      .blog-main-title,
      .projects-main-title,
      .about-main-title {
        font-size: 1.5rem;
      }

      .section-title-svg,
      .section-title-svg-dark {
        height: 30px;
      }
    }
