@import url("https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Libre+Franklin:ital,wght@0,100..900;1,100..900&family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap");

:root {
  --brand-color: #0080ff;
  --light-brand-color: #56b0ff;
  --body-color: #131313;
  --caption-color: #444;
}

body {
  line-height: 1.6;
  font-family: "Source Serif 4", serif;
  font-weight: 400;
  font-size: 19px;
  font-variation-settings: "opsz" 20;
  letter-spacing: -0.25px;
  margin: auto;
  max-width: 750px;
  padding: 20px;
  color: var(--body-color);
}

.logo {
  max-height: 85px; /* Small size for smaller screens */
  margin: 0 auto;
}

/* Since Apple sucks at updating its browser (Safari doesn't support
@media within SVGs), a workaround is needed for now. */
@supports (-webkit-line-snap: baseline) {
  @media (prefers-color-scheme: dark) {
    img.logo {
      content: url("/assets/pragmaticpapers-safari.svg");
    }
  }
}

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

/* Media query for larger screens (e.g., screens wider than 768px) */
@media (min-width: 768px) {
  .logo {
    max-height: 115px; /* Normal size for larger screens */
  }
}

h1 {
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: var(--brand-color);
  color: transparent;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 15.5vw;
  line-height: 0.80597;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 25px;
  margin-top: 5px;
}

@media (min-width: 768px) {
  h1 {
    -webkit-text-stroke-width: 2px;
    font-size: 9.5vw;
  }
}

h2 {
  font-family: "Libre Franklin", sans-serif;
  line-height: 1.2;
  font-size: 38px;
  letter-spacing: 0;
  text-align: center;
  font-weight: 700;
}

h2.htitle {
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.18px;
  text-align: left;
}

h2.htitle:hover {
  color: var(--brand-color);
  transition: color 0.2s ease-in-out;
}

h3 {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.5em;
  text-align: center;
  font-weight: 700;
  line-height: 1.2;
}

h4 {
  font-family: "Libre Franklin", sans-serif;
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: -3px;
  line-height: 1.4;
}

.volumes {
  width: 75%;
  margin: auto;
}

.volume {
  padding-top: 2rem;
}

.volumeinfo {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  line-height: 1.16667;
  color: inherit;
  margin-bottom: 10px;
  position: relative;
}

.volumetitle {
  text-transform: uppercase;
  margin-right: 0.3em;
}

.volumedate {
  color: var(--brand-color);
}

.volumedescription {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.28571;
  color: var(--caption-color);
  margin-top: 14px;
  min-height: 4em;
}

.author,
.supplementary {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.author strong,
.supplementary strong {
  font-weight: 700;
}

.squiggle {
  background-image: url("/assets/squiggle.svg");
  content: "";
  display: block;
  height: 5px;
  margin: 40px auto 0;
  margin-top: 40px;
  margin-bottom: 40px;
  width: 50%;
}

.squigglestatic {
  width: 100%;
  height: 3px;
  margin-top: 1.5em;
  background-size: auto 3px;
  background-repeat: repeat-x;
  background-position: 100% 100%;
  position: relative;
  background-image: url("/assets/squiggle-static.svg");
  display: block;
}

.edition {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

code,
pre,
.codelike {
  font-family: "JetBrains Mono", monospace;
  font-size: 15px;
}

/* Global box-sizing to avoid padding/border issues */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.articlescontainer {
  display: flex;
  flex-wrap: wrap;
  gap: 24px; /* Increased gap for better spacing on desktop */
  padding-top: 15px;
  padding-bottom: 30px;
}

/* Default: Desktop layout (2 articles per row) */
.article {
  flex-basis: calc(50% - 24px); /* Two articles per row with bigger gap */
  display: flex;
  flex-direction: column;
}

/* Image styling */
.articlephoto {
  width: 100%;
  height: 300px; /* Fixed height for images to be the same height on desktop */
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.articlephoto img {
  width: 100%;
  height: 100%; /* Ensure the image takes up full space of the container */
  object-fit: cover; /* Preserve aspect ratio while filling the container */
  border-radius: 6px;
}

/* Ensure the <a> tag doesn't break plex layout */
.article-link {
  display: contents;
}

/* Article info */
.articleinfo {
  padding: 10px;
  flex-grow: 1;
}

/* Info container */
.articleinfotop {
  display: flex;
  flex-direction: column;
}

.articleinfoshort {
  font-family: "Libre Franklin", sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--caption-color);
  line-height: 1.25;
}

.articleinfoshort:hover {
  color: var(--brand-color);
  transition: color 0.2s ease-in-out;
}

.articleinfolong {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--caption-color);
  padding-top: 5px;
}

/* Override a style for other stuff */
a.article-link {
  text-decoration: none;
  outline: 0;
}

.image-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 10px;
  padding-top: 10px;
}

.image-container img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

.caption {
  display: block;
  font-family: "Inter", sans-serif;
  font-size: 0.8em;
  line-height: 1.4;
  margin-top: 10px;
  color: var(--caption-color);
}

a {
  box-shadow: inset 0 -2px 0 0 var(--brand-color);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease-out;
}

a:hover {
  box-shadow: inset 0 -11px 0 0 var(--light-brand-color);
}

a.logolink {
  all: unset;
  cursor: pointer;
}

/* Mobile layout */
@media (max-width: 768px) {
  .articlescontainer {
    display: flex;
    flex-direction: column; /* Ensure articles stack vertically */
    gap: 20px;
    padding-top: 15px;
    padding-bottom: 30px;
  }

  .article {
    display: flex;
    flex-direction: row; /* Arrange image and text in a row */
    align-items: center;
    flex-basis: 100%; /* Ensure each article takes the full width */
  }

  .articlephoto {
    flex: 0 0 30%; /* Image takes 30% width */
    height: 120px; /* Adjust height */
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
  }

  .articlephoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
  }

  .articleinfo {
    flex: 0 0 70%; /* Text takes 70% width */
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .articleinfoshort {
    font-family: "Libre Franklin", sans-serif;
    font-size: 22px;
    color: var(--caption-color);
    line-height: 1.25;
  }

  .articleinfolong {
    font-family: "Inter", sans-serif;
    font-size: 14px;
    color: var(--caption-color);
    padding-top: 5px;
  }
}

samp {
  display: block;
}

sup {
  font-size: 80%;
  line-height: 1;
}

sup a {
  all: unset;
  cursor: pointer;
  color: var(--brand-color);
}

sup a:hover {
  box-shadow: none;
}

#footnotes {
  font-size: 0.85em;
  font-family: "Inter", sans-serif;
}

#footnotes ol {
  list-style-type: decimal;
}

#footnotes a {
  all: unset;
  cursor: pointer;
  color: var(--brand-color);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body {
    color: #e9e9e9;
    background: #0c0c0c;
  }

  h1 {
    -webkit-text-stroke-color: var(--light-brand-color);
  }

  .articleinfoshort {
    color: #e9e9e9;
  }

  .articleinfolong {
    color: #e9e9e9;
  }

  .caption {
    color: #9d9d9d;
  }

  .volumedescription {
    color: #9d9d9d;
  }

  .volumedate {
    color: var(--light-brand-color);
  }
}
