/*
Theme Name: Body Journey
Theme URI: https://bodyjourney.app/
Author: Body Journey
Author URI: https://bodyjourney.app/
Description: Body Journey WordPress theme matching the main brand site.
Version: 0.4.0
License: UNLICENSED
Text Domain: bodyjourney
*/

@font-face {
  font-family: 'Font Awesome Brands';
  src: url('assets/fonts/FontAwesome-Brands.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bj-bg: #000000;
  --bj-surface: #1c1c1e;
  --bj-card: #000000;
  --bj-border: #2c2c2e;
  --bj-text: #ffffff;
  --bj-muted: #8e8e93;
  --bj-primary: #ff6b35;
  --bj-primary-2: #ff8a00;
  --bj-radius-lg: 16px;
  --bj-radius-md: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--bj-text);
  background: var(--bj-bg);
  font-family: Nunito, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: Rubik, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
  color: var(--bj-text);
}

a {
  color: var(--bj-primary);
  text-decoration: none;
}

a:hover {
  color: var(--bj-primary-2);
}

.bj-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}

.bj-header {
  border-bottom: 1px solid #1c1c1e;
  background: var(--bj-bg);
}

.bj-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 16px;
}

.bj-brand {
  font-family: Rubik, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 20px;
  color: var(--bj-primary);
}

.bj-nav a {
  color: var(--bj-text);
  opacity: 0.9;
  margin-left: 14px;
}

.bj-nav a:hover {
  color: var(--bj-primary);
  opacity: 1;
}

.bj-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--bj-surface);
  color: var(--bj-text);
  border: 1px solid var(--bj-border);
  border-radius: var(--bj-radius-md);
  font-family: Rubik, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.bj-download-btn:hover {
  background-color: var(--bj-border);
  color: var(--bj-text);
  transform: translateY(-2px);
}

.bj-download-btn__icon {
  font-family: 'Font Awesome Brands';
  font-size: 20px;
  line-height: 1;
}

.bj-download-btn--ios .bj-download-btn__icon::before {
  content: '\f179';
}

.bj-download-btn--android .bj-download-btn__icon::before {
  content: '\f3ab';
}

.bj-header__downloads {
  display: flex;
  gap: 12px;
  align-items: center;
}

.bj-hero {
  padding: 72px 0;
}

.bj-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 900;
  color: var(--bj-primary);
  margin-bottom: 14px;
}

.bj-hero p {
  max-width: 760px;
  color: var(--bj-muted);
  font-size: 18px;
}

.bj-button {
  display: inline-block;
  padding: 14px 20px;
  border-radius: var(--bj-radius-md);
  background: var(--bj-primary);
  color: #ffffff;
  font-family: Rubik, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
}

.bj-button:hover {
  background: var(--bj-primary-2);
  color: #ffffff;
}

.bj-surface {
  background: var(--bj-surface);
  padding: 70px 0;
}

.bj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.bj-card {
  background: var(--bj-card);
  border: 1px solid var(--bj-border);
  border-radius: var(--bj-radius-lg);
  padding: 22px;
}

.bj-card h3 {
  margin-bottom: 10px;
}

.bj-footer {
  border-top: 1px solid #1c1c1e;
  padding: 40px 0 28px;
  color: var(--bj-muted);
  font-size: 14px;
}

.bj-footer__downloads {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.bj-footer__copyright {
  text-align: center;
  color: var(--bj-muted);
}

.bj-footer__copyright {
  text-align: center;
  color: var(--bj-muted);
}

/* Blog Layout with Sidebar */
.bj-blog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

.bj-sidebar {
  position: sticky;
  top: 20px;
}

.bj-sidebar-section {
  margin-bottom: 32px;
}

.bj-sidebar-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--bj-primary);
}

.bj-search-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bj-search-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bj-card);
  border: 1px solid var(--bj-border);
  border-radius: var(--bj-radius-md);
  color: var(--bj-text);
  font-family: Nunito, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.bj-search-input:focus {
  outline: none;
  border-color: var(--bj-primary);
}

.bj-search-button {
  padding: 10px 14px;
  background: var(--bj-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--bj-radius-md);
  font-family: Rubik, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.bj-search-button:hover {
  background: var(--bj-primary-2);
}

.bj-post-list,
.bj-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bj-post-list li,
.bj-category-list li {
  margin-bottom: 12px;
}

.bj-post-list li a {
  display: block;
  color: var(--bj-text);
  font-size: 14px;
  line-height: 1.4;
}

.bj-post-list li a:hover {
  color: var(--bj-primary);
}

.bj-post-date {
  display: block;
  font-size: 12px;
  color: var(--bj-muted);
  margin-top: 4px;
}

.bj-category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--bj-text);
  font-size: 14px;
}

.bj-category-list li a:hover {
  color: var(--bj-primary);
}

.bj-category-count {
  color: var(--bj-muted);
  font-size: 12px;
}

.bj-main-content {
  min-width: 0;
}

.bj-post-card {
  background: var(--bj-card);
  border: 1px solid var(--bj-border);
  border-radius: var(--bj-radius-lg);
  padding: 0;
  margin-bottom: 32px;
  overflow: hidden;
}

.bj-post-thumbnail {
  width: 100%;
  line-height: 0;
}

.bj-post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}

.bj-post-content {
  padding: 24px;
}

.bj-post-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.bj-post-title a {
  color: var(--bj-text);
}

.bj-post-title a:hover {
  color: var(--bj-primary);
}

.bj-post-meta {
  color: var(--bj-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.bj-meta-sep {
  margin: 0 8px;
}

.bj-post-meta a {
  color: var(--bj-muted);
}

.bj-post-meta a:hover {
  color: var(--bj-primary);
}

.bj-post-excerpt {
  color: var(--bj-text);
  margin-bottom: 16px;
}

.bj-pagination {
  margin-top: 40px;
  text-align: center;
}

.bj-pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

.bj-pagination .page-numbers {
  padding: 8px 14px;
  background: var(--bj-card);
  border: 1px solid var(--bj-border);
  border-radius: var(--bj-radius-md);
  color: var(--bj-text);
  font-size: 14px;
}

.bj-pagination .page-numbers:hover,
.bj-pagination .page-numbers.current {
  background: var(--bj-primary);
  border-color: var(--bj-primary);
  color: #ffffff;
}

/* Single Post Layout with Left Sidebar and Right TOC */
.single-post-container {
  display: grid;
  grid-template-columns: 240px 1fr 260px;
  gap: 32px;
  align-items: start;
  padding: 32px 0;
}

.single-post-content {
  min-width: 0;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.entry-header {
  margin-bottom: 32px;
}

.entry-title {
  font-size: clamp(32px, 4vw, 42px);
  line-height: 1.15;
  font-weight: 800;
  color: var(--bj-primary);
  margin-bottom: 12px;
}

.entry-meta {
  color: var(--bj-muted);
  font-size: 14px;
}

.entry-featured-image {
  margin-bottom: 32px;
  border-radius: var(--bj-radius-lg);
  overflow: hidden;
  line-height: 0;
}

.entry-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.entry-content {
  color: var(--bj-text);
  line-height: 1.7;
  font-size: 16px;
}

.entry-content h2 {
  font-size: 32px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--bj-text);
  scroll-margin-top: 100px;
}

.entry-content h3 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--bj-text);
  scroll-margin-top: 100px;
}

.entry-content p {
  margin-bottom: 1.2em;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.2em;
  padding-left: 28px;
}

.entry-content li {
  margin-bottom: 0.5em;
}

.entry-content a {
  color: var(--bj-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.entry-content a:hover {
  color: var(--bj-primary-2);
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bj-radius-md);
}

.entry-content code {
  background: var(--bj-surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--bj-primary);
}

.entry-content pre {
  background: var(--bj-surface);
  padding: 16px;
  border-radius: var(--bj-radius-md);
  overflow-x: auto;
  margin-bottom: 1.2em;
}

.entry-content pre code {
  background: none;
  padding: 0;
  color: var(--bj-text);
}

.entry-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--bj-border);
}

.entry-categories {
  color: var(--bj-muted);
  font-size: 14px;
}

.entry-categories a {
  color: var(--bj-primary);
  text-decoration: none;
}

.entry-categories a:hover {
  color: var(--bj-primary-2);
  text-decoration: underline;
}

/* Table of Contents Sidebar */
.toc-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  width: 100%;
}

.toc-wrapper {
  background: var(--bj-card);
  border: 1px solid var(--bj-border);
  border-radius: var(--bj-radius-lg);
  padding: 20px;
}

.toc-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--bj-text);
  margin-bottom: 16px;
  margin-top: 0;
}

.toc-nav {
  font-size: 14px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 8px;
}

.toc-h3 {
  margin-left: 16px;
}

.toc-link {
  display: block;
  color: var(--bj-muted);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s ease;
  padding: 4px 0;
}

.toc-link:hover {
  color: var(--bj-primary);
}

.toc-link.active {
  color: var(--bj-primary);
  font-weight: 600;
}

/* Scrollbar styling for TOC */
.toc-sidebar::-webkit-scrollbar {
  width: 6px;
}

.toc-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.toc-sidebar::-webkit-scrollbar-thumb {
  background: var(--bj-border);
  border-radius: 3px;
}

.toc-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--bj-muted);
}

/* Search results layout */
.search-layout {
  padding-top: 24px;
}

.search-main-content {
  max-width: 920px;
}

.search-header {
  margin-bottom: 20px;
}

.search-title {
  color: var(--bj-text);
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 8px;
}

.search-count {
  color: var(--bj-muted);
}

.search-post-card {
  margin-bottom: 20px;
}

.search-empty-state p {
  color: var(--bj-muted);
}

.search-summary-sidebar .toc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-summary-text {
  margin: 0;
  color: var(--bj-muted);
  font-size: 14px;
}

.search-summary-text strong {
  color: var(--bj-text);
}

.search-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.search-summary-button {
  text-align: center;
}

.search-clear-link {
  color: var(--bj-muted);
  font-size: 14px;
}

.search-clear-link:hover {
  color: var(--bj-primary);
}

/* Archive layout */
.archive-layout {
  padding-top: 24px;
}

.archive-main-content {
  max-width: 920px;
}

.archive-header {
  margin-bottom: 20px;
}

.archive-title {
  color: var(--bj-text);
  font-size: clamp(28px, 3vw, 40px);
  margin-bottom: 8px;
}

.archive-description p {
  color: var(--bj-muted);
  margin-bottom: 8px;
}

.archive-count {
  color: var(--bj-muted);
}

.archive-post-card {
  margin-bottom: 20px;
}

.archive-empty-state p {
  color: var(--bj-muted);
}

.archive-summary-sidebar .toc-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-summary-text {
  margin: 0;
  color: var(--bj-muted);
  font-size: 14px;
}

.archive-summary-text strong {
  color: var(--bj-text);
}

.archive-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.archive-summary-button {
  text-align: center;
}

.archive-clear-link {
  color: var(--bj-muted);
  font-size: 14px;
}

.archive-clear-link:hover {
  color: var(--bj-primary);
}

@media (max-width: 1200px) {
  .single-post-container {
    grid-template-columns: 220px 1fr 240px;
    gap: 24px;
  }

  .bj-sidebar-section h3 {
    font-size: 14px;
  }

  .toc-title {
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  .single-post-container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .bj-sidebar {
    position: static;
    order: -1;
  }

  .toc-sidebar {
    position: static;
    max-height: none;
    order: 2;
  }

  .single-post-content {
    order: 1;
  }

  .search-summary-sidebar {
    order: 2;
  }

  .archive-summary-sidebar {
    order: 2;
  }

  .entry-content h2,
  .entry-content h3 {
    scroll-margin-top: 20px;
  }
}

@media (max-width: 600px) {
  .bj-blog-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .bj-sidebar {
    position: static;
    order: 2;
  }

  .bj-main-content {
    order: 1;
  }

  .bj-post-title {
    font-size: 24px;
  }

  .bj-post-content {
    padding: 20px;
  }

  .bj-header__downloads {
    display: none;
  }

  .bj-footer__downloads {
    flex-direction: column;
    align-items: center;
  }

  .bj-download-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .bj-nav a {
    margin-left: 10px;
  }

  .bj-hero {
    padding: 56px 0;
  }

  .single-post-container {
    padding: 20px 0;
  }

  .entry-title {
    font-size: 28px;
  }

  .entry-content h2 {
    font-size: 24px;
  }

  .entry-content h3 {
    font-size: 20px;
  }

  .bj-sidebar {
    order: 2;
  }

  .single-post-content {
    order: 1;
  }

  .toc-sidebar {
    order: 3;
  }

  .search-main-content {
    max-width: 100%;
  }

  .archive-main-content {
    max-width: 100%;
  }
}
