/*
Theme Name: Amirition
Theme URI: https://amirition.me
Author: Amir Ition
Author URI: https://amirition.me
Description: Terminal-inspired personal blog theme with a paper-and-ink aesthetic. Clean semantic HTML, no framework dependencies.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: amirition
Tags: blog, two-columns, right-sidebar, custom-colors, custom-logo, featured-images, sticky-post, translation-ready
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --blue:   #227c9d;
  --teal:   #17c3b2;
  --yellow: #ffcb77;
  --cream:  #fef9ef;
  --coral:  #fe6d73;

  --ink:    #2c2722;
  --body:   #5f564a;
  --muted:  #a89a85;
  --border: #e3d8c4;
  --rule:   #cdbfa6;
  --bg:     #efe7d6;

  --serif: 'Newsreader', Georgia, serif;
  --mono:  'Space Mono', ui-monospace, monospace;

  --radius-card: 7px;
  --radius-pill: 20px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s, color 0.25s;
}
a { color: inherit; }
img, picture { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }
ol, ul { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; overflow-wrap: break-word; }

/* ============================================================
   3. ACCESSIBILITY
   ============================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; top: 0; }

.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;
  word-wrap: normal !important;
}

/* ============================================================
   4. SITE WRAPPER
   ============================================================ */
#page { min-height: 100vh; }

/* ============================================================
   5. SITE HEADER  (non-home pages)
   ============================================================ */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-title {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.site-title .dot { color: var(--coral); }

.main-nav .nav-list { display: flex; gap: 4px; }
.main-nav .nav-list li a {
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--body);
  transition: color 0.15s, background 0.15s;
}
.main-nav .nav-list li a:hover,
.main-nav .nav-list li.current-menu-item > a { color: var(--ink); background: var(--border); }

/* ============================================================
   6. TERMINAL CARD  (shared component)
   ============================================================ */
div.paper {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  overflow: hidden;
}

.box {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.box .bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  font-family: var(--mono);
  font-size: 11px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.bar .dots { display: flex; gap: 5px; flex-shrink: 0; }
.bar .dots span { width: 9px; height: 9px; border-radius: 50%; display: block; }
.dot-r { background: var(--coral); }
.dot-y { background: var(--yellow); }
.dot-g { background: var(--teal); }

/* Box accent variants */
.box.it:hover        { box-shadow: 0 6px 18px rgba(34,124,157,.12); }
.box.it .bar         { background: #e8f1f5; color: var(--blue); border-bottom-color: #d6e6ec; }
.box.misc:hover      { box-shadow: 0 6px 18px rgba(254,109,115,.13); }
.box.misc .bar       { background: #fdeceb; color: var(--coral); border-bottom-color: #f6d6d7; }
.box.about:hover     { box-shadow: 0 6px 18px rgba(44,39,34,.08); }
.box.about .bar      { background: #f2ece0; color: var(--ink); border-bottom-color: #e6dcc8; }
.box.search-box .bar { background: #eaf3f7; color: var(--blue); border-bottom-color: #d6e6ec; }
.box.search-box:hover { box-shadow: 0 6px 18px rgba(34,124,157,.10); }
.box.cats-box .bar   { background: #f2ece0; color: var(--ink); border-bottom-color: #e6dcc8; }
.box.cats-box:hover  { box-shadow: 0 6px 18px rgba(44,39,34,.08); }
.box.comments-box .bar { background: #fdeceb; color: var(--coral); border-bottom-color: #f6d6d7; }

/* ============================================================
   7. HOME PAGE
   ============================================================ */
.home {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 36px 34px;
  font-family: var(--mono);
}

.home-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.home-head .prompt { font-size: 13px; color: var(--teal); }
.home-head .brand {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1px;
  margin-top: 4px;
  line-height: 1.1;
}
.home-head .brand .dot { color: var(--coral); }
.home-head .tagline { font-size: 12px; color: #8a7f72; margin-top: 6px; }

.theme-toggle {
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  cursor: pointer;
  background: none;
  color: inherit;
  font-family: var(--mono);
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.theme-toggle:hover { background: var(--ink); color: var(--cream); }

.home-body { display: flex; gap: 18px; align-items: flex-start; }
.home-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.home-aside { width: 282px; flex-shrink: 0; display: flex; flex-direction: column; gap: 18px; }

/* Post lists */
.post-list { padding: 6px 8px 8px; }
.post-list a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.post-list .title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.post-list-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.post-list.it a:hover   { color: var(--blue);  background: #eaf3f7; }
.post-list.misc a:hover { color: var(--coral); background: #fdecec; }

.no-posts {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 16px 18px;
  text-align: center;
}

/* ============================================================
   8. SIDEBAR: SEARCH
   ============================================================ */
.search-body { padding: 14px; }

.search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-form label { display: contents; }

.search-field {
  flex: 1;
  min-width: 0;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  transition: border-color 0.18s;
}
.search-field::placeholder { color: var(--muted); }
.search-field:focus { outline: none; border-color: var(--blue); }

.search-submit {
  background: var(--blue);
  color: var(--cream);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  flex-shrink: 0;
}
.search-submit:hover { background: #1a6282; transform: translateY(-1px); }

/* ============================================================
   9. SIDEBAR: CATEGORIES
   ============================================================ */
.categories-body { padding: 6px 8px 8px; }

.categories-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s;
}
.categories-list li a:hover { background: #f2ece0; }

.cat-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}
.cat-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.cat-slug-it-and-dev .cat-name     { color: var(--blue); }
.cat-slug-everything-else .cat-name { color: var(--coral); }

/* ============================================================
   10. SIDEBAR: ABOUT
   ============================================================ */
.about-body { padding: 18px; }

.about-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.about-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: #9a8c74;
  background-image: repeating-linear-gradient(45deg, #efe6d2 0 8px, #e7dcc4 8px 16px);
}
.about-name {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  margin-top: 14px;
}
.about-role {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 3px;
}
.about-bio {
  font-family: var(--serif);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--body);
  margin-top: 12px;
}

/* ============================================================
   11. SOCIAL LINKS
   ============================================================ */
.social { margin-top: 24px; text-align: center; }
.social .prompt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--teal);
  margin-bottom: 14px;
}
.social .icons { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.social a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s, border-color 0.18s;
}
.social a:hover                { transform: translateY(-4px); }
.social .gh:hover { background: var(--yellow); color: var(--ink);   border-color: var(--yellow); box-shadow: 0 8px 16px rgba(255,203,119,.45); }
.social .li:hover { background: var(--blue);   color: var(--cream); border-color: var(--blue);   box-shadow: 0 8px 16px rgba(34,124,157,.4); }
.social .tw:hover { background: var(--teal);   color: var(--cream); border-color: var(--teal);   box-shadow: 0 8px 16px rgba(23,195,178,.4); }
.social .yt:hover { background: var(--coral);  color: var(--cream); border-color: var(--coral);  box-shadow: 0 8px 16px rgba(254,109,115,.4); }

/* ============================================================
   12. SINGLE POST
   ============================================================ */
.single {
  max-width: 860px;
  margin: 0 auto;
  padding: 26px 56px 40px;
}

.post-nav {
  display: flex;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  align-items: center;
  flex-wrap: wrap;
}
.post-nav.bottom { margin-top: 30px; }

.navbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 6px 13px;
  transition: background 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.navbtn:hover { background: #f1e8d7; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(44,39,34,.12); }
.navbtn.cat { border-color: var(--blue); color: var(--blue); }
.navbtn.cat:hover { background: #e7f0f4; box-shadow: 0 4px 10px rgba(34,124,157,.18); }
.navbtn.home { margin-left: auto; }

.post-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-top: 22px;
}
.post-title {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.6px;
  color: var(--ink);
}
.post-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
  align-items: center;
}

/* Post body typography */
.post-body p {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--body);
  margin-top: 18px;
}
.post-body p:first-child { margin-top: 22px; }
.post-body p.lead { font-size: 18.5px; color: #3a342c; line-height: 1.7; }

.post-body h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 40px 0 8px;
  letter-spacing: -.3px;
}
.post-body h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 30px 0 6px;
}
.post-body h4 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 24px 0 4px;
}

.post-body ul,
.post-body ol {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--body);
  margin-top: 16px;
  padding-left: 22px;
}
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li + li { margin-top: 6px; }

.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { color: var(--coral); }

.post-body blockquote {
  margin: 28px 0;
  padding: 14px 22px;
  border-left: 4px solid var(--yellow);
  background: #fffdf7;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.65;
  color: var(--body);
}
.post-body blockquote p { margin-top: 0; font-size: inherit; line-height: inherit; }
.post-body blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.post-body pre {
  margin: 20px 0;
  background: var(--ink);
  color: #f0e9da;
  border-radius: 4px;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}
.post-body pre .k { color: var(--teal); }
.post-body pre .v { color: var(--yellow); }
.post-body pre .c { color: var(--muted); font-style: italic; }

.post-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: #ede8e0;
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--coral);
}
.post-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

.post-body hr {
  border: none;
  border-top: 1px dashed var(--rule);
  margin: 36px 0;
}
.post-body figure { margin: 28px 0; }
.post-body figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}
.post-body img { border-radius: 4px; width: 100%; }

/* WordPress block alignments */
.post-body .alignleft  { float: left;  margin: 0 24px 16px 0; }
.post-body .alignright { float: right; margin: 0 0 16px 24px; }
.post-body .aligncenter { margin-left: auto; margin-right: auto; }
.post-body .wp-caption-text {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 6px;
}

/* ============================================================
   BLOCK EDITOR (GUTENBERG) SUPPORT
   ============================================================ */

/* --- Text colors --- */
.has-blue-color   { color: var(--blue)   !important; }
.has-teal-color   { color: var(--teal)   !important; }
.has-yellow-color { color: var(--yellow) !important; }
.has-cream-color  { color: var(--cream)  !important; }
.has-coral-color  { color: var(--coral)  !important; }
.has-ink-color    { color: var(--ink)    !important; }
.has-muted-color  { color: var(--muted)  !important; }
.has-bg-color     { color: var(--bg)     !important; }

/* --- Background colors --- */
.has-background { padding: 1.25em 2em; }
.has-blue-background-color   { background-color: var(--blue)   !important; }
.has-teal-background-color   { background-color: var(--teal)   !important; }
.has-yellow-background-color { background-color: var(--yellow) !important; }
.has-cream-background-color  { background-color: var(--cream)  !important; }
.has-coral-background-color  { background-color: var(--coral)  !important; }
.has-ink-background-color    { background-color: var(--ink)    !important; }
.has-muted-background-color  { background-color: var(--muted)  !important; }
.has-bg-background-color     { background-color: var(--bg)     !important; }

/* --- Font sizes --- */
.has-small-font-size   { font-size: 0.875em; }
.has-medium-font-size  { font-size: 1.125em; }
.has-large-font-size   { font-size: 1.5em;   }
.has-x-large-font-size { font-size: 2em;     }
.has-huge-font-size    { font-size: 2.5em;   }

/* --- Text alignment --- */
.has-text-align-left   { text-align: left; }
.has-text-align-center { text-align: center; }
.has-text-align-right  { text-align: right; }

/* --- Wide & full alignment --- */
.alignwide {
  margin-left:  calc(-8%);
  margin-right: calc(-8%);
}
.alignfull {
  margin-left:  calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
  width: 100vw;
}

/* --- Drop cap --- */
.has-drop-cap:not(:focus)::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.68;
  font-weight: 600;
  margin: 0.1em 0.14em 0 0;
}

/* --- Image block --- */
.wp-block-image img { border-radius: 4px; max-width: 100%; height: auto; }
.wp-block-image figcaption {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* --- Quote & Pullquote --- */
.wp-block-quote {
  border-left: 4px solid var(--blue);
  padding: 0.8em 1.2em;
  margin: 1.5em 0;
  color: var(--body);
}
.wp-block-quote cite,
.wp-block-quote footer {
  font-size: 0.875em;
  color: var(--muted);
  display: block;
  margin-top: 0.5em;
}
.wp-block-pullquote {
  border-top: 4px solid var(--ink);
  border-bottom: 4px solid var(--ink);
  padding: 1.5em;
  text-align: center;
}
.wp-block-pullquote blockquote { border: none; margin: 0; }
.wp-block-pullquote cite {
  font-size: 0.8em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Separator --- */
.wp-block-separator {
  border: none;
  border-top: 2px solid var(--rule);
  margin: 2em auto;
}
.wp-block-separator.is-style-dots {
  border: none;
  text-align: center;
  line-height: 1;
}
.wp-block-separator.is-style-dots::before {
  content: '···';
  color: var(--muted);
  font-size: 1.5em;
  letter-spacing: 0.5em;
}

/* --- Code & Preformatted --- */
.wp-block-code {
  font-family: var(--mono);
  background: rgba(0,0,0,0.04);
  border-radius: 4px;
  padding: 1em 1.25em;
  overflow-x: auto;
  font-size: 0.875em;
}
.wp-block-preformatted {
  font-family: var(--mono);
  font-size: 0.875em;
  overflow-x: auto;
}

/* --- Table --- */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table td,
.wp-block-table th {
  border: 1px solid var(--border);
  padding: 0.5em 0.75em;
}
.wp-block-table th { background: rgba(0,0,0,0.04); font-weight: 600; }

/* --- Buttons --- */
.wp-block-button__link {
  display: inline-block;
  background: var(--blue);
  color: #fff !important;
  padding: 0.55em 1.4em;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.875em;
  transition: opacity 0.15s;
}
.wp-block-button__link:hover { opacity: 0.85; }
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 2px solid currentColor;
}

/* --- Columns --- */
.wp-block-columns { display: flex; gap: 2em; flex-wrap: wrap; }
.wp-block-column  { flex: 1 1 200px; min-width: 0; }

/* --- Group & Cover --- */
.wp-block-group { padding: 1.5em; }
.wp-block-cover { border-radius: var(--radius-card); overflow: hidden; }

/* --- Dark mode adjustments for blocks --- */
body.dark-mode .wp-block-code        { background: #272018; color: #f2888d; }
body.dark-mode .wp-block-quote       { color: #c4b8a6; }
body.dark-mode .wp-block-table td,
body.dark-mode .wp-block-table th    { border-color: #3a3028; }
body.dark-mode .wp-block-table th    { background: #272018; }
body.dark-mode .has-ink-background-color   { color: #e8dfd0; }
body.dark-mode .has-cream-background-color { color: var(--ink); }

/* ============================================================
   13. KEEP READING / RECOMMENDATIONS
   ============================================================ */
.recs {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px dashed var(--rule);
}
.recs h2 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 14px;
  font-weight: 400;
}
.recs a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  padding: 12px 0;
  border-bottom: 1px dashed var(--rule);
  transition: padding-left 0.15s;
}
.recs a:last-child { border-bottom: none; }
.recs a:hover { padding-left: 6px; }
.recs .title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.recs .date {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   14. COMMENTS
   ============================================================ */
.comments-area {
  margin-top: 40px;
}
.comments-inner {
  padding: 20px 24px 28px;
}
.comments-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--coral);
  font-weight: 400;
  margin-bottom: 20px;
}

/* Comment list */
.comments-list { display: flex; flex-direction: column; }
.comment-item {
  padding: 18px 0;
  border-bottom: 1px dashed var(--rule);
}
.comment-item:last-child { border-bottom: none; }
.comment-children {
  padding-left: 24px;
  border-left: 2px solid var(--border);
  margin-top: 4px;
}

.comment-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.comment-author-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.comment-author-name a { text-decoration: none; }
.comment-author-name a:hover { color: var(--blue); }
.comment-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}
.comment-awaiting-moderation {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--yellow);
  background: rgba(255,203,119,.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.comment-text p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.65;
  color: var(--body);
  margin-top: 6px;
}
.comment-text p:first-child { margin-top: 0; }

.comment-reply-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  text-decoration: none;
  padding: 3px 10px;
  border: 1px solid var(--blue);
  border-radius: var(--radius-pill);
  margin-top: 10px;
  transition: background 0.15s, color 0.15s;
}
.comment-reply-link:hover { background: var(--blue); color: var(--cream); }

/* Comment form */
.comment-respond {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--rule);
}
.comment-reply-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 400;
  margin-bottom: 16px;
}
.comment-reply-title small { display: block; margin-top: 6px; }
.comment-reply-title small a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}
.comment-reply-title small a:hover { color: var(--coral); }

.comment-notes {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px;
}
.comment-notes .required { color: var(--coral); }

/* Form fields in a row */
.comment-form-fields-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.comment-form-fields-row > p { flex: 1; margin: 0; }

.comment-form > p,
.comment-form-fields-row > p { margin-bottom: 12px; }

.comment-form label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.comment-form .required { color: var(--coral); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.18s;
}
.comment-form input:focus,
.comment-form textarea:focus { outline: none; border-color: var(--teal); }
.comment-form textarea { resize: vertical; min-height: 120px; }

.comment-form .form-submit { margin: 0; }
.submit {
  background: var(--ink);
  color: var(--cream);
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.submit:hover { background: #3d342b; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(44,39,34,.2); }

.comment-form-cookies-consent label {
  display: inline-flex;
  gap: 8px;
  align-items: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

/* Comment navigation */
.comment-navigation {
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule);
}
.comment-navigation a { color: var(--blue); text-decoration: none; }
.comment-navigation a:hover { text-decoration: underline; }

/* ============================================================
   15. ARCHIVE / BLOG INDEX
   ============================================================ */
.archive-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 36px 40px;
}
.archive-header { margin-bottom: 28px; }
.archive-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.archive-heading {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.4px;
}
.archive-description {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--body);
  margin-top: 8px;
  line-height: 1.6;
}

.archive-list { display: flex; flex-direction: column; }
.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.15s;
}
.archive-item:hover { padding-left: 8px; }
.archive-item .title { font-family: var(--serif); font-size: 17px; font-weight: 600; }
.archive-item .date {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ============================================================
   16. SEARCH RESULTS PAGE
   ============================================================ */
.search-results-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 36px 40px;
}
.search-results-header { margin-bottom: 24px; }
.search-results-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.search-term { color: var(--blue); }
.search-results-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.no-results { text-align: center; padding: 48px 0 32px; }
.no-results p { font-family: var(--serif); font-size: 17px; color: var(--body); margin-bottom: 24px; }

/* ============================================================
   17. POSTS PAGINATION
   ============================================================ */
.posts-navigation,
.pagination { margin-top: 32px; }
.nav-links { display: flex; gap: 8px; align-items: center; font-family: var(--mono); font-size: 12px; }
.nav-links a,
.nav-links span.current {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--body);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--border); color: var(--ink); }
.nav-links span.current { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* ============================================================
   18. PAGE TEMPLATE  (static pages)
   ============================================================ */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 56px 48px;
}
.page-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ink);
  letter-spacing: -.5px;
}

/* ============================================================
   19. SITE FOOTER
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 32px;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ============================================================
   20. DARK MODE
   ============================================================ */
body.dark-mode {
  background: #18140f;
  color: #e8dfd0;
}
body.dark-mode div.paper,
body.dark-mode .site-header {
  background: #201c17;
  border-color: #3a3028;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
body.dark-mode .box                    { border-color: #3a3028; }
body.dark-mode .box .bar              { border-bottom-color: #3a3028; }
body.dark-mode .box.it .bar           { background: #192833; color: #5aaec9; border-bottom-color: #253d4d; }
body.dark-mode .box.misc .bar         { background: #2c1a1c; color: #f2888d; border-bottom-color: #3e2325; }
body.dark-mode .box.about .bar        { background: #231f19; color: #e8dfd0; border-bottom-color: #3a3028; }
body.dark-mode .box.search-box .bar   { background: #192833; color: #5aaec9; border-bottom-color: #253d4d; }
body.dark-mode .box.cats-box .bar     { background: #231f19; color: #e8dfd0; border-bottom-color: #3a3028; }
body.dark-mode .box.comments-box .bar { background: #2c1a1c; color: #f2888d; border-bottom-color: #3e2325; }

body.dark-mode .post-list.it a:hover   { background: #192833; }
body.dark-mode .post-list.misc a:hover { background: #2c1a1c; }
body.dark-mode .categories-list li a:hover { background: #231f19; }
body.dark-mode .cat-count              { background: #3a3028; color: #a89a85; }

body.dark-mode .search-field {
  background: #272018;
  border-color: #3a3028;
  color: #e8dfd0;
}
body.dark-mode .search-field:focus { border-color: var(--teal); }

body.dark-mode .about-photo-placeholder {
  background-image: repeating-linear-gradient(45deg, #231f19 0 8px, #1a1710 8px 16px);
  color: #7d7062;
}

body.dark-mode .post-meta  { border-bottom-color: #e8dfd0; color: #7d7062; }
body.dark-mode .post-body p,
body.dark-mode .post-body li  { color: #c4b8a6; }
body.dark-mode .post-body p.lead { color: #d8cfc0; }
body.dark-mode .post-body h2,
body.dark-mode .post-body h3,
body.dark-mode .post-body h4  { color: #e8dfd0; }
body.dark-mode .post-body a   { color: #5aaec9; }
body.dark-mode .post-body a:hover { color: #f2888d; }
body.dark-mode .post-body blockquote { background: #1a1710; color: #c4b8a6; }
body.dark-mode .post-body code { background: #272018; color: #f2888d; }

body.dark-mode .navbtn         { border-color: #e8dfd0; color: #e8dfd0; }
body.dark-mode .navbtn:hover   { background: #272018; }
body.dark-mode .navbtn.cat     { border-color: #5aaec9; color: #5aaec9; }
body.dark-mode .navbtn.cat:hover { background: #192833; }

body.dark-mode .theme-toggle   { border-color: #e8dfd0; }
body.dark-mode .theme-toggle:hover { background: #e8dfd0; color: #18140f; }

body.dark-mode .social a       { border-color: #e8dfd0; color: #e8dfd0; }

body.dark-mode .comment-item   { border-bottom-color: #3a3028; }
body.dark-mode .comment-children { border-left-color: #3a3028; }
body.dark-mode .comment-text p { color: #c4b8a6; }
body.dark-mode .comment-respond { border-top-color: #3a3028; }
body.dark-mode .recs           { border-top-color: #3a3028; }
body.dark-mode .recs a         { border-bottom-color: #3a3028; }

body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
  background: #272018;
  border-color: #3a3028;
  color: #e8dfd0;
}
body.dark-mode .submit { background: #3d342b; }
body.dark-mode .submit:hover { background: #4e4438; }

body.dark-mode .archive-item   { border-bottom-color: #3a3028; }
body.dark-mode .archive-heading { color: #e8dfd0; }
body.dark-mode .archive-description { color: #c4b8a6; }

body.dark-mode .nav-links span.current { background: #e8dfd0; color: #18140f; border-color: #e8dfd0; }
body.dark-mode .nav-links a { border-color: #3a3028; color: #a89a85; }
body.dark-mode .nav-links a:hover { background: #3a3028; color: #e8dfd0; }

body.dark-mode .site-footer    { color: #7d7062; }

/* ============================================================
   21. RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .home { padding: 24px 22px 30px; }
  .single { padding: 22px 28px 36px; }
  .page-content { padding: 28px 28px 40px; }
  .archive-page,
  .search-results-page { padding: 24px 22px 32px; }
}

@media (max-width: 880px) {
  .home-body    { flex-direction: column; }
  .home-aside   { width: 100%; }
  .comment-form-fields-row { flex-direction: column; }
  .site-header-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 640px) {
  .home { padding: 16px 14px 24px; }
  .home-head { flex-direction: column; gap: 12px; align-items: flex-start; }
  .home-head .brand { font-size: 28px; }
  .theme-toggle { align-self: flex-start; }

  .post-list a { flex-direction: column; gap: 2px; align-items: flex-start; }
  .post-list .date { font-size: 11px; }

  .single { padding: 16px 16px 28px; }
  .page-content { padding: 16px 16px 28px; }
  .post-title { font-size: 26px; }
  .post-body p,
  .post-body ul,
  .post-body ol { font-size: 16px; }
  .post-body blockquote { font-size: 16px; padding: 12px 16px; }
  .post-body pre { font-size: 12px; padding: 12px 14px; }

  .navbtn.home { margin-left: 0; }

  .recs a { flex-direction: column; gap: 2px; align-items: flex-start; }
  .recs .title { font-size: 16px; }

  .archive-item { flex-direction: column; gap: 2px; align-items: flex-start; }
  .archive-page,
  .search-results-page { padding: 16px 14px 28px; }
  .archive-heading { font-size: 24px; }

  .social .icons { gap: 10px; }
  .social a { width: 38px; height: 38px; font-size: 15px; }
}

@media (max-width: 420px) {
  .home { padding: 12px 10px 20px; }
  .home-head .brand { font-size: 24px; }
  .single { padding: 12px 12px 24px; }
  .page-content { padding: 12px 12px 24px; }
  .post-title { font-size: 22px; letter-spacing: -.3px; }
}
