/* alexjames.blog — recreation of the Divi boxed-layout theme */
@import url("/static/fonts/fonts.css");

:root {
  --body-bg: #0a0a0a;
  --content-bg: #26282b; /* uniform background for every page (except the black home page) */
  --text: #bcc0c6;
  --heading: #eceef1;
  --accent: #2ea3f2;
  --buy-red: #e02b20;
  --header-bg: #0a0a0a;
  --header-link: rgba(255, 255, 255, 0.75);
  --header-link-active: #ffffff;
  --meta: #9a9ea4;
  --border: rgba(255, 255, 255, 0.12);
}

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

html { scrollbar-width: thin; scrollbar-color: #3e4142 #2a2d2e; }

body {
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background-color: var(--body-bg);
  line-height: 1.7em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

img { max-width: 100%; height: auto; }

/* ---------- boxed layout ---------- */
#page-container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--content-bg);
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s;
}

#main-content { flex: 1; }

/* ---------- header ---------- */
#main-header {
  background-color: var(--header-bg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 9999;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  height: 80px;
}

#logo { height: 46px; width: auto; display: block; }

#top-menu ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 22px;
}

#top-menu a {
  color: var(--header-link);
  font-size: 14px;
  font-weight: 600;
  line-height: 80px;
  display: block;
  transition: color 0.2s;
}

#top-menu li.current a, #top-menu a:hover { color: var(--header-link-active); opacity: 1; }

#search-toggle {
  background: none;
  border: none;
  color: var(--header-link);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}
#search-toggle:hover { color: #fff; }

#search-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 14px 30px;
  background: var(--header-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
#search-bar.open { display: flex; }
#search-bar form { flex: 1; }
#search-bar input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  padding: 6px 2px;
  outline: none;
}
#search-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}
#search-close:hover { color: #fff; }

/* mobile menu */
#mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
#mobile-menu-toggle span {
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
#mobile-menu-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
#mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
#mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

#mobile-menu { display: none; background: var(--header-bg); border-top: 1px solid rgba(255, 255, 255, 0.08); }
#mobile-menu.open { display: block; }
#mobile-menu ul { list-style: none; padding: 10px 0; }
#mobile-menu a {
  display: block;
  padding: 12px 30px;
  color: var(--header-link);
  font-weight: 600;
}
#mobile-menu a:hover { color: #fff; }

/* ---------- footer ---------- */
#main-footer {
  background: #0a0a0a;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  padding: 28px 20px;
  font-size: 13px;
}

/* ---------- content area (blog / post / about) ---------- */
.content-area {
  width: 80%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 58px 0;
}

/* blog listing */
.archive-header { margin-bottom: 45px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.archive-header h1 { color: var(--heading); font-size: 30px; font-weight: 600; line-height: 1.3; }
.archive-sub { color: var(--meta); font-size: 14px; margin-top: 6px; }

.post-list .post-item { margin-bottom: 55px; }

.entry-image { display: block; margin-bottom: 22px; overflow: hidden; }
.entry-image img {
  width: 100%;
  aspect-ratio: 650 / 400;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.entry-image:hover img { transform: scale(1.02); }

.post-item .entry-title { font-size: 26px; font-weight: 600; line-height: 1.3; margin-bottom: 8px; }
.post-item .entry-title a { color: var(--heading); }
.post-item .entry-title a:hover { color: var(--accent); opacity: 1; }

.post-meta { font-size: 14px; color: var(--meta); margin-bottom: 12px; }
.post-meta .author, .post-meta .published { color: var(--meta); }
.post-meta a { color: var(--accent); }

.post-excerpt p { font-size: 14px; line-height: 1.75; }

.no-results { padding: 40px 0; font-size: 16px; }

/* pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 25px;
  font-size: 14px;
  font-weight: 600;
}
.infinite-sentinel { height: 1px; }
.infinite-loading { text-align: center; color: var(--meta); padding: 22px 0; font-size: 14px; }

/* ---------- single post ---------- */
.single-post .post-header { margin-bottom: 25px; }
.single-post h1.entry-title {
  color: var(--heading);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 10px;
}
.post-featured { width: 100%; margin-bottom: 30px; display: block; }

/* text-to-speech "Listen" player */
.tts-player { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 28px; }
.tts-player[hidden], .tts-extra[hidden] { display: none; }
.tts-main { display: inline-flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); color: var(--heading); padding: 10px 18px; border-radius: 24px; cursor: pointer; font-size: 15px; font-weight: 600; transition: border-color 0.15s, background 0.15s; }
.tts-main:hover { background: rgba(46, 163, 242, 0.12); border-color: var(--accent); }
.tts-icon { color: var(--accent); font-size: 12px; line-height: 1; }
.tts-extra { display: flex; align-items: center; gap: 14px; }
.tts-stop { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--border); color: var(--meta); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 11px; transition: color 0.15s, border-color 0.15s; }
.tts-stop:hover { color: var(--heading); border-color: var(--accent); }
.tts-speed { color: var(--meta); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.tts-speed select { background: var(--content-bg); color: var(--heading); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; cursor: pointer; }
.entry-content .tts-reading { background: rgba(46, 163, 242, 0.16); border-radius: 3px; box-shadow: 0 0 0 5px rgba(46, 163, 242, 0.16); transition: background 0.2s; }

.entry-content { font-size: 20px; line-height: 1.75; }
.entry-content p { margin-bottom: 1.2em; }
.entry-content a { color: #4bb0ff; text-decoration: underline; }
.entry-content a:hover { opacity: 0.85; }
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.35;
  margin: 1.4em 0 0.6em;
}
.entry-content h2 { font-size: 26px; }
.entry-content h3 { font-size: 22px; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em 1.6em; }
.entry-content li { margin-bottom: 0.4em; }
.entry-content img { display: block; margin: 1.5em auto; height: auto; }
.entry-content figure { margin: 1.8em auto; max-width: 100%; }
.entry-content figure img { margin: 0 auto; }
.entry-content figcaption {
  text-align: center;
  font-size: 12.5px;
  color: var(--meta);
  margin-top: 8px;
  font-style: italic;
}
.entry-content .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry-content .has-text-align-center { text-align: center; }
.entry-content a { word-break: break-word; }
.entry-content hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.entry-content strong { color: var(--heading); }
.entry-content em strong, .entry-content strong em { color: inherit; }

.entry-content blockquote {
  border-left: 5px solid var(--accent);
  background: rgba(46, 163, 242, 0.05);
  padding: 18px 24px;
  margin: 1.8em 0;
  font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* embedded tweets degrade to styled cards when offline */
.entry-content blockquote.twitter-tweet {
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: rgba(46, 163, 242, 0.04);
  font-style: normal;
}

.entry-content iframe { max-width: 100%; border: none; margin: 1.5em auto; display: block; }
.entry-content iframe[src*="youtube"], .entry-content iframe[src*="rumble"] {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
}
.entry-content video { max-width: 100%; margin: 1.5em auto; display: block; }

.wp-block-embed__wrapper { max-width: 100%; }

.post-footer-nav { margin-top: 45px; border-top: 1px solid var(--border); padding-top: 22px; font-weight: 600; }

/* ---------- about page ---------- */
.about-page h1 { color: var(--heading); font-size: 30px; font-weight: 600; margin: 18px 0 14px; }
.about-portrait { width: 120px; height: auto; display: block; }
.about-text p { margin-bottom: 0.9em; font-size: 14.5px; }
.about-inactive { margin: 26px 0 12px; }

.social-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.social-btn {
  display: inline-flex;
  align-items: stretch;
  color: #fff;
  border-radius: 3px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}
.social-btn:hover { opacity: 0.88; }
.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  padding: 9px 0;
}
.social-icon img { display: block; }
.social-label {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.18);
}
.social-x { background: #000000; border: 1px solid #333; }
.social-ajr { background: #1d9bf0; }
.ajr-avatar { border-radius: 50%; object-fit: cover; display: block; }
.social-tiktok { background: #fe2c55; }
.social-youtube { background: #a82400; }
.social-rumble { background: #85c742; }
.social-facebook { background: #3b5998; }
.social-instagram { background: #ea2c59; }
.social-truth { background: #5448ee; }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 60px 0; }
.error-404 h1 { font-size: 96px; color: var(--heading); font-weight: 700; line-height: 1; margin-bottom: 20px; }
.error-404 p { margin-bottom: 14px; font-size: 15px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7em;
  border: 2px solid #000;
  border-radius: 3px;
  padding: 6px 31px;
  transition: all 0.2s;
  cursor: pointer;
}
.btn-buy { background-color: var(--buy-red); color: #fff; }
.btn-buy:hover { background-color: #c4231a; opacity: 1; }
.btn-outline {
  background: transparent;
  border-color: #fff;
  color: #fff;
  font-size: 20px;
  padding: 2px 30px;
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.12); opacity: 1; }

/* ---------- home landing (Books / Blog / Socials) — the one black page ---------- */
.page-home #main-content { background: #000; }
.landing {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: #000;
  min-height: calc(100vh - 210px);
}
.lbox {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  min-height: 29vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  /* animate only compositor-friendly transforms so the motion never stutters */
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}
.lbox:hover { transform: scale(1.025) translateZ(0); z-index: 2; }

/* blurred, darkened background layer — keeps the text crisp and dominant.
   The blur is static (never transitions); only its transform animates. */
.lbox-media {
  position: absolute;
  inset: -14px;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(0.42) saturate(0.9);
  transform: scale(1.04) translateZ(0);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.lbox:hover .lbox-media { transform: scale(1.09) translateZ(0); }
.lbox-tint { position: absolute; inset: 0; z-index: 1; pointer-events: none; }

.lbox-label {
  position: relative;
  z-index: 3;
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1;
  text-shadow: 0 3px 26px rgba(0, 0, 0, 0.75);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.lbox:hover .lbox-label { transform: scale(1.08); }
.lbox-hint {
  position: relative;
  z-index: 3;
  margin-top: 12px;
  font-size: 14px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

/* Books — same desert palette as the Theory of Devolution page */
.lbox-books .lbox-media { background-image: url("/static/uploads/2025/01/triarii3915_cold_desert_barren_sand_dunes_storm_clouds_overhead_217a1ea3-c00f-4eaa-9f0d-b9330cd26743.png"); }
.lbox-books .lbox-tint { background: linear-gradient(180deg, rgba(22, 13, 5, 0.4), rgba(10, 7, 3, 0.58)); }

/* Blog — dark red with a faint collage of post images */
.lbox-collage { display: flex; height: 100%; }
.lbox-collage img { flex: 1 1 0; width: 0; height: 100%; object-fit: cover; }
.lbox-blog .lbox-tint { background: linear-gradient(180deg, rgba(92, 12, 12, 0.74), rgba(46, 5, 5, 0.84)); }

/* News — The Alex James Report: predominantly blue, with the profile picture */
.lbox-news .lbox-media {
  background-image: url("/static/img/alexjamesreport.jpg");
  background-position: center;
  filter: blur(6px) brightness(0.6) saturate(1.15);
}
.lbox-news .lbox-tint { background: linear-gradient(155deg, rgba(12, 52, 102, 0.7), rgba(6, 26, 60, 0.84)); }
/* crisp profile picture on the right, with the blurred blue version behind */
.news-avatar {
  position: absolute;
  z-index: 2;
  right: 8%;
  top: 50%;
  transform: translateY(-50%) translateZ(0);
  width: min(24vw, 166px);
  height: min(24vw, 166px);
  border-radius: 50%;
  background: url("/static/img/alexjamesreport.jpg") center / cover no-repeat;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.55);
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform;
}
.lbox-news:hover .news-avatar { transform: translateY(-50%) scale(1.06) translateZ(0); }

@media (max-width: 640px) {
  .lbox { min-height: 24vh; }
  .lbox-label { letter-spacing: 2px; }
  .news-avatar { width: 92px; height: 92px; right: 5%; }
}

/* ---------- book landing page (uses the uniform --content-bg) ---------- */

.book-quote-section {
  background: url("/static/uploads/2025/01/triarii3915_cold_desert_barren_sand_dunes_storm_clouds_overhead_217a1ea3-c00f-4eaa-9f0d-b9330cd26743.png") center / cover no-repeat;
  padding: 5px 20px 0;
}
.book-quote-box {
  max-width: 1080px;
  margin: 12px auto 20px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.25);
  padding: 40px;
  text-align: center;
}
.book-quote {
  color: #b2b2b2;
  font-size: 27px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.45;
}
.book-quote-byline {
  color: #a0a0a0;
  font-size: 15px;
  font-style: italic;
  font-weight: 700;
  margin-top: 6px;
}

.book-hero { position: relative; overflow: hidden; padding: 55px 6px 77px; }
.book-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.book-hero-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 1; }
.book-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.book-hero-left { text-align: center; }
.book-hero-left .btn-outline { float: left; margin-bottom: 11px; }
.book-cover {
  clear: both;
  display: block;
  margin: 20px auto 10px;
  max-height: 561px;
  width: auto;
  max-width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}
.book-title {
  color: #fff;
  font-size: 38px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.2;
  margin: 11px 0 18px;
}
.book-tagline { color: #fff; font-size: 18px; margin-bottom: 30px; line-height: 1.6; }
.book-desc { color: #fff; font-size: 18px; line-height: 1.6; margin-bottom: 18px; }
.book-desc strong { color: #fff; }
.book-features { list-style: none; margin: 24px 0 18px; }
.book-features li { color: #fff; font-size: 16px; line-height: 1.9; }
.book-region-note { color: rgba(255, 255, 255, 0.85); font-size: 14px; margin-bottom: 24px; }
.book-buy-buttons { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 10px 0 30px; }
.amazon-badge { display: block; margin: 8px auto 0; width: 19%; min-width: 90px; }

.book-testimonials {
  background: url("/static/uploads/2026/02/xcvbdfvbxdfhb.jpg") center / cover no-repeat;
  position: relative;
  padding: 68px 40px 30px;
  text-align: center;
}
.book-testimonials::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); }
.book-testimonials > * { position: relative; }
.testimonial {
  color: #fff;
  font-size: 27px;
  font-style: italic;
  font-weight: 600;
  line-height: 1.5;
  max-width: 1080px;
  margin: 0 auto 24px;
}
.book-copyright { color: rgba(255, 255, 255, 0.68); font-size: 12px; padding: 28px 0 16px; }

/* book page footer is replaced by the in-section copyright, keep global one too */
.page-book #main-footer { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  #top-menu { display: none; }
  #mobile-menu-toggle { display: flex; }
  .header-inner { height: 66px; padding: 0 20px; }
  #logo { height: 36px; }
  .content-area { width: 90%; padding: 40px 0; }
  .book-hero-inner { grid-template-columns: 1fr; }
  .book-hero-left .btn-outline { float: none; }
  .book-title { font-size: 30px; text-align: center; }
  .book-hero-right { text-align: center; }
  .book-features { text-align: left; display: inline-block; }
  .book-quote { font-size: 21px; }
  .testimonial { font-size: 21px; }
  .single-post h1.entry-title { font-size: 26px; }
  .post-item .entry-title { font-size: 22px; }
}

@media (max-width: 980px) {
  /* desktop search toggle lives in the collapsed menu instead */
  .search-li { display: none; }
}

.mobile-search { padding: 10px 30px 16px; }
.mobile-search input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  padding: 6px 2px;
  outline: none;
}
