/*
Theme Name: Raj Explorer
Theme URI: https://rajexplorer.com
Author: Raj Explorer
Description: A premium dark archaeology and ancient history blog theme. Unearth the past — one discovery at a time.
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: rajexplorer
*/

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #08090f;
  --surface:     #0e1017;
  --card:        #13151e;
  --card-hover:  #191c28;
  --accent:      #c9943e;
  --accent-light:#deb062;
  --accent-dim:  #a07a30;
  --accent-glow: rgba(201,148,62,0.12);
  --copper:      #b87333;
  --teal:        #3a8c8c;
  --text:        #eae6dd;
  --text-sec:    #a09b8f;
  --text-muted:  #5e5a52;
  --border:      rgba(201,148,62,0.08);
  --border-light:rgba(201,148,62,0.15);
  --glass:       rgba(19,21,30,0.65);
  --radius:      14px;
  --radius-sm:   8px;
  --font-display:'Cormorant Garamond', Georgia, serif;
  --font-body:   'Inter', 'Segoe UI', system-ui, sans-serif;
  --max-w:       1240px;
  --header-h:    72px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .25s; }
a:hover { color: var(--accent-light); }
img { max-width: 100%; height: auto; display: block; }

/* Subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--copper));
  z-index: 9999;
  width: 0%;
  transition: width .1s linear;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  background: rgba(8,9,15,0.82);
  border-bottom: 1px solid var(--border);
  transition: all .35s ease;
}

.site-header.scrolled {
  height: 60px;
  background: rgba(8,9,15,0.95);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo img {
  height: 52px;
  width: auto;
  transition: height .3s ease;
}

.scrolled .site-logo img { height: 42px; }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.nav-menu {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-menu a {
  color: var(--text-sec);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  transition: all .25s;
}

.nav-menu a:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-search-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-sec);
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all .25s;
}

.nav-search-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: all .3s;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ===== CATEGORY NAV BAR ===== */
.cat-nav {
  position: relative;
  z-index: 1;
  margin-top: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.cat-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-nav-inner a {
  padding: 0.75rem 1.25rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .25s;
}

.cat-nav-inner a:hover,
.cat-nav-inner a.current {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== HERO (Homepage) ===== */
.hero {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem 3rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(201,148,62,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1.4rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
  background: var(--accent-glow);
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-sec);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== FEATURED POST ===== */
.featured-section {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto 2rem;
  padding: 0 2rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .4s ease;
}

.featured-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.featured-img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

.featured-img-placeholder {
  width: 100%;
  min-height: 340px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--card) 50%, rgba(201,148,62,0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
}

.featured-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  width: fit-content;
}

.featured-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.featured-body h2 a { color: var(--text); }
.featured-body h2 a:hover { color: var(--accent); }

.featured-excerpt {
  font-size: 0.95rem;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.featured-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.featured-meta .cat { color: var(--accent); font-weight: 600; }

/* ===== SECTION HEADERS ===== */
.section-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  white-space: nowrap;
}

/* ===== POST GRID ===== */
.posts-section {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .35s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-light);
  box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 0 0 1px var(--border-light);
}

.post-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.post-card-img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.post-card:hover .post-card-img { transform: scale(1.05); }

.post-card-img-placeholder {
  width: 100%;
  height: 210px;
  background: linear-gradient(135deg, var(--surface), var(--card), rgba(201,148,62,0.04));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--accent);
  opacity: 0.25;
}

.post-card-cat {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--bg);
  background: var(--accent);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
}

.post-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 0.87rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex: 1;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  transition: gap .25s;
}

.read-more:hover { gap: 0.7rem; color: var(--accent-light); }

/* Ad row spanning full grid */
.ad-row { grid-column: 1 / -1; }

/* ===== SINGLE POST ===== */
.single-hero {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 3rem) 2rem 0;
}

.single-breadcrumb {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.single-breadcrumb a { color: var(--text-muted); }
.single-breadcrumb a:hover { color: var(--accent); }
.single-breadcrumb .sep { margin: 0 0.4rem; }

.single-meta-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.single-cat-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--accent);
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
}

.single-date-reading {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.single-date-reading .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.single-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.18;
  margin-bottom: 1.5rem;
  letter-spacing: -0.3px;
}

.single-hero-img {
  border-radius: var(--radius);
  width: 100%;
  margin-bottom: 0;
}

/* Content */
.single-content-wrap {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
}

.single-content {
  color: var(--text-sec);
  font-size: 1.08rem;
  line-height: 1.9;
}

.single-content h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-top: 0.5rem;
}

.single-content h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.single-content p { margin-bottom: 1.35rem; }
.single-content img { border-radius: var(--radius-sm); margin: 1.5rem 0; }
.single-content ul, .single-content ol { margin: 1rem 0 1.5rem 1.5rem; }
.single-content li { margin-bottom: 0.5rem; }
.single-content strong { color: var(--text); font-weight: 600; }

.single-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  background: var(--card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text);
  font-size: 1.05rem;
}

.single-content a { color: var(--accent); }
.single-content a:hover { text-decoration: underline; }

/* Tags on single post */
.post-tags {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-tags a {
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  transition: all .25s;
}

.post-tags a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Post navigation */
.post-nav {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-sec);
  border: 1px solid var(--border);
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all .25s;
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* Related posts */
.related-section {
  margin-top: 4rem;
  padding-top: 2rem;
}

/* ===== PAGES ===== */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 3rem) 2rem 5rem;
}

.page-wrap h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.page-wrap .page-content { color: var(--text-sec); font-size: 1.05rem; line-height: 1.9; }
.page-wrap .page-content p { margin-bottom: 1.25rem; }
.page-wrap .page-content h2 { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); margin: 2rem 0 1rem; }

/* ===== AD SPACES (AdSense) ===== */
.ad-space {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 1.5rem 0;
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 4rem 2rem 0;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
}

.footer-brand img { height: 48px; margin-bottom: 1rem; }

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }

.footer-col a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all .25s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-w);
  margin: 3rem auto 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== PAGINATION ===== */
.pagination-wrap { margin-top: 3rem; }

.nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.nav-links a, .nav-links span {
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
}

.nav-links a {
  background: var(--card);
  color: var(--text-sec);
  border: 1px solid var(--border);
  transition: all .25s;
}

.nav-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-links .current {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ARCHIVE / CATEGORY ===== */
.archive-hero {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(var(--header-h) + 3rem) 2rem 2rem;
}

.archive-hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 600;
}

.archive-hero p {
  color: var(--text-sec);
  margin-top: 0.5rem;
  font-size: 1rem;
}

/* ===== SEARCH ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(8,9,15,0.92);
  backdrop-filter: blur(20px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}

.search-overlay.active { display: flex; }

.search-box {
  width: 90%;
  max-width: 600px;
}

.search-box input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 1.2rem;
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
}

.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { border-color: var(--accent); }

.search-hint {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-img, .featured-img-placeholder { min-height: 240px; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }

  .menu-toggle { display: flex; }

  .nav-right {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(8,9,15,0.97);
    backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 1.5rem 2rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all .35s ease;
  }

  .nav-right.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-menu { flex-direction: column; width: 100%; }
  .nav-menu a { display: block; padding: 0.75rem 0; font-size: 0.9rem; }
  .nav-search-btn { width: 100%; margin-top: 0.5rem; }

  .cat-nav { margin-top: var(--header-h); }
  .hero h1 { font-size: 2.4rem; }
  .hero { padding: 3rem 1.5rem 2rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .featured-body { padding: 1.5rem; }

  .single-hero { padding-top: calc(var(--header-h) + 2rem); }
  .single-hero h1 { font-size: 1.8rem; }
  .post-nav { flex-direction: column; }

  .related-section .posts-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }
  .single-hero h1 { font-size: 1.6rem; }
}
