/* ==========================================================================
   LAYERING STRATEGY (z-index ladder)
     -1: global bg    (#dream-global-bg)
      0: content      (cards, prose, etc.)
   5000: header block (nav + search)  -> #site-header
   5600: desktop dropdowns / search panels
   6500: mobile click-shield
   7000: mobile menu panel
   ========================================================================== */

:root { --hdr-h: 72px; }            /* JS updates this from real header height */
html { scroll-padding-top: var(--hdr-h); } /* anchor/TOC jumps clear the header */

/* Optional: if you want to pad content via CSS instead of JS body padding */
.page-with-fixed-header,
.main-with-sticky-header { padding-top: var(--hdr-h); }

/* Headings shouldn't land hidden under the header on anchor jump */
.prose :where(h1,h2,h3,h4,h5,h6) { scroll-margin-top: calc(var(--hdr-h) + 8px); }

/* Global background should never steal clicks */
#dream-global-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* Header (nav + search) sits above all content as one unit */
#site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 5000; isolation: isolate; }

/* Search row now inherits header stacking; no special z-index needed */
#search-row  { position: relative; }

/* Desktop dropdowns (DaisyUI) */
@media (min-width: 640px) {
  .dropdown.dropdown-hover .dropdown-content { position: absolute; z-index: 5600; }
}

/* If your search results render into a panel, keep them above content, below mobile menu */
.aa-Panel,
.aa-DetachedOverlay,
.aa-DetachedContainer,
.DocSearch-Container,
.search-results,
.autocomplete-panel {
  position: fixed; z-index: 5600; pointer-events: auto;
}

/* Mobile menu & shield (from nav.html markup) */
@media (max-width: 639px) {
  .mobile-click-shield { position: fixed; inset: 0; z-index: 6500; }
  .mobile-menu-panel   { position: fixed; z-index: 7000; }
}

/* Content must never rise above header/search */
main, .content, .activity-list, .card-container, .card, .prose, .post-content {
  position: relative;
  z-index: 0;
  overflow: visible;
}

/* ==========================================================================
   GENERAL STYLING
   ========================================================================== */

.product-item {
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid #ccc;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ==========================================================================
   PRODUCT DISPLAY (TWO-COLUMN LAYOUT)
   ========================================================================== */

.product-columns {
  display: flex; flex-wrap: wrap; gap: 20px;
  justify-content: space-between; align-items: flex-start;
}
.product-left  { flex: 1; min-width: 250px; text-align: left;  }
.product-right { flex: 1; min-width: 250px; text-align: center; }

.product-title { font-size: 1.5rem; margin-bottom: 15px; }
.product-title a { text-decoration: none; color: #333; }
.product-title a:hover { text-decoration: underline; }

.product-main-image {
  max-width: 100%; border: 1px solid #ccc; border-radius: 5px;
}

.product-sentiment {
  text-align: center; font-style: italic; color: #555; margin: 20px 0;
}

.product-images {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 10px;
}
.product-secondary-image {
  display: block; margin: 0 auto; width: 100%; max-width: 400px;
  aspect-ratio: 1 / 1; object-fit: cover;
  border: 1px solid #ccc; border-radius: 5px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.product-button {
  display: inline-block; padding: 12px 20px; font-size: 16px; font-weight: 700;
  color: #fff; background-color: #ff9900; text-decoration: none; border-radius: 6px;
  text-align: center; transition: background-color .3s ease, transform .2s ease;
}
.product-button:hover { background-color: #cc7a00; transform: translateY(-2px); }

/* ==========================================================================
   SOCIAL ACTIVITY LIST + CARDS
   ========================================================================== */

.activity-list { width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px; }
.activity-list h1 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 20px; }

.card-container { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }

.card {
  background-color: #fff; border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 20px;
  flex: 1 1 calc(33.333% - 20px); /* 3 per row on desktop */
  transition: transform .2s ease-in-out, box-shadow .2s ease-in-out;
  position: relative; z-index: 0;  /* never above header/search */
}
.card:hover { transform: translateY(-5px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); z-index: 0; }

.card h2 { font-size: 1.25rem; margin-bottom: 10px; }
.card h2 a { text-decoration: none; color: #333; transition: color .2s; }
.card h2 a:hover { color: #babfc5; }

.post-meta { font-size: .9rem; color: #666; margin-bottom: 8px; }

.short-content { font-size: 1rem; color: #333; margin-bottom: 15px; line-height: 1.5; }

.read-more {
  display: inline-block; padding: 8px 12px; background-color: #4f647a; color: #fff;
  text-decoration: none; font-weight: 700; border-radius: 8px; transition: background-color .2s;
}
.read-more:hover { background-color: #005bb5; }

/* Separators */
.card-separator { width: 100%; height: 2px; background-color: #ccc; margin: 15px 0; }
.header-separator { width: 100%; height: 2px; background-color: #333; margin-top: 5px; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablets and down: two cards per row */
@media (max-width: 768px) {
  .product-columns { flex-direction: column; gap: 10px; }
  .product-left { order: 1; }
  .product-right { order: 2; }
  .product-secondary-image { margin: 0 auto; }

  .card { flex: 1 1 calc(50% - 20px); }
}

/* Phones: one card per row */
@media (max-width: 480px) {
  .card { flex: 1 1 100%; }
}
/* --- Kill extra vertical space around the search bar --- */
#search-row,
#search-row .container { padding-top: 0 !important; padding-bottom: 0 !important; }

/* If Pagefind UI is in use, it adds margins/padding—zero those out */
#search-row .pagefind-ui,
#search-row .pagefind-ui__form,
#search-row .pagefind-ui__search-input-wrapper { 
  margin-top: 0 !important; 
  margin-bottom: 0 !important; 
  padding-top: 0 !important; 
  padding-bottom: 0 !important; 
}

/* Catch-all for the actual input element */
#search-row .pagefind-ui__search-input,
#search-row input[type="search"] {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Optional: if you see a faint double line, make them share one divider */
#site-header nav { border-bottom: none; }
#search-row { border-top: 1px solid var(--fallback-b3, rgba(0,0,0,.08)); }
