/*
Theme Name: Journal
Author: OpenAI
Description: Минималистичная тема для пагинированного блога в духе классического LiveJournal. Месячные архивы выводятся строкой под названием сайта, предусмотрены нативные комментарии WordPress.
Version: 1.16.3
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Text Domain: journal
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Source Serif 4 Variable — reading and editorial typography. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-cyrillic-ext-standard-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-cyrillic-standard-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-latin-ext-standard-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-latin-standard-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-cyrillic-ext-standard-italic.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-cyrillic-standard-italic.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-latin-ext-standard-italic.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("assets/fonts/source-serif-4-latin-standard-italic.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans Variable — dates, archives and interface elements. */
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("assets/fonts/ibm-plex-sans-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("assets/fonts/ibm-plex-sans-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("assets/fonts/ibm-plex-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 700;
  src: url("assets/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font-reading: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-meta: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  --page-bg: #f7f5f2;
  --text: #23212b;
  --muted: #716d78;
  --link: #176b73;
  --accent: #8f3557;
  --date-bar: #dcd5f2;
  --rail: #eeebf7;
  --line: #cbc5dd;
}

/* Палитры выбираются администратором в настройках темы. */
body.journal-palette-graphite {
  color-scheme: dark;
  --page-bg: #1f2321;
  --text: #e8ece7;
  --muted: #a7b0a8;
  --link: #a9c3af;
  --accent: #d9a441;
  --date-bar: #37483d;
  --rail: #29312c;
  --line: #4b5550;
}

body.journal-palette-editorial {
  --page-bg: #faf3e8;
  --text: #1e2a3a;
  --muted: #687181;
  --link: #294a6d;
  --accent: #a84c36;
  --date-bar: #e7c6b7;
  --rail: #f1ded1;
  --line: #d8c1b3;
}

body.journal-palette-digital {
  --page-bg: #f7f9ff;
  --text: #151a2d;
  --muted: #68708a;
  --link: #2458e6;
  --accent: #7c3aed;
  --date-bar: #dcd8ff;
  --rail: #eef0ff;
  --line: #c8ccea;
}

body.journal-palette-northern-sea {
  --page-bg: #f4f8fa;
  --text: #17232c;
  --muted: #66727b;
  --link: #08798c;
  --accent: #cf3041;
  --date-bar: #d7ecf1;
  --rail: #e2eff1;
  --line: #bfd8de;
}

body.journal-palette-bordeaux-mint {
  --page-bg: #fbf7f5;
  --text: #282322;
  --muted: #71666a;
  --link: #1d7468;
  --accent: #97334c;
  --date-bar: #dbeae4;
  --rail: #f0e3e6;
  --line: #d8c4cc;
}

body.journal-palette-ultramarine {
  --page-bg: #faf8ef;
  --text: #202538;
  --muted: #6a6e7e;
  --link: #1f4eb5;
  --accent: #c3422e;
  --date-bar: #f1d77a;
  --rail: #f3ecd0;
  --line: #d8cba2;
}

body.journal-palette-typographic {
  --page-bg: #f4f1e8;
  --text: #1b1b19;
  --muted: #6e6e69;
  --link: #343735;
  --accent: #c23a2f;
  --date-bar: #dedcd3;
  --rail: #e9e6dd;
  --line: #b9b5aa;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: var(--font-reading);
  font-optical-sizing: auto;
  line-height: 1.65;
}

a { color: var(--link); text-decoration: underline; }
a:hover, a:focus { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
img { max-width: 100%; height: auto; }

.site-shell { width: 100%; padding: 12px 20px 28px; }

.site-header {
  position: relative;
  min-height: 88px;
  padding-right: 92px;
  padding-bottom: 16px;
}

.site-title {
  margin: 18px 0 3px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a { color: var(--accent); text-decoration: none; }
.site-description { margin: 0 0 10px; color: var(--muted); font: 400 14px/1.5 var(--font-meta); }

.custom-logo-link {
  position: absolute;
  top: 0;
  right: 0;
  display: block;
}

.custom-logo { width: 60px; height: 60px; object-fit: cover; }

.archive-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-family: var(--font-meta);
}

.archive-strip li:not(:last-child)::after { content: "·"; margin-left: 9px; color: var(--muted); }

.listing-header {
  width: min(900px, calc(100% - 42px));
  margin: 0 0 14px 42px;
}

.listing-title {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
}

.listing-description { margin-top: 4px; color: var(--muted); font-size: 14px; }
.listing-description > :first-child { margin-top: 0; }
.listing-description > :last-child { margin-bottom: 0; }

.post { margin: 0; }

/* Закрываем нижний край записи, когда секция комментариев не выводится. */
.post-comments-disabled { border-bottom: 2px solid var(--date-bar); }

.post-date {
  margin: 0;
  padding: 1px 2px;
  background: var(--date-bar);
  color: var(--text);
  font-size: 19px;
  font-family: var(--font-meta);
  font-weight: 600;
  line-height: 1.25;
}

.post-frame {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
}

.post-rail { background: var(--rail); border-right: 1px solid var(--line); }
.post-main { width: min(100%, 900px); min-width: 0; padding: 1px 4px 14px; }

.post-heading { display: flex; align-items: baseline; gap: 7px; margin-bottom: 10px; }
.post-time { flex: none; color: var(--muted); font: 400 14px/1.5 var(--font-meta); }

.post-title {
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.post-title a { color: inherit; text-decoration: underline; }
.post-cover { margin: 0 0 16px; }
.post-cover a { display: block; }
.post-cover img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: cover;
}

.home .post-cover img,
.archive .post-cover img,
.search .post-cover img { max-height: 520px; }

.post-content { font-size: 17px; line-height: 1.68; }
.post-content > :first-child { margin-top: 0; }
.post-content > :last-child { margin-bottom: 0; }
.post-content p { margin: 0 0 14px; }
.post-content h2 { font-size: 22px; }
.post-content h3 { font-size: 19px; }
.post-content blockquote { margin: 8px 20px; padding-left: 10px; border-left: 3px solid var(--date-bar); }
.post-content pre { overflow-x: auto; padding: 8px; background: var(--rail); }
code, kbd, pre, samp { font-family: var(--font-meta); }

/* Служебный блок короткой ссылки, который может выводиться плагином. */
.post-content > .shortlink-box,
.post-content > .short-link-box,
.post-content > .short-url-box,
.post-content > [class*="shortlink"],
.post-content > [class*="short-link"] {
  width: min(100%, 520px);
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.post-content > .shortlink-box > :first-child,
.post-content > .short-link-box > :first-child,
.post-content > .short-url-box > :first-child,
.post-content > [class*="shortlink"] > :first-child,
.post-content > [class*="short-link"] > :first-child {
  margin-top: 0;
  font-size: 14px;
}

@supports selector(.post-content:has(input)) {
  .post-content > :is(div, section, form):has(input[readonly]):has(button) {
    width: min(100%, 520px);
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .post-content > :is(div, section, form):has(input[readonly]):has(button) > :first-child {
    margin-top: 0;
    font-size: 14px;
  }
}

.post-meta { margin-top: 14px; font: 400 14px/1.55 var(--font-meta); }

.post-content input[readonly] { font-family: var(--font-meta); }
.post-tags { display: inline; }
.post-tags strong { color: var(--text); }
.post-meta-separator { color: var(--muted); }
.edit-link { margin-left: 0; }

.standalone-page {
  width: min(860px, calc(100% - 44px));
  margin: 44px 0 0 44px;
}

.page-header { margin-bottom: 26px; }

.page-accent {
  display: block;
  width: 72px;
  height: 3px;
  margin-bottom: 20px;
  background: var(--accent);
  opacity: 0.72;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 3vw, 38px);
  font-weight: 750;
  line-height: 1.15;
}

.page-edit-link { margin-top: 8px; font: 400 13px/1.5 var(--font-meta); }
.page-cover { margin: 0 0 24px; }
.page-cover img { display: block; width: 100%; max-height: 620px; object-fit: cover; }

.page-content {
  font-size: 17px;
  line-height: 1.65;
}

.page-content > :first-child { margin-top: 0; }
.page-content > :last-child { margin-bottom: 0; }
.page-content p { margin: 0 0 18px; }
.page-content h2 { margin: 32px 0 12px; font-size: 25px; line-height: 1.25; }
.page-content h3 { margin: 26px 0 10px; font-size: 21px; line-height: 1.3; }
.page-content blockquote { margin: 18px 0; padding-left: 14px; border-left: 2px solid var(--date-bar); }
.page-content blockquote > :last-child { margin-bottom: 0; }
.page-content pre { overflow-x: auto; padding: 10px 12px; background: var(--rail); }

body.page .comments-area {
  grid-template-columns: minmax(0, 860px);
  width: min(860px, calc(100% - 44px));
  max-width: none;
  margin: 36px 0 8px 44px;
}

body.page .comments-rail { display: none; }
body.page .comments-main { grid-column: 1; padding-top: 20px; }
body.page .site-footer { width: min(860px, calc(100% - 44px)); margin-left: 44px; }

.comments-area {
  display: grid;
  grid-template-columns: 42px minmax(0, 900px);
  margin: 0 0 8px;
  max-width: none;
  border-top: 2px solid var(--date-bar);
}

.comments-rail {
  grid-column: 1;
  grid-row: 1;
  background: var(--rail);
  border-right: 1px solid var(--line);
}

.comments-main { grid-column: 2; grid-row: 1; min-width: 0; padding-top: 26px; }

.comments-title {
  margin: 0 0 16px;
  padding: 7px 10px;
  background: var(--date-bar);
  color: var(--text);
  font-size: 19px;
  line-height: 1.35;
}

.comment-list,
.comment-list .children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list .children {
  margin-left: 34px;
  padding-left: 18px;
  border-left: 2px solid var(--line);
}

.comment-body {
  position: relative;
  min-height: 54px;
  padding: 0 0 18px 76px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* Соединяем разделитель вложенного комментария с линией его ветки. */
.comment-list .children .comment-body { border-bottom: 0; }
.comment-list .children .comment-body::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: -20px;
  border-bottom: 1px solid var(--line);
  pointer-events: none;
}

.comment-author .avatar {
  position: absolute;
  top: 2px;
  left: 16px;
  width: 44px;
  height: 44px;
  border: 2px solid var(--date-bar);
  border-radius: 50%;
}

.comment-author .fn { color: var(--accent); font-style: normal; font-weight: 700; }
.comment-author .says { color: var(--muted); font-size: 13px; }
.comment-metadata { margin: 1px 0 10px; color: var(--muted); font: 400 12px/1.5 var(--font-meta); }
.comment-metadata a { color: inherit; }
.comment-content p { margin: 0 0 10px; }
.comment-content > :last-child { margin-bottom: 0; }
.comment-awaiting-moderation { color: var(--accent); font-weight: 600; }
.reply { margin-top: 8px; font: 600 13px/1.5 var(--font-meta); }

.comment-navigation { margin: 14px 0 20px; }
.comment-navigation .nav-links { display: flex; justify-content: space-between; gap: 16px; }
.comment-navigation { font-family: var(--font-meta); }

.comment-respond {
  margin-top: 24px;
  padding: 20px;
  background: var(--rail);
  border-top: 3px solid var(--accent);
}

.comment-reply-title { margin: 0 0 12px; color: var(--text); font-size: 20px; }
.comment-reply-title small { margin-left: 8px; font-size: 12px; }
.comment-notes, .logged-in-as { color: var(--muted); font-size: 13px; }
.comment-form p { margin: 0 0 14px; }
.comment-form { font-family: var(--font-meta); }
.comment-form label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 650; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  max-width: 720px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--page-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
}

.comment-form textarea { min-height: 150px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; max-width: 720px; }
.comment-form-cookies-consent label { font-weight: 400; }
.comment-form .submit {
  padding: 9px 18px;
  color: var(--page-bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  font-family: var(--font-meta);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.comment-form .submit:hover { filter: brightness(0.92); }
.no-comments { margin-left: 10px; color: var(--muted); font-style: italic; }

.pagination {
  position: relative;
  min-height: 42px;
  margin: 0;
  padding: 10px 0 8px 42px;
  text-align: center;
  font-size: 15px;
  font-family: var(--font-meta);
}
.pagination::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.pagination .nav-links { position: relative; z-index: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; }
.pagination .page-numbers { padding: 2px 6px; border: 1px solid var(--line); }
.pagination .current { color: var(--page-bg); background: var(--accent); border-color: var(--accent); }

.empty-state { padding: 24px 0; }
.site-footer { margin-top: 18px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font: 400 13px/1.5 var(--font-meta); }
.home .site-footer,
.archive .site-footer,
.single-post .site-footer { margin-top: 0; }
.single-post .comments-area { margin-bottom: 0; }
.single-post .site-footer { padding-left: 42px; }
.site-footer-row { display: flex; flex-wrap: wrap; align-items: baseline; }
.site-footer-item { min-width: 0; }
.site-footer-item + .site-footer-item::before { content: "·"; margin: 0 7px; color: var(--muted); }
.site-footer-policy,
.site-footer-contact { white-space: nowrap; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .site-shell { padding: 8px 8px 20px; }
  .site-header { min-height: 78px; padding-right: 68px; }
  .site-title { margin-top: 10px; font-size: 21px; }
  .custom-logo { width: 52px; height: 52px; }
  .post-date { font-size: 17px; }
  .listing-header { width: calc(100% - 14px); margin-left: 14px; }
  .post-frame { grid-template-columns: 14px minmax(0, 1fr); }
  .post-heading { align-items: flex-start; flex-direction: column; gap: 0; }
  .post-main { padding-left: 5px; }
  .pagination { padding-left: 14px; }
  .pagination::before { width: 14px; }
  .standalone-page {
    width: calc(100% - 8px);
    margin: 34px 0 0 8px;
  }
  .page-header { margin-bottom: 24px; }
  .page-accent { width: 56px; margin-bottom: 17px; }
  .page-title { font-size: clamp(28px, 9vw, 32px); }
  .page-content { font-size: 16px; line-height: 1.62; }
  .page-content p { margin-bottom: 16px; }
  .page-content blockquote { margin: 16px 0; padding-left: 12px; }
  body.page .comments-area {
    width: calc(100% - 8px);
    margin: 30px 0 8px 8px;
  }
  body.page .site-footer {
    width: calc(100% - 8px);
    margin-left: 8px;
  }
  .comments-area { grid-template-columns: 14px minmax(0, 1fr); }
  .single-post .site-footer { padding-left: 14px; }
  .site-footer { padding-top: 13px; }
  .site-footer-row {
    display: grid;
    align-items: start;
    row-gap: 4px;
  }
  .site-footer-item { width: 100%; }
  .site-footer-item + .site-footer-item::before {
    content: none;
    margin: 0;
  }
  .site-footer-policy,
  .site-footer-contact { white-space: normal; }
  .comment-list .children { margin-left: 14px; padding-left: 10px; }
  .comment-list .children .comment-body::after { left: -12px; }
  .comment-body { padding-left: 58px; }
  .comment-author .avatar { left: 10px; width: 36px; height: 36px; }
  .comment-respond { padding: 14px; }
}
