/*
Theme Name: oklo
Theme URI: https://oklo.org
Author: Greg Laughlin
Description: A modern reading theme for oklo.org — single-column, typography-first, dark header with the transiting planet. Successor to the site's long-running Twenty Eleven look.
Version: 0.1.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: oklo
*/

/* ---------------------------------------------------------------------------
   Tokens
--------------------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --text: #1c1e21;
  --text-soft: #55595f;
  --rule: #e3e1dc;
  --accent: #b8481c;          /* from the planet's limb */
  --accent-hover: #8f3411;
  --header-bg: #000000;
  --header-text: #f5f2ec;
  --code-bg: #f4f2ee;

  --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 45rem;           /* ~720px reading column */
  --wide: 66rem;              /* wide figures, header content */
  --gutter: 1.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101214;
    --text: #d6d3cd;
    --text-soft: #8f8d88;
    --rule: #2a2d31;
    --accent: #e06a35;
    --accent-hover: #f08a55;
    --code-bg: #1a1d20;
  }
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.1875rem;       /* 19px */
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem auto;
  max-width: var(--measure);
}

/* ---------------------------------------------------------------------------
   Header — the black band with the planet
--------------------------------------------------------------------------- */
.site-header {
  background: var(--header-bg) no-repeat right center / auto 100%;
  color: var(--header-text);
}

.site-header .band {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 13rem;
}

.site-title {
  margin: 0;
  font-family: var(--sans);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
}

.site-title a { color: var(--header-text); text-decoration: none; }
.site-title a:hover { color: #ffffff; text-decoration: none; }

.site-description {
  margin: 0.6rem 0 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: rgba(245, 242, 236, 0.62);
}

/* Navigation strip under the band */
.site-nav {
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.site-nav .band {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.site-nav li { margin: 0; }

.site-nav a {
  display: inline-block;
  padding: 0.8rem 0;
  color: var(--text-soft);
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a {
  color: var(--accent);
  text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Content column
--------------------------------------------------------------------------- */
.site-main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem var(--gutter) 4rem;
}

/* Post header */
.entry-header { margin: 0 0 1.75rem; }

.entry-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.entry-title a { color: inherit; }
.entry-title a:hover { color: var(--accent); text-decoration: none; }

.entry-meta {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--accent); }

/* Body copy */
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5 {
  font-family: var(--sans);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 2.2em 0 0.6em;
}

.entry-content h2 { font-size: 1.45rem; }
.entry-content h3 { font-size: 1.2rem; }

.entry-content p { margin: 0 0 1.25em; }

.entry-content blockquote {
  margin: 1.75em 0;
  padding: 0 0 0 1.4em;
  border-left: 3px solid var(--rule);
  color: var(--text-soft);
  font-style: italic;
}

.entry-content code, .entry-content pre {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
}

.entry-content code { padding: 0.15em 0.35em; border-radius: 3px; }

.entry-content pre {
  padding: 1.1em 1.3em;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
}

.entry-content pre code { padding: 0; background: none; }

/* Figures: allowed to breathe wider than the text column on large screens */
.entry-content img,
.entry-content figure,
.entry-content .wp-caption {
  margin: 2em auto;
  display: block;
  max-width: 100%;
}

@media (min-width: 70rem) {
  .entry-content figure.alignwide,
  .entry-content img.size-large,
  .entry-content img.size-full {
    max-width: min(58rem, calc(100vw - 3rem));
    margin-left: 50%;
    transform: translateX(-50%);
  }
}

.wp-caption-text, figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-soft);
  text-align: center;
  margin-top: 0.6em;
}

/* Tables */
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92em;
  margin: 2em 0;
}

.entry-content th, .entry-content td {
  border-bottom: 1px solid var(--rule);
  padding: 0.5em 0.75em;
  text-align: left;
}

.entry-content th {
  font-family: var(--sans);
  font-size: 0.8em;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ---------------------------------------------------------------------------
   Post separators & archive lists
--------------------------------------------------------------------------- */
.post + .post { border-top: 1px solid var(--rule); margin-top: 3.5rem; padding-top: 3.5rem; }

.archive-list { list-style: none; margin: 0; padding: 0; }

.archive-list li {
  display: flex;
  gap: 1.25rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.archive-list .date {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-soft);
  white-space: nowrap;
  min-width: 6.5rem;
}

.page-title {
  font-family: var(--sans);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 2rem;
}

/* Pagination */
.pagination {
  margin: 3.5rem 0 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------------------
   Comments
--------------------------------------------------------------------------- */
.comments-area {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter) 4rem;
}

.comments-title {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  border-top: 1px solid var(--rule);
  padding-top: 2.5rem;
}

.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 2rem; }

.comment-body { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); font-size: 0.95em; }
.comment-meta { font-family: var(--sans); font-size: 0.82rem; color: var(--text-soft); }
.comment-meta .fn { font-style: normal; font-weight: 600; color: var(--text); }
.comment-list .avatar { border-radius: 50%; float: left; margin: 0.2rem 0.9rem 0 0; }

.comment-form label {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: 0.25rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.5em 0.7em;
  font: inherit;
  font-size: 0.95em;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.comment-form input[type="submit"] {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.6em 1.4em;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.comment-form input[type="submit"]:hover { background: var(--accent-hover); }

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--text-soft);
}

.site-footer .band {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

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

/* ---------------------------------------------------------------------------
   Mobile
--------------------------------------------------------------------------- */
@media (max-width: 44rem) {
  body { font-size: 1.0625rem; }

  .site-header .band { min-height: 8.5rem; padding: 2.25rem var(--gutter) 1.75rem; }
  .site-title { font-size: 2rem; }
  .site-description { letter-spacing: 0.1em; font-size: 0.85rem; }

  .site-nav ul { gap: 1.1rem; }

  .site-main { padding-top: 2rem; }
  .entry-title { font-size: 1.55rem; }

  .archive-list li { flex-direction: column; gap: 0.1rem; }
  .archive-list .date { min-width: 0; }
}

/* Accessibility */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px; width: 1px; overflow: hidden;
}
