@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap");

/* Kalameh — place licensed webfont files in fonts/kalameh/ */
@font-face {
  font-family: "Kalameh";
  src: local("Kalameh"),
    local("Kalameh Regular"),
    url("../fonts/kalameh/KalamehWeb-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Kalameh";
  src: local("Kalameh Bold"),
    url("../fonts/kalameh/KalamehWeb-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Site color theme */
:root {
  --color-bg: #f5f2ed;
  --color-card: #0892d0;
  --color-card-hover: #067bb5;
  --color-footer-btn: #111827;
  --color-footer-btn-hover: #9e4f31;
  --color-footer-text: #1e3a5f;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--color-bg);
}

body.bg-gray-50,
.bg-gray-50 {
  background-color: var(--color-bg) !important;
}

section.bg-white {
  background-color: #ffffff;
}

.hashtag-tag {
  background-color: var(--color-card);
  color: #ffffff;
}

/* Footer & primary buttons */
footer.bg-gray-900,
.bg-gray-900.text-white,
button.bg-gray-900,
a.bg-gray-900 {
  background-color: var(--color-footer-btn) !important;
}

footer.bg-gray-900:hover,
button.bg-gray-900:hover,
a.bg-gray-900:hover,
.bg-gray-900.hover\:bg-gray-800:hover {
  background-color: var(--color-footer-btn-hover) !important;
}

footer.bg-gray-900,
footer.bg-gray-900 .text-white,
footer.bg-gray-900 h3,
footer.bg-gray-900 h4,
footer.bg-gray-900 p,
footer.bg-gray-900 span,
footer.bg-gray-900 li,
footer.bg-gray-900 a,
footer.bg-gray-900 .text-gray-400,
footer.bg-gray-900 .fas,
footer.bg-gray-900 .fab {
  color: var(--color-footer-text) !important;
}

footer.bg-gray-900 a:hover,
footer.bg-gray-900 .hover\:text-white:hover,
footer.bg-gray-900 .hover\:text-pink-400:hover {
  color: var(--color-card) !important;
}

/* Card / link accents (Tailwind blue utilities) */
.text-blue-600 {
  color: var(--color-card) !important;
}

.hover\:text-blue-600:hover,
.hover\:text-blue-800:hover,
.group:hover .group-hover\:text-blue-600 {
  color: var(--color-card-hover) !important;
}

.border-blue-600 {
  border-color: var(--color-card) !important;
}

.bg-blue-100 {
  background-color: rgba(8, 146, 208, 0.15) !important;
}

.text-blue-800 {
  color: var(--color-card-hover) !important;
}

/* Persian font - Vazirmatn for RTL mode */
.rtl {
  font-family: "Vazirmatn", "Tahoma", "Arial", sans-serif;
}

/* Bold titles in Persian mode */
.rtl h1,
.rtl h2,
.rtl h3,
.rtl h4,
.rtl h5,
.rtl h6 {
  font-weight: bold !important;
}

/* Bold specific title classes in Persian mode */
.rtl .font-bold,
.rtl .font-semibold,
.rtl .font-medium {
  font-weight: bold !important;
}

/* RTL spacing for dropdown arrows */
.rtl .fas.fa-chevron-down {
  margin-left: 0.5rem !important;
  margin-right: 0 !important;
}

/* Smart banner height that adapts to device */
.banner-section {
  /* Fill remaining viewport under compact sticky header so banner fits first screen */
  height: calc(100dvh - 7.5rem);
  min-height: 320px;
  max-height: none;
  position: relative;
  overflow: hidden;
  margin-left: 8%;
  margin-right: 8%;
  margin-bottom: 2rem;
  margin-top: 0.5rem;
  padding: 0;
  border-radius: 1rem;
}

/* Blurred background layer for banner */
.banner-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--blur-bg-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(25px);
  transform: scale(1.15);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out, background-image 0.8s ease-in-out;
}

.banner-section.has-blur::before {
  opacity: 0.7;
}

/* Transparent black overlay for blurred background */
.banner-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
  pointer-events: none;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .banner-section {
    height: min(52vw, 40vh);
    min-height: 11.5rem;
    max-height: 22rem;
    margin-left: 4%;
    margin-right: 4%;
    margin-bottom: 0.5rem;
    margin-top: 0.25rem;
  }

  .banner-section::before {
    background-position: center center;
    transform: scale(1.05);
  }

  .banner-slide {
    background-size: cover;
    background-position: center center;
  }

  .banner-slide img {
    object-fit: cover;
    object-position: center center;
  }
}

/* Very small mobile devices */
@media (max-width: 480px) {
  .banner-section {
    height: min(56vw, 38vh);
    min-height: 10.5rem;
    max-height: 20rem;
    margin-left: 3%;
    margin-right: 3%;
    margin-bottom: 0.375rem;
  }

  .banner-slide {
    left: 0;
    right: 0;
  }
}

/* Landscape mobile devices */
@media (max-height: 500px) and (orientation: landscape) {
  .banner-section {
    height: min(70vh, 18rem);
    min-height: 9rem;
    max-height: 18rem;
  }
}

.banner-slide {
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
  z-index: 2;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Subtle overlay on banner slide */
.banner-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 1;
  pointer-events: none;
}

.banner-slide.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.banner-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

/* Glass-style slide caption */
.banner-caption {
  position: absolute;
  bottom: 5.5rem;
  inset-inline-start: 2.5rem;
  z-index: 5;
  max-width: min(88%, 28rem);
  padding: 1rem 1.35rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 1rem;
  color: #fff;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.banner-caption-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.banner-caption-sub {
  margin: 0.35rem 0 0;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  font-weight: 400;
  line-height: 1.5;
  opacity: 0.92;
}

/* Banner Navigation Buttons */
.banner-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  backdrop-filter: blur(5px);
}

.banner-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.banner-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.banner-nav-prev {
  left: 2rem;
}

.banner-nav-next {
  right: 2rem;
}

.banner-nav-btn i {
  font-size: 1.25rem;
}

/* Banner Indicators */
.banner-indicators-container {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 20;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 0.75rem 1.25rem;
  border-radius: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.banner-indicator {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: white;
  opacity: 0.5;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.banner-indicator.active {
  opacity: 1;
  transform: scale(1.2);
}

.banner-pause-icon {
  color: white;
  font-size: 0.875rem;
  margin-right: 0.5rem;
  opacity: 0.8;
}

/* Responsive adjustments for banner navigation */
@media (max-width: 768px) {
  .banner-section {
    margin-left: 4%;
    margin-right: 4%;
  }

  .banner-slide {
    left: 0;
    right: 0;
  }

  .banner-caption {
    bottom: 2.75rem;
    inset-inline-start: 0.75rem;
    inset-inline-end: 0.75rem;
    max-width: none;
    padding: 0.55rem 0.75rem;
    border-radius: 0.625rem;
  }

  .banner-caption-title {
    font-size: 0.8rem;
    line-height: 1.3;
  }

  .banner-caption-sub {
    font-size: 0.68rem;
    margin-top: 0.2rem;
    line-height: 1.35;
  }

  .banner-nav-btn {
    width: 34px;
    height: 34px;
  }

  .banner-nav-btn i {
    font-size: 0.85rem;
  }

  .banner-nav-prev {
    left: 0.5rem;
  }

  .banner-nav-next {
    right: 0.5rem;
  }

  .banner-indicators-container {
    bottom: 0.65rem;
  }
}

/* Home stats bar — narrow single-line strip below banner */
.home-stats-bar {
  margin-left: 8%;
  margin-right: 8%;
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 10;
}

.home-stats-bar__inner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  min-height: 2.5rem;
  padding: 0.35rem 0;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-stats-bar__inner::-webkit-scrollbar {
  display: none;
}

.home-stats-bar__item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 0;
  min-width: max-content;
  padding: 0.25rem 0.85rem;
  white-space: nowrap;
  border-inline-end: 1px solid #e5e7eb;
}

.home-stats-bar__item:last-child {
  border-inline-end: none;
}

.home-stats-bar__number {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #2563eb;
  flex-shrink: 0;
}

.home-stats-bar__label {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  color: #4b5563;
}

@media (max-width: 768px) {
  .home-stats-bar {
    margin-left: 4%;
    margin-right: 4%;
    margin-top: -0.25rem;
    margin-bottom: 0.75rem;
  }

  .home-stats-bar__inner {
    justify-content: flex-start;
    min-height: 2.125rem;
    padding: 0.3rem 0;
  }

  .home-stats-bar__item {
    flex: 0 0 auto;
    padding: 0.2rem 0.65rem;
    gap: 0.25rem;
  }

  .home-stats-bar__number {
    font-size: 0.85rem;
  }

  .home-stats-bar__label {
    font-size: 0.625rem;
  }
}

.project-card {
  border: none !important;
  border-top: none !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
}

/* Project cards — match news/events card proportions */
.project-card > [class*="aspect-"] {
  aspect-ratio: 16 / 10 !important;
}

.project-card > .p-4,
.project-card > .p-6 {
  padding: 1rem !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0 !important;
}

.project-card p.text-gray-600 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0 !important;
  line-height: 1.5;
}

/* Home & projects page — 3 cards per row on mobile */
@media (max-width: 767px) {
  .home-projects-grid .project-card:hover,
  .projects-page-grid .project-card:hover {
    transform: none;
  }

  .home-projects-grid .project-card > [class*="aspect-"],
  .projects-page-grid .project-card > [class*="aspect-"] {
    aspect-ratio: 1 / 1 !important;
  }

  .home-projects-grid .project-card > .p-4,
  .projects-page-grid .project-card > .p-4 {
    padding: 0.45rem !important;
    gap: 0.25rem !important;
  }

  .home-projects-grid .project-card h3,
  .projects-page-grid .project-card h3 {
    font-size: 0.62rem !important;
    line-height: 1.35;
    white-space: normal !important;
    -webkit-line-clamp: 3;
  }

  .home-projects-grid .project-card p.text-gray-600,
  .home-projects-grid .project-card .flex.flex-wrap.gap-2,
  .home-projects-grid .project-card .mt-auto,
  .projects-page-grid .project-card p.text-gray-600,
  .projects-page-grid .project-card .flex.flex-wrap.gap-2,
  .projects-page-grid .project-card .mt-auto {
    display: none !important;
  }
}

/* Project modal — credits section */
.project-credits-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.project-credits-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.project-credits-title,
.project-credits-title strong {
  display: block;
  font-weight: 700 !important;
  color: #111827;
  line-height: 1.5;
}

.project-credits-names {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  color: #374151;
  font-weight: 400;
  line-height: 1.6;
}

.rtl .project-credits-names {
  align-items: flex-end;
}

.project-credits-name {
  display: block;
  width: 100%;
}

.nav-link {
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: #3B82F6;
}

.social-icon {
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
  transform: translateY(-2px);
  color: #3B82F6;
}

.lang-btn {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.lang-btn.active {
  background-color: #111827;
  color: white;
}

.rtl {
  direction: rtl;
}

/* RTL spacing adjustments for contact section icons */
.rtl .w-12.h-12.mr-4 {
  margin-right: 0;
  margin-left: 1rem;
}

/* General RTL spacing for icon containers */
.rtl .mr-4 {
  margin-right: 0;
  margin-left: 1rem;
}

/* RTL spacing for social media icons - fix for Persian mode */
.rtl .flex.space-x-3 > * + * {
  margin-left: 0;
  margin-right: 0.75rem;
}

.rtl .flex.space-x-4 > * + * {
  margin-left: 0;
  margin-right: 1rem;
}

/* Specific fix for header social icons in RTL */
.rtl .social-icon {
  margin-left: 0 !important;
}

.rtl .social-icon:not(:first-child) {
  margin-right: 0.5rem !important;
  margin-left: 0 !important;
}

/* Specific fix for footer social icons in RTL */
.rtl footer .flex > a {
  margin-left: 0 !important;
}

.rtl footer .flex > a:not(:first-child) {
  margin-right: 0.75rem !important;
  margin-left: 0 !important;
}

/* Footer LTR layout (English) — columns and text start from the left */
html[dir="ltr"] footer {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] footer .grid > div {
  text-align: left;
}

html[dir="ltr"] footer .flex.items-center.space-x-3,
html[dir="ltr"] footer .flex.space-x-4 {
  justify-content: flex-start;
}

html[dir="ltr"] footer .border-t > div {
  flex-direction: row;
  justify-content: space-between;
  text-align: left;
}

html[dir="ltr"] footer .border-t > div > div:first-child {
  justify-content: flex-start;
  text-align: left;
}

html[dir="ltr"] footer .flex > a:not(:first-child) {
  margin-left: 0.75rem !important;
  margin-right: 0 !important;
}

/* RTL spacing between language toggle and social icons */
.rtl .flex.items-center.space-x-4 > div:last-child {
  margin-left: 0 !important;
  margin-right: 1.5rem !important;
}

/* Logo styling - transparent background */
.logo-container {
  background: transparent;
  border: none;
}

.logo-container img {
  object-fit: contain;
  filter: brightness(1.1) contrast(1.1);
  transition: filter 0.3s ease;
}

header .logo-container {
  overflow: visible;
  background: transparent;
  /* Compact logo so header + banner fit first viewport */
  width: 3.5rem !important;
  height: 3.5rem !important;
}

/* Compact brand row + nav so first screen shows full banner */
header > .max-w-7xl > .flex.justify-start.items-center {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

header .desktop-nav {
  padding-top: 0.4rem !important;
  padding-bottom: 0.4rem !important;
}

header .desktop-nav .nav-link {
  font-size: 0.8125rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.logo-container:hover img {
  filter: brightness(1.2) contrast(1.2);
}

footer .logo-container {
  background: #fff;
  padding: 0.375rem;
  border-radius: 0.375rem;
}

/* Footer logo — white background for contrast on dark footer */
footer .footer-logo-container {
  width: clamp(3rem, 9vw, 4rem);
  height: clamp(3rem, 9vw, 4rem);
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  padding: 0.375rem;
  border-radius: 0.375rem;
}

footer .footer-logo-container img {
  object-fit: contain;
  width: 100%;
  height: 100%;
}

/* Footer main columns */
footer .footer-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  footer .footer-main-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  footer .footer-main-grid {
    grid-template-columns: 1.4fr 1fr 1.2fr;
    column-gap: 1.5rem;
    row-gap: 1rem;
    align-items: start;
    justify-content: space-between;
  }
}

@media (min-width: 1280px) {
  footer .footer-main-grid {
    column-gap: 2rem;
  }
}

/* Favicon styling for better transparency support */
link[rel="icon"] {
  background: transparent;
}

/* Ensure favicon displays properly in different browsers */
@media (prefers-color-scheme: dark) {
  link[rel="icon"] {
    filter: brightness(1.1);
  }
}

.hidden-lang {
  display: none;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

/* Features Showcase Section - Modern Card Design */
.showcase-card {
  min-height: 450px;
  position: relative;
}

.showcase-box {
  position: relative;
  z-index: 10;
  width: 100%;
}

.showcase-image {
  position: absolute;
  z-index: 5;
}

/* Mobile responsive adjustments */
@media (max-width: 1023px) {
  .showcase-image {
    right: 0 !important;
    left: 6 !important;
    right: 6 !important;
  }

  .rtl .showcase-image {
    left: 0 !important;
    right: 6 !important;
    left: 6 !important;
  }
}

/* RTL Support for Showcase Section */
.rtl .showcase-image {
  left: auto;
  right: 6;
}

@media (min-width: 1024px) {
  .rtl .showcase-image {
    left: -80px;
    right: 6;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Partner logos — static single row */
.partners-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.35rem, 1.2vw, 1.5rem);
  width: 100%;
  padding-block: 0.75rem;
}

.partners-row__logo {
  height: clamp(28px, 4.2vw, 52px);
  width: auto;
  max-width: clamp(40px, 7vw, 96px);
  object-fit: contain;
  flex: 1 1 0;
  min-width: 0;
  filter: grayscale(1);
  opacity: 0.7;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

.partners-row__logo:hover {
  filter: grayscale(0);
  opacity: 1;
  transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .partners-row__logo {
    transition: none;
  }

  .partners-row__logo:hover {
    transform: none;
  }
}

/* Section headers — title larger than subtitle on all breakpoints */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  white-space: normal !important;
}

.section-header__subtitle {
  margin: 0 auto;
  max-width: 42rem;
  font-size: clamp(0.875rem, 1.75vw, 1.125rem);
  font-weight: 400;
  line-height: 1.6;
  color: #4b5563;
  white-space: normal !important;
}

@media (max-width: 768px) {
  .section-header {
    margin-bottom: 0.75rem;
  }

  .section-header__title {
    font-size: clamp(1.2rem, 5.5vw, 1.85rem) !important;
    line-height: 1.25;
    margin-bottom: 0.35rem;
  }

  .section-header__subtitle {
    font-size: clamp(0.68rem, 3vw, 0.875rem) !important;
    line-height: 1.45;
    padding-inline: 0.25rem;
  }

  /* Home page — tighter vertical rhythm on mobile */
  main#home > section:not(.banner-section) {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  main#home > section.banner-section {
    margin-bottom: 0.5rem !important;
    margin-top: 0.25rem !important;
  }

  main#home .home-stats-bar {
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
  }

  main#home .mt-10 {
    margin-top: 0.875rem !important;
  }

  main#home .home-cta-card {
    padding: 1rem !important;
  }

  main#home .home-cta-card .gap-6 {
    gap: 0.75rem !important;
  }

  main#home .home-cta-card h2 {
    margin-bottom: 0.5rem !important;
  }

  main#home .home-cta-card .mb-4 {
    margin-bottom: 0.5rem !important;
  }

  main#home .partners-row {
    padding-block: 0.25rem;
  }

  main#home .partners-row + p,
  main#home section:has(.partners-row) > div > p.mb-4 {
    margin-bottom: 0.5rem !important;
  }
}

/* Home — video cards (width ×0.7, height ×0.5) */
.home-videos-grid {
  max-width: 56rem; /* 70% of max-w-7xl (80rem) */
  margin-inline: auto;
}

.home-video-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  border-radius: 0.625rem;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
  border: 1px solid #f3f4f6;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 640px) {
  .home-video-card {
    flex-direction: row;
    min-height: 6.5rem;
  }
}

@media (min-width: 1024px) {
  .home-video-card {
    flex-direction: column;
    min-height: auto;
  }
}

.home-video-card:not(.home-video-card--soon):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
}

.home-video-card__cover {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-video-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 640px) {
  .home-video-card__cover {
    width: 48%;
    max-width: 18rem;
    aspect-ratio: 16 / 9;
    min-height: 0;
    align-self: center;
  }
}

@media (min-width: 1024px) {
  .home-video-card__cover {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 9;
    min-height: auto;
    max-height: none;
  }
}

.home-video-card__cover--placeholder {
  background: #e5e7eb;
}

.home-video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 1.125rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.home-video-card:hover .home-video-card__play {
  opacity: 1;
}

.home-video-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.5rem 0.625rem;
  min-height: 0;
}

@media (min-width: 640px) {
  .home-video-card__body {
    padding: 0.625rem 0.75rem;
  }
}

.home-video-card--soon {
  cursor: default;
  opacity: 0.85;
}

.dropdown-menu {
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(-10px);
  opacity: 0;
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
}

/* Services section layout */
.services-grid {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.service-item {
  flex: 1 1 0;
}

.service-item.small {
  flex: 1 1 0;
}

.service-item.large {
  flex: 2 1 0; /* make center card visibly larger */
}

.service-media {
  display: block;
  overflow: hidden;
  border-radius: 1rem;
  aspect-ratio: 4 / 3;
  box-shadow: 0 14px 38px #0000001f;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-footer-btn);
}

.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.service-media:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.16);
}

.service-media:hover img {
  transform: scale(1.05);
}

/* Icon inside service card */
.service-icon {
  width: 64px;
  height: 64px;
  opacity: 0.9;
  transition: transform 0.35s ease, filter 0.35s ease, opacity 0.35s ease;
}

.service-icon.emphasized {
  width: 88px;
  height: 88px;
}

.service-media:hover .service-icon {
  transform: scale(1.12);
  filter: saturate(1.15) brightness(1.15);
  opacity: 1;
}

.service-title {
  margin: 0.75rem 0 0;
  text-align: center;
  color: #0f172a; /* slate-900 */
  font-weight: 700;
  font-size: 1.25rem;
}

/* Gradient backgrounds for service cards */
.grad-ai {
  background: linear-gradient(135deg, #4f46e5 0%, #22d3ee 100%);
}

.grad-fab {
  background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
}

.grad-research {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

@media (max-width: 1024px) {
  .service-item.large {
    flex: 1.3 1 0;
  }
}

@media (max-width: 768px) {
  .services-grid {
    flex-direction: column;
  }
  .service-item,
  .service-item.large,
  .service-item.small {
    flex: 1 1 auto;
  }
  .service-media {
    aspect-ratio: 16 / 9;
  }
}

/* Optional placeholder fallback */
.service-placeholder {
  background: #b2aca4; /* neutral gray-beige similar to sample */
  color: var(--color-footer-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Breadcrumb Navigation */
.breadcrumb {
  padding: 1rem 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.breadcrumb-container {
  max-width: 80rem; /* 7xl equivalent */
  margin: 0 auto;
  padding: 0 1rem;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb-link {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--color-card);
}

.breadcrumb-separator {
  color: #9ca3af;
  margin: 0 0.25rem;
}

.breadcrumb-current {
  color: var(--color-card);
  font-weight: 500;
}

/* RTL support for breadcrumbs */
.rtl .breadcrumb-list {
  direction: rtl;
}

/* Topic Navigation (for News page) */
.topic-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2rem;
}

.topic-nav-item {
  display: flex;
  align-items: center;
  color: var(--color-card);
  text-decoration: none;
  font-size: 1.125rem; /* Increased from 0.95rem to 1.125rem (18px) */
  font-weight: 500;
  transition: color 0.2s ease, font-weight 0.2s ease, font-size 0.2s ease;
  padding: 0.5rem 0;
}

.topic-nav-item:hover {
  color: var(--color-card-hover);
  font-weight: 600;
  font-size: 1.1875rem; /* Slightly bigger on hover (19px) */
}

.topic-nav-item::before {
  content: ">";
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.rtl .topic-nav-item::before {
  content: "<";
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.topic-nav-item:first-child::before {
  display: none;
}

.topic-nav-item.active {
  color: var(--color-card-hover);
  font-weight: 600;
}

/* Topic navigation with title + subtitle (Products & Experiences) */
.topic-navigation--subtitles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 0 1.5rem;
  border-bottom: none;
}

.topic-navigation-sticky {
  position: sticky;
  top: 5.5rem;
  z-index: 40;
  margin-bottom: 2rem;
}

/* Compact single-line sticky topic bar */
.topic-navigation-sticky.topic-navigation--subtitles {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.5rem 0.25rem 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #93c5fd #eff6ff;
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
}

.topic-navigation-sticky.topic-navigation--subtitles::-webkit-scrollbar {
  height: 4px;
}

.topic-navigation-sticky.topic-navigation--subtitles::-webkit-scrollbar-thumb {
  background: #93c5fd;
  border-radius: 9999px;
}

.topic-navigation--subtitles .topic-nav-item {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.25rem;
  padding: 0.875rem 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  min-height: 4.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.topic-navigation--subtitles .topic-nav-item::before {
  display: none;
}

.topic-navigation--subtitles .topic-nav-item:hover {
  font-size: inherit;
  border-color: var(--color-card);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.topic-navigation--subtitles .topic-nav-item.active {
  border-color: var(--color-card);
  background: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.15);
}

.topic-navigation--subtitles .topic-nav-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-card);
}

.topic-navigation--subtitles .topic-nav-item:hover .topic-nav-title,
.topic-navigation--subtitles .topic-nav-item.active .topic-nav-title {
  color: var(--color-card-hover);
}

.topic-navigation--subtitles .topic-nav-subtitle {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.35;
  color: #6b7280;
  max-width: 11rem;
}

.topic-navigation--subtitles .topic-nav-item.active .topic-nav-subtitle {
  color: #4b5563;
}

.topic-navigation-sticky.topic-navigation--subtitles .topic-nav-item {
  flex: 0 0 auto;
  flex-direction: row;
  min-height: unset;
  padding: 0.5rem 0.875rem;
  white-space: nowrap;
  border-radius: 9999px;
  box-shadow: none;
}

.topic-navigation-sticky.topic-navigation--subtitles .topic-nav-item:hover,
.topic-navigation-sticky.topic-navigation--subtitles .topic-nav-item.active {
  transform: none;
  box-shadow: none;
}

.topic-navigation-sticky.topic-navigation--subtitles .topic-nav-item.active {
  background: #fff;
  border-color: var(--color-card);
}

.topic-navigation-sticky.topic-navigation--subtitles .topic-nav-subtitle {
  display: none;
}

.topic-navigation-sticky.topic-navigation--subtitles .topic-nav-title {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.rtl .topic-navigation--subtitles .topic-nav-item {
  text-align: center;
}

.rtl .topic-navigation-sticky.topic-navigation--subtitles .topic-nav-item {
  text-align: center;
}

@media (max-width: 768px) {
  .topic-navigation-sticky {
    top: 4.5rem;
  }

  .topic-navigation--subtitles:not(.topic-navigation-sticky) {
    grid-template-columns: repeat(2, 1fr);
  }

  .topic-navigation--subtitles:not(.topic-navigation-sticky) .topic-nav-subtitle {
    max-width: none;
    font-size: 0.625rem;
  }

  .topic-navigation-sticky.topic-navigation--subtitles .topic-nav-title {
    font-size: 0.75rem;
  }

  .topic-navigation-sticky.topic-navigation--subtitles .topic-nav-item {
    padding: 0.4375rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .topic-navigation--subtitles:not(.topic-navigation-sticky) {
    grid-template-columns: 1fr;
  }
}

/* Articles list (Products & Experiences) */
.articles-list {
  list-style: decimal;
  padding-right: 1.5rem;
  padding-left: 1.5rem;
}

.rtl .articles-list {
  padding-right: 1.5rem;
  padding-left: 1.5rem;
  text-align: right;
}

.articles-list li {
  padding-bottom: 0.25rem;
  text-align: justify;
}

.articles-list li::marker {
  color: var(--color-card);
  font-weight: 600;
}

/* Responsive topic navigation (News & Events style) */
@media (max-width: 768px) {
  .topic-navigation:not(.topic-navigation--subtitles) {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .topic-navigation:not(.topic-navigation--subtitles) .topic-nav-item {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .topic-navigation:not(.topic-navigation--subtitles) .topic-nav-item::before {
    display: none;
  }
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Scroll offset for anchor links (to account for sticky header) */
/* Using JavaScript for more precise control, but keeping minimal CSS offset as fallback */
section[id],
div[id] {
  scroll-margin-top: 0; /* JavaScript handles the offset precisely */
}

/* Go to Top Button */
.go-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--color-footer-btn);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0;
  transform: translateY(20px);
}

.go-to-top.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.go-to-top:hover {
  background-color: var(--color-footer-btn-hover);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.go-to-top:active {
  transform: translateY(0);
}

.go-to-top i {
  font-size: 1.25rem;
}

/* RTL support for go to top button */
.rtl .go-to-top {
  right: auto;
  left: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .go-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
  }

  .rtl .go-to-top {
    right: auto;
    left: 1.5rem;
  }
}

/* Mobile-specific logo and header adjustments */
@media (max-width: 768px) {
  /* Smaller logo on mobile — transparent PNG, tight gap to title */
  header .logo-container {
    width: 2.25rem !important;
    height: 2.25rem !important;
    overflow: visible !important;
    flex-shrink: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  header .logo-container img {
    object-fit: contain !important;
  }

  header .flex.items-center.gap-3,
  header .flex.items-center.space-x-3 {
    gap: 0.375rem !important;
  }

  /* Reserve space for fixed language box + hamburger menu */
  html[dir="ltr"] header .flex.justify-start.items-center {
    padding-right: 7rem;
  }

  html[dir="rtl"] header .flex.justify-start.items-center {
    padding-left: 7rem;
  }

  .fixed-language-container {
    top: 0.75rem;
    gap: 0.5rem;
  }

  html[dir="ltr"] .fixed-language-container {
    right: 0.75rem;
  }

  html[dir="rtl"] .fixed-language-container {
    left: 0.75rem;
  }

  /* Smaller Cultural heritage studies research laboratory text on mobile - prevent wrapping, show full text */
  header h1 {
    font-size: clamp(0.75rem, 2vw, 1rem) !important;
    line-height: 1.25rem !important;
    white-space: nowrap !important;
  }

  /* English title is longer — scale down to avoid overlap */
  html[dir="ltr"] header h1 {
    font-size: clamp(0.6rem, 1.6vw, 0.8rem) !important;
    line-height: 1.1rem !important;
  }

  /* Smaller subtitle on mobile - show full text */
  header p.text-sm {
    font-size: clamp(0.5rem, 1.2vw, 0.625rem) !important;
    line-height: 0.875rem !important;
    white-space: nowrap !important;
  }

  html[dir="ltr"] header p.text-sm {
    font-size: clamp(0.45rem, 1vw, 0.55rem) !important;
    line-height: 0.75rem !important;
  }

  /* Prevent all headings from wrapping on mobile - reduce font size instead of truncating */
  h1 {
    white-space: nowrap !important;
    font-size: clamp(0.875rem, 2.5vw, 1.5rem) !important;
  }

  h2 {
    white-space: nowrap !important;
    font-size: clamp(0.75rem, 2vw, 1.25rem) !important;
  }

  h3 {
    white-space: nowrap !important;
    font-size: clamp(0.7rem, 1.8vw, 1.1rem) !important;
  }

  h4,
  h5,
  h6 {
    white-space: nowrap !important;
    font-size: clamp(0.65rem, 1.5vw, 1rem) !important;
  }

  /* Prevent buttons from wrapping text - reduce font size */
  button,
  .btn,
  [role="button"] {
    white-space: nowrap !important;
    font-size: clamp(0.65rem, 1.5vw, 0.875rem) !important;
  }

  /* Specific styling for gray-900 buttons to be narrow and single-line */
  .bg-gray-900.text-white,
  button.bg-gray-900,
  a.bg-gray-900 {
    white-space: nowrap !important;
    font-size: clamp(0.6rem, 1.4vw, 0.8rem) !important;
    padding: 0.375rem 0.75rem !important; /* Smaller padding for narrow button */
  }

  /* Prevent navigation links from wrapping */
  .nav-link,
  nav a,
  nav button {
    white-space: nowrap !important;
    font-size: clamp(0.7rem, 1.6vw, 0.875rem) !important;
  }

  /* Prevent dropdown buttons from wrapping */
  .dropdown-toggle,
  .dropdown button {
    white-space: nowrap !important;
    font-size: clamp(0.7rem, 1.6vw, 0.875rem) !important;
  }

  /* Ensure header text container doesn't shrink too much */
  header .flex.items-center.space-x-3 > div:last-child {
    flex-shrink: 0;
    min-width: 0;
    max-width: 100%;
  }

  /* Ensure header logo and text fit on one line */
  header .flex.justify-between {
    flex-wrap: nowrap;
  }

  /* Adjust header text container to prevent wrapping - allow text to be visible */
  header .flex.items-center > div:last-child {
    min-width: 0;
    flex: 1 1 auto;
  }
}

/* Header layout - Logo always on left side */
header .flex.justify-end {
  justify-content: flex-start !important;
}

/* Ensure logo container stays on left in all cases */
@media (max-width: 768px) {
  header .flex.justify-end {
    justify-content: flex-start !important;
  }
}

/* Fixed Language Box & Hamburger Container - Right side for LTR (English) */
.fixed-language-container {
  position: fixed;
  top: 0.65rem;
  right: 1rem;
  left: auto;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-direction: row; /* LTR order: Language → Hamburger (reading left to right) */
}

/* RTL (Farsi): Move to left side, reverse order (Hamburger → Language) */
.rtl .fixed-language-container {
  right: auto;
  left: 1rem;
  flex-direction: row-reverse; /* RTL order: Hamburger → Language (reading right to left) */
}

/* Fixed Social Icons - Hidden (moved to mobile menu) */
.fixed-social-icons {
  display: none;
}

/* Mobile Social Icons in Hamburger Menu */
.mobile-social-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
}

.mobile-social-icons .social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-social-icons .social-icon:hover {
  transform: scale(1.1);
}

/* Language Box Styles */
.language-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.language-menu-title {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0.5rem;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  font-size: 1.25rem;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  margin: 0;
  box-sizing: border-box;
}

.language-menu-title:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
  transform: scale(1.05);
}

.language-menu-title i {
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-menu-options {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 60px;
  z-index: 101;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.language-box:hover .language-menu-options,
.language-box:focus-within .language-menu-options,
.language-menu-options.show {
  display: flex !important;
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.language-menu-options li {
  margin: 0;
  padding: 0;
}

.language-option-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background-color: white;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.language-option-btn:hover {
  background-color: #f3f4f6;
  border-color: rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

.language-option-btn.active {
  background-color: var(--color-card);
  color: white;
  border-color: var(--color-card);
}

.language-option-btn.active:hover {
  background-color: var(--color-card-hover);
  border-color: var(--color-card-hover);
}

/* RTL Support for Language Box */
.rtl .language-box {
  align-items: flex-start;
}

.rtl .language-menu-options {
  right: auto;
  left: 0;
}

/* Hamburger menu styles */
.hamburger-menu {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  z-index: 100;
  position: relative;
}

.hamburger-menu span {
  width: 25px;
  height: 3px;
  background-color: var(--color-card);
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile navigation menu */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-nav.active {
  display: block;
  max-height: 1000px;
  transition: max-height 0.5s ease-in;
}

.mobile-nav nav {
  padding: 1rem;
}

.mobile-nav .nav-link {
  display: block;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

.mobile-nav .nav-link:hover {
  background-color: var(--color-bg);
  color: var(--color-card);
}

.mobile-nav .dropdown {
  position: relative;
}

.mobile-nav .dropdown-menu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  box-shadow: none;
  border: none;
  background-color: var(--color-bg);
  margin-top: 0;
  padding-left: 1.5rem;
  display: none;
}

.mobile-nav .dropdown.active .dropdown-menu {
  display: block;
}

.mobile-nav .dropdown-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rtl .mobile-nav .dropdown-toggle {
  text-align: right;
}

.mobile-nav .dropdown-toggle i {
  transition: transform 0.3s ease;
}

.mobile-nav .dropdown.active .dropdown-toggle i {
  transform: rotate(180deg);
}

/* Hide desktop navigation on mobile */
@media (max-width: 768px) {
  .desktop-nav {
    display: none !important;
  }

  .fixed-language-container {
    display: flex;
  }

  .hamburger-menu {
    display: flex;
  }
}

/* Show desktop navigation on larger screens */
@media (min-width: 769px) {
  .mobile-nav {
    display: none !important;
    max-height: 0 !important;
  }

  .mobile-nav.active {
    display: none !important;
    max-height: 0 !important;
  }

  .hamburger-menu {
    display: none !important;
  }

  .fixed-language-container {
    display: flex;
  }
}

@media (max-width: 480px) {
  /* Ensure all headings stay on one line on very small screens - reduce font size */
  h1 {
    white-space: nowrap !important;
    font-size: clamp(0.75rem, 2vw, 1rem) !important;
  }

  h2 {
    white-space: nowrap !important;
    font-size: clamp(0.7rem, 1.8vw, 0.95rem) !important;
  }

  h3 {
    white-space: nowrap !important;
    font-size: clamp(0.65rem, 1.6vw, 0.85rem) !important;
  }

  h4,
  h5,
  h6 {
    white-space: nowrap !important;
    font-size: clamp(0.6rem, 1.4vw, 0.75rem) !important;
  }

  /* Ensure buttons don't wrap - smaller font */
  button,
  .btn,
  [role="button"] {
    white-space: nowrap !important;
    font-size: clamp(0.6rem, 1.3vw, 0.75rem) !important;
  }

  /* Gray-900 buttons - even smaller for narrow buttons */
  .bg-gray-900.text-white,
  button.bg-gray-900,
  a.bg-gray-900 {
    white-space: nowrap !important;
    font-size: clamp(0.55rem, 1.2vw, 0.7rem) !important;
    padding: 0.25rem 0.5rem !important;
  }

  /* Header adjustments for very small screens */
  header h1 {
    font-size: clamp(0.7rem, 1.8vw, 0.875rem) !important;
    white-space: nowrap !important;
  }

  header p.text-sm {
    font-size: clamp(0.45rem, 1vw, 0.5rem) !important;
    white-space: nowrap !important;
  }
}

/* Footer Mobile Responsive Styles */
footer,
footer.site-footer {
  position: relative;
  background-color: #111827;
  color: #ffffff;
}

footer.site-footer h3,
footer.site-footer h4,
footer.site-footer p,
footer.site-footer span,
footer.site-footer li,
footer.site-footer a,
footer.site-footer .fas,
footer.site-footer .fab {
  color: #ffffff;
}

footer.site-footer a:hover {
  color: rgba(255, 255, 255, 0.85);
}

.rtl .site-brand-heading .brand-title {
  font-family: "Kalameh", "Vazirmatn", "Tahoma", sans-serif;
  font-weight: 700;
}

.rtl .site-brand-heading .brand-tagline {
  font-family: "Kalameh", "Vazirmatn", "Tahoma", sans-serif;
  font-weight: 400;
}

/* Site brand heading */
.site-brand-heading .brand-title {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.site-brand-heading h1.brand-title {
  font-size: 1.125rem;
  line-height: 1.2;
}

.site-brand-heading .brand-line {
  display: block;
  white-space: nowrap;
}

.site-brand-heading .brand-tagline {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.35;
}

.site-brand-heading--footer .brand-title {
  font-size: 1.0625rem;
  line-height: 1.35;
}

.site-brand-heading--footer .brand-tagline {
  font-size: 0.875rem;
  margin-top: 0.4rem;
  white-space: nowrap;
}

/* Footer brand — logo beside title */
footer .footer-brand-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

footer .footer-brand-row .site-brand-heading--footer {
  flex: 1;
  min-width: 0;
}

footer .footer-brand-logo {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  padding: 0.375rem;
  border-radius: 0.375rem;
}

/* Footer columns — strict 4 equal parts */
footer .footer-columns-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 768px) {
  footer .footer-columns-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  footer .footer-columns-grid {
    grid-template-columns: 1.35fr 1fr 1.15fr 0.85fr;
    gap: 1rem;
  }

  /* Contact content fills the column edge; add buffer before Resources */
  footer .footer-columns-grid > .footer-col:nth-child(3),
  footer .grid > div:nth-child(3) {
    padding-inline-end: 1.25rem;
  }

  footer .footer-columns-grid > .footer-col:nth-child(4),
  footer .grid > div:nth-child(4) {
    padding-inline-start: 1.25rem;
  }
}

footer .footer-col {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

footer .footer-col h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

footer ul.space-y-3 li .fa-clock + span {
  white-space: nowrap;
}

/* Footer column grids (overrides Tailwind gap-8) */
footer .grid {
  gap: 1rem !important;
}

@media (min-width: 1024px) {
  footer .grid {
    grid-template-columns: 1.35fr 1fr 1.15fr 0.85fr !important;
  }
}

/* Mobile Footer — full homepage footer, stacked layout */
@media (max-width: 768px) {
  footer,
  footer.site-footer {
    padding-top: 2rem !important;
    padding-bottom: 1.5rem !important;
    max-height: none !important;
    overflow: visible !important;
  }

  footer .footer-main-grid,
  footer .footer-columns-grid,
  footer .grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }

  footer .footer-columns-grid > .footer-col:nth-child(3),
  footer .footer-columns-grid > .footer-col:nth-child(4),
  footer .grid > div:nth-child(3),
  footer .grid > div:nth-child(4) {
    padding-inline: 0 !important;
  }

  footer .footer-col h4,
  footer h4.text-lg.font-semibold.mb-4.text-white {
    display: block !important;
    font-size: 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  footer .footer-brand-row {
    gap: 0.625rem;
  }

  footer .footer-brand-logo {
    width: 2.75rem;
    height: 2.75rem;
  }

  footer .footer-logo-container {
    width: 2.75rem !important;
    height: 2.75rem !important;
  }

  footer .site-brand-heading h3 {
    font-size: 0.9375rem !important;
  }

  footer .site-brand-heading .brand-line {
    white-space: normal;
  }

  footer .footer-col-about .site-brand-heading .brand-tagline {
    display: block !important;
    white-space: normal;
    font-size: 0.8125rem;
    margin-top: 0.35rem;
  }

  footer .footer-col-about .flex.space-x-4 {
    margin-top: 0.5rem !important;
  }

  footer ul.space-y-2\.5,
  footer ul.space-y-3,
  footer .footer-col ul {
    gap: 0.625rem;
  }

  footer .footer-col ul li {
    display: flex !important;
  }

  footer .footer-col ul li span,
  footer .footer-col ul li a {
    font-size: 0.8125rem !important;
    line-height: 1.45 !important;
  }

  footer ul.space-y-3 li .fa-clock + span {
    white-space: normal;
  }

  footer .border-t {
    padding-top: 1.25rem !important;
    margin-top: 0 !important;
  }

  footer .border-t > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    text-align: start !important;
    gap: 1rem !important;
  }

  footer .border-t > div > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
  }

  footer .border-t > div > div:first-child > div:first-child {
    display: flex !important;
  }

  footer .border-t p.text-white,
  footer .border-t p.text-gray-400 {
    font-size: 0.75rem !important;
    line-height: 1.45 !important;
    text-align: start !important;
    margin: 0 !important;
  }

  footer .border-t > div > div:last-child {
    width: 100%;
    justify-content: flex-start !important;
    gap: 1rem !important;
  }

  footer .border-t a {
    font-size: 0.8125rem !important;
    padding: 0 !important;
  }

  footer .border-t img.h-10 {
    height: 2.25rem !important;
  }
}

@media (max-width: 480px) {
  footer,
  footer.site-footer {
    padding-top: 1.75rem !important;
    padding-bottom: 1.25rem !important;
  }

  footer .footer-main-grid,
  footer .footer-columns-grid,
  footer .grid {
    gap: 1.25rem !important;
  }

  footer .site-brand-heading h3 {
    font-size: 0.875rem !important;
  }

  footer .footer-col h4,
  footer h4.text-lg.font-semibold.mb-4.text-white {
    font-size: 0.9375rem !important;
  }

  footer .footer-col ul li span,
  footer .footer-col ul li a {
    font-size: 0.78125rem !important;
  }

  footer .border-t p.text-white,
  footer .border-t p.text-gray-400 {
    font-size: 0.6875rem !important;
  }
}

/* Landscape mobile — two columns where space allows */
@media (max-width: 768px) and (orientation: landscape) {
  footer .footer-main-grid,
  footer .footer-columns-grid,
  footer .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }
}
/* Add this if you want extra smooth transitions and specific "Bento" behavior */
.partner-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.partner-card:hover {
  transform: translateY(-5px);
}

/* Ensures logos never touch the edges of their bento box */
.partner-card img {
  padding: 10%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Books page — clean bento layout */
.books-page-bento {
  max-width: 72rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.books-page-bento__lead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 48rem;
  margin-inline: auto;
  width: 100%;
}

.books-page-bento__books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
  width: 100%;
}

.books-page-bento__footer {
  display: grid;
  grid-template-columns: 1fr;
}

.books-bento-cell {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.books-bento-book {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.25s ease;
}

.books-bento-book:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.books-bento-intro {
  padding: 1.75rem 2rem;
  width: 100%;
  text-align: center;
}

.books-bento-intro p {
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.75;
  text-align: center;
}

.books-bento-intro p + p {
  margin-top: 1rem;
}

.books-bento-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  text-align: center;
  width: 100%;
  max-width: 18rem;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
}

.books-bento-stat-number {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
  color: #2563eb;
  margin-bottom: 0.5rem;
}

.books-bento-stat-label {
  color: #4b5563;
  font-weight: 600;
  font-size: 0.875rem;
}

.books-bento-upcoming {
  padding: 1.5rem;
  height: 100%;
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.625rem;
}

.books-bento-upcoming h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #92400e;
}

.books-bento-upcoming p {
  font-size: 0.8125rem;
  color: #57534e;
  line-height: 1.6;
  text-align: justify;
}

.books-bento-book-cover {
  flex-shrink: 0;
  height: 18rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.books-bento-book-cover img {
  height: 16rem;
  width: auto;
  max-width: calc(100% - 0.5rem);
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.books-bento-book--hero .books-bento-book-cover {
  height: 18.5rem;
}

.books-bento-book--hero .books-bento-book-cover img {
  height: 16.5rem;
}

.books-bento-book:hover .books-bento-book-cover img {
  transform: scale(1.03);
}

.books-bento-book-body {
  flex: 1;
  padding: 1rem 1.125rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 7.5rem;
}

.books-bento-book-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.5;
  flex: 1;
}

.books-bento-book-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2563eb;
  transition: color 0.2s ease;
  margin-top: auto;
}

.books-bento-book-link:hover {
  color: #1e40af;
}

.books-bento-contact {
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
}

.books-bento-contact p {
  font-size: 0.875rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.books-bento-contact a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.625rem;
  background: #2563eb;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s ease;
}

.books-bento-contact a:hover {
  background: #1d4ed8;
}

@media (min-width: 1024px) {
  .books-page-bento__books {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .books-bento-book-cover {
    height: 20rem;
  }

  .books-bento-book-cover img {
    height: 18rem;
  }
}

@media (min-width: 1280px) {
  .books-page-bento__books {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .books-bento-book-cover {
    height: 16rem;
  }

  .books-bento-book-cover img {
    height: 14rem;
  }
}

@media (max-width: 639px) {
  .books-page-bento__books {
    grid-template-columns: 1fr;
  }

  .books-bento-stat-number {
    font-size: 2.25rem;
  }
}

/* News Page Image Hover Effects */

/* Seminar article images */
article.bg-white.rounded-xl.shadow-lg img {
  transition: transform 0.4s ease, filter 0.4s ease;
}

article.bg-white.rounded-xl.shadow-lg:hover img {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* Pre-lab seminar images */
.pre-lab-image {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.pre-lab-image:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Industry communication article images */
article.bg-white\/95.rounded-2xl img {
  transition: transform 0.4s ease, filter 0.4s ease;
}

article.bg-white\/95.rounded-2xl:hover img {
  transform: scale(1.03);
  filter: brightness(1.05) saturate(1.1);
}

/* Honor & achievements images */
article.bg-white.rounded-2xl img {
  transition: transform 0.4s ease, filter 0.4s ease;
}

article.bg-white.rounded-2xl:hover img {
  transform: scale(1.06);
  filter: brightness(1.08);
}

/* Research position image */
article.bg-white.rounded-3xl img {
  transition: transform 0.4s ease, filter 0.4s ease;
}

article.bg-white.rounded-3xl:hover img {
  transform: scale(1.02);
  filter: brightness(1.03);
}

/* Gallery modal images */
#seminarModalGallery img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

#seminarModalGallery img:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* About page – team member portraits */
.team-members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .team-members-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
  }

  .team-members-grid--pairs {
    grid-template-columns: repeat(2, 1fr);
    max-width: calc(50% - 0.625rem);
    margin-left: auto;
    margin-right: auto;
  }
}

.team-members-grid--pairs {
  margin-top: 1rem;
}

.team-member-card {
  background-color: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.25rem 0.75rem;
  text-align: center;
}

.team-member-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.team-member-role {
  font-size: 0.8rem;
  color: #6b7280;
}

.team-portrait {
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 auto 0.875rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .team-portrait {
    width: 6.5rem;
    height: 6.5rem;
  }
}

.team-portrait:hover {
  border-color: #1e3a8a;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.25);
}

.team-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.team-portrait:hover img {
  transform: scale(1.1);
}

.team-portrait--placeholder {
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.team-portrait--director {
  width: 12rem;
  height: auto;
  aspect-ratio: 3 / 4;
  max-width: 100%;
  border-radius: 0.75rem;
}
