/* Markdown */
:root{
--maincolor: rgb(70, 70, 70);
--bordercl:#b1b1b1;
--callouctcolor:dodgerblue;
--hovercolor:rgb(78, 78, 78);
--darkMaincolor: #50abfa;
}

/* Prevent width+padding from exceeding viewport (fixes sideways scroll) */
*, *::before, *::after { box-sizing: border-box; }

/* Fonts */

  /* font-family: 'Fira Sans', sans-serif; */
  /* font-family: "Scheherazade New", serif; */
  /* font-family: "Roboto", sans-serif; */

/* End Fonts */

html {
  font-family: "Inter", sans-serif;
  color: #232333;
  font-size: 17px;
  line-height: 1.6em;
}

body{
  display: block;
  margin: 8px;
}

* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.content {
  flex: 1;
}

::selection {
  background: var(--maincolor);
  color: #fff;
}

p {
  font-family: "Inter", sans-serif;
  line-height: 1.5;
}

hr {
  border: 0;
  border-top: 0.12rem dashed var(--bordercl);
  margin: 1em 0;
}

blockquote {
  border-left: 3px solid var(--bordercl);
  color: #737373;
  margin: 0;
  padding-left: 1em;
}

a {
  border-bottom: 3px solid var(--maincolor);
  color: inherit;
  text-decoration: none;
  padding-bottom: .17rem;
}
a:hover {
    background-color: var(--hovercolor);
    color: #fff;
}

ul {
  list-style: none;
  /* padding-left: 2ch; */
}
ul li {
  /* text-indent: -2ch; */
  margin-bottom: 1rem;
  list-style: none;
}
ul > li::before {
  content: '-> ';
  font-weight: bold;
  
}

ul {
  padding: 0 1rem;
}

nav a {
  margin-right: 1rem;
}

nav ul {
    list-style: none;
    /* padding: 10px */
}

nav a:last-child {
  margin-right: 0;  /* prevents trailing gap */
}

ul li {
    text-decoration: none;
}

/* Images */
img {
  border: 1px solid #717171;
  max-width: 100%;
}

figure {
  box-sizing: border-box;
  display: inline-block;
  margin: 0;
  max-width: 100%;
}

figure img {
  max-height: 500px;
}

figure h4 {
  font-size: 1rem;
  margin: 0;
  margin-bottom: 1em;
}
figure h4::before {
  content: '↳ ';
}

/* Code blocks */
code {
  background-color: #f1f1f1;
  padding: .1em .2em;
}

pre {
  background-color: #ececec;
  line-height: 1.4;
  overflow-x: auto;
  padding: 1em;
}

.highlight pre ::selection {
  background: var(--maincolor);
  color: white;
}

pre code {
  background-color: transparent;
  color: inherit;
  font-size: 100%;
  padding: 0;
}

/* Containers */
.content {
  /* margin-bottom: 4em; */
  margin-left: auto;
  margin-right: auto;
  max-width: 800px;
  padding: 0 1ch;
  word-wrap: break-word;
}

.content.blog-post {
  max-width: 1000px;
}

.site-logo {
  font-weight: 800;
}

.handwriting {
border: 0px;
}

/* Header */
header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 1em 0;
  line-height: 1.7em;
}

header .main {
  font-size: 1.5rem;
}
h1, h2, h3, h4, h5, h6 {
  font-size: 1.2rem;
  margin-top: 2em;
}

.meta {
  color: #999;
  letter-spacing: -0.5px;
}

.post-container {
  align-items: flex-start;
  display: flex;
  gap: 20px;
}

.post-content {
  flex: 3;
  min-width: 0;
}

/* Base styles - keeps TOC visible on larger screens */
.toc {
  background-color: #ececec;
  border-radius: 5px;
  color: #141414;
  flex: 0 0 auto;
  height: auto;
  margin-left: 20px;
  max-width: 300px;
  overflow-y: auto;
  padding: 10px;
  position: sticky;
  top: 20px;
}

/* Default content sizing */
.content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Blog posts */
.content.blog-post {
  max-width: 1000px;
}

.content.tags-page {
  width: 800px;
}

.content.articles-page {
  width: 800px;
}

.content.tags-page,
.content.articles-page { width: 800px; }

/* Fig caption padding from 600px up (kept from your original) */
@media (min-width: 600px) {
  figure { padding: 0 40px; }
}

/* ---------- Phones (≤600px) ---------- */
@media (max-width: 600px) {
  /* TOC hidden on phones */
  .toc { display: none; }

  /* Blog posts: full width + small padding */
  .content.blog-post { max-width: 100%; padding: 0 20px; }

  /* Layout tweaks */
  .post-container { flex-direction: column; }
  header { flex-direction: column; text-align: center; }
  nav { display: flex; justify-content: center; align-items: center; margin-top: 17px; }

  /* Type scale */
  h1, h2, h3 { font-size: 1.1rem; }
  p, li { font-size: 16px; }

  /* Tags & All-articles: fill viewport without overflow */
  .content.tags-page,
  .content.articles-page {
    width: 100%;
    max-width: 100%;
    padding-inline: 15px;
    margin-inline: auto;
  }
}

/* ---------- Small tablets (601–768px) ---------- */
@media (min-width: 601px) and (max-width: 768px) {
  /* TOC becomes a full-width block under title */
  .toc {
    display: block;           /* ensure visible after phone breakpoint */
    position: relative;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-bottom: 20px;
  }

  /* Blog posts: fluid column */
  .content.blog-post { max-width: 95%; }

  /* Tags & All-articles: tablet cap (no vw to avoid iOS overflow) */
  .content.tags-page,
  .content.articles-page {
    width: 100%;
    max-width: 680px;
    padding-inline: 15px;
    margin-inline: auto;
  }
}

/* ---------- Large tablets / small desktops (769–1024px) ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
  /* TOC as sidebar, narrower on this band */
  .toc { max-width: 250px; font-size: 0.9em; position: sticky; top: 20px; }

  /* Blog posts: capped column */
  .content.blog-post { max-width: 900px; }

  /* Tags & All-articles: desktop cap */
  .content.tags-page,
  .content.articles-page {
    width: 100%;
    max-width: 800px;
    padding-inline: 15px;
    margin-inline: auto;
  }
}

/* ---------- Desktops (≥1025px) ---------- */
@media (min-width: 1025px) {
  /* Blog posts: full desktop cap */
  .content.blog-post { max-width: 1000px; }

  /* Tags & All-articles: full desktop cap */
  .content.tags-page,
  .content.articles-page {
    width: 100%;
    max-width: 800px;
    padding-inline: 15px;
    margin-inline: auto;
  }
}


/* Footer */
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 0.12rem dashed var(--bordercl);
  padding-top: 1rem;
  padding-bottom: .5rem;
  margin-top: 2rem;
  
}

/* Social media footer */
.soc {
  display: flex;
  align-items: center;
  border-bottom: none;
}

.border {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  border: 1px solid;
}

.footer-info {
  padding: var(--footer-padding);
}

.footer-license {
  font-size: .9rem;
  text-align: center;
  color: #999;
  display: flex; 
  justify-content: center;
  margin: 0;
}

/* Common */
.title h1 {
  font-size: 2rem;
  margin-bottom: 0;
}

time {
  color: grey;
}

/* Posts */
article .title h1{
  margin-bottom: 1em;
  margin-top: 1em;
}

/* Callout */
.callout {
  background-color: var(--callouctcolor);
  color: #fff;
  padding: 1em;
}

.callout p {
  font-family: 'IBM Plex Mono', monospace;
  margin: 0;
}

.callout a {
  border-bottom: 3px solid #fff;
}

.callout a:hover {
  background-color: #fff;
  color: var(--callouctcolor);
}

.callout-alert {
  color: #000000;
  background-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-color: #ff6347;
}

.callout-custom {
  color: #000000;
}

.callout-tip {
  color: #000000;
  background-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-color: dodgerblue;
}

.callout-warning {
  color: #000000;
  background-color: transparent;
  border-width: 3px;
  border-style: solid;
  border-color: #ffd700;
}

.site-description {
display: flex;
justify-content: space-between;
}

.tags li::before{
  content: "# ";
}

.tags a{
  border-bottom: 3px solid var(--maincolor); 
}

.tags a:hover{
  color:white;
  background-color: var(--hovercolor); 
}

svg{
  max-height: 15px;
}

.soc:hover{
  color: white;
}

.draft-label{ 
    color: var(--bordercl);
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 4px;
    margin-left: 6px;
    background-color: #f9f2f4;
}

.highlight {
  position: relative;
  font-size: .95rem;
  -webkit-overflow-scrolling: touch;
}

.highlight pre {
  border: 1px solid rgb(216, 215, 215);
  border-radius: 4px;
}

.highlight pre code[class*="language-"] {
  -webkit-overflow-scrolling: touch;
}

.highlight pre code[class*="language-"]::before {
  background: black;
  border-radius: 0 0 0.25rem 0.25rem;
  color: rgb(82, 20, 20);
  font-size: 12px;
  letter-spacing: 0.025rem;
  padding: 0.1rem 0.5rem;
  position: absolute;
  right: 1rem;
  text-align: right;
  text-transform: uppercase;
  top: 0;
}

.highlight pre code[class=language-javaScript]::before,
.highlight pre code[class="language-js"]::before {
content: "js";
background: #f7df1e;
color: black;
}

.highlight pre code[class*='language-yml']::before,
.highlight pre code[class*='language-yaml']::before {
content: 'yaml';
background: #f71e6a;
color: white;
}

.highlight pre code[class*='language-shell']::before,
.highlight pre code[class*='language-bash']::before,
.highlight pre code[class*='language-sh']::before {
content: 'shell';
background: green;
color:white
}
.highlight pre code[class*='language-json']::before{
content: 'json';
background: dodgerblue;
 color: #000000 
}
.highlight pre code[class*='language-python']::before,
.highlight pre code[class*='language-py']::before {
content: 'py';
background: blue;
color: yellow ;
}
.highlight pre code[class*='language-css']::before{
content: 'css';
background: cyan;
color: black ;
}
.highlight pre code[class*='language-go']::before{
content: 'Go';
background: cyan;
color: royalblue ;
}
.highlight pre code[class*='language-md']::before,
.highlight pre code[class*='language-md']::before{
content: 'Markdown';
background: royalblue;
color: whitesmoke ;
}
.highlight pre code[class*='language-ts']::before{
  content: 'TS';
  background: #3178C6;
  color: #fff;
}
.highlight pre code[class*='language-c']::before {
  content: 'C';
  background: #A8B9CC;
  color: black;
}
.highlight pre code[class*='language-cpp']::before {
  content: 'C++';
  background: #00599C;
  color: white;
}

.highlight pre code[class*='language-rust']::before {
  content: 'Rust';
  background: #DEA584;
  color: black;
}

/* table */
table {
  border-spacing: 0;
  border-collapse: collapse;
}

table th{
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
  font-size: large;
}

table td{
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.feather {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.tag-list { display:flex; flex-wrap:wrap; gap:.4rem .5rem; }
.tag-pill {
  text-decoration:none;
  font-size:.8rem; line-height:1.6;
  padding:.15rem .6rem;
  border-radius:999px;
  background:#f3f4f6;          /* light gray */
  border:1px solid #e5e7eb;
  color:#0f172a;
}
.tag-pill::before { content:"#"; opacity:.6; margin-right:.25em; }
.tag-pill:hover { 
  background-color: var(--hovercolor);
  color: #fff;
}

/* #commento .commento-markdown,
#commento .commento-markdown-toggle,
#commento .commento-markdown-help,
#commento .commento-markdown-table,
#commento .commento-markdown-popup,
#commento .commento-markdown-dropdown {
  display: none !important;
} */

.commento-markdown-button {
  display: none !important;
}

.commento-logo-text {
  display: none !important;
}

/* ---------- Commento: minimal card theme (override) ---------- */
#commento {
  --c-border: #dfe2e5;
  --c-muted:  #6b7280;
  --c-pill:   #f3f4f6;
  --c-accent: var(--maincolor);   /* you already define this */
  --c-hover:  var(--hovercolor);
  --c-bg:     #fff;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif !important;
  color: #0f172a;
}

/* composer ---------------------------------------------------- */
#commento .commento-textarea-container textarea {
  width: 100% !important;
  min-height: 120px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 10px !important;
  background: #fafafa !important;
  outline: none !important;
}
#commento .commento-textarea-container textarea:focus {
  border-color: var(--c-accent) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 25%, transparent) !important;
}

#commento .commento-button-margin {            /* input row */
  margin-top: .75rem !important;
  display: flex !important;
  gap: .6rem !important;
  align-items: flex-start !important;
}

#commento .commento-submit-button {
  background: var(--c-accent) !important;
  border: 1px solid var(--c-accent) !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: .5rem 1rem !important;
  font-weight: 600 !important;
}
#commento .commento-submit-button:hover {
  background: var(--c-hover) !important;
  border-color: var(--c-hover) !important;
}

/* hide Commento’s Markdown help & popup (optional) */
#commento .commento-markdown-button,
#commento .commento-markdown-popup,
#commento .commento-markdown-dropdown,
#commento .commento-markdown-table { display: none !important; }

/* login link */
#commento .commento-login { margin-bottom: .5rem !important; }
#commento .commento-login-text { font-size: .85rem !important; color: var(--c-muted) !important; }

/* sort buttons ----------------------------------------------- */
#commento .commento-sort-policy-buttons { display: flex !important; gap: .4rem !important; align-items: center !important; }
#commento .commento-sort-policy-button {
  padding: .2rem .6rem !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 999px !important;
  background: var(--c-pill) !important;
  color: #0f172a !important;
  font-size: .85rem !important;
}
#commento .commento-sort-policy-button-selected {
  background: #e8eefc !important; border-color: #bfdbfe !important; color: #1d4ed8 !important;
}

/* comment cards ---------------------------------------------- */
#commento .commento-card {
  border: 1px solid var(--c-border) !important;
  border-left: 3px solid var(--c-accent) !important;
  border-radius: 12px !important;
  background: var(--c-bg) !important;
  padding: .75rem !important;
  margin: 1rem 0 !important;
}

/* header area -> grid with tidy actions */
#commento .commento-header {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: .5rem 1rem !important;
}
#commento .commento-avatar-img {
  width: 36px !important; height: 36px !important;
  border-radius: 999px !important; border: 1px solid var(--c-border) !important;
}
#commento .commento-name { font-weight: 600 !important; max-width: none !important; }
#commento .commento-subtitle { color: var(--c-muted) !important; font-size: .85rem !important; }

/* header action buttons */
#commento .commento-options { position: static !important; width: auto !important; display: flex !important; gap: .25rem !important; }
#commento .commento-option-button {
  position: static !important;
  width: 28px !important; height: 28px !important;
  border-radius: 6px !important; border: 1px solid var(--c-border) !important;
  background: #fff !important; opacity: .8 !important;
}
#commento .commento-option-button:hover { opacity: 1 !important; background: var(--c-pill) !important; }

/* optional: hide voting to simplify UI */
/* #commento .commento-option-upvote, #commento .commento-option-downvote { display:none !important; } */

/* body / nesting --------------------------------------------- */
#commento .commento-comments { margin-top: 1rem !important; }
#commento .commento-body { margin-left: 2rem !important; }
@media (max-width: 600px) { #commento .commento-body { margin-left: 1rem !important; } }

/* links inside comments to match your site */
#commento .commento-body a {
  border-bottom: 2px solid var(--c-accent) !important; padding-bottom: .05rem !important; text-decoration: none !important;
}
#commento .commento-body a:hover { background: var(--c-hover) !important; color: #fff !important; }

#commento .commento-option-button {
  position: static !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 6px !important;
  border: 1px solid var(--c-border) !important;
  background-color: #fff !important;  /* was background: #fff */
  opacity: .85 !important;
}

#commento .commento-option-button:hover {
  background-color: #f3f4f6 !important;  /* was background: #f3f4f6 */
  opacity: 1 !important;
}
