/* ==========================================================================
   BLOGS: navbar dropdown, articles list, article page
   Load AFTER styles.css. Uses only existing colour variables, so both
   themes work automatically.
   ========================================================================== */

/* ---------- Navbar "Blogs" dropdown ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-dropdown-toggle svg {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
}

.nav-dropdown.is-open .nav-dropdown-toggle svg {
  transform: rotate(180deg);
}

.nav-submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 10px;
  min-width: 280px;
  max-width: 340px;
  list-style: none;
  padding: 8px;
  background-color: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  z-index: 1100;
}

/* Invisible bridge so the menu does not close while the mouse crosses the gap */
.nav-submenu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 12px;
}

.nav-dropdown.is-open .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
  }
}

.nav-submenu li + li {
  border-top: 1px solid var(--border-hairline);
}

.nav-submenu-link {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--ink);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-submenu-link:hover,
.nav-submenu-link:focus-visible {
  background-color: var(--selected);
  color: var(--rose);
}

.nav-submenu li:last-child .nav-submenu-link {
  font-weight: 600;
  color: var(--rose);
}

/* ---------- Page shell ---------- */
.blog-main {
  background-color: var(--bg);
  padding: clamp(118px, 12vw, 150px) 0 var(--section-padding-y);
  min-height: 70vh;
  position: relative;
  z-index: 2;
}

.blog-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.blog-page-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 500;
  font-variation-settings: 'opsz' 48;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 16px;
}

.blog-empty {
  color: var(--ink-soft);
}

/* ---------- Articles list ---------- */
.blog-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.blog-card {
  position: relative;
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--service-hover-gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.blog-card::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background-color: var(--rose);
  transition: width 0.35s ease;
  pointer-events: none;
}

.blog-card:hover,
.blog-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
  border-color: var(--visit-border-hover);
}

.blog-card:hover::before,
.blog-card:focus-within::before {
  opacity: 1;
}

.blog-card:hover::after,
.blog-card:focus-within::after {
  width: 100%;
}

.blog-card-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--selected);
}

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

.blog-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 22px 22px 24px;
}

.blog-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose-label);
}

.blog-card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 1.5vw, 1.32rem);
  font-weight: 500;
  font-variation-settings: 'opsz' 28;
  line-height: 1.28;
  color: var(--ink);
}

.blog-card-summary {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.blog-card-more {
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--rose);
}

/* ---------- Article page ---------- */
.blog-post {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 32px);
}

.blog-back {
  display: inline-block;
  margin-bottom: 28px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--rose);
  transition: transform 0.2s ease;
}

.blog-back:hover {
  transform: translateX(-3px);
}

.blog-post-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  font-variation-settings: 'opsz' 48;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 14px;
}

.blog-post-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-label);
  margin: 0 0 30px;
}

.blog-post-cover {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-card);
  margin: 0 0 34px;
}

.blog-post-body {
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.blog-post-body > * + * {
  margin-top: 1.1em;
}

.blog-post-body h2,
.blog-post-body h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 1.9em;
}

.blog-post-body h2 { font-size: 1.6rem; }
.blog-post-body h3 { font-size: 1.25rem; }

.blog-post-body strong { color: var(--ink); }

.blog-post-body a {
  color: var(--rose);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post-body ul,
.blog-post-body ol {
  padding-left: 1.4em;
}

.blog-post-body li + li {
  margin-top: 0.4em;
}

.blog-post-body blockquote {
  border-left: 3px solid var(--rose);
  background-color: var(--surface);
  border-radius: 0 14px 14px 0;
  padding: 16px 20px;
  color: var(--ink);
}

.blog-post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

.blog-post-body hr {
  border: none;
  border-top: 1px solid var(--border-hairline);
  margin: 2em 0;
}

/* Urdu or Arabic articles */
.blog-post.is-rtl .blog-post-body {
  font-family: var(--font-urdu);
  font-size: 1.15rem;
  line-height: 2.1;
}

.blog-post.is-rtl .blog-post-body blockquote {
  border-left: none;
  border-right: 3px solid var(--rose);
  border-radius: 14px 0 0 14px;
}

/* Call to action under each article */
.blog-post-cta {
  margin-top: 52px;
  padding: clamp(24px, 4vw, 34px);
  background-color: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.blog-post-cta-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 8px;
}

.blog-post-cta-text {
  color: var(--ink-soft);
  margin: 0 0 20px;
}

.blog-post-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.blog-disclaimer {
  margin: 22px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .blog-card::before,
  .blog-card::after,
  .blog-back,
  .nav-submenu,
  .nav-dropdown-toggle svg {
    transition: none;
  }

  .blog-card:hover,
  .blog-back:hover {
    transform: none;
  }
}

/* ---------- Navbar spacing fix (8 menu items) ---------- */
.navbar-container {
  max-width: 1320px;                      /* wider than the page content */
  padding: 0 clamp(20px, 3vw, 48px);      /* less side padding */
  gap: 24px;
}

.nav-brand,
.nav-actions {
  flex-shrink: 0;                         /* never squeezed by the menu */
}

.nav-navigation {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.nav-menu {
  gap: clamp(14px, 1.7vw, 26px);
}

.nav-link {
  white-space: nowrap;
}

/* Smaller laptop screens: tighten a little more */
@media (max-width: 1240px) {
  .nav-menu {
    gap: 14px;
  }

  .nav-link {
    font-size: 0.88rem;
  }

  .nav-sublabel {
    display: none;                        /* the small label under the name */
  }

  .nav-actions .btn-primary-pill {
    padding: 9px 16px;
  }
}