/* 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 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-light);
}

.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 badges for special post states */

.status-badge {
  display: inline-block;
  padding: var(--space-3xs) var(--space-2xs);
  border-radius: var(--border-radius-small);
  font-size: var(--size-step-min-2);
  font-weight: var(--font-bold);
  line-height: 1;
}

.status-badge--garden {
  background-color: var(--color-accent);
  color: var(--color-light);
}
.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-mid);
    opacity: 1;
  }
  &::placeholder {
    color: var(--color-mid);
    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-mid);
}
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);
}