/*
Theme Name: Spiritual Meaning World
Theme URI: https://spiritualmeaning.world
Author: Spiritual Meaning World
Author URI: https://spiritualmeaning.world
Description: Clean magazine-style theme for spiritual content. 15-post homepage grid, Quote of the Week, author box on posts, ad-ready sidebar. Lightning fast.
Version: 2.1.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: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spiritual-meaning-world
Tags: blog, custom-menu, custom-logo, featured-images, right-sidebar, two-columns
*/

:root {
  --primary: #4a3f6b;
  --primary-dark: #2f2744;
  --accent: #c9a86c;
  --accent-bg: #f7f3eb;
  --text: #2a2730;
  --muted: #6e6878;
  --bg: #f8f7f5;
  --surface: #ffffff;
  --border: #e6e2db;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(47, 39, 68, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100%;
}
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.3; color: var(--primary-dark); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.site { display: flex; flex-direction: column; min-height: 100vh; overflow: visible; }
.main { flex: 1; padding: 2rem 0 3rem; }

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0;
  gap: 1rem;
}
.logo a {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.logo img { max-height: 44px; width: auto; }
.nav ul { display: flex; list-style: none; gap: .15rem; margin: 0; }
.nav a {
  display: block;
  padding: .45rem .85rem;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
}
.nav a:hover, .nav .current-menu-item > a {
  color: var(--primary);
  background: var(--accent-bg);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: .4rem;
  cursor: pointer;
  color: var(--primary-dark);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
  overflow: visible;
}

/* Magazine Grid – 15 posts */
.mag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}
.mag-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}
.mag-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(47, 39, 68, .1);
}
.mag-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--border);
}
.mag-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.mag-card:hover .mag-thumb img { transform: scale(1.04); }
.mag-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  aspect-ratio: 16 / 10;
  color: var(--accent);
  font-size: 1.8rem;
}
.mag-body { padding: 1rem 1.1rem 1.15rem; flex: 1; display: flex; flex-direction: column; }
.mag-meta {
  font-size: .78rem;
  color: var(--muted);
  margin-bottom: .4rem;
}
.mag-title {
  font-size: 1.02rem;
  margin-bottom: .5rem;
  flex: 1;
}
.mag-title a { color: var(--primary-dark); }
.mag-title a:hover { color: var(--primary); }
.mag-more {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: .35rem;
}
.mag-more:hover { color: var(--primary-dark); }

/* Single post */
.single-post {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.single-thumb { aspect-ratio: 2 / 1; overflow: hidden; background: var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.single-thumb img { width: 100%; height: 100%; object-fit: cover; }
.single-body { padding: 1.75rem 2rem 2rem; }
.single-meta {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .6rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.single-title { font-size: 1.85rem; margin-bottom: 1.25rem; }
.single-content { font-size: 1.05rem; line-height: 1.8; }
.single-content p { margin-bottom: 1.2rem; }
.single-content h2, .single-content h3 { margin: 1.75rem 0 .75rem; }
.single-content img { border-radius: 6px; margin: 1.25rem 0; }
.single-content blockquote {
  border-left: 3px solid var(--accent);
  padding: .6rem 0 .6rem 1.1rem;
  margin: 1.5rem 0;
  font-family: var(--serif);
  font-style: italic;
  background: var(--accent-bg);
  border-radius: 0 6px 6px 0;
}

/* Author box – on every single post */
.author-box {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  margin-top: 2.25rem;
}
.author-box img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--surface);
}
.author-box h4 { font-size: 1.05rem; margin-bottom: .3rem; }
.author-box h4 a { color: var(--primary-dark); }
.author-box p { font-size: .92rem; color: var(--muted); margin: 0; line-height: 1.55; }

/* Comments – single only */
.comments { margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.comments-title { font-size: 1.35rem; margin-bottom: 1.25rem; }
.comment-list { list-style: none; margin: 0 0 2rem; }
.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: .85rem;
}
.comment .children { list-style: none; margin: .85rem 0 0 1.25rem; }
.comment-meta { display: flex; align-items: center; gap: .65rem; margin-bottom: .6rem; }
.comment-meta img { width: 40px; height: 40px; border-radius: 50%; }
.comment-author { font-weight: 600; color: var(--primary-dark); }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.comment-form h3 { margin-bottom: 1rem; }
.comment-form label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: .3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: var(--bg);
  margin-bottom: .9rem;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 63, 107, .12);
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .7rem 1.5rem;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}
.comment-form .submit:hover { background: var(--primary-dark); }

/* Sidebar */
.sidebar {
  position: sticky;
  top: 4.75rem;
  width: 100%;
  max-width: 300px;
  align-self: start;
}
.widget {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.widget-title {
  font-size: .95rem;
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent);
  color: var(--primary-dark);
}
.widget ul { list-style: none; margin: 0; }
.widget li {
  padding: .4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--text); }
.widget a:hover { color: var(--primary); }

/* Quote widget */
.quote-widget {
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
}
.quote-widget .widget-title {
  color: var(--accent);
  border-bottom-color: rgba(201, 168, 108, .35);
}
.quote-text {
  font-family: var(--serif);
  font-size: 1.02rem;
  font-style: italic;
  line-height: 1.6;
  margin-bottom: .7rem;
}
.quote-author { font-size: .85rem; opacity: .9; text-align: right; }
.quote-author::before { content: "— "; }

/* Recent posts in sidebar – compact */
.sidebar-posts { list-style: none; margin: 0; padding: 0; }
.sidebar-posts li {
  display: flex;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.sidebar-posts li:last-child { border-bottom: none; }
.sidebar-posts img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.sidebar-posts a {
  font-size: .88rem;
  font-weight: 500;
  color: var(--primary-dark);
  line-height: 1.35;
}
.sidebar-posts a:hover { color: var(--primary); }
.sidebar-posts .sp-date {
  display: block;
  font-size: .75rem;
  color: var(--muted);
  margin-top: .15rem;
  font-weight: 400;
}

/* Ad slot */
.ad-slot {
  text-align: center;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.ad-slot img, .ad-slot iframe, .ad-slot ins {
  max-width: 100% !important;
  margin: 0 auto;
  display: block;
}

/* Search */
.search-form { display: flex; gap: .4rem; }
.search-field {
  flex: 1;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  background: var(--bg);
}
.search-submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .55rem .9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: .85rem;
}
.search-submit:hover { background: var(--primary-dark); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 2rem;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .65rem;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.pagination a:hover {
  background: var(--accent-bg);
  border-color: var(--primary);
  color: var(--primary);
}
.pagination .current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.8);
  padding: 1.75rem 0;
  margin-top: auto;
}
.footer a { color: var(--accent); }
.footer a:hover { color: #fff; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  font-size: .88rem;
}
.footer-menu ul { display: flex; list-style: none; margin: 0; gap: 1.1rem; }

/* Misc */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px;
}
.no-posts { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.archive-header { margin-bottom: 1.5rem; }
.archive-title { font-size: 1.5rem; }

/* Responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.15rem; }
  .sidebar .widget, .sidebar .ad-slot { margin-bottom: 0; }
  .mag-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .6rem 1.25rem 1rem;
    box-shadow: var(--shadow);
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: .6rem .4rem; }
  .mag-grid { grid-template-columns: 1fr; }
  .single-body { padding: 1.25rem; }
  .single-title { font-size: 1.45rem; }
  .author-box { flex-direction: column; align-items: center; text-align: center; }
  .comment .children { margin-left: .6rem; }
  .sidebar { grid-template-columns: 1fr; }
}


/* ==========================================================================
   Sidebar Author Box
   ========================================================================== */
.author-sidebar {
  text-align: center;
  padding: 1.5rem 1.25rem;
}
.author-sidebar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
}
.author-sidebar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-bg);
  box-shadow: var(--shadow);
}
.author-sidebar-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: .2rem;
  font-family: var(--font);
}
.author-sidebar-name {
  font-size: 1.1rem;
  margin-bottom: .4rem;
}
.author-sidebar-name a { color: var(--primary-dark); }
.author-sidebar-name a:hover { color: var(--primary); }
.author-sidebar-bio {
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   Ad-optimized slots (AdSense-ready)
   ========================================================================== */
.ad-slot {
  margin-bottom: 1.25rem;
  text-align: center;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}
.ad-slot .ad-inner {
  display: block;
  line-height: 0;
}
.ad-slot img,
.ad-slot iframe,
.ad-slot ins,
.ad-slot .adsbygoogle {
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto;
  display: block;
}
/* Reserve space for 300x250 to reduce CLS when ads load */
.ad-top,
.ad-mid {
  min-height: 0;
}
.ad-bottom {
  position: sticky;
  top: 5rem;
}

/* ==========================================================================
   Beautiful comments under posts
   ========================================================================== */
.comments-wrap {
  margin-top: 2.5rem;
}
.comments-list-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}
.comments-title {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.comment {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: .85rem;
}
.comment .children {
  list-style: none;
  margin: .85rem 0 0 1.15rem;
  padding: 0;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .65rem;
}
.comment-meta img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
}
.comment-author {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: .95rem;
}
.comment-date {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 400;
}
.comment-content {
  font-size: .95rem;
  line-height: 1.6;
}
.comment-content p:last-child { margin-bottom: 0; }
.reply a {
  font-size: .82rem;
  font-weight: 600;
  margin-top: .4rem;
  display: inline-block;
}

/* Comment form card */
.comment-box {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.75rem 1.85rem;
}
.comment-box .comment-reply-title,
.comment-form h3 {
  font-size: 1.25rem;
  margin-bottom: .5rem;
  color: var(--primary-dark);
}
.comment-notes {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.15rem;
}
.comment-form label {
  display: block;
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: .3rem;
  color: var(--text);
}
.comment-form .required { color: #c45c5c; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: .95rem;
  background: var(--bg);
  margin-bottom: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 63, 107, .12);
  background: #fff;
}
.comment-form textarea {
  min-height: 130px;
  resize: vertical;
}
.comment-form .form-submit { margin: 0; }
.comment-form .submit {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .75rem 1.75rem;
  font-size: .95rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.comment-form .submit:hover {
  background: var(--primary-dark);
}
.comment-form .submit:active {
  transform: scale(.98);
}
.no-comments {
  color: var(--muted);
  font-size: .95rem;
  margin-bottom: 1rem;
}

@media (max-width: 960px) {
  .sidebar {
    position: static;
    max-width: none;
  }
  .ad-bottom {
    position: static;
  }
}
@media (max-width: 640px) {
  .comment-box,
  .comments-list-box {
    padding: 1.25rem;
  }
  .comment .children {
    margin-left: .5rem;
  }
}
