/*
Theme Name: Crossway Bible
Theme URI: https://crosswaybible.com
Author: Crossway Bible
Author URI: https://crosswaybible.com
Description: Simple, clean Christian blog theme. Latest posts first, About page, and Categories dropdown. Built for Crossway Bible.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crossway
*/

/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Open Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #2b2b2b;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color 0.15s; }
a:hover { color: #9a7a2e; }
img { max-width: 100%; height: auto; display: block; }

:root {
  --bg: #ffffff;
  --bg-soft: #f8f6f2;
  --ink: #2b2b2b;
  --ink-soft: #555555;
  --ink-mute: #888888;
  --rule: #e6e2dc;
  --accent: #c19a3e;
  --accent-deep: #9a7a2e;
  --dark: #2d2620;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Open Sans', system-ui, sans-serif;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ============ SITE HEADER ============ */
.site-header {
  padding: 20px 32px;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-logo-mark {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 4px;
  flex-shrink: 0;
}
.site-logo img { width: 44px; height: 44px; border-radius: 4px; }
.site-logo-text { line-height: 1.15; }
.site-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--dark);
  margin: 0;
}
.site-tagline {
  font-size: 0.72rem;
  color: var(--ink-mute);
  font-style: italic;
  margin-top: 2px;
}

/* Nav */
.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-link {
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.current {
  background: var(--bg-soft);
  color: var(--accent-deep);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 3px;
  transition: background 0.15s;
}
.dropdown-btn:hover, .dropdown.open .dropdown-btn {
  background: var(--bg-soft);
  color: var(--accent-deep);
}
.dropdown-btn::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.2s;
}
.dropdown.open .dropdown-btn::after { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: white;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 3px;
  padding: 8px 0;
  min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all 0.2s;
  z-index: 30;
}
.dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dropdown-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 18px;
  font-size: 0.88rem;
  color: var(--ink);
}
.dropdown-menu a:hover {
  background: var(--bg-soft);
  color: var(--accent-deep);
}
.dropdown-menu .count {
  color: var(--ink-mute);
  font-size: 0.78rem;
  margin-left: 8px;
}

/* ============ PAGE TITLE ============ */
.page-title {
  text-align: center;
  padding: 48px 32px 32px;
  border-bottom: 1px solid var(--rule);
  max-width: 1200px;
  margin: 0 auto;
}
.page-title h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--dark);
  margin: 0 0 8px;
}
.page-title p {
  color: var(--ink-mute);
  font-size: 0.95rem;
  margin: 0;
}

/* ============ POSTS GRID ============ */
.posts-grid {
  padding: 48px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: white;
  transition: transform 0.25s ease;
}
.post-card:hover { transform: translateY(-3px); }

.post-card-img {
  aspect-ratio: 3/2;
  background: var(--bg-soft) no-repeat center/cover;
  overflow: hidden;
  border-radius: 3px;
  margin-bottom: 18px;
  position: relative;
}
.post-card-img > div {
  width: 100%; height: 100%;
  background: inherit;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.post-card:hover .post-card-img > div { transform: scale(1.04); }

.post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-cat {
  display: inline-block;
  color: var(--accent-deep);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.post-card h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--dark);
  letter-spacing: -0.005em;
  /* Limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card:hover h3 { color: var(--accent-deep); }
.post-card p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 14px;
  /* Limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: auto;
  padding-top: 6px;
  align-items: center;
}
.post-card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.post-card-meta svg {
  width: 13px;
  height: 13px;
  stroke: var(--ink-mute);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ============ PAGINATION ============ */
.pagination {
  text-align: center;
  padding: 24px 32px 56px;
  max-width: 1200px;
  margin: 0 auto;
}
.pagination .page-numbers {
  display: inline-block;
  padding: 10px 16px;
  margin: 0 2px;
  background: white;
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 3px;
  transition: all 0.15s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

/* ============ SINGLE POST ============ */
.single-post {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px;
}
.single-post .post-meta-top {
  text-align: center;
  margin-bottom: 16px;
}
.single-post .post-cat {
  display: inline-block;
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.single-post h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  color: var(--dark);
  margin: 0 0 16px;
  text-align: center;
}
.single-post .post-byline {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.single-post .post-byline .byline-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.single-post .post-byline svg {
  width: 14px;
  height: 14px;
  stroke: var(--ink-mute);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.single-post .post-byline strong { color: var(--ink); font-weight: 600; }
.single-post .featured-img {
  margin: 0 -32px 32px;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-soft);
}
.single-post .featured-img img {
  width: 100%; height: 100%; object-fit: cover;
}
.single-post .post-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
}
.single-post .post-content p { margin: 0 0 1.2em; }
.single-post .post-content h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--dark);
  margin: 2em 0 0.6em;
}
.single-post .post-content h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--dark);
  margin: 1.6em 0 0.5em;
}
.single-post .post-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  margin: 1.5em 0;
  padding: 16px 24px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
}
.single-post .post-content a {
  color: var(--accent-deep);
  text-decoration: underline;
}
.single-post .post-content img {
  border-radius: 4px;
  margin: 1.2em auto;
}
.single-post .post-content ul,
.single-post .post-content ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.single-post .post-content li { margin-bottom: 0.4em; }

.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 12px;
}
.post-footer a {
  color: var(--accent-deep);
  font-weight: 600;
}

/* ============ PAGE (About, etc) ============ */
.page-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 32px;
  font-size: 1.05rem;
  line-height: 1.75;
}
.page-content h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--dark);
  margin: 0 0 24px;
  text-align: center;
}
.page-content h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--dark);
  margin: 1.8em 0 0.5em;
}
.page-content p { margin: 0 0 1.2em; }
.page-content a {
  color: var(--accent-deep);
  text-decoration: underline;
}

/* ============ FOOTER ============ */
.site-footer {
  background: #1c1813;
  color: #b8b0a3;
  padding: 32px;
  text-align: center;
  margin-top: 48px;
}
.site-footer .footer-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: white;
  margin: 0 0 8px;
}
.site-footer .footer-tag {
  font-size: 0.85rem;
  color: #8a8275;
  margin: 0 0 20px;
  font-style: italic;
}
.site-footer .footer-copy {
  border-top: 1px solid #2d2620;
  padding-top: 16px;
  font-size: 0.78rem;
  color: #6a6258;
  max-width: 600px;
  margin: 0 auto;
}

/* ============ EMPTY / 404 ============ */
.no-results {
  text-align: center;
  padding: 80px 32px;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.1rem;
}

/* ============ SEARCH FORM ============ */
.search-form {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto 32px;
}
.search-form input[type="search"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  background: var(--bg-soft);
  font-family: var(--sans);
  font-size: 0.9rem;
  outline: none;
  border-radius: 3px;
}
.search-form input[type="search"]:focus {
  border-color: var(--accent);
  background: white;
}
.search-form button {
  background: var(--dark);
  color: white;
  border: none;
  padding: 10px 22px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
}
.search-form button:hover { background: var(--accent-deep); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .site-header {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .main-nav { justify-content: center; }
  .dropdown-menu { right: auto; left: 0; }
  .page-title { padding: 32px 16px 24px; }
  .posts-grid { grid-template-columns: 1fr; padding: 32px 16px; gap: 24px; }
  .pagination { padding: 16px 16px 40px; }
  .single-post, .page-content { padding: 32px 20px; }
  .single-post .featured-img { margin: 0 -20px 24px; }
}

/* WordPress utility classes WP expects themes to honor */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.alignwide { max-width: none; }
.alignfull { max-width: none; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: 0.85rem;
  color: var(--ink-mute);
  text-align: center;
  padding: 8px 0;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.sticky { display: block; }
.gallery-caption { color: var(--ink-mute); }
.bypostauthor { display: block; }
