/*
Theme Name: How to Be the Better Person
Theme URI: https://howtobethebetterperson.com
Author: The JPProject
Author URI: https://howtobethebetterperson.com
Description: A minimal standalone theme for How to Be the Better Person. Each post is a single thought with an optional expandable full reflection and audio version.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: better-person
Tags: minimal, blog, custom-logo, custom-menu, one-column
*/

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

/* ── VARIABLES ── */
:root {
  --bg:      #faf9f7;
  --text:    #1a1a1a;
  --muted:   #888;
  --accent:  #3a6b5c;
  --border:  #e0ddd8;
  --white:   #ffffff;
}

html { scroll-behavior: smooth; }

/* ── BASE ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════════════
   HEADER — 3-column CSS grid
   Desktop:  [ 1fr empty ] [ auto: tagline·logo·name ] [ 1fr empty ]
   Mobile:   [ 1fr: logo·name ] [ auto: hamburger ]
   ══════════════════════════════════════════════════════ */

.bp-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  width: 100%;
}

.bp-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "left center right";
  align-items: center;
  padding: 0.75rem 2rem;
  width: 100%;
}

/* Center column: tagline + logo + site name, always one line */
.bp-header__center {
  grid-area: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  min-width: 0;
}

/* Right column: hamburger (empty on desktop) */
.bp-header__right {
  grid-area: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* "A few thoughts on" */
.bp-header__tagline {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
}

/* Branding: logo + site name */
.bp-header__branding {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* WP outputs: .custom-logo-link > img.custom-logo
   Override WP block library which sets img { height: auto } */
.bp-header__branding .custom-logo-link {
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.bp-header__branding .custom-logo-link img,
.bp-header__branding .custom-logo-link img.custom-logo,
.bp-header__branding img {
  height: 48px !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
  flex-shrink: 0;
}

/* Logo fallback */
.bp-header__logo-fallback {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--text);
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
}

/* Site name */
.bp-header__site-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
  flex-shrink: 0;
}

.bp-header__site-name:hover { color: var(--text); }

/* Mobile toggle — hidden on desktop */
.bp-header__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text);
  line-height: 0;
  align-items: center;
  justify-content: center;
}

.bp-header__hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bp-header__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.bp-header__close {
  display: none;
  font-size: 1.2rem;
  line-height: 1;
}

.bp-header__toggle[aria-expanded="true"] .bp-header__hamburger { display: none; }
.bp-header__toggle[aria-expanded="true"] .bp-header__close     { display: block; }

/* Mobile nav dropdown */
.bp-mobile-nav {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0 1rem;
}

.bp-mobile-nav[hidden] { display: none; }
.bp-mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.bp-mobile-nav li { border-bottom: 1px solid var(--border); }
.bp-mobile-nav li:last-child { border-bottom: none; }

.bp-mobile-nav a {
  display: block;
  padding: 0.75rem 2rem;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.bp-mobile-nav a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  .bp-header__inner { padding: 0.65rem 1.5rem; }
  .bp-header__branding .custom-logo-link img,
  .bp-header__branding img { height: 40px !important; }
  .bp-header__site-name { font-size: 0.95rem; }
}

/* Mobile: 2-col grid — branding fills left, toggle on right */
@media (max-width: 600px) {
  .bp-header__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas: "center right";
    padding: 0.6rem 1rem;
  }
  .bp-header__tagline { display: none; }
  .bp-header__toggle  { display: flex; }
  .bp-header__branding .custom-logo-link img,
  .bp-header__branding img { height: 36px !important; }
  .bp-header__site-name { font-size: 0.9rem; }
}

@media (max-width: 380px) {
  .bp-header__site-name { font-size: 0.82rem; letter-spacing: 0.03em; }
}

/* ── MAIN CONTENT ── */
.site-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem 4rem;
}

/* ── SINGLE POST ── */
.post-wrap {
  max-width: 680px;
  width: 100%;
  text-align: center;
  animation: fadeUp 0.7s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-category {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.post-category::before,
.post-category::after {
  content: '';
  display: block;
  height: 1px;
  width: 40px;
  background: var(--border);
}

.thought {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  line-height: 1.45;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 2.5rem;
}

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

.post-meta {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-meta a { color: var(--accent); text-decoration: none; }

/* ── MORE BUTTON ── */
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  transition: border-color 0.2s;
}

.more-link:hover { border-bottom-color: var(--accent); }

.more-link .chevron {
  display: inline-block;
  transition: transform 0.35s ease;
  font-size: 0.7rem;
}

.more-link.open .chevron { transform: rotate(180deg); }

/* ── EXPANDED ARTICLE ── */
.full-article {
  display: none;
  max-width: 680px;
  width: 100%;
  text-align: left;
}

.full-article.visible {
  display: block;
  animation: expandIn 0.45s ease both;
}

@keyframes expandIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.article-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.article-divider::before,
.article-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── AUDIO BLOCK ── */
.audio-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.audio-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.audio-icon:hover { opacity: 0.85; }

.audio-icon svg { width: 14px; height: 14px; fill: white; margin-left: 2px; }

.audio-info { flex: 1; min-width: 0; }

.audio-label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.audio-title {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-link {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.audio-link:hover { border-bottom-color: var(--accent); }

.audio-native { width: 100%; margin-top: 0.6rem; accent-color: var(--accent); display: none; }
.audio-native.shown { display: block; }

/* ── ARTICLE BODY ── */
.article-body { font-size: 1rem; line-height: 1.85; color: #444; }
.article-body p { margin-bottom: 1.4rem; }
.article-body p:last-child { margin-bottom: 0; }

/* ── POST NAV ── */
.post-nav {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 680px;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-nav a:hover { color: var(--accent); }
.post-nav .arrow { font-size: 1rem; }

/* ── ARCHIVE ── */
.thoughts-archive { max-width: 680px; width: 100%; animation: fadeUp 0.7s ease both; }

.archive-heading {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.archive-heading::before,
.archive-heading::after { content: ''; display: block; height: 1px; flex: 1; background: var(--border); }

.thought-item { border-bottom: 1px solid var(--border); padding: 1.8rem 0; }
.thought-item:first-of-type { padding-top: 0; }

.thought-item a {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.45;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.thought-item a:hover { color: var(--accent); }

.archive-pagination {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 680px;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-pagination a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.archive-pagination a:hover { color: var(--accent); }

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.08em;
  background: var(--white);
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.8rem;
  margin-bottom: 1.2rem;
}

.footer-nav a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover { color: var(--accent); }
.footer-copy { color: var(--muted); }
.footer-copy a { color: var(--accent); text-decoration: none; }

/* ── GENERAL RESPONSIVE ── */
@media (max-width: 540px) {
  .site-main { padding: 3rem 1.5rem 3rem; }
  .audio-block { flex-wrap: wrap; }
  .footer-nav { gap: 0.4rem 1.2rem; }
}
