/* Site theme. Loaded after main.css and overrides it.
   Palette and type follow https://yasmin.ie, light and dark. */

:root {
  --bg:     #fdfdfc;
  --fg:     #1a1a19;
  --muted:  #63625d;
  --faint:  #8a8983;
  --accent: #9d1e3c;
  --rule:   #e4e2dc;
  --chip:   #f2f0ea;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:     #131211;
    --fg:     #ecebe8;
    --muted:  #a3a19b;
    --faint:  #7d7b75;
    --accent: #e8798f;
    --rule:   #2b2926;
    --chip:   #1f1d1b;
  }
}

/* ---------- base ---------- */

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a, a:link, a:active, a:visited { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); text-decoration: underline; }

h1, h2, h3, h4, h5 {
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h1 { font-size: 32px; letter-spacing: -0.02em; margin-bottom: 16px; }
h2 { font-size: 24px; margin-top: 32px; }
h3 { font-size: 19.2px; margin-top: 28px; }

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

.main-layout { background: transparent; }

/* ---------- sidebar ---------- */

div.col-sm-3 {
  margin-top: 72px;
  font-size: 15px;
  color: var(--muted);
}

div.col-sm-3 strong {
  display: block;
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 11.52px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.author-name {
  margin: 0;
  font-size: 21.6px;
  line-height: 1.2;
}

.author-name a, .author-name a:link { color: var(--fg); }
.author-name a:hover { color: var(--accent); text-decoration: none; }

div.col-sm-3 div.profile-about {
  margin-top: 6.4px;
  color: var(--muted);
  font-size: 15px;
}

.social { margin: 14.4px 0; }
.social ul li { margin: 0 9.6px 0 0; }
.social li a { font-size: 18px; color: var(--muted); }
.social li a:hover { color: var(--accent); text-decoration: none; }

.sidebar-nav li { padding: 1.6px 0; }
.sidebar-nav li::before { content: none; }
.sidebar-nav a { color: var(--fg); }
.sidebar-nav a:hover { color: var(--accent); text-decoration: none; }

input#js-search__input,
.form-control {
  height: 38.4px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: none;
  font-family: inherit;
  font-size: 15px;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: none;
  outline: none;
}

.form-control::placeholder { color: var(--faint); }

.search__results > li { border-top: 1px solid var(--rule); }

/* menu toggle, shown only on narrow screens */
.menu-toggle, .menu-button { display: none; }

/* ---------- post list ---------- */

.section-label {
  margin: 0 0 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  color: var(--faint);
  font-size: 12.8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.posts h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 8px;
  font-size: 21.6px;
}

.posts lord-icon {
  width: 44px !important;
  height: 44px !important;
  flex: none;
}

.posts p { color: var(--muted); }

.posts hr { margin: 28px 0; }

/* the footer draws the closing rule */
.posts hr:last-child { display: none; }

/* ---------- posts ---------- */

.post-title { font-size: 33.6px; line-height: 1.15; }

span.time, span.categories {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.content, .post-content { color: var(--fg); }

.content img, .post-content img { border-radius: 4px; }

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--chip);
  color: var(--fg);
  font-size: 0.88em;
}

div.content pre, .post-content pre {
  border-radius: 6px;
  background: #1e1d1b;
  color: #ecebe8;
}

pre code { padding: 0; background: transparent; color: inherit; }

blockquote {
  margin: 20px 0;
  padding: 4px 16px;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-size: inherit;
}

table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 15.2px;
}

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

th { color: var(--faint); font-size: 12.8px; letter-spacing: 0.06em; text-transform: uppercase; }

.share-page, .PageNavigation a {
  border-color: var(--rule);
}

.share-page { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }

.panel-body { padding-left: 0; }

.pagination > li > a,
.pagination > li > span {
  border-color: var(--rule);
  background: var(--bg);
  color: var(--accent);
}

.pagination > .active > a,
.pagination > .active > a:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.pagination > .disabled > span { color: var(--faint); background: var(--bg); border-color: var(--rule); }

footer {
  height: auto;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--faint);
  font-size: 13.6px;
}

/* icons drawn for a light background */
@media (prefers-color-scheme: dark) {
  .posts lord-icon { filter: invert(1) hue-rotate(180deg); }
  .content img, .post-content img { background: #fff; }
}

/* ---------- layout ---------- */

@media (min-width: 1024px) {
  .fixed-condition { max-width: 240px; }
}

/* wide screens, sidebar plus text fill the container so both margins match */
@media (min-width: 1100px) {
  .container { width: 1070px; max-width: 100%; }
  div.col-sm-3 { width: 280px; }
  div.col-sm-8 { width: 760px; }
}

@media (min-width: 768px) and (max-width: 1099px) {
  div.col-sm-8 { width: 75%; }
}

@media (min-width: 768px) {
  .main-layout { padding-top: 64px; }
  .menu { display: block; }
}

/* narrow screens, compact bar with a menu button */
@media (max-width: 767px) {
  body { font-size: 16.5px; }

  div.col-sm-3 { margin-top: 0; padding-top: 16px; }

  .fixed-condition { position: relative; }

  .menu-toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 72px;
    height: 38.4px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
  }

  .menu-button {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    padding: 5.6px 14.4px;
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--fg);
    font-size: 14.4px;
    line-height: 1.4;
  }

  .menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--accent); outline-offset: 2px; }
  .menu-toggle:checked + .menu-button { border-color: var(--accent); color: var(--accent); }

  .menu { display: none; padding-top: 12px; }
  .menu-toggle:checked ~ .menu { display: block; }

  .menu hr { display: none; }

  .main-layout { padding-top: 16px; }

  h1, .post-title { font-size: 28px; }
}
