/*
Theme Name: The Flawed Seeker
Theme URI: https://theflawedseeker.com
Description: A daily spiritual reflection journal. Minimal, warm, literary.
Author: The Flawed Seeker
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: flawed-seeker
*/

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ============================================================
   VARIABLES
============================================================ */
:root {
  --bg: #F5F0E8;
  --fg: #2A2A2A;
  --accent: #5C6B8A;
  --muted: #7A7672;
  --border: #E0D9D0;
  --narrator: #EDE7DB;
  --card: #FFFFFF;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --max-w: 1200px;
  --content-w: 700px;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: var(--sans); scroll-behavior: smooth; }
body { background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: #fff; }

/* ============================================================
   UTILITIES
============================================================ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: var(--content-w); margin: 0 auto; padding: 0 24px; }

.section-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}

.cat-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
}
.cat-tag a { color: var(--accent); }
.cat-tag a:hover { text-decoration: underline; }

.divider { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

.text-link {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-link:hover { opacity: 0.8; }

.empty-state, .error-state {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
  text-align: center;
  padding: 60px 24px;
}

/* ============================================================
   NAVBAR
============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transition: background 0.25s, border-color 0.25s;
}
.site-header.scrolled {
  background: rgba(245, 240, 232, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-name {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.site-nav a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  transition: color 0.15s;
}
.site-nav a:hover { color: var(--accent); }

/* Search toggle button */
.search-toggle-btn {
  color: var(--muted);
  transition: color 0.15s;
  display: flex;
  align-items: center;
  padding: 2px;
}
.search-toggle-btn:hover { color: var(--accent); }
.search-toggle-btn svg { width: 18px; height: 18px; }

/* Inline search bar */
.header-search-bar {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.header-search-bar.open { display: block; }
.header-search-bar form {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-search-bar input[type="search"] {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  padding: 8px 0;
  color: var(--fg);
  transition: border-color 0.15s;
}
.header-search-bar input[type="search"]:focus { border-color: var(--accent); }
.header-search-bar input[type="search"]::placeholder { color: rgba(122,118,114,0.6); }
.header-search-bar button[type="submit"] {
  color: var(--muted);
  padding: 4px;
}

/* Mobile */
.mobile-menu-btn { display: none; color: var(--muted); padding: 4px; }
.mobile-menu-btn svg { width: 22px; height: 22px; }
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { font-family: var(--sans); font-size: 15px; color: var(--muted); }
.mobile-nav a:hover { color: var(--accent); }
.mobile-nav form { padding-top: 8px; }
.mobile-nav input[type="search"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  padding: 8px 0;
  color: var(--fg);
}

/* ============================================================
   HERO
============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 65vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.28); }
.hero-text {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
  max-width: 720px;
}
.hero-headline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 44px;
  line-height: 1.25;
  color: #fff;
  font-weight: 400;
}
.hero-sub {
  margin-top: 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: rgba(255,255,255,0.88);
  font-weight: 300;
}

/* ============================================================
   FEATURED POST
============================================================ */
.featured-section { background: var(--bg); }
.featured-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 56px;
  align-items: center;
}
.featured-meta { display: flex; flex-direction: column; gap: 20px; }
.featured-title {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.15;
  color: var(--fg);
  font-weight: 500;
}
.featured-title a:hover { color: var(--accent); }
.featured-excerpt {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}
.featured-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.featured-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--narrator);
}

/* ============================================================
   PILLARS STRIP
============================================================ */
.pillars-strip { background: var(--bg); border-top: 1px solid var(--border); }
.pillars-strip-inner { max-width: var(--max-w); margin: 0 auto; padding: 80px 24px; }
.pillars-strip-inner .section-label { margin-bottom: 32px; }
.pillars-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
.pillars-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 20px;
  min-width: 880px;
}
.pillar-link { display: block; }
.pillar-link-name {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--fg);
  line-height: 1.3;
  transition: color 0.15s;
}
.pillar-link:hover .pillar-link-name { color: var(--accent); }
.pillar-link-desc {
  margin-top: 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ============================================================
   RECENT POSTS GRID
============================================================ */
.recent-section { background: var(--bg); border-top: 1px solid var(--border); }
.recent-inner { max-width: var(--max-w); margin: 0 auto; padding: 80px 24px; }
.recent-inner .section-label { margin-bottom: 32px; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.recent-inner .text-link { display: inline-block; margin-top: 32px; }

/* ============================================================
   POST CARD
============================================================ */
.post-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: 0 1px 0 0 var(--border);
  transition: border-color 0.15s;
  color: var(--fg);
}
.post-card:hover { border-color: var(--accent); }
.post-card-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.25;
  color: var(--fg);
  transition: color 0.15s;
}
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-excerpt {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}
.post-card-date {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
  margin-top: auto;
  padding-top: 8px;
}

/* ============================================================
   NARRATOR SECTION
============================================================ */
.narrator-section {
  background: var(--narrator);
  border-top: 1px solid var(--border);
}
.narrator-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 96px 24px;
  text-align: center;
}
.narrator-inner .section-label { margin-bottom: 32px; }
.narrator-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.65;
  color: var(--fg);
  font-weight: 400;
}
.narrator-inner .text-link { display: inline-block; margin-top: 32px; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-name {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--accent);
  flex-shrink: 0;
}
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 24px; }
.footer-nav a { font-family: var(--sans); font-size: 13px; color: var(--muted); transition: color 0.15s; }
.footer-nav a:hover { color: var(--accent); }
.footer-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ============================================================
   SINGLE POST
============================================================ */
.single-wrap {
  padding-top: 120px;
  padding-bottom: 100px;
}
.post-header { margin-bottom: 32px; }
.post-header .cat-tag { margin-bottom: 14px; }
.post-title {
  font-family: var(--serif);
  font-size: 36px;
  line-height: 1.2;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 12px;
}
.post-meta-date {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

/* Post content */
.entry-content p {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
  color: var(--fg);
  margin-bottom: 24px;
}
.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}
.entry-content ul { padding: 0; margin-bottom: 24px; }
.entry-content ul li {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.9;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
}
.entry-content ul li::before { content: "—"; position: absolute; left: 0; color: var(--muted); }
.entry-content em, .entry-content i { font-style: italic; font-family: var(--serif); }
.entry-content strong { font-weight: 600; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { max-width: 100%; height: auto; margin: 24px 0; }
.entry-content blockquote {
  font-family: var(--serif);
  font-style: italic;
  border-left: 2px solid var(--border);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--muted);
}
.entry-content h2 { font-family: var(--serif); font-size: 24px; margin: 32px 0 16px; }
.entry-content h3 { font-family: var(--serif); font-size: 20px; margin: 24px 0 12px; }

/* Post footer credit */
.post-credit {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.post-credit p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
}

/* More reflections below post */
.more-reflections { margin-top: 80px; }
.more-reflections .section-label { margin-bottom: 24px; }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-top: 24px; }
.more-reflections .text-link { display: inline-block; margin-top: 24px; }

/* ============================================================
   CATEGORY ARCHIVE (Pillar Archive)
============================================================ */
.archive-wrap {
  padding-top: 120px;
  padding-bottom: 100px;
}
.archive-header { margin-bottom: 48px; }
.archive-header .cat-tag { margin-bottom: 12px; }
.archive-title {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 8px;
}
.archive-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--muted);
  margin-top: 8px;
}

/* Post list rows */
.post-list { }
.post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.post-list .post-row:first-child { border-top: 1px solid var(--border); }
.post-row-left { display: flex; flex-direction: column; gap: 4px; }
.post-row-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--fg);
  transition: color 0.15s;
}
.post-row-title:hover { color: var(--accent); }
.post-row-date {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pagination */
.pagination {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
}
.pagination a.page-numbers { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pagination .current { color: var(--fg); font-weight: 500; }

/* ============================================================
   SEARCH RESULTS
============================================================ */
.search-wrap { padding-top: 120px; padding-bottom: 100px; }
.search-top-form { margin-bottom: 40px; }
.search-top-form form {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  gap: 12px;
}
.search-top-form input[type="search"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--fg);
  padding: 4px 0;
}
.search-top-form input[type="search"]::placeholder { color: rgba(122,118,114,0.6); }
.search-top-form button { color: var(--muted); display: flex; align-items: center; }
.search-top-form button svg { width: 20px; height: 20px; }
.search-count { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-bottom: 32px; }

/* ============================================================
   PILLARS PAGE
============================================================ */
.pillars-page-wrap { padding-top: 120px; padding-bottom: 100px; }
.pillars-page-header { margin-bottom: 48px; }
.pillars-page-header .section-label { margin-bottom: 16px; }
.pillars-page-subtitle {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--muted);
  font-style: italic;
}
.pillars-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.pillar-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px;
  transition: border-color 0.15s;
}
.pillar-card:hover { border-color: var(--accent); }
.pillar-card-name {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--fg);
  transition: color 0.15s;
  font-weight: 500;
}
.pillar-card:hover .pillar-card-name { color: var(--accent); }
.pillar-card-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
}
.pillar-card-count {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

/* ============================================================
   ALL-POSTS ARCHIVE PAGE (page-archive.php)
============================================================ */
.full-archive-wrap { padding-top: 120px; padding-bottom: 100px; }
.full-archive-header { margin-bottom: 48px; }
.full-archive-header .section-label { margin-bottom: 20px; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; }
.filter-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.filter-tag:hover, .filter-tag.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   ABOUT PAGE
============================================================ */
.about-wrap { padding-top: 120px; padding-bottom: 100px; }
.about-statement {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.65;
  color: var(--fg);
  text-align: center;
  max-width: 680px;
  margin: 0 auto 80px;
}
.about-section { max-width: 680px; margin: 0 auto 60px; }
.about-section .section-label { margin-bottom: 16px; }
.about-section p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  color: var(--fg);
  margin-top: 16px;
}

/* ============================================================
   CONTACT PAGE
============================================================ */
.contact-wrap { padding-top: 120px; padding-bottom: 100px; }
.contact-header { margin-bottom: 40px; }
.contact-header .section-label { margin-bottom: 16px; }
.contact-header p {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--muted);
  font-style: italic;
}
.contact-form { max-width: 560px; }
.form-group { margin-bottom: 20px; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
  display: block;
  border-radius: 0;
  -webkit-appearance: none;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: rgba(122,118,114,0.7); }
.contact-submit {
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 28px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
  display: inline-block;
  margin-top: 8px;
}
.contact-submit:hover { background: #4a5872; }
.contact-note {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 28px;
  max-width: 500px;
  line-height: 1.7;
}
.contact-success {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--fg);
  padding: 24px 0;
}

/* ============================================================
   LEGAL PAGES (Disclaimer, Privacy Policy)
============================================================ */
.legal-wrap { padding-top: 120px; padding-bottom: 100px; }
.legal-wrap .section-label { margin-bottom: 16px; }
.legal-title {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 24px;
}
.legal-body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  color: var(--fg);
  max-width: 680px;
}

/* ============================================================
   DEFAULT PAGE
============================================================ */
.page-wrap { padding-top: 120px; padding-bottom: 100px; }
.page-title {
  font-family: var(--serif);
  font-size: 32px;
  color: var(--fg);
  font-weight: 500;
  margin-bottom: 32px;
}
.page-body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
  color: var(--fg);
  max-width: 680px;
}
.page-body p { margin-bottom: 20px; }
.page-body a { color: var(--accent); text-decoration: underline; }

/* ============================================================
   404
============================================================ */
.not-found-wrap {
  padding-top: 180px;
  padding-bottom: 100px;
  text-align: center;
}
.not-found-title {
  font-family: var(--serif);
  font-size: 48px;
  color: var(--fg);
  margin-bottom: 16px;
}
.not-found-msg {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero-headline { font-size: 26px; }

  .featured-inner { grid-template-columns: 1fr; padding: 56px 24px; gap: 32px; }
  .featured-title { font-size: 26px; }

  .posts-grid { grid-template-columns: 1fr; }
  .more-grid { grid-template-columns: 1fr; }
  .pillars-cards { grid-template-columns: 1fr; }

  .narrator-quote { font-size: 18px; }

  .footer-inner { flex-direction: column; text-align: center; }

  .post-title { font-size: 26px; }
  .entry-content p { font-size: 16px; }

  .archive-title { font-size: 24px; }
  .about-statement { font-size: 18px; }

  .post-row { flex-direction: column; gap: 4px; }

  .header-search-bar form { padding: 14px 24px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars-cards { grid-template-columns: repeat(2, 1fr); }
  .pillars-row { grid-template-columns: repeat(5, 1fr); min-width: 0; }
  .featured-inner { gap: 32px; }
}

/* WordPress alignment classes */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin: 16px auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 6px; }
