/* 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: none
}

/* 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; }

    .site-description p{
      text-align: center;
    }

  /* 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;
}

.site-description p{
  font-family: 'Fira Sans', sans-serif;
  font-size: 1.5em;
}

.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;
  border:1px solid #e5e7eb;
  color:#0f172a;
}
.tag-pill::before { content:"#"; opacity:.6; margin-right:.25em; }
.tag-pill:hover { 
  background-color: var(--hovercolor);
  color: #fff;
}


.list .post-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border, #eee);
}

.post-card__content {
  flex: 1 1 auto;
  min-width: 0;
}

.post-card__content h1 {
  margin-top: 0;       
  margin-bottom: 0.5em;
}

.post-card__media:link,
.post-card__media:visited,
.post-card__media:hover,
.post-card__media:active,
.post-card__media:focus {
  text-decoration: none !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
}


.post-card__media {
  flex: 0 0 150px;
  display: block;
  align-self: center;
  text-decoration: none;
  margin-top: 1.5em;       
  border-bottom: none !important;
  /* border: 1px rgb(128, 128, 128);   */
  background:transparent;
}

.post-card__media img {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
  border: 1px dashed rgb(202, 202, 202);
  border-radius: 5px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  will-change: transform;
}


.post-card__media:hover img {
  transform: scale(1.04);
  
}


.post-card__media:focus {
  outline: none;
}


@media (max-width: 700px) {
  .post-card__media {
    display: none; 
  }
  .list .post-card {
    gap: 0.5rem;
  }
}

/* Row: title on left, tags on right */
.title-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;  /* allows tags to wrap if space is tight */
}

/* Tag styling */
.tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.post-card__content .tag-list .tag-pill {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  border: 0;
  border-radius: 99px;
  background: none;
  color: #333;
  text-decoration: underline;
  transition: background 0.2s ease;
}

.post-card__content .tag-list .tag-pill:hover {
  border-radius: 99px;
  background: #e2e2e2;
}

.tldr {
  font-family: 'Fira Sans', sans-serif;
  font-size: larger;
  margin-bottom: 1em;
}


