/* Khazana Box - Optimized Custom Stylesheet */

/* Hardware accelerated transitions & smooth scrolling */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: #D4AF37;
  color: #000000;
}

/* Ensure Bootstrap Icons font loads with font-display: swap to eliminate render blocking */
@font-face {
  font-family: "bootstrap-icons";
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/fonts/bootstrap-icons.woff2?1bb88866b4085542c8ed5fb61b9393dd") format("woff2"),
       url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/fonts/bootstrap-icons.woff?1bb88866b4085542c8ed5fb61b9393dd") format("woff");
}

/* Hero Carousel Slide Transitions - Optimized for instant LCP detection */
.hero-slider-slide {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* First slide and active slide are immediately visible without opacity delay */
.hero-slider-slide:first-child,
.hero-slider-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 10;
}

/* Inactive slides smoothly fade out during carousel navigation */
.hero-slider-slide:not(.is-active) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider-slide picture,
.hero-slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Accessible 44x44px Carousel Tab Dots */
.hero-slider-dot {
  position: relative;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
  outline: none;
}

.hero-slider-dot::after {
  content: '';
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.45);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-slider-dot:hover::after,
.hero-slider-dot:focus-visible::after {
  background-color: #D4AF37;
  transform: scale(1.2);
}

.hero-slider-dot.is-active::after {
  width: 26px;
  background-color: #D4AF37;
  border-radius: 9999px;
}

/* Category Circular Frames & Overlap Layout */
.category-circle-card {
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.category-circle-card:hover {
  transform: translateY(-6px);
}

.category-circle-frame {
  position: relative;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  border: 3px solid #D4AF37;
  background-color: #ffffff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.category-circle-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-circle-card:hover .category-circle-frame {
  border-color: #B8860B;
  box-shadow: 0 20px 25px -5px rgba(184, 134, 11, 0.25);
}

.category-circle-card:hover .category-circle-frame img {
  transform: scale(1.08);
}

.category-circle-card:hover .category-name-label {
  color: #B8860B;
}

.category-overlap-grid {
  display: none;
}

@media (min-width: 1024px) {
  .category-overlap-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 10px 0;
  }
}

.category-item {
  margin: 0 -8px;
  position: relative;
  transition: transform 0.3s ease, z-index 0.3s ease;
  z-index: 1;
}

.category-item:hover {
  z-index: 10;
  transform: scale(1.05);
}

/* App-Style Category Navigation Utilities */
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
}

.mobile-category-pill {
  min-height: 40px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Toast Notifications */
#toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  z-index: 9999;
}

#toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Safe Area Padding */
@supports (padding-top: env(safe-area-inset-top)) {
  .safe-area-top {
    padding-top: env(safe-area-inset-top);
  }
  .safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ==========================================================================
   BLOG POST REFINED EDITORIAL STYLES
   ========================================================================== */

/* Reading Progress Indicator */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #D4AF37 0%, #B8860B 100%);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* Article Scroll Anchors */
.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4,
#frequently-asked-questions {
  scroll-margin-top: 110px;
}

/* Rich Article Body Typography */
.blog-article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #374151;
  letter-spacing: -0.003em;
}

.blog-article-content p {
  margin-bottom: 1.4rem;
  color: #374151;
}

.blog-article-content p.lead {
  font-size: 1.18rem;
  line-height: 1.85;
  color: #1f2937;
  font-weight: 400;
  border-left: 3px solid #D4AF37;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.04) 0%, transparent 100%);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border-radius: 0 4px 4px 0;
}

.blog-article-content h2 {
  font-family: var(--font-cinzel, "Cinzel", serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  margin-top: 2.75rem;
  margin-bottom: 1.1rem;
  letter-spacing: 0.01em;
  position: relative;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.blog-article-content h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background-color: #D4AF37;
}

.blog-article-content h3 {
  font-family: var(--font-cinzel, "Cinzel", serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  letter-spacing: 0.01em;
}

.blog-article-content h4 {
  font-family: var(--font-cinzel, "Cinzel", serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.45;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.blog-article-content strong,
.blog-article-content b {
  font-weight: 600;
  color: #111827;
}

.blog-article-content a {
  color: #B8860B;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: all 0.2s ease;
}

.blog-article-content a:hover {
  color: #7a5806;
  text-decoration-thickness: 2px;
}

.blog-article-content ul {
  list-style: none;
  padding-left: 0.25rem;
  margin-bottom: 1.6rem;
  margin-top: 0.5rem;
}

.blog-article-content ul > li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.75;
}

.blog-article-content ul > li::before {
  content: '✦';
  position: absolute;
  left: 0;
  top: 0.05em;
  color: #D4AF37;
  font-size: 0.85rem;
  line-height: 1.75;
}

.blog-article-content ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1.6rem;
}

.blog-article-content ol > li {
  margin-bottom: 0.75rem;
  line-height: 1.75;
  padding-left: 0.35rem;
}

.blog-article-content blockquote {
  position: relative;
  background: #FAF8F5;
  border-left: 4px solid #D4AF37;
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #2c3036;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.04);
}

.blog-article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Callout Highlights within content */
.blog-callout {
  background-color: #FAF7F2;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-left: 4px solid #D4AF37;
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

/* Table of Contents Luxury Card */
.toc-container {
  background: linear-gradient(180deg, #FBFBFB 0%, #F8F7F4 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.04);
}

.toc-link {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toc-link:hover {
  color: #B8860B;
  transform: translateX(4px);
}

/* FAQ Accordion Styling */
.faq-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.faq-card.is-open {
  border-color: #D4AF37;
  box-shadow: 0 4px 14px -2px rgba(212, 175, 55, 0.12);
  background-color: #ffffff;
}

.faq-card .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
}

.faq-card.is-open .faq-answer {
  max-height: 500px;
  opacity: 1;
}

/* Sticky Sidebar Refinements */
@media (min-width: 1024px) {
  .blog-sticky-sidebar {
    position: sticky;
    top: 96px;
    align-self: flex-start;
  }
}

/* ==========================================================================
   LAPTOP & DESKTOP GRID LAYOUT FIXES (Ensures 100% visibility on all viewports)
   ========================================================================== */

/* Robust Article Grid Layout (Mobile -> Laptop -> Desktop) */
.blog-layout-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
}

.blog-main-content {
  width: 100%;
  min-width: 0;
}

.blog-sidebar {
  width: 100%;
}

@media (min-width: 1024px) {
  .blog-layout-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 340px !important;
    gap: 2.5rem !important;
    align-items: start !important;
  }

  .blog-main-content {
    min-width: 0 !important;
    width: 100% !important;
  }

  .blog-sidebar {
    width: 340px !important;
    min-width: 340px !important;
  }

  /* Grid Span Fallbacks for standard 12-column grid */
  .lg\:col-span-1 { grid-column: span 1 / span 1 !important; }
  .lg\:col-span-2 { grid-column: span 2 / span 2 !important; }
  .lg\:col-span-3 { grid-column: span 3 / span 3 !important; }
  .lg\:col-span-4 { grid-column: span 4 / span 4 !important; }
  .lg\:col-span-5 { grid-column: span 5 / span 5 !important; }
  .lg\:col-span-6 { grid-column: span 6 / span 6 !important; }
  .lg\:col-span-7 { grid-column: span 7 / span 7 !important; }
  .lg\:col-span-8 { grid-column: span 8 / span 8 !important; }
  .lg\:col-span-9 { grid-column: span 9 / span 9 !important; }
  .lg\:col-span-10 { grid-column: span 10 / span 10 !important; }
  .lg\:col-span-11 { grid-column: span 11 / span 11 !important; }
  .lg\:col-span-12 { grid-column: span 12 / span 12 !important; }
}

@media (min-width: 1280px) {
  .blog-layout-grid {
    grid-template-columns: minmax(0, 1fr) 370px !important;
    gap: 3rem !important;
  }

  .blog-sidebar {
    width: 370px !important;
    min-width: 370px !important;
  }
}

/* Color Combination & Contrast Enhancements */
.text-gold-accent {
  color: #996515 !important; /* Rich Dark Gold for high-contrast on white (WCAG AA > 5.2:1) */
}

.text-gold-light {
  color: #D4AF37 !important; /* Radiant Royal Gold for dark backgrounds */
}

.bg-gold-subtle {
  background-color: #FAF8F2 !important;
  border-color: rgba(212, 175, 55, 0.3) !important;
}

.border-gold-accent {
  border-color: #D4AF37 !important;
}

.blog-tag-pill {
  background-color: #F3F4F6;
  color: #374151;
  border: 1px solid #E5E7EB;
  transition: all 0.2s ease;
}

.blog-tag-pill:hover {
  background-color: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

/* Concierge Dark Premium Card */
.concierge-dark-card {
  background-color: #141414 !important;
  background-image: linear-gradient(145deg, #1b1b1b 0%, #0c0c0c 100%) !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: 1rem !important;
  color: #ffffff !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5) !important;
  position: relative;
  overflow: hidden;
}

.concierge-dark-card h3 {
  color: #ffffff !important;
}

.concierge-dark-card p {
  color: #d1d5db !important;
}

/* Curated Recommendation Image Thumbnail */
.curated-rec-thumb {
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  border-radius: 0.5rem !important;
  overflow: hidden !important;
  background-color: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.curated-rec-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* The Khazana Box Editorial Journal Header */
.editorial-journal-header {
  position: relative;
  background-color: #0c0c0c;
  overflow: hidden;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.editorial-journal-header .header-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.85);
  transform: scale(1.02);
  pointer-events: none;
}

.editorial-journal-header .header-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.85) 0%, rgba(14, 14, 14, 0.72) 45%, rgba(8, 8, 8, 0.90) 100%);
  pointer-events: none;
}

.editorial-journal-header .header-overlay-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 65%, rgba(0, 0, 0, 0.8) 100%);
  pointer-events: none;
}

/* Handcrafted Pakistani Luxury Banner */
.handcrafted-luxury-banner {
  background-color: #FAF7F2;
  background-image: linear-gradient(135deg, #FDFBF7 0%, #F7F2E8 50%, #ECE4D6 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 1rem;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.handcrafted-luxury-banner .luxury-banner-tag {
  color: #996515 !important;
}

.handcrafted-luxury-banner .luxury-banner-heading {
  color: #0f172a !important; /* Black / dark charcoal */
}

.handcrafted-luxury-banner .luxury-banner-desc {
  color: #334155 !important; /* Dark charcoal */
}

.handcrafted-luxury-banner .luxury-btn-primary {
  background-color: #D4AF37 !important;
  color: #000000 !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
}

.handcrafted-luxury-banner .luxury-btn-primary:hover {
  background-color: #c49b25 !important;
  color: #000000 !important;
}

.handcrafted-luxury-banner .luxury-btn-secondary {
  background-color: #ffffff !important;
  color: #1e293b !important; /* Dark charcoal */
  border: 1px solid #cbd5e1 !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
}

.handcrafted-luxury-banner .luxury-btn-secondary:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important; /* Black */
  border-color: #94a3b8 !important;
}

/* ==========================================================================
   ADMIN PORTAL SCOPED THEME TOKENS & CONTRAST GUARANTEES
   ========================================================================== */
.admin-portal {
  --admin-bg: #0f0f0f;
  --admin-surface: #161616;
  --admin-card: #181818;
  --admin-elevated: #202020;
  --admin-border: #2d2d2d;
  --admin-text-primary: #f9fafb;
  --admin-text-secondary: #d1d5db;
  --admin-text-muted: #9ca3af;
  --admin-gold: #D4AF37;
  --admin-gold-hover: #e3be42;

  background-color: var(--admin-bg) !important;
  color: var(--admin-text-primary) !important;
  color-scheme: dark;
}

.admin-portal h1,
.admin-portal h2,
.admin-portal h3,
.admin-portal h4 {
  color: var(--admin-text-primary);
}

.admin-portal input:not([type="checkbox"]):not([type="radio"]),
.admin-portal textarea,
.admin-portal select {
  background-color: var(--admin-elevated);
  color: var(--admin-text-primary);
  border-color: #374151;
}

.admin-portal input::placeholder,
.admin-portal textarea::placeholder {
  color: var(--admin-text-muted) !important;
  opacity: 1;
}

.admin-portal select option {
  background-color: #181818;
  color: #f9fafb;
}

.admin-portal button:disabled,
.admin-portal input:disabled,
.admin-portal select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Portal Top Section Switcher & Status Filter Pills */
.admin-portal .portal-tab-btn {
  color: #d1d5db;
  background-color: transparent;
}

.admin-portal .portal-tab-btn:hover:not(.is-active) {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.admin-portal .portal-tab-btn.is-active {
  background-color: var(--admin-gold) !important;
  color: #0a0a0a !important;
}

.admin-portal .admin-filter-pill {
  background-color: #222222;
  color: #e5e7eb;
  border: 1px solid #374151;
}

.admin-portal .admin-filter-pill:hover:not(.is-active) {
  background-color: #2c2c2c;
  color: #ffffff;
  border-color: #4b5563;
}

.admin-portal .admin-filter-pill.is-active {
  background-color: var(--admin-gold) !important;
  color: #0a0a0a !important;
  border-color: var(--admin-gold) !important;
}

.admin-portal .admin-filter-pill.is-active i,
.admin-portal .portal-tab-btn.is-active i {
  color: #0a0a0a !important;
}

.admin-portal .portal-tab-btn:focus-visible,
.admin-portal .admin-filter-pill:focus-visible,
.admin-portal button:focus-visible,
.admin-portal a:focus-visible {
  outline: 2px solid var(--admin-gold);
  outline-offset: 2px;
}
