/* =========================================================
   agenticeng.ru — custom theme (based on Эгея / fiesta)
   ========================================================= */

/* --- CSS Variables (light mode) --- */
:root {
  --backgroundColor: rgb(255, 248, 252);
  --backgroundTransparentColor: rgba(255, 255, 255, 0.8);
  --foregroundColor: rgb(64, 48, 144);
  --thinRuleColor: rgba(64, 48, 144, 0.12);

  --headingsColor: rgb(255, 0, 160);
  --headingsUnderlineColor: rgba(255, 0, 160, 0.25);
  --boldColor: var(--headingsColor);

  --linkColor: rgb(48, 138, 240);
  --linkUnderlineColor: rgba(48, 138, 240, 0.25);
  --linkColorVisited: rgb(171, 80, 224);
  --linkUnderlineColorVisited: rgba(171, 80, 224, 0.12);
  --hoverColor: rgb(64, 212, 255);
  --hoverUnderlineColor: rgba(64, 212, 255, 0.12);

  --tagColor: rgb(17, 192, 104);
  --tagUnderlineColor: rgba(17, 192, 104, 0.12);

  --engineTextColor: var(--foregroundColor);
  --engineTextUnderlineColor: var(--thinRuleColor);

  --imageBorderColor: #e8e8e8;
  --inputBackgroundColor: rgb(213, 255, 253);

  --maxWidth: 1280px;
  --marginTop: 48px;
  --marginLeft: 6%;
  --marginRight: 6%;
  --marginTopCompact: 14px;
  --marginLeftCompact: 3%;
  --marginRightCompact: 3%;

  --blogTitleFontSize: 28px;
  --blogTitleLineHeight: 32px;
  --noteTextFontSize: 20px;
  --noteTextLineHeight: 28px;
  --smallFontSize: 12px;
  --smallLineHeight: 16px;

  --mainFontFamily:
    system-ui, -apple-system, BlinkMacSystemFont, "SF UI Text", "Segoe UI",
    Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans",
    "Helvetica Neue", Helvetica, Arial, sans-serif;

  --time: 1.333s;
}

/* --- Dark mode overrides --- */
@media (prefers-color-scheme: dark) {
  :root {
    --backgroundColor: rgb(38, 33, 43);
    --backgroundTransparentColor: rgba(0, 0, 0, 0.8);
    --foregroundColor: rgb(239, 220, 239);
    --thinRuleColor: rgba(234, 200, 234, 0.25);

    --headingsColor: rgb(255, 64, 185);
    --headingsUnderlineColor: rgba(255, 64, 185, 0.25);

    --linkColor: rgb(144, 173, 255);
    --linkUnderlineColor: rgba(144, 173, 255, 0.25);
    --linkColorVisited: rgb(203, 139, 255);
    --linkUnderlineColorVisited: rgba(184, 97, 255, 0.12);
    --hoverColor: rgb(64, 212, 255);
    --hoverUnderlineColor: rgba(64, 212, 255, 0.12);

    --tagColor: rgb(17, 192, 104);
    --tagUnderlineColor: rgba(17, 192, 104, 0.12);

    --engineTextColor: var(--foregroundColor);
    --inputBackgroundColor: #253542;
    --imageBorderColor: #404040;
  }
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
pre,
table,
thead,
tbody,
tr,
th,
td,
img,
form,
input,
textarea,
select,
button {
  margin: 0;
  padding: 0;
  outline: none;
  font-size: 100%;
  font-style: normal;
  font-weight: normal;
  text-align: left;
  vertical-align: baseline;
}

body {
  background: var(--backgroundColor);
  color: var(--foregroundColor);
}

body,
input,
textarea,
select,
button {
  font-size: 16px;
  line-height: 24px;
  font-family: var(--mainFontFamily);
}

/* --- JetBrains Mono --- */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

pre,
tt,
code,
pre *,
tt *,
code * {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-feature-settings: "liga" 1, "calt" 1;
}

pre,
code {
  white-space: pre-wrap;
}

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

hr {
  border: none;
  border-top: 1px solid var(--thinRuleColor);
  margin: 24px 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin: 16px 0;
  font-size: var(--noteTextFontSize);
  line-height: var(--noteTextLineHeight);
}

th,
td {
  padding: 8px 12px;
  border: 1px solid var(--thinRuleColor);
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: bold;
  color: var(--headingsColor);
  background: rgba(255, 0, 160, 0.06);
}

/* --- Links --- */
a {
  color: var(--linkColor);
  border-color: var(--linkUnderlineColor);
  text-decoration: none;
  border-bottom: 1px solid var(--linkUnderlineColor);
  transition:
    color var(--time) ease-out,
    border-color var(--time) ease-out;
}

a:visited {
  color: var(--linkColorVisited);
  border-color: var(--linkUnderlineColorVisited);
}

a:hover {
  color: var(--hoverColor);
  border-color: var(--hoverUnderlineColor);
  transition: none;
}

/* --- Layout --- */
.common {
  margin: 0 auto;
  max-width: var(--maxWidth);
}

.flag {
  position: relative;
  width: 100%;
  padding: var(--marginTop) 0 60px;
}

@media screen and (max-width: 1023px) {
  .flag {
    padding: var(--marginTopCompact) 0 48px;
  }
}

.header-content {
  position: relative;
  display: flex;
  align-items: flex-start;
  margin: 0 var(--marginRight) 0 var(--marginLeft);
}

@media screen and (max-width: 1023px) {
  .header-content {
    margin: 0 var(--marginRightCompact) 0 var(--marginLeftCompact);
  }
}

/* --- Header nav --- */
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
}

.header-nav-link {
  display: inline-block;
  font-size: 15px;
  color: var(--foregroundColor);
  opacity: 0.6;
  border-bottom: none;
  transition: opacity var(--time) ease-out;
}

.header-nav-link:hover {
  opacity: 1;
  border-bottom: none;
}

.header-nav-link.is-active {
  opacity: 1;
  color: var(--hoverColor);
}

/* --- Logo / userpic --- */
.logo {
}

.logo a {
  display: inline-block;
  border-bottom: none;
}

.userpic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  border: 2px solid var(--thinRuleColor);
  transition: border-color var(--time) ease-out;
}

.logo a:hover .userpic {
  border-color: var(--hoverColor);
  transition: none;
}

/* --- Blog title --- */
.title {
  font-size: var(--blogTitleFontSize);
  line-height: var(--blogTitleLineHeight);
}

.title-inner {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.title-inner .logo {
  flex-shrink: 0;
}

.title-text {
}

.title h1 {
  margin: 0;
  font-weight: bold;
  font-size: inherit;
  line-height: inherit;
  color: var(--headingsColor);
}

.title h1 a,
.title h1 a:visited {
  color: var(--headingsColor);
  border-color: var(--headingsUnderlineColor);
}

.title h1 a:hover {
  color: var(--hoverColor);
  border-color: var(--hoverUnderlineColor);
}

.blog-description {
  margin-top: 4px;
  font-size: 16px;
  line-height: 22px;
  color: var(--foregroundColor);
  opacity: 0.7;
}

.blog-description p {
  margin: 0;
}

/* --- Main content / footer --- */
.content,
.footer {
  margin: 0 var(--marginRight) 40px var(--marginLeft);
  width: calc(100% - var(--marginRight) - var(--marginLeft));
}

.content {
  min-height: 320px;
}

@media screen and (max-width: 1023px) {
  .content,
  .footer {
    margin: 0 var(--marginRightCompact) 40px var(--marginLeftCompact);
    width: calc(100% - var(--marginRightCompact) - var(--marginLeftCompact));
  }
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--thinRuleColor);
  padding-top: 16px;
  font-size: var(--smallFontSize);
  line-height: var(--smallLineHeight);
}

.footer-copy {
  color: var(--engineTextColor);
}

.footer-rss {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--thinRuleColor) !important;
  border-bottom: 1px solid var(--thinRuleColor) !important;
  font-size: 11px;
  line-height: 18px;
  opacity: 0.7;
}

.footer-rss:hover {
  opacity: 1;
  border-color: var(--hoverColor) !important;
}

.footer-engine {
  margin-top: 4px;
  color: var(--engineTextColor);
}

.footer a,
.footer a:link,
.footer a:visited {
  color: var(--engineTextColor);
  border-color: var(--engineTextUnderlineColor);
}

.footer a:hover {
  color: var(--hoverColor);
  border-color: var(--hoverUnderlineColor);
}

/* --- Post / note list --- */
.e2-note {
  margin: 0 0 60px;
}

.note-header {
  display: block;
  margin-bottom: 8px;
}

.note-title {
  font-weight: bold;
  font-size: 36px;
  line-height: 42px;
  color: var(--headingsColor);
  max-width: 720px;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.note-title a,
.note-title a:visited {
  color: var(--headingsColor);
  border-color: var(--headingsUnderlineColor);
}

.note-title a:hover {
  color: var(--hoverColor);
  border-color: var(--hoverUnderlineColor);
}

.note-date {
  font-size: var(--smallFontSize);
  line-height: var(--smallLineHeight);
  color: var(--foregroundColor);
  opacity: 0.5;
  white-space: nowrap;
}

.note-summary {
  margin-top: 8px;
}

/* --- Single post --- */
.e2-note-single .note-title {
  font-size: 32px;
  line-height: 38px;
  margin-bottom: 8px;
}

@media screen and (max-width: 1023px) {
  .e2-note-single .note-title {
    font-size: 24px;
    line-height: 30px;
  }
}

.note-meta {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: var(--smallFontSize);
  line-height: var(--smallLineHeight);
}

.note-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-body {
  font-size: var(--noteTextFontSize);
  line-height: var(--noteTextLineHeight);
  max-width: 720px;
}

/* --- Rich text --- */
.e2-text p,
.e2-text ul,
.e2-text ol,
.e2-text blockquote,
.e2-text pre,
.e2-text table {
  margin-bottom: 20px;
}

.e2-text p,
.e2-text blockquote {
  max-width: 720px;
}

.e2-text ul,
.e2-text ol {
  padding-left: 40px;
  max-width: 720px;
}

.e2-text li {
  margin-bottom: 4px;
}

.e2-text h2,
.e2-text h3,
.e2-text h4 {
  color: var(--headingsColor);
  font-weight: bold;
  margin: 32px 0 12px;
  line-height: 1.2;
}

.e2-text h2 {
  font-size: 28px;
  line-height: 34px;
}
.e2-text h3 {
  font-size: 22px;
  line-height: 28px;
}
.e2-text h4 {
  font-size: 18px;
}

.e2-text strong,
.e2-text b {
  font-weight: bold;
  color: var(--boldColor);
}

.e2-text code {
  background: var(--inputBackgroundColor);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
}

.e2-text pre {
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 22px;
}

.e2-text pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.e2-text blockquote {
  margin-left: 0;
  padding: 0 0 0 40px;
  color: var(--foregroundColor);
  opacity: 0.8;
}

.e2-text img {
  border: 1px solid var(--imageBorderColor);
  border-radius: 6px;
  max-width: 100%;
}

.e2-text .lead {
  color: rgb(142, 51, 245);
  font-weight: bold;
  font-size: 22px;
  line-height: 28px;
  margin-bottom: 20px;
  max-width: 720px;
}

@media (prefers-color-scheme: dark) {
  .e2-text .lead {
    color: rgb(180, 120, 255);
  }
}

/* --- Tags --- */
.tag {
  display: inline-block;
  color: var(--tagColor);
  border-color: var(--tagUnderlineColor);
  font-size: 14px;
  line-height: 20px;
}

.tag:visited {
  color: var(--tagColor);
  border-color: var(--tagUnderlineColor);
}

.tag:hover {
  color: var(--hoverColor);
  border-color: var(--hoverUnderlineColor);
}

/* --- Tags page --- */
.tag-header {
  margin-bottom: 24px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* --- Headings on taxonomy/archive pages --- */
.page-heading {
  font-size: 32px;
  line-height: 38px;
  font-weight: bold;
  color: var(--headingsColor);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--thinRuleColor);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: space-between;
  padding: 24px 0 0;
  font-size: 16px;
}

/* --- Responsive video (YouTube / iframe) --- */
.e2-text-video {
  margin: 20px 0 28px;
  max-width: 720px;
}

.e2-text-super-wrapper {
  max-width: 100%;
}

.e2-text-proportional-wrapper {
  position: relative;
  height: 0;
  overflow: hidden;
}

.e2-text-proportional-wrapper iframe,
.e2-text-proportional-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.e2-text-caption {
  margin-top: 8px;
  font-size: var(--smallFontSize);
  line-height: var(--smallLineHeight);
  color: var(--foregroundColor);
  opacity: 0.6;
}

/* --- Archived comments --- */
.comments-archived {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--thinRuleColor);
}

.comments-archived-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--headingsColor);
  margin: 0 0 6px;
}

.comments-archived-notice {
  font-size: 13px;
  color: var(--foregroundColor);
  opacity: 0.55;
  margin: 0 0 24px;
}

.comment {
  display: flex;
  gap: 14px;
  margin-bottom: 0;
}

.comment-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--thinRuleColor);
}

.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  font-size: 15px;
  color: var(--foregroundColor);
  text-decoration: none;
}

a.comment-author:hover {
  color: var(--hoverColor);
}

.comment-date {
  font-size: 12px;
  color: var(--foregroundColor);
  opacity: 0.55;
}

.comment-text {
  font-size: 17px;
  line-height: 1.55;
  color: var(--foregroundColor);
}

.comment-text p {
  margin: 0 0 10px;
}

.comment-text p:last-child {
  margin-bottom: 0;
}

.comment-text blockquote {
  border-left: 3px solid var(--thinRuleColor);
  padding-left: 12px;
  margin: 10px 0;
  opacity: 0.75;
  font-style: italic;
}

.comment-reply {
  margin-top: 16px;
  padding-left: 16px;
  border-left: 2px solid var(--thinRuleColor);
}

/* --- Post navigation (prev/next) --- */
.note-navigation {
  display: flex;
  justify-content: space-between;
  padding: 28px 0;
  margin-top: 40px;
  font-size: 16px;
  gap: 16px;
}

.nav-newer {
  margin-left: auto;
}

.nav-modifier::after {
  content: '⌥';
}

[data-os="other"] .nav-modifier::after {
  content: 'Alt';
}
