/*
Theme Name: The Journal
Theme URI: https://example.com/the-journal
Author: The Journal
Author URI: https://example.com
Description: A clean, minimal blog theme with tag filtering, post listings, and an elegant reading experience.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-journal
Tags: blog, minimal, clean, typography
*/

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #faf9f6;
  --ink: #1a1a18;
  --muted: #8a8880;
  --accent: #c4622d;
  --border: #e5e3de;
  --tag-bg: #f0ede8;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── NAV ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: #000;
  border-bottom: 1px solid #222;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: 64px;
}
.site-branding .site-title {
  font-family: 'Geist', sans-serif;
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: -0.02em;
  font-weight: 400;
}
.site-branding .site-title a { color: inherit; text-decoration: none; }

.main-navigation ul {
  display: flex; gap: 2rem;
  list-style: none;
}
.main-navigation a {
  font-size: 0.85rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: #888;
  transition: color 0.2s;
  text-decoration: none;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a { color: #fff; }

.header-search { display: flex; align-items: center; }
.header-search .search-form {
  display: flex; align-items: center; gap: 0.5rem;
  background: #1a1a1a; border: 1px solid #333;
  border-radius: 2px; padding: 0.4rem 0.8rem;
}
.header-search .search-field {
  border: none; background: transparent;
  font-family: 'Inter', sans-serif; font-size: 0.85rem;
  color: #fff; outline: none; width: 160px;
}
.header-search .search-field::placeholder { color: #666; }
.header-search .search-submit {
  background: none; border: none; cursor: pointer;
  color: #666; font-size: 0.9rem; padding: 0;
  font-family: inherit;
}

/* ── HERO (front page / archive) ── */
.page-hero {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem) 2rem;
  border-bottom: 1px solid var(--border);
}
.page-hero .hero-eyebrow {
  font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 1rem;
}
.page-hero h1 {
  font-family: 'Geist', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.08; letter-spacing: -0.03em;
  max-width: 700px;
  margin-bottom: 1rem;
}
.page-hero .hero-description {
  color: var(--muted); font-size: 1.05rem; font-weight: 300;
  max-width: 480px;
}

/* ── TAG FILTER ── */
.tag-filter-bar {
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
}
.tag-filter-label {
  font-size: 0.75rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  margin-right: 0.5rem;
}
.tag-filter-bar .tag-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border); border-radius: 2px;
  background: transparent;
  font-family: 'Inter', sans-serif; font-size: 0.8rem;
  cursor: pointer; color: var(--muted); transition: all 0.15s;
  text-decoration: none;
}
.tag-filter-bar .tag-btn:hover,
.tag-filter-bar .tag-btn.active {
  border-color: var(--ink); color: var(--ink);
}
.tag-filter-bar .tag-btn.current-cat {
  background: var(--ink); color: var(--cream); border-color: var(--ink);
}

/* ── POSTS GRID ── */
.posts-grid {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* ── POST CARD ── */
.post-card {
  border-bottom: 2px solid transparent;
  padding-bottom: 1.5rem;
  transition: border-color 0.2s;
}
.post-card:hover { border-color: var(--accent); }

/* thumbnail */
.post-thumb {
  width: 100%; aspect-ratio: 1/1;
  overflow: hidden; border-radius: 2px;
  margin-bottom: 1rem;
  background: var(--tag-bg);
  display: block;
}
.post-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.45s ease;
  display: block;
}
.post-card:hover .post-thumb img { transform: scale(1.04); }

.post-card-meta {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.post-tag {
  font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 500;
}
.post-date { font-size: 0.78rem; color: var(--muted); }
.post-card h2 {
  font-family: 'Geist', sans-serif;
  font-size: 1.35rem; line-height: 1.25;
  letter-spacing: -0.01em; margin-bottom: 0.6rem;
  transition: color 0.2s;
}
.post-card h2 a { color: inherit; text-decoration: none; }
.post-card:hover h2 a { color: var(--accent); }
.post-card .excerpt {
  font-size: 0.9rem; color: var(--muted);
  font-weight: 300; line-height: 1.65;
}
.read-more {
  display: inline-block; margin-top: 0.9rem;
  font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink); font-weight: 500;
}

/* ── PAGINATION ── */
/* ── INFINITE SCROLL SPINNER ── */
#load-sentinel {
  height: 1px;
  margin-top: 1rem;
}
.load-spinner {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 2.5rem;
}
.load-spinner span {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  animation: bounce 1.2s ease-in-out infinite;
}
.load-spinner span:nth-child(2) { animation-delay: 0.2s; }
.load-spinner span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ── SINGLE POST ── */
.single-post-outer {
  padding: 0 clamp(1.5rem, 5vw, 4rem) clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
}
.breadcrumb-wrap {
  flex: 0 0 64px; /* matches nav height */
  display: flex;
  align-items: center;
}
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2.5rem;
  transition: color 0.2s; text-decoration: none;
}
.back-link:hover { color: var(--ink); }

/* Two-column layout: sticky image left, content right */
.single-post-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: start;
  max-width: 1160px;
}
.single-post-layout.no-image {
  grid-template-columns: 1fr;
  max-width: 680px;
  margin: 0 auto;
}

/* Sticky image column */
.post-featured-col {
  position: sticky;
  top: calc(64px + 2rem);
}
.post-featured-img-wrap {
  position: relative;
}
.post-featured-img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 3px;
  background: var(--tag-bg);
}
.post-featured-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.post-featured-img.is-link:hover img { transform: scale(1.03); }

/* eBay hover badge on image */
/* eBay Button — full width under featured image */
.ebay-cta {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.85rem 1.2rem;
  background: #e53238;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(229,50,56,0.25);
}
.ebay-cta:hover {
  background: #c0272d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(229,50,56,0.35);
}
.ebay-cta:active { transform: translateY(0); }
.ebay-cta svg { flex-shrink: 0; }

/* Scrollable content column */
.single-post-wrap {
  min-width: 0;
}
.post-header-eyebrow {
  font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.post-header h1 {
  font-family: 'Geist', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1rem;
}
.post-header-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 2.5rem; }
.post-divider { height: 1px; background: var(--border); margin-bottom: 2.5rem; }

/* Responsive: stack on smaller screens */
@media (max-width: 860px) {
  .single-post-layout {
    grid-template-columns: 1fr;
  }
  .post-featured-col { position: static; }
  .post-featured-img { aspect-ratio: 1/1; margin-bottom: 0.5rem; }
}

.entry-content {
  font-size: 1.05rem; font-weight: 300; line-height: 1.8; color: #2e2e2c;
}
.entry-content p { margin-bottom: 1.4rem; }
.entry-content h2, .entry-content h3 {
  font-family: 'Geist', sans-serif;
  font-size: 1.35rem; margin: 2rem 0 0.8rem;
}
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem; margin: 1.5rem 0;
  color: var(--muted); font-style: italic;
}
.entry-content a { color: var(--accent); text-decoration: underline; }
.entry-content img { border-radius: 2px; margin: 1.5rem 0; }
.entry-content ul, .entry-content ol {
  padding-left: 1.5rem; margin-bottom: 1.4rem;
}
.entry-content li { margin-bottom: 0.4rem; }

/* eBay Button */
.ebay-cta {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2.5rem;
  padding: 0.85rem 1.6rem;
  background: #e53238;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(229,50,56,0.25);
}
.ebay-cta:hover {
  background: #c0272d;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(229,50,56,0.35);
}
.ebay-cta:active { transform: translateY(0); }
.ebay-cta svg { flex-shrink: 0; }

/* Post tags */
.post-tags { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.post-tags span { font-size: 0.78rem; color: var(--muted); margin-right: 0.5rem; }
.post-tags a {
  font-size: 0.78rem; background: var(--tag-bg);
  padding: 0.25rem 0.6rem; border-radius: 2px;
  color: var(--muted); margin-right: 0.3rem;
  text-decoration: none; transition: all 0.15s;
}
.post-tags a:hover { background: var(--ink); color: var(--cream); }

/* Author box */
.author-box {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--border); border-radius: 2px;
}
.author-box h3 { font-family: 'Geist', sans-serif; font-size: 1rem; margin-bottom: 0.4rem; }
.author-box p { font-size: 0.9rem; color: var(--muted); font-weight: 300; }

/* ── PAGE (static) ── */
.page-wrap {
  max-width: 640px; margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 2rem);
}
.page-wrap .page-eyebrow {
  font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.page-wrap h1 {
  font-family: 'Geist', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 2rem;
}
.page-wrap .entry-content { font-size: 1.05rem; font-weight: 300; line-height: 1.8; color: #2e2e2c; }

/* ── SEARCH RESULTS ── */
.search-results-header {
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem) 1rem;
  border-bottom: 1px solid var(--border);
}
.search-results-header h1 {
  font-family: 'Geist', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.5rem); letter-spacing: -0.02em;
}
.search-results-header p { color: var(--muted); margin-top: 0.5rem; }

/* ── FOOTER ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.5rem, 5vw, 4rem);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-top: 4rem;
}
.footer-logo {
  font-family: 'Geist', sans-serif;
  font-size: 1rem; color: var(--muted);
}
.site-footer p { font-size: 0.8rem; color: var(--muted); }

/* ── NO POSTS ── */
.no-posts {
  padding: 4rem clamp(1.5rem, 5vw, 4rem);
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .header-search { display: none; }
  .main-navigation ul { gap: 1.2rem; }
}

/* ── SKIP LINK (accessibility + SEO) ── */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
  background: #000; color: #fff;
  font-size: 0.85rem; padding: 0.5rem 1rem;
  z-index: 9999; text-decoration: none;
}
.skip-link:focus {
  left: 1rem; top: 1rem;
  width: auto; height: auto;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 0;
  margin: 0;
}
.breadcrumb ol {
  list-style: none;
  display: flex; gap: 0.4rem; align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.breadcrumb li { font-size: 0.78rem; color: var(--muted); }
.breadcrumb li + li::before { content: '/'; margin-right: 0.4rem; color: var(--border); }
.breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb li[aria-current="page"] { color: var(--ink); }

/* ── SCREEN READER TEXT ── */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; word-wrap: normal !important;
}

/* ── YOUTUBE EMBED ── */
.youtube-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 3px;
  overflow: hidden;
  background: #000;
  margin: 1.5rem 0 2rem;
}
.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
