@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

/* ================== CSS ================== */
/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================== Variables ================== */
:root {
  --bg: #ffffff;
  --text: #000000;
  --link: #000000;
  --accent: #000000;
  --emoji-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #191919;       /* softer dark background */
  --text: #f5f5f5;     /* off-white text for comfort */
  --link: #ffffff;     /* light links */
  --accent: #ffffff;
  --emoji-bg: #ffffff; /* white emoji background */
}

/* ================== Body ================== */
body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, sans-serif;
    margin: 2rem;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

/* ================== Header ================== */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

header h2 {
    font-size: 1.2rem;
    color: #555;
}

header hr {
    width: 100%;
    max-width: 800px;  /* matches your main content width */
    margin: 2rem auto; /* centers it */
    border: none;
    border-top: 1px solid var(--text); /* subtle line using current text color */

}

/* ================== Site Nav ================== */
.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* spacing between items */
    flex-wrap: wrap;
}

.site-nav a,
#theme-toggle {
    all: unset;               /* remove default button styles */
    cursor: pointer;
    color: var(--link);
    font-weight: 500;
    transition: color 0.3s, opacity 0.3s;
}

.site-nav a:hover,
#theme-toggle:hover {
    opacity: 0.7;
}

/* ================== Main ================== */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0rem 1rem;
}

/* Align lists with content */
main ul,
main ol {
    padding-left: 1.2rem;           /* indent for bullets/numbers */
    margin: 1rem 0;                 /* vertical spacing */
    list-style-position: inside;    /* bullets/numbers align with text */
}

/* Optional: nicer bullet style for ul */
main ul {
    list-style-type: disc;          /* default: disc, you can change */
}

/* Optional: nicer number style for ol */
main ol {
    list-style-type: decimal;
}

/* ================== Articles ================== */
article h1, article h2, article h3 {
    margin: 1.5rem 0 0.5rem;
    line-height: 1.2;
}

article p {
    margin-bottom: 1rem;
}

pre {
    background-color: #f5f5f5;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

code {
    font-family: "Courier New", monospace;
    font-size: 0.95rem;
}

img {
    display: block;
    margin: 2rem auto;
    max-width: 100%;
    height:auto;
    object-fit:cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.figure-right {
    float: right;
    margin-left: 1rem;
    margin-bottom: 1rem;
    max-width: 300px;
}

/* ================== Callouts ================== */
.callout {
    margin: 1.5rem 0;
    padding: 2rem 2.5rem;
    border-left: 4px solid #000;
    border-radius: 8px;
    max-width: 700px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.callout .author {
    margin-top: 1rem;
    font-weight: bold;
    font-style: italic;
    color: #555;
}

/* ================== Blockquote ================== */
blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    color: #555;
    margin: 1rem 0;
}

/* ================== Date ================== */
.date {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

/* ================== Links ================== */
a {
    color: var(--link);
    text-decoration: none;
}

a:visited {
    color: var(--link); /* prevents the default purple color */
}

a:hover,
a:active {
    opacity: 0.7;
    color: var(--accent); /* optional: slight highlight on hover */
}

/* ================== Footer ================== */
footer {
    margin-top: 4rem;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
}

footer a {
    display: inline-block;
    width: 40px;
    height: 40px;
    transition: transform 0.6s ease;
}

footer a:hover {
    transform: rotate(360deg);
}

footer svg {
    width: 50%;
    height: 100%;
    fill: var(--link);
    transition: fill 0.3s;
}


/* ================== Code Block Theming ================== */

/* Light Mode */
pre, code {
  background: #f5f5f5;
  color: #222;
}

pre {
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.95rem;
  border: 1px solid #e0e0e0;
}

code {
  background: rgba(0,0,0,0.05);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: "JetBrains Mono", "Courier New", monospace;
}

/* Dark Mode */
[data-theme="dark"] pre, 
[data-theme="dark"] code {
  background: #1e1e1e; /* similar to VSCode dark */
  color: #dcdcdc;
  border-color: #2a2a2a;
}

[data-theme="dark"] pre {
  box-shadow: 0 0 15px rgba(255,255,255,0.05);
}

[data-theme="dark"] code {
  background: rgba(255,255,255,0.1);
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;  /* matches your main content width */
  margin: 2rem auto;
  aspect-ratio: 16 / 9; /* keeps proper proportions */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Optional: Tighter spacing and full width for smaller screens */
@media (max-width: 480px) {
  .video-container {
    max-width: 100%;
    margin: 1rem auto;
  }
}




/* ================== Responsive Layout ================== */
@media (max-width: 1024px) {
  main {
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  main {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  body {
    margin: 1rem;
  }
  main {
    max-width: 100%;
    padding: 0;
  }
}


/* ================== Code Block Styling ================== */
pre {
  background: #1e1e1e; /* editor dark theme background */
  color: #dcdcdc;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "Fira Code", "JetBrains Mono", Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

code {
  font-family: inherit;
  background: none;
  color: inherit;
}

/* Inline code (not blocks) */
p code, li code {
  background: rgba(0, 0, 0, 0.07);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* ================== Syntax Highlighting ================== */

/* C++ keywords */
.lang-cpp .hljs-keyword { color: #569cd6; font-weight: 500; }

/* Numbers */
.lang-cpp .hljs-number,
.lang-cpp .hljs-symbol,
.lang-cpp .hljs-literal { color: #b5cea8; }

/* Strings */
.lang-cpp .hljs-string { color: #ce9178; }

/* Comments */
.lang-cpp .hljs-comment { color: #6a9955; font-style: italic; }

/* Functions & built-in identifiers */
.lang-cpp .hljs-built_in { color: #4fc1ff; }

/* Highlighted code lines (optional) */
.lang-cpp .hljs-code { display: block; padding-left: 1rem; }

/* ================== Light Theme Support ================== */
[data-theme="light"] pre {
  background: #f5f5f5;
  color: #1e1e1e;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

[data-theme="light"] .lang-cpp .hljs-comment { color: #008000; }
[data-theme="light"] .lang-cpp .hljs-string { color: #a31515; }
[data-theme="light"] .lang-cpp .hljs-keyword { color: #0000ff; }
[data-theme="light"] .lang-cpp .hljs-number { color: #098658; }
[data-theme="light"] .lang-cpp .hljs-built_in { color: #795e26; }



















