/* gspanos.tech — the whole stylesheet. No framework, no build. */

:root {
  color-scheme: light;
  --bg: hsl(0deg 0% 98%);
  --text: hsl(203deg 11% 15%);
  --link: hsl(172deg 18% 41%);
  --accent: hsl(225deg 65% 40%);
  --heading: hsl(0deg 0% 7%);
  --quote: hsl(351deg 66% 48%);
  --muted: hsl(210deg 6% 45%);
  --rule: hsl(210deg 6% 85%);
}

:root.dark {
  color-scheme: dark;
  --bg: hsl(210deg 6% 12%);
  --text: hsl(220deg 3% 79%);
  --link: hsl(330deg 49% 67%);
  --accent: hsl(225deg 83% 80%);
  --heading: hsl(0deg 0% 93%);
  --quote: hsl(102deg 100% 86%);
  --muted: hsl(220deg 3% 60%);
  --rule: hsl(210deg 6% 25%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 auto;
  display: flex;
  min-height: 100vh;
  max-width: 48rem;
  flex-direction: column;
  padding: 4rem 2rem 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas,
    "DejaVu Sans Mono", monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- links ---------- */

a {
  color: inherit;
  text-decoration-color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--link);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 2rem;
  top: 0.5rem;
  z-index: 10;
  background-color: var(--bg);
  padding: 0.5rem;
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.site-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--heading);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header nav a {
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  color: var(--link);
  text-decoration: underline;
}

#theme-toggle {
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  padding: 0.25rem;
  color: inherit;
  cursor: pointer;
}

#theme-toggle:hover {
  color: var(--link);
}

#theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

:root:not(.dark) #theme-toggle .moon,
:root.dark #theme-toggle .sun {
  display: none;
}

/* ---------- layout ---------- */

main {
  flex: 1;
}

h1,
h2,
h3,
h4 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.15rem;
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1rem;
  margin: 2rem 0 0.5rem;
}

h2::before,
h3::before {
  content: "#";
  margin-right: 0.4rem;
  color: var(--accent);
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.25rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2rem 0;
}

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

blockquote p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  display: block;
  overflow-x: auto;
}

th,
td {
  border: 1px solid var(--rule);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

th {
  color: var(--heading);
}

/* ---------- code ---------- */

code {
  font-family: inherit;
  font-size: 0.95em;
  background-color: var(--rule);
  border-radius: 3px;
  padding: 0.1em 0.3em;
}

pre {
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
}

/* ---------- post lists ---------- */

.bio,
.post-list {
  list-style: none;
  padding: 0;
}

/* Narrow screens: date on its own line above the title. Wide screens: two
   columns, with the date column wide enough for the longest date
   ("18 September 2024") so every title starts at the same x. */
.post-list li {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}

.post-list time {
  color: var(--muted);
}

@media (min-width: 640px) {
  .post-list li {
    flex-direction: row;
    gap: 0 0.75rem;
  }

  .post-list time {
    min-width: 10rem;
  }
}

/* ---------- post page ---------- */

.post-meta {
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.post-meta .tags {
  color: var(--accent);
}

article > :first-child {
  margin-top: 0;
}

/* ---------- socials ---------- */

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 2rem 0;
}

.socials ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.socials li {
  margin: 0;
}

.socials a {
  display: inline-block;
  padding: 0.25rem;
}

.socials svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 5rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.site-footer nav {
  display: flex;
  gap: 1rem;
}

@media (min-width: 640px) {
  .site-footer {
    flex-direction: row;
    justify-content: space-between;
  }
}
