/*
 * The current site's design (Berlin-Phil inspired), ported from the Next.js
 * app's global.css + *.module.scss files into one plain stylesheet.
 * Sections below are labelled with the component they came from.
 */

@import url('/assets/font.css');

/* ---- global.css ------------------------------------------------------ */

:root {
  font-size: 18px;
  font-family: 'BPH Sans Text', 'IBM Plex Sans', sans-serif;
  line-height: 1.4;
  --primary-color: rgba(0, 0, 0, 0.87);
  --accent-color: rgb(255, 204, 0); /* berlin phil color */
  --breakpoint: 860px; /* reference only: media queries can't read vars */
}

body {
  margin: 0;
  padding: 0;
  background: white;
  color: black;
}

h1,
h2 {
  font-family: 'BPH Sans Bold', 'IBM Plex Sans', sans-serif;
}

article {
  max-width: 80ch;
  position: relative;
}
article pre {
  overflow-x: auto;
}
article img,
article video {
  max-width: 100%;
  height: auto;
}
article code {
  font-family: Menlo, monospace;
  font-size: 0.8em;
}
article a {
  color: var(--primary-color);
}
article a:hover {
  background: var(--accent-color);
}

/* ---- PageWrapper ------------------------------------------------------ */

.wrap-page {
  padding: 0 1rem;
}

/* ---- Header ----------------------------------------------------------- */

.header-nav {
  display: block;
  position: sticky;
  top: 0;
  background: white;
  opacity: 0.9;
  padding: 0.5rem 0;
  box-sizing: border-box;
  z-index: 1;
}
.header-nav ul {
  margin: 0;
  padding: 0;
  display: flex;
}
.header-nav li {
  list-style: none;
  margin-right: 0.5rem;
}
.header-nav a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 4px solid rgba(255, 204, 0, 0);
  transition: border-bottom 0.2s;
}
.header-nav a:hover {
  border-bottom: 4px solid var(--accent-color);
}
.header-nav .highlighted {
  border-bottom: 2px solid var(--accent-color);
}

/* ---- Greeting --------------------------------------------------------- */

.site-heading {
  margin-bottom: 2rem;
  padding: 0;
}
.site-heading-title {
  font-size: 2.78rem;
  margin-bottom: 0;
  line-height: 100%;
}
.site-heading-title::after {
  font-size: 2rem;
  content: ' a work in progress';
  opacity: 0.04;
}
.site-heading-subtitle {
  font-family: 'BPH Sans Text', 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  margin-top: 0;
  font-size: 2.78rem;
}
@media (max-width: 859px) {
  .site-heading-title::after {
    display: block;
    font-size: 1.5rem;
  }
  .site-heading-subtitle {
    font-size: 1.5rem;
  }
}

/* ---- HomePageArticleList ---------------------------------------------- */

.article-list-section {
  padding: 0;
  max-width: 60rem;
  margin-bottom: 10rem;
}
.article-list-year {
  font-family: 'BPH Sans Text', sans-serif;
  font-size: 14px;
  font-weight: normal;
  opacity: 0.2;
  display: flex;
  justify-content: flex-end;
  margin-top: 2rem;
}
.article-list {
  padding: 0;
}
.article-list-item {
  list-style: none;
}
.article-list-item-image,
.article-list-item-image-after-title {
  position: relative;
  overflow: hidden; /* keeps the hover zoom inside the frame */
}
.article-list-item-image-after-title {
  margin-top: 1rem;
}
.article-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}
.article-image:hover {
  transform: scale(1.05);
}
a.article-title {
  font-size: 2rem;
  font-family: 'BPH Sans Bold';
  padding: 2px 0;
  transition: background-color 0.2s;
  color: var(--primary-color);
  align-self: baseline;
}
a.article-title:hover {
  background-color: var(--accent-color);
}
.article-dates {
  margin-top: 0.5rem;
  opacity: 0.4;
  font-size: 0.8em;
  display: block;
}
.article-excerpts {
  margin-top: auto;
}
.article-excerpts a,
a.article-read-more-link {
  color: var(--primary-color);
  transition: background-color 0.1s ease;
}
.article-excerpts a:hover,
a.article-read-more-link:hover {
  background: var(--accent-color);
}
a.article-read-more-link {
  align-self: baseline;
}

@media (max-width: 859px) {
  .article-list-item-image {
    display: none;
  }
  .article-list-item-image-after-title {
    display: block;
  }
  .article-list-item-info {
    margin-bottom: 3rem;
  }
}
@media (min-width: 860px) {
  .article-list-item-image-after-title {
    display: none;
  }
  .article-list-item-image {
    display: block;
  }
  .article-list-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 4rem;
  }
  .article-list-item-info {
    grid-column: 1 / span 2;
  }
  .article-list-item-image + .article-list-item-info {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--primary-color);
  }
}

/* ---- HomePageRecentShortNoteList -------------------------------------- */

.short-note-list-section {
  margin-bottom: 8rem;
  max-width: 60rem;
  overflow-x: auto;
  padding: 0;
}
.short-note-list-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.short-note-see-all-link {
  color: var(--primary-color);
}
.short-note-list {
  padding: 0;
}
.short-note-entry {
  list-style: none;
}
@media (max-width: 859px) {
  .short-note-list {
    display: block;
  }
  .short-note-entry {
    margin-bottom: 1rem;
  }
}
@media (min-width: 860px) {
  .short-note-list {
    min-width: 60rem;
    display: flex;
  }
  .short-note-entry {
    flex: 20rem;
    height: 14rem;
  }
  .short-note-entry:not(:first-child) {
    margin-left: 1rem;
  }
}
.short-note-link-wrapper {
  height: 100%;
  box-sizing: border-box;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  color: var(--primary-color);
  background: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.short-note-link-wrapper:hover {
  border: 1px solid var(--primary-color);
  background: white;
}
.short-note-title {
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--primary-color);
  font-family: 'BPH Sans Bold';
  margin-top: 0.2rem;
  margin-bottom: 1rem;
}
.time-row {
  font-size: 1.2rem;
}
.read-more-row {
  font-size: 14px;
  margin-top: auto;
  text-align: right;
  text-decoration: underline;
}

/* ---- notes page + NotesPageNoteLists ---------------------------------- */

.notes-page-main {
  margin-bottom: 8rem;
  padding: 0;
}
.note-list-heading {
  font-size: 2.5rem;
  margin-bottom: 0;
  padding: 0;
}
.note-list {
  line-height: 1.5;
}
.note-item-link {
  color: var(--primary-color);
  padding: 2px 4px;
}
.note-item-link:hover {
  background: var(--accent-color);
}

/* The zero-JS toggle: show the list matching the checked radio. */
.listing {
  display: none;
}
#listByTag:checked ~ .listing-by-tag,
#listByYear:checked ~ .listing-by-year {
  display: block;
}

/* ---- single note ([...slug]) ------------------------------------------ */

.note-article {
  margin: 6rem 0;
  padding: 0;
}
.cover-image {
  position: relative;
}
.cover-image img {
  width: 100%;
  height: auto;
}
.image-credit {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  mix-blend-mode: overlay;
}
.note-title {
  font-size: 2.5rem;
  margin: 0;
}
.note-dates {
  text-align: right;
  opacity: 0.8;
}
@media (max-width: 859px) {
  .note-article {
    margin-top: 2rem;
  }
}

/* ---- 404 -------------------------------------------------------------- */

.not-found {
  margin-bottom: 8rem;
}

/* ---- Footer ----------------------------------------------------------- */

.footer {
  background-color: white;
  opacity: 0.9;
  border-top: 1px solid var(--primary-color);
  font-size: 0.9em;
  padding: 4rem 1rem 1rem;
  position: relative;
  box-sizing: border-box;
}
.footer-copyright {
  font-family: 'BPH Sans Bold';
}
.footer-section {
  display: flex;
  margin: 0;
}
.site-list {
  padding: 0;
  display: flex;
  margin: 0;
}
.site-entry {
  list-style: none;
}
.site-entry:not(:last-child)::after {
  content: ',';
  margin-right: 0.7ch;
}
.site-entry a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 4px solid rgba(255, 204, 0, 0);
  transition: border-bottom 0.2s;
}
.site-entry a:hover {
  border-bottom: 4px solid var(--accent-color);
}
@media (min-width: 860px) {
  .footer {
    align-items: baseline;
    display: flex;
  }
  .footer-section:not(:first-child)::before {
    content: '-';
    margin: 0 0.25rem;
  }
}
