/* HOME PAGE - mobile responsiveness tweaks */

/* ----- MOBILE GALLERY (carousel -> 2 columns on mobile) ----- */
.mobile-gallery {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.mobile-gallery .gallery-item {
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
}

.mobile-gallery .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mobile-gallery .gallery-caption {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #333;
  padding: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  /* Yozuvlar bir nechta qatorga bo'linishi uchun */
  max-height: 4.2rem;
  /* Maksimal 3 qator uchun cheklov */
  overflow: hidden;
  /* Agar yozuv uzun bo'lsa, ko'p nuqtalar bilan cheklanadi */
  text-overflow: ellipsis;
  /* Uzun yozuvlar uchun ko'p nuqtalar */
}

/* Slightly larger images for larger phones */
@media (min-width: 420px) {
  .mobile-gallery .gallery-item {
    height: 160px;
  }

  .mobile-gallery .gallery-caption {
    font-size: 0.9rem;
    max-height: 4.8rem;
  }
}

@media (min-width: 540px) {
  .mobile-gallery .gallery-item {
    height: 180px;
  }

  .mobile-gallery .gallery-caption {
    font-size: 0.95rem;
    max-height: 5.1rem;
  }
}

/* Ensure desktop carousel remains unchanged */
@media (min-width: 768px) {
  .mobile-gallery {
    display: none;
  }
}

/* ----- CERTIFICATION STEPS ----- */
.certification-step {
  transition: all 0.25s ease;
}

.certification-step .step-number {
  font-size: 1.4rem;
}

@media (max-width: 575.98px) {
  .certification-step {
    padding: 0.9rem;
  }

  .certification-step .step-number {
    font-size: 1.25rem;
  }
}

/* Remove any problematic rule that forced .col-lg-2 to 100% width on small screens */
@media (max-width: 767.98px) {
  .col-lg-2 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }

  .row.g-3>.col-lg-2 {
    padding-left: .5rem;
    padding-right: .5rem;
  }
}

/* ----- Small UI improvements ----- */
.card-img-top,
.gallery-img,
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Reduce heavy shadows on small screens */
@media (max-width: 767.98px) {
  .shadow-sm {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06) !important;
  }
}

/* ===========================
   HOME PAGE - CARDS & TITLES
   Move previously inline styles here
   =========================== */

/* Title with horizontal rules and centered text (like screenshot) */
.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading hr {
  flex-grow: 1;
  border: 0;
  height: 1px;
  background: #dcdcdc;
  margin: 0;
}

.section-heading .title-text {
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
}

/* Keep card appearance same as home cards and specific override for home cards */
.home-cards .card {
  border-radius: .9rem;
}

.home-cards .card-img-top {
  height: 160px;
  /* desktop height */
  object-fit: cover;
  display: block;
  width: 100%;
}

@media (max-width: 575.98px) {
  .home-cards .card-img-top {
    height: 140px;
    /* smaller on mobile to keep proportion */
  }
}

/* Hover shadow consistent with home cards */
.hover-shadow {
  transition: transform .18s ease, box-shadow .18s ease;
}

.hover-shadow:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

/* Rounded helpers */
.rounded-top-4 {
  border-top-left-radius: .9rem !important;
  border-top-right-radius: .9rem !important;
}

.rounded-4 {
  border-radius: .9rem !important;
}

/* Small card text sizes (matching home) */
.card-body-small {
  padding: .75rem;
}

.card-title-small {
  font-size: .98rem;
  margin-bottom: .35rem;
  line-height: 1.1;
}

/* card text clamp: bir nechta qatorni kesish uchun (vendor + standart) */
.card-text-small {
  font-size: .82rem;
  color: #6c757d;

  display: -webkit-box;
  /* WebKit uchun */
  -webkit-box-orient: vertical;
  /* WebKit uchun */
  -webkit-line-clamp: 3;
  /* WebKit uchun — nechta qator ko'rsatilishi kerak */

  display: box;
  /* fallback / eski spec (kamroq ishlatiladi) */
  box-orient: vertical;

  line-clamp: 3;
  /* STANDART tavsiya etilgan xususiyat - linter uchun */
  /* Eslatma: hozirda ko'plab brauzerlar faqat -webkit-line-clamp'ni qo'llaydi,
     ammo line-clamp qo'shish yaxshi amaliyot va linter ogohlantirishini olib tashlaydi */

  overflow: hidden;
  /* agar kerak bo'lsa, pastdagi qoida bilan ellipsis effektini yanada ishonchli qilishingiz mumkin */
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
}

/* agar .gallery-caption yoki boshqa joylarda ham line-clamp ishlatilgan bo'lsa,
   ularni ham shu tartibda yangilang */

/* Footer small */
.card-footer-small {
  background: transparent;
  border-top: 0;
  padding: .55rem .75rem;
  font-size: .78rem;
  color: #6c757d;
}

/* Centered small action button under cards */
.cards-action {
  margin-top: .5rem;
  margin-bottom: 1.5rem;
}

.cards-action .btn-action {
  border-radius: 30px;
  padding: .45rem 1.1rem;
  font-size: .95rem;
  box-shadow: none;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #3cb371;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.cards-action .btn-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  background: #f8fff9;
  text-decoration: none;
}

.cards-action .btn-action:active {
  transform: translateY(-1px) scale(.995);
}

/* Make sure small screens show single column (Bootstrap default col-md-3 -> xs full width) */
/* No extra rule needed, but keep small spacing */
@media (max-width: 575.98px) {
  .section-heading .title-text {
    font-size: .95rem;
  }

  .cards-action .btn-action {
    padding: .42rem .9rem;
    font-size: .9rem;
  }
}

/* Ensure action button is visibly focusable for accessibility */
.cards-action .btn-action:focus {
  outline: 3px solid rgba(60, 179, 113, 0.12);
  outline-offset: 2px;
}


/* ===========================
   HOME PAGE - CARDS & TITLES
   Move previously inline styles here
   =========================== */

/* Title with horizontal rules and centered text (like screenshot) */
.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading hr {
  flex-grow: 1;
  border: 0;
  height: 1px;
  background: #dcdcdc;
  margin: 0;
}

.section-heading .title-text {
  font-size: 1.05rem;
  letter-spacing: 1px;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
}

/* Keep card appearance same as home cards and specific override for home cards */
.home-cards .card {
  border-radius: .9rem;
}

.home-cards .card-img-top {
  height: 160px;
  /* desktop height */
  object-fit: cover;
  display: block;
  width: 100%;
}

@media (max-width: 575.98px) {
  .home-cards .card-img-top {
    height: 140px;
    /* smaller on mobile to keep proportion */
  }
}

/* Hover shadow consistent with home cards */
.hover-shadow {
  transition: transform .18s ease, box-shadow .18s ease;
}

.hover-shadow:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

/* Rounded helpers */
.rounded-top-4 {
  border-top-left-radius: .9rem !important;
  border-top-right-radius: .9rem !important;
}

.rounded-4 {
  border-radius: .9rem !important;
}

/* Small card text sizes (matching home) */
.card-body-small {
  padding: .75rem;
}

.card-title-small {
  font-size: .98rem;
  margin-bottom: .35rem;
  line-height: 1.1;
}

/* Footer small */
.card-footer-small {
  background: transparent;
  border-top: 0;
  padding: .55rem .75rem;
  font-size: .78rem;
  color: #6c757d;
}

/* Centered small action button under cards */
.cards-action {
  margin-top: .5rem;
  margin-bottom: 1.5rem;
}

.cards-action .btn-action {
  border-radius: 30px;
  padding: .45rem 1.1rem;
  font-size: .95rem;
  box-shadow: none;
  border: 1px solid #d0d0d0;
  background: #fff;
  color: #3cb371;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.cards-action .btn-action:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  background: #f8fff9;
  text-decoration: none;
}

.cards-action .btn-action:active {
  transform: translateY(-1px) scale(.995);
}

/* Make sure small screens show single column (Bootstrap default col-md-3 -> xs full width) */
/* No extra rule needed, but keep small spacing */
@media (max-width: 575.98px) {
  .section-heading .title-text {
    font-size: .95rem;
  }

  .cards-action .btn-action {
    padding: .42rem .9rem;
    font-size: .9rem;
  }
}

/* Ensure action button is visibly focusable for accessibility */
.cards-action .btn-action:focus {
  outline: 3px solid rgba(60, 179, 113, 0.12);
  outline-offset: 2px;
}

/* Batafsil tugmasi - yashil dizayn */
.btn-batafsil {
  background-color: #3cb371;
  /* asosiy yashil rang */
  color: #fff;
  /* matn oq bo'lsin */
  font-size: 0.75rem;
  padding: 0.28rem 0.85rem;
  border-radius: 20px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  border: none;
  box-shadow: 0 6px 14px rgba(60, 179, 113, 0.14);
  transition: background-color .12s ease, transform .08s ease, box-shadow .12s ease;
  cursor: pointer;
}

/* Hover / focus holatlari */
.btn-batafsil:hover,
.btn-batafsil:focus {
  background-color: #2e9e57;
  /* hover uchun biroz quyuqroq yashil */
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(46, 158, 87, 0.16);
  text-decoration: none;
  outline: none;
}

/* Kichik ekranlarda biroz kichikroq padding */
@media (max-width: 575.98px) {
  .btn-batafsil {
    padding: 0.22rem 0.6rem;
    font-size: 0.72rem;
  }
}

/* Agar fon kartaning footerida ohangga moslashishi kerak bo'lsa (agar footer text-muted bo'lsa) */
.card-footer-small .btn-batafsil {
  color: #fff;
}


/* home.css yoki extra_css ichiga qo'shilsin */

/* Thumbnail hover zoom */
.gallery-thumb {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: zoom-in;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

/* Make the small side images clickable and preserve cover */
.side-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal nav buttons - make larger tap targets on small screens */
.gallery-nav {
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
}

.gallery-nav:hover {
  opacity: 1;
}




/* mygov badge styles */
.mygov-badge {
  max-width: 420px;
  /* keng ekranda maksimal o'lcham */
  width: 90%;
  /* kichik ekranlarda moslashuv */
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  display: inline-block;
  object-fit: contain;
  background: #ffffff;
}

/* Hover / focus effects */
.mygov-badge:hover,
.mygov-badge:focus {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  filter: saturate(1.05);
  outline: none;
}

/* make sure anchor is keyboard-focus friendly */
.container a[aria-label] {
  outline-offset: 4px;
}

.container a[aria-label]:focus .mygov-badge {
  box-shadow: 0 0 0 4px rgba(60, 179, 113, 0.14);
  /* subtle green focus ring */
}

/* mobile tweaks */
@media (max-width: 576px) {
  .mygov-badge {
    max-width: 280px;
    width: 86%;
  }

  .container p.small {
    font-size: 12px;
  }
}



/* Barcha tugmalar (inactive holat) – faqat chiziqli yashil yozuv */
#newsEventsTab .nav-link {
  background-color: transparent;
  /* fon yo‘q */
  color: #2e9e57;
  /* yashil matn */
  border: 1px solid #2e9e57;
  /* chiziq yashil */
  border-radius: 12px;
  transition: background-color .2s ease, color .2s ease;
}

/* Aktiv (tanlangan/bosilgan) tugma */
#newsEventsTab .nav-link.active,
#newsEventsTab .nav-link.show {
  background-color: #2e9e57;
  /* fon yashil */
  color: #ffffff;
  /* oq matn */
  border-color: #2e9e57;
  /* chiziq ham yashil */
}

/* Hover holati (faqat inactive tugma ustida bo‘lsa) */
#newsEventsTab .nav-link:not(.active):hover {
  background-color: rgba(46, 158, 87, 0.08);
  /* engil yashil fon */
  color: #2e9e57;
  text-decoration: none;
}

/* ========== Ensure stat cards have equal height and consistent title area ========== */

/* Make the column a flex container so its child .stat-card can stretch */
.stats-cards>.col-md-5,
.stats-cards>.col-sm-6,
.stats-cards>.col-12 {
  display: flex;
}

/* Make cards stretch to full height of column and use column layout */
.stats-cards .stat-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* centers content vertically if content shorter */
  align-items: center;
  padding: 18px;
  /* keep padding consistent */
  box-sizing: border-box;
  min-height: 140px;
  /* ensure minimum visible height (adjustable) */
}

/* Keep the icon, title and number spaced consistently */
.stats-cards .stat-card .stat-icon {
  font-size: 2.2rem;
  /* slightly smaller to keep layout stable */
  margin-bottom: 8px;
}

/* Title: limit to max 2 lines and reserve fixed space so cards stay equal */
.stats-cards .stat-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: inherit;
  margin: 0 0 8px;
  line-height: 1.15;
  text-align: center;

  /* clamp to 2 lines and provide reserved height for 2 lines */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.15em * 2.1);
  /* reserve ~2 lines of height (line-height * 2) */
}

/* Number: consistent size */
.stats-cards .stat-card .stat-count {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 6px;
}

/* Visual parity: ensure both cards same border/shadow */
.stats-cards .stat-card {
  border: 1px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
  border-radius: .9rem;
  background: #fff;
}

/* Mobile: stack columns but keep equal-height look via min-height and flex */
@media (max-width: 767.98px) {

  .stats-cards>.col-md-5,
  .stats-cards>.col-sm-6,
  .stats-cards>.col-12 {
    display: block;
    /* revert to normal stacking on very small screens */
  }

  .stats-cards .stat-card {
    min-height: 120px;
    padding: 14px;
  }

  .stats-cards .stat-card .stat-count {
    font-size: 1.8rem;
  }

  .stats-cards .stat-card h3 {
    min-height: calc(1.15em * 2);
  }
}