/* ----------------------------
   Overpass Mono (static)
----------------------------- */
@font-face {
  font-family: 'Overpass Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/overpass-mono-v21-latin-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Overpass Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/overpass-mono-v21-latin-600.woff2') format('woff2');
}

/* ----------------------------
   Open Sauce One (variable)
----------------------------- */
@font-face {
  font-family: "Open Sauce One";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/OpenSauceOneVF.woff2") format("woff2-variations"),
       url("/fonts/OpenSauceOneVF.woff2") format("woff2");
}

@font-face {
  font-family: "Open Sauce One";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/OpenSauceOneVF-Italic.woff2") format("woff2-variations"),
       url("/fonts/OpenSauceOneVF-Italic.woff2") format("woff2");
}

/* ----------------------------
   Satoshi Bold
----------------------------- */
@font-face {
  font-family: 'Satoshi';
  src: url('/fonts/satoshi-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ff-base: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --ff-satoshi: 'Satoshi', var(--ff-base);
  --ff-open-sauce-one: 'Open Sauce One', var(--ff-base);
  --ff-overpass-mono: 'Overpass Mono', monospace;
  --bg-color: #f7f0eb;
  --text-color: #222;
  --color-primary: #1a8fe3;
  --color-secondary: #e7e7e7;
  --form-border: #c6c6c6;
  --form-input-bg: #eceff4;
  --form-input-radius: 6px;
  --form-submit-hover: #156fa3;
  --form-text-color: #444;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --form-input-bg: #eceff4;
    --form-border: #484848;
    --form-text-color: #3c3a3a;
  }
}

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

html, body {
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  font-size: 18px;
  line-height: 27px;
}

body::before {
  content: "";
  height: 6px;
  background: linear-gradient( to right, #38C4C4 0 5%, #F25C30 5% 10%, #E63946 10% 15%, #F4E3C1 15% 20%, #F2A900 20% 25%, #38C4C4 25% 30%, #F25C30 30% 35%, #E63946 35% 40%, #F4E3C1 40% 45%, #F2A900 45% 50%, #38C4C4 50% 55%, #F25C30 55% 60%, #E63946 60% 65%, #F4E3C1 65% 70%, #F2A900 70% 75%, #38C4C4 75% 80%, #F25C30 80% 85%, #E63946 85% 90%, #F4E3C1 90% 95%, #F2A900 95% 100% );
  border-radius: 6px;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
}

body {
  font-family: var(--ff-open-sauce-one);
  line-height: 1.5;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr; /* mobile-first single column */
  grid-template-areas:
    "header"
    "main"
    "footer";
  gap: 1rem;
  justify-content: center;
  grid-auto-columns: minmax(0, 1fr);
  padding: 3rem 1rem;
  max-width: 100%;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  grid-area: header;
  gap: 0;
  position: relative;
}

header .title { grid-area: title; flex: 0 0 auto; }
header nav    { grid-area: nav; }

header h1 {
  margin: 0;
}

header .title {
  text-decoration: none;
}

header .title h1 {
  text-transform: uppercase;
  line-height: 1.2;
  display: inline;
  background: #111;
  color: #fff;
  padding: 0.8rem 1.5rem;
  font-size: 1.2rem;
  font-family: 'Open Sauce One',var(--ff-base);
  font-weight: bold;
}


nav, time, footer h3 {
  font-family: var(--ff-overpass-mono);
}

time {
  font-style: normal;
  font-size: 15px;
  font-family: var(--ff-overpass-mono);
  line-height: 1;
}

footer h3 {
  font-weight: 400;
  text-transform: uppercase;
  font-family: var(--ff-overpass-mono);
  font-size: 1rem;
  text-transform: uppercase;
}

main {
  grid-area: main;
  line-height: 1.6;
}

main h1 {
  line-height: 1.2;
}

footer {
  grid-area: footer;
  padding: 0 !important;
}

footer h3:not(:first-of-type) {
  margin-top: 2rem;
}

ul, ol {
  margin: 0;
  padding: 0 0 0 1.25rem;
}

li {
  margin: 0;
  padding: 0;
}

ul.blog-posts {
  list-style-type: none;
  padding: unset;
  margin: 0;
}

ul.blog-posts li {
  display: flex;
  flex-direction: column;
}

ul.blog-posts li span {
  line-height: 1;
}

ul.embedded.blog-posts li > a {
  font-size: 1.9rem;
  font-weight: 700;
  font-family: 'Satoshi', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--heading-color);
  text-decoration: none;
  line-height: 1.2;
}

footer ul.embedded.blog-posts li > a{
  font-size: inherit;
}

.bio-image {
  width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

a {
  color: currentColor;
  text-decoration-color: var(--color-primary);
  text-decoration-thickness: 0.2ex;
  text-underline-offset: 0.3ex;
}

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

main p:has(a.glightbox) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  justify-items: center;
  margin-bottom: 1em;
}

main p:has(a.glightbox) img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

main p:has(a.glightbox) img:hover {
  transform: scale(1.05);
}

.email-signup {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    gap: 3px;
    font-family: var(--ff-satoshi);
}

.email-signup br {
    display: none;
}

.email-signup input[type="text"] {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.email-signup input[type="email"] {
    padding: 0.75rem 1rem !important;
    font-size: 1rem;
  	border: 1px solid var(--form-border);
  	border-radius: var(--form-input-radius);
  	background-color: var(--form-input-bg) !important;
    color: var(--form-text-color);
    transition: border-color 0.2s;
}

.email-signup input[type="email"]:focus {
    border-color: var(--color-primary);
    outline: none;
}

.email-signup input[type="email"]::placeholder {
    color: var(--form-text-color);
    opacity: 0.7;
}

.email-signup input[type="submit"] {
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--form-input-radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--font-stack);
}

.email-signup input[type="submit"]:hover {
    background: var(--form-submit-hover);
    color: #fff;
}

button {
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: var(--text-color);
  border: none;
  border-radius: var(--form-input-radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: var(--font-stack);
}

nav {
  position: relative;
}

nav .hamburger {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  color: #111;
  width: 38px;
  height: 38px;
  z-index: 10;
}

nav .hamburger svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

nav .nav-links {
  display: none; /* hidden by default */
  position: absolute;
  top: 100%; /* right below header */
  right: 0;   /* align to hamburger / header right */
  background: var(--bg-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 9;
}

/* Toggle class to show menu */
nav .nav-links.show {
  display: flex;
}

nav .nav-links p {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

nav .nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-family: var(--ff-overpass-mono);
  font-weight: 600;
}

#upvote-form {
  margin-top: 2rem;
  display: block !important;
}

footer span:has(a[href="https://bearblog.dev"]) {
  display: block;
  text-align: center;
  font-size: 16px;
}

/* ----------------------------
   Media Queries for larger screens
----------------------------- */
@media (min-width: 768px) {
  body {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      "header header"
      "main footer";
    gap: 3rem;
    max-width: 1300px;
    padding: 3rem 1rem;
  }
  header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "title nav";
    gap: 1rem;
    position: static;
  }

  header nav p {
    gap: 1.5rem;
  }
  header .title h1 {
    font-size: 1.6rem;
    line-height: 1;
  }
  nav .hamburger {
    display: none;
  }
  nav .nav-links {
    position: static;
    display: block;
    padding: 0;
    box-shadow: none;
    flex-direction: row;
    gap: 1.5rem;
  }
  nav .nav-links p {
    display: flex;
    gap: 1.5rem;
    flex-direction: row;
  }
  ul:has(li:nth-child(10)),
  ol:has(li:nth-child(10)) {
    column-count: 2;
  }
}