/* ─────────────────────────────────────────────────────────────
   error-pages.css — Error, Search Results, Archive & Search
   Overlay styles. Fully themed to match home.css: dark luxury
   palette, CSS custom properties, font stack, spacing rhythm,
   scroll-reveal, hover micro-interactions, and component patterns.
───────────────────────────────────────────────────────────── */

/* ─── Page wrappers ───────────────────────────────────────── */

.error-page,
.search-results-page,
.archive-page {
  background: #000;
  color: var(--white);
  min-height: 100vh;
}

.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Ambient glow behind error page */
.error-page::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,164,93,0.07) 0%, transparent 68%);
  pointer-events: none;
}

.error-page::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,164,93,0.2), transparent);
}

.error-page-inner {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ─── Error code ──────────────────────────────────────────── */

.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 700;
  color: transparent;
  background: linear-gradient(135deg, var(--gold) 0%, rgba(200,164,93,0.45) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

/* ─── Decorative rule under error code ───────────────────── */

.error-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 28px;
  max-width: 220px;
}

.error-rule::before,
.error-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,164,93,0.4));
}

.error-rule::after {
  background: linear-gradient(90deg, rgba(200,164,93,0.4), transparent);
}

.error-rule-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(200,164,93,0.5);
}

/* ─── Error title & text ──────────────────────────────────── */

.error-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 16px;
}

.error-text {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.52);
  line-height: 1.9;
  margin-bottom: 40px;
  letter-spacing: 0.02em;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Kicker pill (reuse home.css pattern) ────────────────── */

.error-kicker {
  display: inline-block;
  margin-bottom: 22px;
  padding: 7px 18px;
  border: 1px solid rgba(200,164,93,0.38);
  border-radius: 999px;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(200,164,93,0.07);
}

/* ─── Search form ─────────────────────────────────────────── */

.error-search {
  margin-bottom: 36px;
}

.indra-search-form {
  display: flex;
  max-width: 460px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  overflow: hidden;
  background: #0d0d0d;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.indra-search-form:focus-within {
  border-color: rgba(200,164,93,0.45);
  box-shadow: 0 0 0 3px rgba(200,164,93,0.07);
}

.indra-search-input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.85);
  background: transparent;
  outline: none;
}

.indra-search-input::placeholder {
  color: rgba(255,255,255,0.25);
}

.indra-search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  background: var(--gold);
  color: #111;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.25s ease, opacity 0.25s ease;
  flex-shrink: 0;
}

.indra-search-submit:hover {
  background: var(--gold-light);
}

/* ─── Navigation link strip ───────────────────────────────── */

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease,
              border-color 0.25s ease, color 0.25s ease;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.78);
  background: rgba(255,255,255,0.04);
}

.error-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(200,164,93,0.45);
  color: var(--gold);
  background: rgba(200,164,93,0.07);
}

.error-btn-primary {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
}

.error-btn-primary:hover {
  background: var(--gold-light);
  color: #111;
  border-color: var(--gold-light);
  opacity: 1;
}

/* ─── Search results / archive pages ─────────────────────── */

.search-results-page,
.archive-page {
  padding: 80px 0 100px;
}

.search-results-page .container,
.archive-page .container {
  position: relative;
}

/* Section label / kicker above title */
.search-section-label,
.archive-section-label {
  font-family: var(--font-accent);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  display: block;
}

.search-page-title,
.archive-page-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 10px;
}

.search-page-title span,
.archive-page-title span {
  color: var(--gold);
}

.search-result-count,
.archive-description {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  line-height: 1.85;
  margin-bottom: 50px;
  max-width: 600px;
}

/* Thin gold rule below heading block */
.search-title-rule {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--gold);
  opacity: 0.65;
  margin: 18px 0 50px;
}

/* ─── Results grid ────────────────────────────────────────── */

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
  margin-bottom: 60px;
}

/* ─── Result card — matches invest-card / diff-card ──────── */

.search-result-card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  overflow: hidden;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  transition: border-color 0.35s ease, transform 0.3s ease, box-shadow 0.35s ease;
}

/* Gold accent line at top of card, fades in on hover.
   NOTE: animates opacity (not the gradient itself) — gradients
   can't be smoothly interpolated between two color-stop states. */
.search-result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,164,93,0.5), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.search-result-card:hover::before {
  opacity: 1;
}

.search-result-card:hover {
  border-color: rgba(200,164,93,0.28);
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(200,164,93,0.08);
}

/* ─── Card thumbnail ──────────────────────────────────────── */

.search-result-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #111;
  flex-shrink: 0;
}

.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s ease;
}

.search-result-card:hover .search-result-thumb img {
  transform: scale(1.06);
}

/* Thumbnail placeholder when no image */
.search-result-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #0e0d08, #111008);
  border-bottom: 1px solid rgba(200,164,93,0.08);
  flex-shrink: 0;
}

.search-result-thumb-placeholder i {
  font-size: 28px;
  color: rgba(200,164,93,0.22);
}

/* ─── Card body ───────────────────────────────────────────── */

.search-result-body {
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Post type pill */
.search-result-type {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(200,164,93,0.85);
  background: rgba(200,164,93,0.08);
  border: 1px solid rgba(200,164,93,0.16);
  margin-bottom: 14px;
  width: fit-content;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.search-result-card:hover .search-result-type {
  background: rgba(200,164,93,0.13);
  border-color: rgba(200,164,93,0.28);
  color: var(--gold);
}

.search-result-body h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.35;
  margin-bottom: 12px;
}

.search-result-body h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s ease;
}

.search-result-body h2 a:hover {
  color: var(--gold);
}

.search-result-body p {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  line-height: 1.85;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Read more link */
.search-result-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  transition: opacity 0.2s ease, gap 0.2s ease;
  margin-top: auto;
}

.search-result-link:hover {
  opacity: 0.75;
  gap: 10px;
}

.search-result-link i {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.search-result-link:hover i {
  transform: translateX(3px);
}

/* ─── Pagination ──────────────────────────────────────────── */

.search-pagination {
  display: flex;
  justify-content: center;
}

.search-pagination .nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.search-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.search-pagination .page-numbers:hover {
  border-color: rgba(200,164,93,0.4);
  color: var(--gold);
  background: rgba(200,164,93,0.06);
}

.search-pagination .page-numbers.current {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
  font-weight: 600;
}

.search-pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

/* ─── Empty / no-results state ────────────────────────────── */

.error-search-empty {
  padding: 80px 20px 100px;
  text-align: center;
}

/* ─── Live search overlay ─────────────────────────────────── */

.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 40px;
  overflow-y: auto;
}

.search-overlay.open {
  display: flex;
  animation: overlayIn 0.25s ease forwards;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.search-overlay-inner {
  width: 100%;
  max-width: 760px;
  position: relative;
  animation: panelDrop 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes panelDrop {
  from { opacity: 0; transform: translateY(-24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Close button */
.search-overlay-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  z-index: 2;
}

.search-overlay-close:hover {
  background: rgba(200,164,93,0.15);
  color: var(--gold);
  border-color: var(--gold);
}

/* Overlay search field */
.search-overlay-form {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(200,164,93,0.3);
  border-radius: 12px;
  overflow: hidden;
  background: #0c0c0c;
  margin-bottom: 8px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-overlay-form:focus-within {
  border-color: rgba(200,164,93,0.55);
  box-shadow: 0 0 0 4px rgba(200,164,93,0.07);
}

.search-overlay-icon {
  padding: 0 18px 0 22px;
  color: rgba(200,164,93,0.55);
  font-size: 15px;
  flex-shrink: 0;
}

.search-overlay-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 18px 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--white);
  outline: none;
  letter-spacing: 0.02em;
}

.search-overlay-input::placeholder {
  color: rgba(255,255,255,0.2);
}

.search-overlay-clear {
  padding: 0 18px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.28);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
  display: none;
  flex-shrink: 0;
}

.search-overlay-clear.visible { display: flex; align-items: center; }
.search-overlay-clear:hover   { color: rgba(255,255,255,0.7); }

/* Hint text */
.search-overlay-hint {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(255,255,255,0.22);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
  padding-left: 22px;
}

/* ─── Overlay results list ────────────────────────────────── */

.search-overlay-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-overlay-result {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
  animation: resultSlideIn 0.2s ease forwards;
  opacity: 0;
}

@keyframes resultSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-overlay-result:hover {
  background: rgba(200,164,93,0.06);
  border-color: rgba(200,164,93,0.18);
}

/* Thumbnail */
.search-overlay-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: #161510;
  border: 1px solid rgba(200,164,93,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-overlay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-overlay-thumb i {
  font-size: 17px;
  color: rgba(200,164,93,0.3);
}

/* Text block */
.search-overlay-meta {
  flex: 1;
  min-width: 0;
}

.search-overlay-type {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.75;
  margin-bottom: 4px;
}

.search-overlay-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  transition: color 0.2s ease;
}

.search-overlay-result:hover .search-overlay-title {
  color: var(--gold);
}

.search-overlay-excerpt {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(255,255,255,0.38);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrow indicator */
.search-overlay-arrow {
  color: rgba(200,164,93,0.3);
  font-size: 12px;
  flex-shrink: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.search-overlay-result:hover .search-overlay-arrow {
  color: var(--gold);
  transform: translateX(3px);
}

/* ─── Overlay states ──────────────────────────────────────── */

.search-overlay-state {
  text-align: center;
  padding: 48px 20px;
}

.search-overlay-state-icon {
  font-size: 32px;
  color: rgba(200,164,93,0.22);
  margin-bottom: 16px;
}

.search-overlay-state h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
}

.search-overlay-state p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 300;
  color: rgba(255,255,255,0.32);
  line-height: 1.8;
}

/* Spinner */
.search-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(200,164,93,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* View all link */
.search-overlay-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px;
  margin-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  transition: color 0.2s ease;
}

.search-overlay-view-all:hover {
  color: var(--gold);
}

.search-overlay-view-all i {
  font-size: 10px;
}

/* ─── Highlighted search term ─────────────────────────────── */

mark {
  background: transparent;
  color: var(--gold);
  font-weight: 600;
}

/* index.php fallback template styling */
.fallback-main {
    padding: 100px 20px;
    background: #000;
    color: #fff;
    min-height: 50vh;
}

.fallback-container {
    max-width: 760px;
    margin: 0 auto;
}

.fallback-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #fff;
    margin-bottom: 16px;
}

.fallback-meta {
    font-family: 'Jost', sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 24px;
}

.fallback-thumb img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 30px;
}

.fallback-content {
    font-family: 'Jost', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
}

.fallback-content p {
    margin-bottom: 20px;
}

.fallback-empty {
    text-align: center;
    padding: 60px 0;
}

.fallback-empty p {
    font-family: 'Jost', sans-serif;
    color: rgba(255,255,255,0.6);
    margin-bottom: 24px;
}

.fallback-pagination {
    margin-top: 40px;
    text-align: center;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
  .error-page {
    padding: 80px 20px 100px;
  }

  .search-overlay {
    padding: 70px 16px 30px;
    align-items: flex-start;
  }

  .search-overlay-input {
    font-size: 1rem;
    padding: 16px 0;
  }

  .search-results-page,
  .archive-page {
    padding: 60px 0 80px;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .error-code {
    font-size: clamp(4rem, 22vw, 6rem);
  }

  .error-title {
    font-size: 1.4rem;
  }

  .error-links {
    flex-direction: column;
    align-items: stretch;
  }

  .error-btn {
    width: 100%;
    justify-content: center;
  }

  .search-overlay-thumb {
    display: none;
  }

  .search-overlay-close {
    top: 14px;
    right: 14px;
  }

  .search-overlay {
    padding: 60px 12px 24px;
  }
}

@media (max-width: 400px) {
  .error-code {
    font-size: 4rem;
  }

  .search-results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-overlay,
  .search-overlay-inner,
  .search-overlay-result {
    animation: none;
  }
}