/* ============================================================
   شرکت تعاونی توسعه و عمران شهرستان قم — homepage
   ============================================================ */

@font-face {
  font-family: 'pinar';
  src: url('assets/Ray-Medium.woff') format('woff');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* greens / teals */
  --green-900: #0c2d2d;
  --green-800: #203c3c;
  --green-700: #2c4545;
  --teal-600: #106a6a;
  --teal-500: #106874;
  --teal-panel: rgba(46, 126, 119, 0.59);
  --dark-mobile: #003535;
  --dark-footer-mobile: #0a2934;

  /* sands / browns */
  --brown: #b26b2d;
  --sand-1: #efc792;
  --sand-2: #d8893f;
  --orange: #d28f44;

  /* neutrals */
  --nav-text: #003333;
  --card: #d1d5db;
  --gray-100: #f3f4f6;
  --emerald: #065f46;
  --white: #fff;

  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
  --header-h: 176px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'pinar', Vazirmatn, Tahoma, system-ui, sans-serif;
  background: linear-gradient(to right, var(--green-900), var(--green-700));
  color: var(--white);
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 3px solid var(--sand-1);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, p { margin: 0; }

/* ============================================================
   HEADER
   ============================================================ */

.header-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

.navbar {
  position: relative;
  display: flex;
  justify-content: flex-start; /* RTL start == flush right, as on the original */
  height: 132px;
  background-color: var(--gray-100);
  background-image: url('assets/navbar.png');
  background-size: cover;
  background-position: center;
}

.navbar-inner {
  display: flex;
  flex-direction: column;
  width: 70vw;
}

.navbar-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: 80px;
}

.navbar-logo { margin: .5rem; }   /* first in DOM => rightmost in RTL */
.navbar-logo img { height: 64px; width: auto; }

.navbar-title {
  margin-right: 1rem;
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.navbar-bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
  height: 52px;
}

.nav-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  width: 66.666%;
  background-image: linear-gradient(to right, var(--sand-1), var(--sand-2));
  color: var(--nav-text);
  font-size: 1.125rem;
  font-weight: 600;
}

.nav-links a {
  padding: 0 .5rem;
  transition: color .2s ease;
}
.nav-links a:hover,
.nav-links a[aria-current='page'] { color: #7a2f0a; }

.nav-actions {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  width: 33.333%;
  overflow: hidden;
}

.nav-actions a {
  background: var(--teal-600);
  color: var(--white);
  font-size: 1.125rem;
  text-align: center;
  border-radius: .5rem;
  padding: .5rem 1rem;
  transition: background .2s ease, transform .2s ease;
  white-space: nowrap;
}
.nav-actions a:hover { background: #0d5555; transform: translateY(-1px); }
.nav-actions a + a { margin-right: .5rem; }

.navbar-emblem {
  position: absolute;
  top: 0;
  left: 0;
  width: 126px;
  height: 132px;
}
.navbar-emblem img { height: 113px; width: 126px; }

/* mobile header (hidden on desktop) */
.mobile-navbar,
.mobile-menu { display: none; }

/* ============================================================
   MARQUEE
   ============================================================ */

.marquee-container {
  width: 100%;
  overflow: hidden;
  background: var(--gray-100);
  padding: .5rem 0;
}

.marquee-viewport {
  position: relative;
  display: flex;
  overflow-x: hidden;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
}

.marquee-track--clone {
  position: absolute;
  top: 0;
  left: 100%;
}

.marquee-track span {
  margin-right: 1rem;
  color: var(--emerald);
  font-weight: 500;
  font-size: 1.25rem;
  display: inline-block;
}

.marquee-container:hover .marquee-track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ============================================================
   GENERIC CAROUSEL
   ============================================================ */

.carousel-viewport { overflow: hidden; width: 100%; }

.carousel-track {
  display: flex;
  flex-direction: row;
  will-change: transform;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

.carousel-slide { flex: 0 0 auto; }

.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  padding: 1rem 0;
}

.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.carousel-dots button[aria-selected='true'] {
  background: #2e8bff;
  transform: scale(1.35);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  width: 100%;
  height: 740px;
  margin-bottom: 2.5rem;
}

.hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-slider .carousel-viewport,
.hero-slider .carousel-track { height: 100%; }
.hero-slider .carousel-slide { width: 100%; height: 100%; }
.hero-slider img { width: 100%; height: 100%; object-fit: cover; }

.hero picture {
  display: block;
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
}

.hero-overlay {
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.hero-divider {
  height: 40px;
  background: var(--brown);
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */

.section-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.section-heading h2 {
  width: 25%;
  padding: 1rem;
  text-align: center;
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 600;
  border-end-start-radius: 1rem;
  border-end-end-radius: 1rem;
}

.section-heading--news { padding-top: 0; }
.section-heading--news h2 { background: var(--brown); }

.section-heading--honors {
  margin-top: 2.5rem;
  height: 40px;
  box-shadow: 0 -30px 20px -7px var(--green-800);
}
.section-heading--honors h2 {
  background: var(--green-800);
  margin-bottom: -5rem;
}

/* ============================================================
   NEWS SECTION
   ============================================================ */

.news-section {
  padding-bottom: 1rem;
  background-color: var(--teal-panel);
  background-image: url('assets/cover-1.png');
  background-size: cover;
  background-position: center;
}

.news-section .carousel-slide { width: 33.3333%; }

.news-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 2rem 2rem;
  padding: 2rem 0;
  background: var(--card);
  color: var(--nav-text);
  border-radius: .5rem;
  box-shadow: var(--shadow-xl);
  transition: transform .5s ease-in;
  height: calc(100% - 2rem);
}
.news-card:hover { transform: scale(.9); }

.news-card > img {
  width: 400px;
  max-width: calc(100% - 2rem);
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border-radius: .5rem;
  box-shadow: var(--shadow-xl);
  margin-bottom: 1rem;
}

.news-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 0 1rem;
  flex: 1;
}

.news-card-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--nav-text);
  line-height: 1.6;
}

.news-card-meta {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto;
  font-size: .95rem;
}

.news-card-meta a {
  color: #1d4ed8;
  text-decoration: underline;
}
.news-card-meta time { color: #4b5563; }

/* ============================================================
   HONORS SECTION
   ============================================================ */

.honors-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-height: 70vh;
  background-image: url('assets/footer.png');
  background-size: cover;
  background-position: center;
  padding-top: 2.5rem;
}

.honors-section .carousel-slide { width: 25%; }

.honor-card {
  margin: 0 2rem 1rem;
  padding: 1rem 2.4rem 0;
  background: var(--card);
  color: var(--nav-text);
  border-radius: .5rem;
  box-shadow: var(--shadow-xl);
  transition: transform .5s ease-in;
  height: calc(100% - 1rem);
  display: flex;
  flex-direction: column;
}
.honor-card:hover { transform: scale(.94); }

.honor-card img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  margin: 0 auto;
}

.honor-card h3 {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 1rem .25rem;
  margin-top: auto;
  line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 60vh;
  background-image: url('assets/footer.png');
  background-size: cover;
  background-position: center;
}

.footer-band {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 36vh;               /* the original band is 3/5 of a 60vh footer */
  margin-bottom: 2.5rem;
  padding: 1.5rem 0;
  background-image: linear-gradient(to right, var(--orange), var(--teal-500));
}

.footer-col { width: 33.333%; }

.footer-col--logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  background-image: url('assets/footer-logo-panel.png');
  background-size: cover;
  background-position: center;
}
.footer-col--logo img { width: 300px; height: auto; }

.footer-col--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--white);
}

.footer-links {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  width: 100%;
  gap: .5rem;
}
.footer-links a {
  font-size: 1.125rem;
  font-weight: 600;
  transition: opacity .2s ease;
}
.footer-links a:hover { opacity: .75; }

.footer-phones {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  font-size: 1.05rem;
  direction: ltr;
}

.footer-address { font-size: 1.05rem; text-align: center; }

.footer-col--badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5rem;                       /* the badge PNGs carry a lot of transparent padding */
}
.footer-col--badges img { width: 168px; height: auto; }

.footer-bottom {
  padding-bottom: 1rem;
  text-align: center;
  color: var(--white);
  font-size: .95rem;
  line-height: 1.9;
}
.footer-bottom a { text-decoration: underline; }

/* ============================================================
   RESPONSIVE  (<= 640px)
   ============================================================ */

@media (max-width: 640px) {
  .navbar { display: none; }

  .mobile-navbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1rem;
    background: var(--dark-mobile);
    text-align: right;
  }

  .mobile-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
  }
  .mobile-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: var(--white);
    transition: transform .25s ease, opacity .25s ease;
  }
  .mobile-toggle[aria-expanded='true'] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .mobile-toggle[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
  .mobile-toggle[aria-expanded='true'] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .mobile-title {
    color: var(--white);
    font-size: .95rem;
    font-weight: 600;
    flex: 1;
    text-align: center;
    padding: 0 .5rem;
  }

  .mobile-logo img { height: 42px; width: auto; }

  .mobile-menu {
    display: block;
    background: var(--dark-mobile);
    border-top: 1px solid rgba(255, 255, 255, .15);
    padding: .5rem 1rem 1rem;
  }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu a {
    display: block;
    padding: .75rem .25rem;
    color: var(--white);
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .mobile-menu a.mobile-menu-cta {
    margin-top: .75rem;
    background: var(--teal-600);
    border-radius: .5rem;
    text-align: center;
    border-bottom: 0;
  }

  .marquee-track span { font-size: 1rem; margin-right: 1.5rem; }

  .hero { height: 620px; margin-bottom: 1.5rem; }
  .hero picture { opacity: .9; }
  .hero-overlay { object-fit: cover; }

  .section-heading h2 { width: 100%; font-size: 1.25rem; }
  .section-heading--honors h2 { margin-bottom: -4rem; }

  .news-section .carousel-slide,
  .honors-section .carousel-slide { width: 100%; }

  .news-card { margin: 0 1rem 1.5rem; }
  .honor-card { margin: 0 1rem 1rem; }
  .honor-card img { height: 260px; }

  .honors-section { min-height: 80vh; }

  .footer { min-height: auto; background: var(--dark-footer-mobile); }
  .footer-band {
    flex-direction: column;
    min-height: 0;
    gap: 1.75rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem 1rem;
  }
  .footer-col { width: 100%; }
  .footer-col--logo { justify-content: center; background-image: none; align-self: auto; }
  .footer-col--logo img { width: 200px; }
  .footer-links { flex-wrap: wrap; justify-content: center; gap: .75rem 1.25rem; }
  .footer-col--badges { flex-direction: row; justify-content: center; gap: 0; }
  .footer-col--badges img { width: 150px; }
  .footer-bottom { padding: 0 1rem 1rem; font-size: .85rem; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .marquee-track--clone { display: none; }
  .carousel-track { transition: none; }
  .news-card, .honor-card { transition: none; }
  .news-card:hover, .honor-card:hover { transform: none; }
}
