/* Default (light) theme */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --link-color: #555555;
  --date-color: #999999;
  --footer-color: #aaaaaa;
  --button-color: #000000;
  --button-bg: #eeeeee;
}

/* Dark theme overrides */
body.dark {
  --bg-color: #121212;
  --text-color: #eeeeee;
  --link-color: #bbbbbb;
  --date-color: #888888;
  --footer-color: #666666;
  --button-color: #ffffff;
  --button-bg: #1f1f1f;
}

.theme-icon {
  max-width: 100%;         /* scales down to fit container */
  height: auto;            /* keeps aspect ratio */
}

/* Default (light theme) */
body .theme-icon.dark { display: none; }
body .theme-icon.light { display: block; }

/* Dark theme override */
body.dark .theme-icon.light { display: none; }
body.dark .theme-icon.dark  { display: block; }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
  transition: none;
}

/* Style only inline code */
p code, li code, span code {
  background: var(--button-bg);
  color: var(--button-color);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-family: Consolas, monospace;
  font-size: 0.95em;
}

article ol {
  margin: 1em 0;
  padding-left: 2em;
  list-style-position: outside;
}
article ol li {
  margin: 0.3em 0;
}

article ol li::marker {
  font-weight: bold;
}

.collapsible {
  max-height: 300px;
  overflow: hidden;
  position: relative;
  transition: max-height 0.4s ease;
  margin: 0.5em 0;
  border: none;              /* remove border */
  border-radius: 8px;          /* remove rounding */
  background: transparent;   /* no background */
}

.collapsible::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to bottom, transparent, black);
  pointer-events: none;
}

.collapsible.expanded {
  max-height: 5000px;
}

.collapsible.expanded::after {
  display: none;
}

.collapsible-toggle {
  display: inline-block;
  margin: 4px 0;
  padding: 2px 6px;
  font-size: 0.85em;
  cursor: pointer;
  background: none;         /* transparent button background */
  border: none;             /* no border */
  color: inherit;           /* inherit text color from theme */
  text-decoration: underline;
}

pre {
  overflow-x: auto;      /* horizontal scroll if needed */
  -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
}

/* Don’t mess with Pygments blocks */
.highlight pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-family: 'Fira Code', monospace;
  font-size: clamp(2rem, 5vw, 4rem);  /* Scale font */
  font-weight: bold;
  color: #33ff33;                     /* Classic terminal green */
  background-color: #000000;          /* Terminal-like background */
  padding: 1rem 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 255, 0, 0.2);  /* Subtle glow */
  letter-spacing: -0.5px;
  margin-bottom: 1rem;
}

.unstyled-link {
  text-decoration: none;
  color: inherit;
  font: inherit;
}

.unstyled-link:hover,
.unstyled-link:visited {
  color: inherit;
  text-decoration: none;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

nav a {
  text-decoration: none;
  color: var(--link-color);
  font-size: 0.95rem;
}

nav a:hover {
  text-decoration: underline;
}

/* Theme toggle button */
#theme-toggle {
  background: var(--button-bg);
  color: var(--button-color);
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

main article {
  margin-bottom: 2.5rem;
  font-size: 1.125rem;
  line-height: 1.5;
}

article h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

article h3 {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

article h2 a {
  color: inherit;
  text-decoration: none;
}

article h2 a:hover {
  text-decoration: underline;
}

blockquote {
  border-left: 4px solid var(--link-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--date-color);
}

.summary-link {
  text-decoration: none;  /* Remove underline */
  color: inherit;         /* Keep normal text color */
  display: block;         /* Make entire summary clickable */
}

.thumbnail {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1rem;
  object-fit: cover;
}

.date {
  font-size: 0.85rem;
  color: var(--date-color);
  margin-bottom: 0.75rem;
  display: block;
}

footer {
  text-align: center;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--footer-color);
}

.about-container {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 1200px;
  margin: 2rem auto;
  flex-wrap: wrap;
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-text {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-text p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-text a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--link-color);
  margin-bottom: 0.5rem;
}

.about-text a:hover {
  text-decoration: underline;
}

.icon {
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  vertical-align: middle;
  filter: grayscale(100%);
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.95em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
table th, table td {
  border: 1px solid #ddd;
  padding: 8px 12px;
}
table th {
  background: #222;
  color: #fff;
  text-align: left;
}
table tr:nth-child(even) {
  background: #f9f9f9;
}

/* Copy button for Pygments code blocks */
.highlight {
  position: relative; /* container must be relative */
}

.highlight .copy-btn {
  position: absolute;
  top: 0.6em;      /* a bit lower */
  right: 0.6em;    /* a bit inward */
  font-size: 0.7em;
  padding: 0.2em 0.5em;
  border: none;
  border-radius: 4px;
  background-color: var(--button-bg);
  color: var(--button-color);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

/* Add this to your existing CSS; default hover behavior remains unchanged */
.highlight.touched .copy-btn {
  opacity: 0.9;          /* visible when .touched is present */
}

/* Show button when hovering the block */
.highlight:hover .copy-btn {
  opacity: 0.7;
}

.highlight:hover .copy-btn:hover {
  opacity: 1;
}

.highlight .copy-btn.copied {
  background-color: var(--link-color);
  color: var(--bg-color);
  opacity: 1;
}
