/* Gallery dialog */
.gallery-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border-radius: var(--border-radius-medium);
  border: none;
  padding: var(--space-m);
  max-inline-size: 90vw;
  max-block-size: 90vh;
  background: var(--color-bg);
  overflow: auto;
  z-index: 1000;
}
.gallery-dialog::backdrop {
  background-image: var(--gradient-flames);
  opacity: 0.9;
  filter: brightness(50%);
}
/* Image sizing within dialog */
.gallery-dialog picture {
  display: contents;
}
.gallery-dialog img {
  max-block-size: 60vh;
  max-inline-size: 100%;
  inline-size: auto;
  block-size: auto;
  -o-object-fit: contain;
     object-fit: contain;
}
/* Gallery thumbnails */
.gallery-thumb {
  all: unset;
  cursor: pointer;
  border-radius: var(--border-radius-small);
  overflow: hidden;
}
.gallery-thumb img {
  aspect-ratio: 1;
  -o-object-fit: cover;
     object-fit: cover;
  transition: transform 0.2s ease;
}
.gallery-thumb:hover img {
  transform: scale(1.05);
}
/* Don't indicate interactivity without JS */
is-land:not(:defined) .gallery-thumb {
  cursor: default;
}
.post article h1 {
  font-size: var(--size-step-5);
}

.post article h1 a {
  text-decoration: none;
}

.post article h1 a:hover,
.post article h1 a:focus-visible {
  text-decoration: underline;
}

.post article h2 {
  font-size: var(--size-step-3);
}

.post article h3 {
  font-size: var(--size-step-2);
}

.post article h2,
.post article h3 {
  color: var(--color-text);
}

/* make featured image alwyays 16/9 */

.post h1 + :is(picture, figure) img {
  inline-size: var(--max-img-width, 100%);
  block-size: auto;
  aspect-ratio: 16/9;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center;
     object-position: center;
}

.date {
  font-size: var(--size-step-1);
  color: var(--color-text-muted);
}

.credit {
  font-size: var(--size-step-min-1);
  color: var(--color-text-accent);
  background-color: var(--color-bg);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--border-radius-medium);
  transform: translateY(-4ch) translateX(-0.5ch);
  max-inline-size: -moz-fit-content;
  max-inline-size: fit-content;
}

.meta {
  font-size: var(--size-step-min-1);
  margin-block-end: var(--space-m);
}

/* Post metadata styling */

.post-meta {
  margin-block-end: var(--space-m);
}

.post-meta__label {
  color: var(--color-text-accent);
  font-weight: var(--font-regular);
}

.post-meta__separator {
  color: var(--color-text-accent);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.post-meta__primary .dt-published {
  font-weight: var(--font-medium);
}

.post-meta__primary .dt-updated {
  font-weight: var(--font-medium);
  font-style: italic;
}

/* .status-badge now lives in blocks/tag.css (shared, accent-neutral) */

/* Previous / next post navigation (under the webmentions block) */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-s);
  margin-block-start: var(--space-xl);
  padding-block-start: var(--space-l);
  border-block-start: 1px solid var(--edge);
}

.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  padding: var(--space-s) var(--space-m);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--color-bg-accent);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.post-nav__link:hover,
.post-nav__link:focus-visible {
  border-color: var(--hot);
}

/* Lone card (first or last post): keep "Next" on the right. */

.post-nav__link--next {
  text-align: right;
}

.post-nav__link--next:only-child {
  grid-column: 2;
}

.post-nav__dir {
  font-family: var(--font-label);
  font-size: var(--size-step-min-2);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--hot);
}

.post-nav__title {
  font-size: var(--size-step-1);
  font-weight: var(--font-extra-bold);
  line-height: 1.15;
}

@media (max-width: 40rem) {
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav__link--next,
  .post-nav__link--next:only-child {
    grid-column: auto;
    text-align: left;
  }
}
.footnotes {
  font-size: var(--size-step-min-1);
}

.footnote-ref {
  font-size: var(--size-step-min-2);
  vertical-align: super;
  margin-inline-start: 0.1ch;
  color: var(--color-text-accent);
}

.footnote-ref a {
  text-decoration: none;
  padding: 0.3ch;
}

.footnote-backref {
  text-decoration: none;
  background-color: var(--color-bg-accent);
  border-radius: var(--border-radius-medium);
  padding-inline: var(--space-xs);
}

.footnote-backref:hover {
  color: var(--color-primary);
}
/* © https://piccalil.li/complete-css */
form > * + * {
  margin-top: var(--flow-space, 1rem);
}
:is(input:not([type='checkbox'], [type='radio'], [type='color']), select, textarea) {
  padding: 0.5em 0.8em;
  border-radius: var(--border-radius-small);
  border: var(--stroke);
  background: var(--color-bg-accent);
  color: var(--color-text);
  width: 100%;
  &::-moz-placeholder {
    color: var(--color-text-muted);
    opacity: 1;
  }
  &::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
  }
}
label {
  line-height: var(--leading-fine);
  font-weight: var(--font-bold);
}
label::after {
  content: '\A';
  white-space: pre;
}
/* Usually label wraps checkbox and radio buttons, so we give ourselves more layout and text-flow control with flex */
label:has(input) {
  display: flex;
  align-items: baseline;
  gap: var(--space-s);
  font-weight: var(--font-normal);
}
label:has(input) + label:has(input) {
  --flow-space: var(--space-s-m);
}
/* Slightly adjusts the vertical position of the check/radio */
label:has(input) input {
  transform: translateY(-0.1ex);
}
input:disabled {
  background: var(--color-bg-accent-3);
}
input:disabled,
label input:disabled + * {
  cursor: not-allowed;
}
fieldset {
  border: var(--stroke);
  padding: var(--space-m);
}
legend {
  font-weight: var(--font-bold);
  padding-inline: var(--space-xs);
}