/* ==========================================================================
   Font Faces — served from Express via Nginx (absolute paths)
   ========================================================================== */

@font-face {
  font-family: "GT Pressura";
  font-style: normal;
  font-weight: 100;
  src: url("/fonts/GT-Pressura-Standard-Light.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura";
  font-style: italic;
  font-weight: 100;
  src: url("/fonts/GT-Pressura-Standard-Light-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura";
  font-style: normal;
  font-weight: 400;
  src: url("/fonts/GT-Pressura-Standard-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura";
  font-style: italic;
  font-weight: 400;
  src: url("/fonts/GT-Pressura-Standard-Regular-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura";
  font-style: normal;
  font-weight: 700;
  src: url("/fonts/GT-Pressura-Standard-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura";
  font-style: italic;
  font-weight: 700;
  src: url("/fonts/GT-Pressura-Standard-Bold-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura Mono";
  font-style: normal;
  font-weight: 100;
  src: url("/fonts/GT-Pressura-Mono-Light.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura Mono";
  font-style: italic;
  font-weight: 100;
  src: url("/fonts/GT-Pressura-Mono-Light-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura Mono";
  font-style: normal;
  font-weight: 400;
  src: url("/fonts/GT-Pressura-Mono-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura Mono";
  font-style: italic;
  font-weight: 400;
  src: url("/fonts/GT-Pressura-Mono-Regular-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura Mono";
  font-style: normal;
  font-weight: 700;
  src: url("/fonts/GT-Pressura-Mono-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "GT Pressura Mono";
  font-style: italic;
  font-weight: 700;
  src: url("/fonts/GT-Pressura-Mono-Bold-Italic.woff2") format("woff2");
}

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
  --sans-serif: "GT Pressura";
  --mono: "GT Pressura Mono";
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: rgb(60, 60, 60);
    --secondary: rgb(0, 0, 0);
    --text: rgb(230, 230, 230);
    --accent-color: rgb(200, 189, 28);
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --background: rgb(250, 250, 250);
    --secondary: rgb(238, 238, 238);
    --text: rgb(35, 31, 32);
    --accent-color: rgb(12, 128, 33);
  }
}

/* ==========================================================================
   Type Scale (matches Express site typography.css)
   ========================================================================== */

.text--xxs { font-size: 0.625rem; }
.text--xs  { font-size: 0.75rem; }
.text--s   { font-size: 1rem; }
.text      { font-size: 1.125rem; }
.text--l   { font-size: 1.25rem; }
.text--xl  { font-size: 1.5rem; }
.text--xxl { font-size: 1.875rem; }
.text--xxxl  { font-size: 3.25rem; }
.text--xxxxl { font-size: 4rem; }
.text--bold  { font-weight: bold; }

@media (width <= 51.25rem) {
  .text--xxs  { font-size: 0.5rem; }
  .text--xs   { font-size: 0.625rem; }
  .text--s    { font-size: 0.75rem; }
  .text       { font-size: 1rem; }
  .text--l    { font-size: 1.125rem; }
  .text--xl   { font-size: 1.25rem; }
  .text--xxl  { font-size: 1.5rem; }
  .text--xxxl  { font-size: 2.25rem; }
  .text--xxxxl { font-size: 3.25rem; }
}

@media (width <= 27.5rem) {
  .text--xxs  { font-size: 0.5rem; }
  .text--xs   { font-size: 0.625rem; }
  .text--s    { font-size: 0.75rem; }
  .text       { font-size: 0.875rem; }
  .text--l    { font-size: 1rem; }
  .text--xl   { font-size: 1.125rem; }
  .text--xxl  { font-size: 1.25rem; }
  .text--xxxl  { font-size: 1.5rem; }
  .text--xxxxl { font-size: 1.875rem; }
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  background-color: var(--background);
}

body {
  margin: 0;
  font: 16px var(--sans-serif), "Lucida Grande", Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5 {
  color: var(--text);
  font-weight: normal;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

address, small, li, p, figure {
  color: var(--text);
  font-style: normal;
  font-weight: normal;
  line-height: 1.4em;
}

nav {
  position: relative;
  z-index: 10;
}

p {
  font-family: var(--sans-serif);
}

figure {
  margin: 0 0 2rem 0;
}

figure img {
  width: 100%;
  height: auto;
}

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

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: min(90.625rem, 94.2vw);
  margin-block: 2.5rem;
  margin-inline: auto;
}

.ax-button {
  all: unset;
  outline: revert;
  box-sizing: border-box;
}

/* ==========================================================================
   Header & Navigation (matches Express site)
   ========================================================================== */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#logo {
  width: 75px;
  height: auto;
}

#mobile-menu {
  display: none;
  width: 1.5rem;
  height: 1.5rem;
}

#mobile-menu-close {
  display: none;
}

#nav-menu {
  display: flex;
  font-size: 1.125rem;
  gap: 5vw;
}

#nav-menu > li {
  padding-bottom: 0.5rem;
  list-style: none;
  scale: 1.0;
  transition: scale 300ms;
  border-bottom: 3px solid transparent;
}

#nav-menu > li.selected {
  border-bottom: 3px solid var(--text);
}

#nav-menu > li:hover {
  scale: 1.2;
  transition: scale 300ms;
  border-bottom: 3px solid var(--accent-color);
}

#nav-menu a {
  color: var(--text);
}

#nav-menu a:hover {
  text-decoration: none;
  color: var(--text);
}

li.submenu {
  position: relative;
}

li.submenu ul {
  display: none;
  position: absolute;
  outline: 1px solid black;
  background-color: var(--background);
  list-style: none;
  padding: 20px;
  top: calc(100% + 3px);
}

li.submenu ul.active {
  display: grid;
  grid-template-rows: 1fr;
  gap: 20px;
}

li.submenu ul li:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Footer (matches Express site)
   ========================================================================== */

footer {
  background-color: var(--secondary);
  font-family: var(--mono);
  font-style: normal;
  font-weight: normal;
  font-size: 1.125rem;
  padding-top: 2.125rem;
}

footer > div.container {
  display: grid;
  grid-template-columns: [col] 1fr [col] 1fr [col] 1fr [col];
  gap: 20px;
  margin-block: 0;
}

#contact-information {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  grid-column: col 1 / col 3;
}

#contact-information a {
  text-decoration: none;
  color: var(--text);
}

#social-links {
  grid-column: col 3 / col 4;
}

#social-links ul {
  float: right;
  padding: 0;
  margin: 0;
  list-style: none;
}

#social-links svg {
  vertical-align: middle;
  margin-right: .5rem;
}

#social-links a {
  vertical-align: middle;
}

#copyright-notice {
  grid-column: col 1 / col 4;
  text-align: right;
  margin-bottom: 2.5rem;
  font-size: 1.125rem;
}

/* ==========================================================================
   Blog Header
   ========================================================================== */

.blog-header {
  margin-bottom: 0;
}

.blog-header h1 {
  margin-bottom: 0;
}

.blog-header p {
  margin-top: 0.5rem;
  color: var(--text);
  opacity: 0.7;
}

/* ==========================================================================
   Author Header
   ========================================================================== */

.author-header {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

/* ==========================================================================
   Post Feed (card grid)
   ========================================================================== */

.post-feed {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

.post-card {
  display: flex;
  flex-direction: column;
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
}

.post-card-link:hover {
  text-decoration: none;
}

.post-card-link:hover .post-card-title {
  color: var(--accent-color);
}

.post-card-image {
  margin: 0;
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform 400ms;
}

.post-card-link:hover .post-card-image img {
  transform: scale(1.03);
}

.post-card-body {
  padding-top: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-tag {
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.post-card-title {
  color: var(--text);
  margin: 0 0 0.5rem 0;
  font-weight: normal;
  transition: color 300ms;
}

.post-card-excerpt {
  color: var(--text);
  opacity: 0.7;
  margin: 0 0 0.75rem 0;
  flex: 1;
}

.post-card-meta {
  color: var(--text);
  opacity: 0.5;
}

.post-card--featured {
  grid-column: span 2;
}

.post-card--featured .post-card-image img {
  aspect-ratio: 2 / 1;
}

/* ==========================================================================
   Individual Post
   ========================================================================== */

.post-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 50rem;
  margin-bottom: 2.5rem;
}

.post-tag {
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.post-title {
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.15;
}

.post-meta {
  color: var(--text);
  opacity: 0.5;
  margin-top: 1.25rem;
  font-family: var(--mono);
}

.post-meta a {
  color: var(--text);
}

.post-meta-sep {
  margin-inline: 0.5rem;
}

.post-feature-image {
  margin-bottom: 2.5rem;
}

.post-feature-image img {
  width: 100%;
  height: auto;
}

.post-feature-image figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  opacity: 0.6;
  color: var(--text);
  text-align: center;
}

/* ==========================================================================
   Post Content (Ghost editor output)
   ========================================================================== */

.post-content {
  max-width: 50rem;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text);
}

/* Lead paragraph — first paragraph gets a slightly larger size */
.post-content > p:first-child {
  font-size: 1.3rem;
  line-height: 1.7;
}

.post-content p {
  margin-bottom: 1.75rem;
  font-size: inherit;
  line-height: inherit;
}

.post-content h2 {
  font-size: 1.875rem;
  margin-top: 3.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 0.75rem;
}

.post-content h4 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.5rem;
}

.post-content a {
  color: var(--accent-color);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.post-content a:hover {
  text-decoration-thickness: 2px;
}

.post-content blockquote {
  margin: 2.5rem 0;
  padding: 0 0 0 2rem;
  border-left: 3px solid var(--accent-color);
  font-style: italic;
}

.post-content blockquote p {
  font-size: 1.3rem;
  line-height: 1.6;
  opacity: 0.85;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content pre {
  background-color: var(--secondary);
  padding: 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.post-content pre code {
  padding: 0;
  background: none;
}

.post-content code:not(pre code) {
  background-color: var(--secondary);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.75rem;
}

.post-content li {
  margin-bottom: 0.6rem;
  line-height: 1.7;
  padding-left: 0.25rem;
}

.post-content figure {
  margin: 2.5rem 0;
}

.post-content figcaption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  opacity: 0.5;
  color: var(--text);
  text-align: center;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--text);
  opacity: 0.15;
  margin: 3.5rem 0;
}

/* Ghost content cards (gallery, bookmark, etc.) */
.post-content .kg-width-wide {
  max-width: min(90.625rem, 94.2vw);
  margin-left: calc(50% - min(45.3125rem, 47.1vw));
  margin-right: calc(50% - min(45.3125rem, 47.1vw));
}

.post-content .kg-width-full {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.post-content .kg-image-card img,
.post-content .kg-gallery-card img {
  width: 100%;
  height: auto;
}

/* ==========================================================================
   Post Footer
   ========================================================================== */

.post-footer {
  max-width: 50rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-footer-tag {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  background-color: var(--secondary);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  border-radius: 3px;
  transition: background-color 200ms, color 200ms;
}

.post-footer-tag:hover {
  text-decoration: none;
  background-color: var(--accent-color);
  color: var(--background);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination a {
  color: var(--text);
}

.pagination a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* ==========================================================================
   Error Page
   ========================================================================== */

.error-page {
  text-align: center;
  padding: 6rem 0;
}

.error-page h1 {
  margin-bottom: 0.5rem;
}

.error-page p {
  margin-bottom: 2rem;
  opacity: 0.6;
}

.error-page a {
  color: var(--accent-color);
}

/* ==========================================================================
   Responsive — Medium (≤ 56.25rem / 900px)
   ========================================================================== */

@media (width <= 56.25rem) {
  header {
    padding: 1rem 1rem;
  }

  nav {
    display: none;
    background-color: var(--background);
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100vh;
    opacity: 0;
    transition-property: display opacity;
    transition-duration: 300ms;
    transition-behavior: allow-discrete;

    @starting-style {
      opacity: 1;
    }
  }

  nav.show {
    display: grid;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100vh;
    opacity: 1;
    transition-property: display opacity;
    transition-duration: 300ms;
    transition-behavior: allow-discrete;

    @starting-style {
      opacity: 0;
    }
  }

  nav.show #mobile-menu-close {
    display: block;
    position: fixed;
    width: 1.5rem;
    height: 1.5rem;
    top: 2.125rem;
    right: 2.125rem;
  }

  #nav-menu {
    display: grid;
    font-size: 2.25rem;
    text-align: center;
    align-content: center;
    padding: 0;
    margin: 0;
  }

  #nav-menu li {
    border-bottom: none;
  }

  #nav-menu li.selected {
    border-bottom: none;
  }

  #nav-menu li:hover {
    scale: none;
    transition: none;
    border-bottom: none;
  }

  #mobile-menu {
    display: block;
  }

  .container {
    margin: 1rem 1.125rem;
  }

  /* Post feed: 2 columns on tablet */
  .post-feed {
    grid-template-columns: 1fr 1fr;
  }

  .post-card--featured {
    grid-column: span 2;
  }

  /* Footer responsive */
  footer {
    font-size: 1rem;
  }

  footer > div.container {
    display: grid;
    grid-template-columns: [col] 1fr [col] 1fr [col] 1fr [col];
    gap: 20px;
    margin-block: 0;
  }

  #contact-information {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    grid-column: col 1 / col 4;
  }

  footer div#social-links {
    grid-column: col 1 / col 4;
  }

  #social-links ul {
    float: initial;
  }

  #copyright-notice {
    grid-column: col 1 / col 4;
    text-align: right;
    margin-bottom: 2.5rem;
    font-size: 1rem;
  }
}

/* ==========================================================================
   Responsive — Small (≤ 27.5rem / 440px)
   ========================================================================== */

@media (width <= 27.5rem) {
  /* Post feed: single column on mobile */
  .post-feed {
    grid-template-columns: 1fr;
  }

  .post-card--featured {
    grid-column: span 1;
  }

  .post-card--featured .post-card-image img {
    aspect-ratio: 3 / 2;
  }

  .author-header {
    flex-direction: column;
    text-align: center;
  }

  #contact-information {
    grid-template-columns: 1fr;
  }

  #copyright-notice {
    text-align: center;
  }
}
