/*
Theme Name:  Otherwise Books
Theme URI:   https://otherwise-books.com
Description: House theme for Otherwise Books. Matches the main site aesthetic.
Version:     1.0.1
Author:      Paul Beard
Author URI:  https://paulbeard.org
License:     GPL-2.0-or-later
Text Domain: otherwise-books
*/

/* ── Variables ──────────────────────────────────────────────────────────────── */
:root {
  --ink:    #1a1a18;
  --muted:  #5a5a54;
  --rule:   #d4d0c8;
  --cream:  #faf8f4;
  --accent: #2a4a2a;
  --meta:   #9a9a94;
  --white:  #ffffff;
}

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

html { font-size: 18px; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout shell ───────────────────────────────────────────────────────────── */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  width: 100%;
}

/* ── Site header ────────────────────────────────────────────────────────────── */
.site-header {
  max-width: 560px;
  margin: 0 auto;
  padding: 4rem 2rem 0;
  width: 100%;
}

.site-branding {
  margin-bottom: 3rem;
}

.site-title {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: normal;
  font-family: Georgia, serif;
}

.site-title a {
  color: var(--muted);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--ink);
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.main-navigation {
  margin-top: 0.75rem;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.main-navigation a {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.main-navigation a:hover {
  color: var(--ink);
}

/* ── Post list (archive / home) ─────────────────────────────────────────────── */
.post-list {
  list-style: none;
}

.post-list-item {
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
}

.post-list-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.post-date {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 0.5rem;
}

.post-list-item h2 {
  font-size: 1.1rem;
  font-weight: normal;
  font-style: italic;
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

.post-list-item h2 a {
  color: var(--ink);
  text-decoration: none;
}

.post-list-item h2 a:hover {
  text-decoration: underline;
}

.post-excerpt {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
}

.read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Single post / page ─────────────────────────────────────────────────────── */
.entry-header {
  margin-bottom: 2rem;
}

.entry-label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.entry-title {
  font-size: 1.75rem;
  font-weight: normal;
  font-style: italic;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.entry-meta {
  font-size: 0.78rem;
  color: var(--meta);
  border-top: 1px solid var(--rule);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* ── Post content ───────────────────────────────────────────────────────────── */
.entry-content {
  margin-top: 2rem;
}

.entry-content p {
  margin-bottom: 1.4rem;
  font-size: 1rem;
  line-height: 1.75;
}

.entry-content h2 {
  font-size: 1.1rem;
  font-weight: bold;
  font-style: normal;
  margin: 2.5rem 0 0.75rem;
  color: var(--ink);
}

.entry-content h3 {
  font-size: 0.95rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2rem 0 0.6rem;
  color: var(--muted);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.4rem 1.5rem;
  font-size: 1rem;
  line-height: 1.75;
}

.entry-content li { margin-bottom: 0.4rem; }

.entry-content blockquote {
  border-left: 2px solid var(--rule);
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  color: var(--muted);
  font-style: italic;
}

.entry-content hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content img {
  margin: 2rem 0;
}

.entry-content figure {
  margin: 2rem 0;
}

.entry-content figcaption {
  font-size: 0.78rem;
  color: var(--meta);
  margin-top: 0.5rem;
}

/* ── Post navigation ────────────────────────────────────────────────────────── */
.post-navigation {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.82rem;
}

.nav-previous { text-align: left; }
.nav-next     { text-align: right; }

.nav-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 0.3rem;
}

.post-navigation a {
  color: var(--ink);
  font-style: italic;
}

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.pagination .page-numbers {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule);
  color: var(--muted);
  text-decoration: none;
}

.pagination .page-numbers.current {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.pagination .page-numbers:hover:not(.current) {
  border-color: var(--muted);
}

/* ── Page: no-posts ─────────────────────────────────────────────────────────── */
.no-results {
  padding: 3rem 0;
  color: var(--muted);
  font-style: italic;
}

/* ── Comments ───────────────────────────────────────────────────────────────── */
.comments-area {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.comments-title {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.comment-list { list-style: none; }

.comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}

.comment-author {
  font-size: 0.82rem;
  font-weight: bold;
  color: var(--ink);
}

.comment-meta {
  font-size: 0.72rem;
  color: var(--meta);
  margin-bottom: 0.75rem;
}

.comment-content p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink);
}

/* Comment form */
.comment-respond {
  margin-top: 2.5rem;
}

.comment-reply-title {
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  font-weight: normal;
}

.comment-form label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink);
  outline: none;
  border-radius: 0;
  appearance: none;
  margin-bottom: 1.25rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--muted);
}

.comment-form textarea {
  min-height: 140px;
  resize: vertical;
}

.comment-form .submit {
  font-family: Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 0;
}

.comment-form .submit:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Search form ────────────────────────────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
}

.search-form input[type="search"] {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--ink);
  border-right: none;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  border-radius: 0;
  appearance: none;
}

.search-form button {
  font-family: Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 1.2rem;
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
}

/* ── Divider ────────────────────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--rule); margin: 3rem 0; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  letter-spacing: 0.05em;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover { color: var(--ink); }

/* ── WordPress admin bar nudge ──────────────────────────────────────────────── */
.admin-bar .site-header { margin-top: 32px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .site-content  { padding: 2.5rem 1.25rem 4rem; }
  .site-header   { padding: 2.5rem 1.25rem 0; }
  .entry-title   { font-size: 1.45rem; }
  .search-form input[type="search"] { border-right: 1px solid var(--ink); border-bottom: none; }
}
/* Two-column layout */
.content-wrapper {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.content-main {
    flex: 1;
    min-width: 0;
}

.sidebar {
    flex: 0 0 220px;
    font-size: 0.9rem;
    color: var(--color-muted, #6b6b6b);
}

.sidebar .widget {
    margin-bottom: 2rem;
}

.sidebar .widget-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-ink, #2a2a2a);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-rule, #d4cfc8);
}

.sidebar .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .widget ul li {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--color-rule, #d4cfc8);
    line-height: 1.4;
}

.sidebar .widget ul li a {
    color: var(--color-ink, #2a2a2a);
    text-decoration: none;
}

.sidebar .widget ul li a:hover {
    color: var(--color-accent, #7a6a52);
}

/* Responsive — stack on small screens */
@media ( max-width: 700px ) {
    .content-wrapper {
        flex-direction: column;
    }
    .sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
}
