/* ==========================================================================
   Mehr Yad Corporate Website - Design System & Stylesheet (RTL)
   ========================================================================== */

/* System & Persian Font Stack (Supports Offline / Local / Restricted Networks) */

:root {
  --primary: #1e3a8a;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #0d9488;
  --secondary-hover: #0f766e;
  --accent: #d97706;
  --accent-hover: #b45309;
  
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50: #f8fafc;
  --white: #ffffff;
  
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --card-shadow-hover: 0 20px 30px -10px rgba(30, 58, 138, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-family: 'Vazirmatn', 'Vazir', 'Tahoma', 'Segoe UI', system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
  font-size: 16px;
  color: var(--dark-soft);
  background-color: var(--gray-50);
}

body {
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  font-weight: 800;
  line-height: 1.3;
}

.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-600);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.title-wrapper {
  text-align: center;
  margin-bottom: 3.5rem;
}

.title-wrapper .section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* Header & Top Bar */
.top-bar {
  background-color: var(--dark);
  color: var(--gray-300);
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-info {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.top-info span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header {
  background: var(--white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo img {
  height: 62px;
  width: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* Nav Menu */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-link {
  display: block;
  padding: 0.6rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark-soft);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--dark);
  cursor: pointer;
  padding: 0.25rem;
}

/* Hero Section */
.hero {
  background: var(--bg-gradient);
  color: var(--white);
  padding: 5rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 80% 20%, rgba(13, 148, 136, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-content h2 {
  color: var(--white);
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.hero-content p {
  font-size: 1.15rem;
  color: var(--gray-300);
  margin-bottom: 2rem;
  line-height: 1.8;
}

.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--secondary-hover);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(13, 148, 136, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: var(--white);
  transform: translateY(-2px);
}

.hero-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--secondary);
  display: block;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--gray-300);
}

/* Page Header (Inner Pages) */
.page-banner {
  background: var(--bg-gradient);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
  position: relative;
}

.page-banner h2 {
  color: var(--white);
  font-size: 2.25rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
  color: var(--gray-300);
}

.breadcrumb a {
  color: var(--gray-300);
}

.breadcrumb a:hover {
  color: var(--white);
}

/* Content Sections */
.py-section {
  padding: 4.5rem 0;
}

.bg-white {
  background-color: var(--white);
}

.bg-light {
  background-color: var(--gray-50);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--primary-light);
}

.service-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.service-card p {
  color: var(--gray-600);
  font-size: 0.975rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Useful Links Grid (PRD FR-5: 2 rows, 3 columns) */
.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 1rem;
}

.link-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: var(--transition);
}

.link-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--card-shadow-hover);
}

.link-card:hover::before {
  opacity: 1;
}

.link-badge {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-color: var(--gray-50);
  border: 2px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  transition: var(--transition);
}

.link-card:hover .link-badge {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.link-badge img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.link-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--dark);
}

.link-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.link-card .btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

.link-card:hover .btn-link {
  color: var(--primary-hover);
  gap: 0.75rem;
}

/* News Section & News Page */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.news-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
}

.news-body {
  padding: 1.75rem;
}

.news-date {
  font-size: 0.825rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.news-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.news-card p {
  color: var(--gray-600);
  font-size: 0.925rem;
  margin-bottom: 1.25rem;
}

/* Special Featured Banner for Calendar */
.calendar-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f766e 100%);
  color: var(--white);
  border-radius: var(--radius-xl);
  padding: 3rem;
  margin-bottom: 3.5rem;
  box-shadow: 0 15px 30px rgba(15, 118, 110, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.calendar-banner-content h3 {
  color: var(--white);
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}

.calendar-banner-content p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  max-width: 650px;
}

.calendar-banner-btn {
  background-color: var(--accent);
  color: var(--white);
  padding: 1rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 15px rgba(217, 119, 6, 0.3);
}

.calendar-banner-btn:hover {
  background-color: var(--accent-hover);
  color: var(--white);
  transform: translateY(-2px);
}

/* Gallery & Image Showcases */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  height: 240px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
  color: var(--white);
  opacity: 0.9;
  transition: var(--transition);
}

.gallery-overlay h4 {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
}

/* About Page & Feature Layouts */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.about-text h3 {
  font-size: 1.8rem;
  margin-bottom: 1.25rem;
  color: var(--primary);
}

.about-text p {
  font-size: 1.05rem;
  color: var(--gray-700);
  line-height: 1.9;
  margin-bottom: 1.5rem;
  text-align: justify;
}

.about-card-box {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--card-shadow);
}

.feature-list {
  list-style: none;
  margin-top: 1.5rem;
}

.feature-list li {
  position: relative;
  padding-right: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--dark-soft);
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  right: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
}

/* Contact Form & Information */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
}

.contact-info-card {
  background: var(--primary);
  color: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info-card h3 {
  color: var(--white);
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: flex-start;
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-item-text h4 {
  color: var(--gray-200);
  font-size: 0.875rem;
  font-weight: 500;
}

.contact-item-text p {
  color: var(--white);
  font-weight: 700;
  font-size: 1.05rem;
}

.contact-form-card {
  background: var(--white);
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  box-shadow: var(--card-shadow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Footer & IEOA Badge (PRD FR-8) */
.site-footer {
  background-color: var(--dark);
  color: var(--gray-300);
  padding-top: 4.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 3rem;
  padding-bottom: 3.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-col h3 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 3px;
  background-color: var(--secondary);
  border-radius: 2px;
}

.footer-col p {
  color: var(--gray-400);
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--gray-400);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--white);
  padding-right: 0.5rem;
}

.ieoa-badge-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
}

.ieoa-badge-box img {
  height: 70px;
  width: auto;
  object-fit: contain;
}

.ieoa-text h4 {
  font-size: 0.95rem;
  color: var(--dark);
  font-weight: 800;
  line-height: 1.3;
}

.ieoa-text p {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.footer-bottom {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-grid, .about-grid, .contact-grid, .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .calendar-banner {
    flex-direction: column;
    text-align: center;
    padding: 2.25rem;
  }

  .nav-list {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 280px;
    height: calc(100vh - 80px);
    background: var(--white);
    flex-direction: column;
    padding: 2rem 1.5rem;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    gap: 0.75rem;
  }

  .nav-list.active {
    right: 0;
  }

  .mobile-toggle {
    display: block;
  }
}

@media (max-width: 640px) {
  .links-grid {
    grid-template-columns: 1fr; /* PRD FR-5 requirement for mobile: 1 column */
  }

  .hero-content h2 {
    font-size: 2rem;
  }
  
  .top-info {
    font-size: 0.8rem;
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .top-bar .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}
