/*
Theme Name: Open Journal
Theme URI: https://210mike.com/
Author: Mike + OpenAI
Description: A quiet, minimal, text-first personal blog theme for essays, notes, and independent writing.
Version: 1.3.5
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: open-journal
*/

:root {
  --bg: #fbfbfa;
  --text: #171717;
  --muted: #77736d;
  --line: #e8e6e1;
  --soft: #f3f2ef;
  --content: 720px;
  --site: 980px;
}

html[data-theme="dark"] {
  --bg: #111210;
  --text: #f1f0ec;
  --muted: #aaa69e;
  --line: #2d2e2a;
  --soft: #1b1c19;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--muted); }
button, input, textarea { font: inherit; }
img { max-width: 100%; height: auto; }

.wrap { width: min(calc(100% - 40px), var(--site)); margin-inline: auto; }
.content-width { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.navbar {
  min-height: 108px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  position: relative;
}
.nav-left {
  min-width: 1px;
}
.brand {
  grid-column: 2;
  justify-self: center;
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  line-height: 0;
}
.brand img { display: block; height: auto; }
.default-brand-logo {
  width: clamp(260px, 31vw, 430px);
  max-width: 100%;
}
html[data-theme="dark"] .default-brand-logo {
  filter: invert(1) brightness(1.15) contrast(1.05);
}
.custom-logo-link { display: block; line-height: 0; }
.custom-logo { max-height: 64px; width: auto; }
.nav-links { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 20px; }
.nav-links ul { list-style: none; display: flex; align-items: center; gap: 20px; margin: 0; padding: 0; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .88rem; }
.nav-links a:hover, .current-menu-item > a { color: var(--text); }
.icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}
.icon-button:hover { background: var(--soft); color: var(--text); }
.menu-toggle { display: none; }

.home-intro {
  padding: 34px 0 0;
}
.home-intro p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
}
.home-writing .list-heading {
  padding-top: 26px;
}

.list-heading {
  margin: 0;
  padding: 34px 0 12px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.post-list { margin: 0; padding: 0; list-style: none; }
.post-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 30px;
  border-top: 1px solid var(--line);
}
.post-row:first-child { border-top: 0; }
.post-date {
  color: var(--muted);
  font-size: .82rem;
  padding-top: 5px;
  white-space: nowrap;
}
.post-row h2 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.post-row h2 a { text-decoration: none; }
.post-row h2 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.post-row p { margin: 0; color: var(--muted); font-size: .96rem; max-width: 650px; }
.post-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: .77rem;
}
.post-meta-inline a { color: inherit; text-decoration: none; }
.post-meta-inline a:hover { color: var(--text); }

.archive-header { padding: 56px 0 24px; border-bottom: 1px solid var(--line); }
.archive-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.archive-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 500;
}
.archive-header p { color: var(--muted); max-width: 650px; margin: 12px 0 0; }

.article-header { padding: 66px 0 38px; }
.article-kicker { color: var(--muted); font-size: .78rem; margin-bottom: 14px; }
.article-kicker a { color: inherit; text-decoration: none; }
.article-title {
  margin: 0 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 6vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  font-weight: 500;
}
.article-deck { color: var(--muted); font-size: 1.06rem; margin: 0 0 18px; }
.article-byline { color: var(--muted); font-size: .8rem; display: flex; gap: 7px; flex-wrap: wrap; }

.entry-content {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  line-height: 1.78;
  padding-bottom: 22px;
}
.entry-content > * { margin-top: 0; margin-bottom: 1.35em; }
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.18;
  letter-spacing: -.025em;
  margin-top: 2.2em;
}
.entry-content h2 { font-size: 1.65rem; }
.entry-content h3 { font-size: 1.35rem; }
.entry-content blockquote {
  margin: 2em 0;
  padding-left: 20px;
  border-left: 2px solid var(--text);
  color: var(--muted);
  font-style: italic;
}
.entry-content a { text-decoration-thickness: 1px; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2.8em 0; }
.entry-content pre { overflow: auto; background: var(--soft); padding: 18px; font-size: .82em; }
.entry-content code { font-family: "SFMono-Regular", Consolas, monospace; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption { color: var(--muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: .78rem; }

.article-footer { border-top: 1px solid var(--line); margin-top: 26px; padding: 26px 0 74px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .8rem; color: var(--muted); }
.tags a { color: inherit; text-decoration: none; }
.tags a:hover { color: var(--text); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 34px; font-size: .82rem; color: var(--muted); }
.post-nav > div:last-child { text-align: right; }
.post-nav a { color: inherit; text-decoration: none; }
.post-nav strong { display: block; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 500; margin-top: 4px; }

.pagination { padding: 25px 0 70px; border-top: 1px solid var(--line); }
.pagination .nav-links { margin: 0; display: flex; gap: 12px; }
.page-numbers { color: var(--muted); text-decoration: none; font-size: .86rem; }
.page-numbers.current, .page-numbers:hover { color: var(--text); }

.search-form { display: flex; gap: 8px; max-width: 520px; margin-top: 22px; }
.search-form input[type="search"] {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
}
.search-form input[type="submit"] {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
}

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 38px; color: var(--muted); font-size: .8rem; }
.footer-row { display: flex; justify-content: space-between; gap: 20px; }
.footer-row a { color: inherit; }
.screen-reader-text { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.empty-state { padding: 38px 0 70px; color: var(--muted); }

@media (max-width: 700px) {
  .wrap, .content-width { width: min(calc(100% - 28px), var(--site)); }
  .navbar {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    position: relative;
  }
  .nav-left { display: none; }
  .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(220px, calc(100% - 92px));
    max-width: calc(100% - 92px);
  }
  .default-brand-logo { width: 100%; max-width: 220px; margin-inline: auto; }
  .custom-logo { max-height: 50px; max-width: 100%; width: auto; margin-inline: auto; }
  .menu-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    position: relative;
    z-index: 30;
  }
  .nav-links {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 70px;
    display: none;
    padding: 15px;
    border: 1px solid var(--line);
    background: var(--bg);
    z-index: 20;
  }
  .nav-links.is-open { display: flex; flex-direction: column; align-items: stretch; }
  .nav-links ul { flex-direction: column; align-items: stretch; gap: 3px; }
  .nav-links a { display: block; padding: 7px 0; }
  .theme-toggle { align-self: flex-start; }
  .home-writing .list-heading { padding-top: 22px; }
  .post-row { grid-template-columns: 1fr; gap: 6px; padding: 23px 0 25px; }
  .post-date { padding-top: 0; }
  .article-header { padding-top: 48px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav > div:last-child { text-align: left; }
  .footer-row { flex-direction: column; }
}


/* Writing Studio --------------------------------------------------------- */
.write-link,
.owner-edit-link {
  color: var(--muted);
  text-decoration: none;
}
.write-link {
  font-size: .88rem;
  font-weight: 600;
}
.write-link:hover,
.owner-edit-link:hover { color: var(--text); }

.writing-studio {
  width: min(calc(100% - 40px), 860px);
  padding: 48px 0 84px;
}
.studio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.studio-eyebrow {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.studio-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.studio-header-actions {
  display: flex;
  gap: 16px;
  padding-bottom: 4px;
  font-size: .8rem;
}
.studio-header-actions a { color: var(--muted); text-decoration: none; }
.studio-header-actions a:hover { color: var(--text); }

.studio-notice {
  margin: 0 0 24px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  font-size: .84rem;
}
.studio-notice-error { border-color: #a84343; }

.studio-title-input {
  display: block;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.04em;
}
.studio-title-input::placeholder { color: var(--muted); opacity: .58; }

.studio-editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.studio-editor .wp-editor-wrap,
.studio-editor .wp-editor-container { border: 0 !important; }
.studio-editor .wp-editor-container { background: var(--bg); }
.studio-editor .mce-tinymce,
.studio-editor .mce-toolbar-grp,
.studio-editor .mce-top-part::before { box-shadow: none !important; }
.studio-editor .mce-toolbar-grp {
  border-bottom: 1px solid var(--line) !important;
  background: var(--soft) !important;
}
.studio-editor .mce-btn,
.studio-editor .mce-btn button { background: transparent !important; }
.studio-editor textarea.wp-editor-area {
  min-height: 460px;
  border: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.75;
  padding: 20px;
}

.studio-details {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(0, 1.35fr);
  gap: 18px;
  margin-top: 18px;
}
.studio-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}
.studio-field label span { font-weight: 400; }
.studio-field select,
.studio-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}
.studio-field select:focus,
.studio-field input:focus { border-color: var(--muted); }

.studio-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 0 0;
}
.studio-status {
  color: var(--muted);
  font-size: .76rem;
}
.studio-status strong { color: var(--text); font-weight: 600; }
.studio-word-count::before { content: " · "; }
.studio-buttons { display: flex; gap: 9px; }
.studio-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 650;
  font-size: .83rem;
}
.studio-button-primary {
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
}
.studio-button-secondary {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}
.studio-button:hover { opacity: .78; }

.studio-recent {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.studio-recent h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.studio-recent-list { border-top: 1px solid var(--line); }
.studio-recent-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.studio-recent-title { font-family: Georgia, "Times New Roman", serif; }
.studio-recent-meta { color: var(--muted); font-size: .75rem; white-space: nowrap; }

@media (max-width: 700px) {
  .write-link { padding: 7px 0; }
  .writing-studio { width: min(calc(100% - 28px), 860px); padding-top: 34px; }
  .studio-header { align-items: flex-start; flex-direction: column; gap: 10px; margin-bottom: 26px; }
  .studio-header-actions { padding-bottom: 0; }
  .studio-title-input { font-size: clamp(2rem, 11vw, 3rem); }
  .studio-details { grid-template-columns: 1fr; }
  .studio-actions { align-items: stretch; flex-direction: column; }
  .studio-buttons { width: 100%; }
  .studio-button { flex: 1; }
  .studio-recent-row { flex-direction: column; gap: 2px; }
  .studio-recent-meta { white-space: normal; }
}
