/* Markdown */
:root{
--maincolor: red;
--bordercl:rebeccapurple;
--callouctcolor:dodgerblue;
--hovercolor:navy;
--darkMaincolor: #50fa7b;
}

html {
  color: #232333;
  font-family: 'Roboto Mono', monospace;
  font-size: 1rem;
  line-height: 1.6em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

p {
  font-family: 'Roboto Mono', sans-serif;
  font-smooth: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

hr {
  border: 0;
  border-top: 3px dotted 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;
}
a:hover {
    background-color: var(--hovercolor);
    color: #fff;
}

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

/* Images */
img {
  border: 3px solid #ececec;
  max-width: 100%;
  height: auto;
}

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

figure img {
  max-height: 500px;
  width: 100%;
  object-fit: contain;
}

/* Mobile-first approach for figure padding */
figure {
  padding: 0 10px;
}

@media screen and (min-width: 600px) {
  figure {
    padding: 0 40px;
  }
}

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

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

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

.highlight pre ::selection {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

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

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

/* Responsive breakpoints for content width */
@media screen and (min-width: 768px) {
  .content {
    max-width: 80vw;
  }
}

@media screen and (min-width: 1024px) {
  .content {
    max-width: 60vw;
  }
}

/* Header - Make it stack on mobile */
header {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin: 1em 0;
  line-height: 2.5em;
}

@media screen and (min-width: 768px) {
  header {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0;
  }
}

header .main {
  font-size: 1.5rem;
}

/* Responsive font sizes */
@media screen and (max-width: 480px) {
  html {
    font-size: 0.9rem;
  }

  header .main {
    font-size: 1.3rem;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-size: 1.2rem;
}

@media screen and (max-width: 480px) {
  h1, h2, h3, h4, h5, h6 {
    font-size: 1.1rem;
    margin-top: 1.5em;
  }
}

h1::before { color: var(--maincolor); content: '# '; }
h2::before { color: var(--maincolor); content: '## '; }
h3::before { color: var(--maincolor); content: '### '; }
h4::before { color: var(--maincolor); content: '#### '; }
h5::before { color: var(--maincolor); content: '##### '; }
h6::before { color: var(--maincolor); content: '###### '; }

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

/* Post container - Stack on mobile */
.post-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

@media screen and (min-width: 1024px) {
  .post-container {
    flex-direction: row;
    align-items: flex-start;
    min-width: 50vw;
  }
}

.post-content {
  flex: 1;
  min-width: 0;
  width: 100%;
}

@media screen and (min-width: 1024px) {
  .post-content {
    flex: 3;
  }
}

/* TOC - Mobile responsive */
.toc {
  background-color: #ececec;
  border-radius: 5px;
  color: #232333;
  height: auto;
  max-width: 100%;
  overflow-y: auto;
  position: static;
  width: 100%;
  padding: 10px;
}

@media screen and (min-width: 1024px) {
  .toc {
    flex: 0 0 auto;
    margin-left: 20px;
    max-width: 300px;
    position: sticky;
    top: 20px;
    width: auto;
  }
}

/* Footer - Stack on mobile */
footer {
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: flex-start;
  border-top: 0.4rem dotted var(--bordercl);
  padding: 2rem 0rem;
  margin-top: 2rem;
}

@media screen and (min-width: 768px) {
  footer {
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
}

.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);
}

/* Common */
.title h1 {
  margin-bottom: 0;
}

time {
  color: grey;
}

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

/* Callout */
.callout {
  background-color: var(--callouctcolor);
  color: #fff;
  padding: 1em;
  margin: 1em 0;
  border-radius: 4px;
}

.callout p {
  font-family: 'Departure 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;
  flex-direction: column;
  gap: 1em;
}

@media screen and (min-width: 768px) {
  .site-description {
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
  }
}

.tags li::before{
  content: "🏷 ";
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif;
}
.tags a{
  border-bottom: 3px solid var(--maincolor);
}
.tags a:hover{
  color:white;
  background-color: var(--hovercolor);
}
svg.feather {
  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;
  -webkit-overflow-scrolling: touch;
}
.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: white;
  font-size: 12px;
  letter-spacing: 0.025rem;
  padding: 0.1rem 0.5rem;
  position: absolute;
  right: 1rem;
  text-align: right;
  text-transform: uppercase;
  top: 0;
}

/* Mobile adjustments for code language labels */
@media screen and (max-width: 480px) {
  .highlight pre code[class*="language-"]::before {
    font-size: 10px;
    right: 0.5rem;
    padding: 0.05rem 0.25rem;
  }
}

.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;
}

/* Table - Mobile responsive */
table {
  border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

@media screen and (min-width: 768px) {
  table {
    display: table;
    white-space: normal;
  }
}

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

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

/* Mobile table adjustments */
@media screen and (max-width: 768px) {
  table th,
  table td {
    padding: 4px 8px;
    font-size: 0.9rem;
  }

  table th {
    font-size: 1rem;
  }
}

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

/* Additional mobile optimizations */
@media screen and (max-width: 480px) {
  body {
    margin: 4px;
  }

  .content {
    padding: 0 0.5ch;
  }

  ul {
    padding-left: 1ch;
  }

  ul li {
    text-indent: -1ch;
  }

  blockquote {
    padding-left: 0.5em;
    margin: 0.5em 0;
  }

  pre {
    padding: 0.5em;
    font-size: 0.9rem;
  }
}

.list-item {
  margin-top: 2rem
}
