/* ==========================================================================
   cameronreilly.com — Cameron Reilly theme
   Editorial paper-and-ink. Design tokens taken verbatim from the handoff.
   Desktop-first, with collapse rules at 860px / 620px.
   ========================================================================== */

:root {
  --cr-paper:       #faf7f2;
  --cr-ink:         #211d18;
  --cr-body:        #4a4239;
  --cr-muted:       #6b6153;
  --cr-label:       #8a7f6e;
  --cr-accent:      #a5562f;
  --cr-rule:        #e4dccb;
  --cr-rule-soft:   #efe8d9;
  --cr-underline:   #c9beac;
  --cr-selection:   #e9dfcd;

  --cr-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --cr-sans:  'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --cr-wide:   1060px;   /* home */
  --cr-narrow:  720px;   /* subpages, blog, single */
  --cr-gutter:   40px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html, body {
  margin: 0;
  padding: 0;
  background: var(--cr-paper);
}

body {
  font-family: var(--cr-serif);
  color: var(--cr-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--cr-selection); }

a {
  color: var(--cr-ink);
  text-decoration: underline;
  text-decoration-color: var(--cr-underline);
  text-underline-offset: 3px;
  transition: color .15s, text-decoration-color .15s;
}
a:hover { color: var(--cr-accent); text-decoration-color: var(--cr-accent); }

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

/* Shell: every page is one centred column on paper. */
.cr-shell   { min-height: 100vh; background: var(--cr-paper); }
.cr-wrap    { max-width: var(--cr-narrow); margin: 0 auto; padding: 40px var(--cr-gutter) 64px; }
.cr-wrap--wide { max-width: var(--cr-wide); }

/* --------------------------------------------------------------------------
   Shared type primitives
   -------------------------------------------------------------------------- */

/* Eyebrow: 12px Archivo, uppercase, wide tracking, over a hairline rule. */
.cr-eyebrow {
  font-family: var(--cr-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cr-label);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cr-rule);
}

/* Eyebrow with a trailing link on the same rule row (e.g. "All posts"). */
.cr-eyebrow-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cr-rule);
}
.cr-eyebrow-row > span:first-child {
  font-family: var(--cr-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cr-label);
}
.cr-eyebrow-row a {
  font-family: var(--cr-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--cr-muted);
  text-decoration: none;
  white-space: nowrap;
}
.cr-eyebrow-row a:hover { color: var(--cr-accent); }

.cr-h1        { font-size: 52px; font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; margin: 0 0 40px; }
.cr-h1--home  { font-size: 68px; line-height: 1.02; margin: 0 0 24px; }
.cr-h1--tight { margin-bottom: 16px; }

.cr-lead { font-size: 19px; line-height: 1.7; margin: 0 0 20px; }
.cr-lead:last-child { margin-bottom: 0; }

.cr-tag {
  font-family: var(--cr-sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cr-accent);
  white-space: nowrap;
}
.cr-tag--year { font-size: 12px; display: block; margin-bottom: 16px; }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

.cr-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 88px;
}
/* Home has no wordmark — links sit hard right. */
.cr-nav--home { justify-content: flex-end; }

.cr-nav-brand {
  font-family: var(--cr-sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--cr-ink);
  text-decoration: none;
}
.cr-nav-brand:hover { color: var(--cr-accent); }

.cr-nav-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--cr-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.cr-nav-links a { color: var(--cr-muted); text-decoration: none; }
.cr-nav-links a:hover,
.cr-nav-links a.is-active { color: var(--cr-accent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.cr-footer {
  margin-top: 112px;
  padding-top: 28px;
  border-top: 1px solid var(--cr-rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
}
.cr-footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--cr-sans);
  font-size: 14px;
}
.cr-footer-links a { color: var(--cr-ink); text-decoration: none; }
.cr-footer-links a:hover { color: var(--cr-accent); }
.cr-footer-note {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.cr-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 72px;
  align-items: center;
}
.cr-hero-eyebrow {
  font-family: var(--cr-sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cr-label);
  margin-bottom: 20px;
}
.cr-hero-tagline {
  font-size: 24px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.45;
  color: var(--cr-body);
  max-width: 24em;
  margin: 0;
}
.cr-hero-portrait {
  width: 300px;
  height: 360px;
  object-fit: cover;
  object-position: 50% 20%;
  display: block;
  border-radius: 2px;
}

.cr-section { margin-top: 96px; }
.cr-bio { max-width: 620px; }
.cr-bio p { font-size: 19px; line-height: 1.7; margin: 0 0 20px; }
.cr-bio p:last-child { margin-bottom: 0; }

/* Projects: two columns of link rows, each a title + accent category tag. */
.cr-projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 56px;
}
.cr-project {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--cr-rule);
  text-decoration: none;
}
.cr-project-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.cr-project-title { font-size: 26px; font-weight: 500; }
.cr-project-desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--cr-muted);
  margin: 8px 0 0;
}
.cr-project:hover .cr-project-title { color: var(--cr-accent); }

/* Recent writing / blog list rows. */
.cr-postlist { display: flex; flex-direction: column; }
.cr-postrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--cr-rule-soft);
  text-decoration: none;
}
.cr-postrow-title { font-size: 21px; }
.cr-postrow-date {
  font-family: var(--cr-sans);
  font-size: 12px;
  color: var(--cr-label);
  white-space: nowrap;
}
.cr-postrow:hover .cr-postrow-title { color: var(--cr-accent); }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.cr-about-portrait {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: 50% 18%;
  display: block;
  border-radius: 2px;
  margin-bottom: 56px;
}
.cr-block { margin-bottom: 64px; }
.cr-block > .cr-eyebrow { display: block; padding-bottom: 14px; margin-bottom: 22px; }
/* The timeline sits tighter under its rule than prose does. */
.cr-block--timeline > .cr-eyebrow { margin-bottom: 6px; }
.cr-block p { font-size: 19px; line-height: 1.7; margin: 0 0 18px; }
.cr-block p:last-child { margin-bottom: 0; }

.cr-timeline { display: flex; flex-direction: column; }
.cr-timeline-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--cr-rule-soft);
}
.cr-timeline-when {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
  padding-top: 3px;
}
.cr-timeline-role { font-size: 20px; font-weight: 500; }
.cr-timeline-desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--cr-muted);
  margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   Books
   -------------------------------------------------------------------------- */

.cr-books { display: flex; flex-direction: column; gap: 64px; }
.cr-book {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  align-items: start;
}
.cr-book-cover {
  width: 180px;
  display: block;
  border-radius: 2px;
  box-shadow: 0 2px 12px rgba(33, 29, 24, 0.14);
}
.cr-book h2 { font-size: 30px; font-weight: 500; margin: 0 0 4px; line-height: 1.15; }
.cr-book p  { font-size: 18px; line-height: 1.65; margin: 0 0 12px; }
.cr-book-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--cr-sans);
  font-size: 14px;
}
.cr-books-closer { font-size: 17px; margin: 72px 0 0; color: var(--cr-muted); }

/* --------------------------------------------------------------------------
   News Sources / Now — stacked sections
   -------------------------------------------------------------------------- */

.cr-stack { display: flex; flex-direction: column; gap: 48px; }
.cr-stack .cr-eyebrow { display: block; padding-bottom: 14px; margin-bottom: 16px; }

.cr-linklist {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  font-size: 19px;
}

.cr-now-meta {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
  margin: 0 0 64px;
}
.cr-now-meta a { color: var(--cr-label); }
.cr-now-meta a:hover { color: var(--cr-accent); }

.cr-stack h2 { font-size: 28px; font-weight: 500; margin: 0 0 10px; }
.cr-stack section > p { font-size: 19px; line-height: 1.7; margin: 0; }

.cr-page-intro {
  font-size: 19px;
  line-height: 1.7;
  color: var(--cr-body);
  margin: 0 0 64px;
  max-width: 34em;
}

/* --------------------------------------------------------------------------
   Blog index / archive
   -------------------------------------------------------------------------- */

.cr-archive-head { margin-bottom: 8px; }

.cr-blogrow {
  display: block;
  padding: 24px 0;
  border-bottom: 1px solid var(--cr-rule-soft);
  text-decoration: none;
}
.cr-blogrow-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.cr-blogrow-title { font-size: 24px; font-weight: 400; line-height: 1.25; }
.cr-blogrow:hover .cr-blogrow-title { color: var(--cr-accent); }
.cr-blogrow-excerpt {
  font-size: 16px;
  line-height: 1.55;
  color: var(--cr-muted);
  margin: 8px 0 0;
}

.cr-pagination {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  font-family: var(--cr-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.cr-pagination a { color: var(--cr-muted); text-decoration: none; }
.cr-pagination a:hover { color: var(--cr-accent); }
.cr-pagination .cr-pagination-spacer { visibility: hidden; }

.cr-empty { font-size: 19px; color: var(--cr-muted); }

/* --------------------------------------------------------------------------
   Single post / generic page
   -------------------------------------------------------------------------- */

.cr-post-kicker {
  font-family: var(--cr-sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cr-label);
  margin-bottom: 20px;
}
.cr-post-kicker a { color: var(--cr-label); text-decoration: none; }
.cr-post-kicker a:hover { color: var(--cr-accent); }

.cr-featured { margin: 0 0 40px; }
.cr-featured img { display: block; width: 100%; border-radius: 2px; }

.cr-post-endrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--cr-rule);
  font-family: var(--cr-sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--cr-label);
}
.cr-post-endrow a { color: var(--cr-muted); text-decoration: none; }
.cr-post-endrow a:hover { color: var(--cr-accent); }

/* Prose: the container for 20 years of legacy post + page bodies. */
.cr-prose { font-size: 19px; line-height: 1.7; }
.cr-prose > *:first-child { margin-top: 0; }
.cr-prose > *:last-child  { margin-bottom: 0; }
.cr-prose p { margin: 0 0 22px; }
.cr-prose h1, .cr-prose h2, .cr-prose h3, .cr-prose h4 {
  font-weight: 500;
  line-height: 1.25;
  margin: 44px 0 14px;
}
.cr-prose h1 { font-size: 34px; font-weight: 400; }
.cr-prose h2 { font-size: 28px; }
.cr-prose h3 { font-size: 23px; }
.cr-prose h4 { font-size: 20px; }
.cr-prose ul, .cr-prose ol { margin: 0 0 22px; padding-left: 1.4em; }
.cr-prose li { margin-bottom: 8px; }
.cr-prose img,
.cr-prose iframe,
.cr-prose video { max-width: 100%; height: auto; border-radius: 2px; }
.cr-prose iframe { display: block; }
.cr-prose figure { margin: 32px 0; }
.cr-prose figcaption {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
  margin-top: 8px;
}
.cr-prose blockquote {
  margin: 32px 0;
  padding-left: 24px;
  border-left: 2px solid var(--cr-rule);
  color: var(--cr-body);
  font-style: italic;
}
.cr-prose blockquote p:last-child { margin-bottom: 0; }
.cr-prose hr {
  border: 0;
  border-top: 1px solid var(--cr-rule);
  margin: 44px 0;
}
.cr-prose code, .cr-prose kbd, .cr-prose samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--cr-selection);
  padding: 1px 5px;
  border-radius: 2px;
}
.cr-prose pre {
  background: var(--cr-selection);
  padding: 18px 20px;
  border-radius: 2px;
  overflow-x: auto;
  font-size: 15px;
  line-height: 1.5;
}
.cr-prose pre code { background: none; padding: 0; }
.cr-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
  margin: 0 0 22px;
  display: block;
  overflow-x: auto;
}
.cr-prose th, .cr-prose td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--cr-rule-soft);
}
.cr-prose th { font-family: var(--cr-sans); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cr-label); }

/* Legacy Divi/WP alignment + caption classes still present in old bodies. */
.cr-prose .alignleft   { float: left;  margin: 6px 28px 20px 0; }
.cr-prose .alignright  { float: right; margin: 6px 0 20px 28px; }
.cr-prose .aligncenter { display: block; margin: 24px auto; }
.cr-prose .wp-caption  { max-width: 100%; }
.cr-prose .wp-caption-text {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
}
.cr-prose::after { content: ""; display: table; clear: both; }

/* Comments — plain and out of the way. ~7,300 of them across 20 years, so a
   long thread has to read as a footnote, not a second article. */
.cr-comments { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--cr-rule); }
.cr-comments > .cr-eyebrow { display: block; margin-bottom: 8px; }

.cr-commentlist,
.cr-commentlist ol,
.cr-commentlist ul { list-style: none; margin: 0; padding: 0; }
.cr-commentlist .children { padding-left: 28px; border-left: 1px solid var(--cr-rule-soft); }

.cr-comments .comment-body {
  padding: 20px 0;
  border-bottom: 1px solid var(--cr-rule-soft);
  font-size: 17px;
  line-height: 1.6;
}
.cr-comments .comment-body p { margin: 8px 0 0; }
.cr-comments .comment-meta,
.cr-comments .comment-metadata,
.cr-comments .comment-awaiting-moderation,
.cr-comments .reply {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
}
.cr-comments .comment-author {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-ink);
  font-weight: 600;
}
.cr-comments .comment-author .says { display: none; }
.cr-comments .comment-metadata a,
.cr-comments .reply a { color: var(--cr-label); text-decoration: none; }
.cr-comments .comment-metadata a:hover,
.cr-comments .reply a:hover { color: var(--cr-accent); }
.cr-comments .reply { margin-top: 8px; }
.cr-comments-closed,
.cr-comments-note {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
}

/* Reply form — same hairline-underline treatment as the search field. */
.cr-commentform { margin-top: 40px; }
.cr-commentform-title { display: block; margin-bottom: 20px; }
.cr-commentform .comment-form-comment,
.cr-commentform .comment-form-author,
.cr-commentform .comment-form-email,
.cr-commentform .comment-form-url { margin: 0 0 20px; }
.cr-commentform label {
  display: block;
  font-family: var(--cr-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cr-label);
  margin-bottom: 6px;
}
.cr-commentform textarea,
.cr-commentform input[type="text"],
.cr-commentform input[type="email"],
.cr-commentform input[type="url"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--cr-serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--cr-ink);
  background: transparent;
  border: 1px solid var(--cr-rule);
  border-radius: 2px;
  padding: 10px 12px;
}
.cr-commentform textarea { min-height: 140px; resize: vertical; }
.cr-commentform textarea:focus,
.cr-commentform input:focus { outline: 0; border-color: var(--cr-accent); }
.cr-commentform .comment-form-cookies-consent {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
}
.cr-commentform .comment-form-cookies-consent label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  margin: 0;
  color: var(--cr-muted);
}
.cr-commentform .submit,
.cr-comment-submit {
  font-family: var(--cr-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cr-muted);
  background: transparent;
  border: 1px solid var(--cr-rule);
  border-radius: 2px;
  padding: 10px 22px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.cr-commentform .submit:hover,
.cr-comment-submit:hover { color: var(--cr-accent); border-color: var(--cr-accent); }
.cr-commentform #cancel-comment-reply-link {
  font-family: var(--cr-sans);
  font-size: 13px;
  color: var(--cr-label);
  text-decoration: none;
  margin-left: 12px;
}

/* Search form on the 404 / search templates. */
.cr-searchform { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.cr-searchform input[type="search"] {
  font-family: var(--cr-serif);
  font-size: 18px;
  color: var(--cr-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--cr-rule);
  padding: 8px 0;
  min-width: 260px;
  flex: 1;
}
.cr-searchform input[type="search"]:focus { outline: 0; border-bottom-color: var(--cr-accent); }
.cr-searchform button {
  font-family: var(--cr-sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cr-muted);
  background: transparent;
  border: 1px solid var(--cr-rule);
  border-radius: 2px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.cr-searchform button:hover { color: var(--cr-accent); border-color: var(--cr-accent); }

/* Screen-reader-only, for labels the design doesn't show. */
.cr-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Responsive — the prototypes are desktop-first; collapse to one column and
   keep the whitespace generous.
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .cr-hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .cr-hero-portrait { width: 100%; height: 420px; }
  .cr-projects { grid-template-columns: 1fr; gap: 0; }
  .cr-h1--home { font-size: 52px; }
  .cr-nav { margin-bottom: 56px; }
}

@media (max-width: 620px) {
  :root { --cr-gutter: 22px; }

  .cr-wrap { padding: 28px var(--cr-gutter) 56px; }

  .cr-nav { flex-direction: column; align-items: flex-start; gap: 16px; }
  .cr-nav-links { gap: 20px; }

  .cr-h1        { font-size: 38px; margin-bottom: 28px; }
  .cr-h1--home  { font-size: 42px; }
  .cr-hero-tagline { font-size: 21px; }
  .cr-hero-portrait { height: 340px; }

  .cr-section { margin-top: 64px; }
  .cr-block, .cr-stack { gap: 40px; }

  /* Timeline: date stacked over the role rather than beside it. */
  .cr-timeline-row { grid-template-columns: 1fr; gap: 6px; }
  .cr-timeline-when { padding-top: 0; }

  /* Book covers go full-width above the copy. */
  .cr-book { grid-template-columns: 1fr; gap: 24px; }
  .cr-book-cover { width: 180px; }

  /* Long titles need to wrap away from the right-hand tag/date. */
  .cr-project-top,
  .cr-postrow,
  .cr-blogrow-top { flex-direction: column; align-items: flex-start; gap: 6px; }

  .cr-footer { margin-top: 72px; }
  .cr-prose { font-size: 18px; }
}
