:root {
  accent-color: var(--accent-color);
}

main {
  min-height: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block-start: 2rem;
}

h1 {
  font-size: 3em;
  font-size: 2.25em;
}

h2 {
  font-size: 1.6875em;
}

h3 {
  font-size: 1.265625em;
}

h4,
h5,
h6 {
  font-size: 1em;
}

button,
.\<button\>,
input[type='button'],
input[type='submit'],
input[type='reset'],
::file-selector-button {
  &.big {
    font-size: 1em;
    padding: 0.3em 0.5em;
  }
}

[hidden] {
  display: none !important;
}

a,
.\<a\> {
  border: none;
  border-radius: 0;
  background: none;
  display: inline;
}

a:any-link {
  cursor: pointer;
}

.\<small\> {
  font-size: 0.8em;
}

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

td,
th {
  vertical-align: baseline;
  text-align: start;
}

input:is(
  :not([type]),
  [type='text' i],
  [type='text' i],
  [type='date' i],
  [type='datetime-local' i],
  [type='email' i],
  [type='month' i],
  [type='number' i],
  [type='password' i],
  [type='search' i],
  [type='tel' i],
  [type='time' i],
  [type='url' i],
  [type='week' i]
),
textarea,
select {
  border: none;
  border: 1px solid var(--bg3);
  border-radius: 0.2rem;
  font: inherit;
  padding: 0.4em;
}

textarea {
  field-sizing: content;
}

::placeholder {
  font-style: italic;
}

label {
  padding: 0.4em 0.4em 0.4em 0;
  min-width: 7em;
}

.contents {
  display: contents;
}

.inline {
  display: inline;
}

.grid {
  display: grid;
  gap: 0.5em;
}

.hue-slider {
  -webkit-appearance: none;
  background: none;
  &::-webkit-slider-runnable-track {
    height: 1em;
    border-radius: .5em;
    border: 1px solid black;
    box-shadow: 0 0 0 1px white;
    background: linear-gradient(
      to right in lch longer hue,
      lch(50 100 0) 0 0
    )
  }
  &::-moz-range-track {
    height: 1em;
    border-radius: .5em;
    border: 1px solid black;
    box-shadow: 0 0 0 1px white;
    background: linear-gradient(
      to right in lch longer hue,
      lch(50 100 0) 0 0
    )
  }
  &::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: 1px solid white;
    box-shadow: 0 0 0 1px black;
    background: none;
    height: .5em;
    width: .5em;
    border-radius: .5em;
    margin-block-start: calc(.25em - 1px);
  }
  &::-moz-range-thumb {
    border: 1px solid white;
    box-shadow: 0 0 0 1px black;
    background: none;
    height: .5em;
    width: .5em;
  }
}

.grid-row {
  display: contents;

  > :first-child {
    grid-column-start: 1;
  }
}

.socials-list {
  display: inline-block;

  display: grid;
  grid: auto-flow / 1fr 1fr auto;
  gap: 0.5em;

  > div {
    display: contents;
  }
}

:host(image-upload) {
  display: grid;
  grid-auto-columns: 6em;
  grid-auto-flow: column;
  gap: .5rem;

  margin-block: .25rem;

  .uploader-label {
    text-align: center;
    align-content: center;
  }

  .thumbs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: contents;
  }

  .thumb {
    display: grid;
    aspect-ratio: 1 / 1;

    .img {
      grid-area: 1/1/1/1;
      min-width: none;
      align-self: stretch;
      object-fit: cover;
    }
    .thumb-actions {
      grid-area: 1/1/1/1;
      display: grid;

      .thumb-action {
        grid-area: 1/1/1/1;

        &.-removeimage {
          align-self: start;
          justify-self: end;
        }

        &.-alttext {
          align-self: end;
          justify-self: end;
          text-transform: uppercase;
        }
      }
    }
  }
}

.unlink {
  &:not(:hover, :focus-visible) {
    text-decoration: none;
  }
}

.\(vh\) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.h-entry {
  margin-block: 1em;
}

.quick-entry {
  display: grid;
  .quick-entry-content {
    margin-block-end: 0.5em;
  }

  .quick-entry-form-actions {
    display: flex;
    justify-content: space-between;

    .quick-entry-submit {
      margin-block-start: auto;
    }
  }
}

.entry-editor {
  input:is(
    :not([type]),
    [type='text' i],
    [type='text' i],
    [type='date' i],
    [type='datetime-local' i],
    [type='email' i],
    [type='month' i],
    [type='number' i],
    [type='password' i],
    [type='search' i],
    [type='tel' i],
    [type='time' i],
    [type='url' i],
    [type='week' i]
  ),
  select,
  textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: none;
  }

  .titleRow {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5em;

    .title {
      grid-area: 1/1;
    }

    .extraFields {
      display: contents;

      summary {
        list-style: none;
        grid-area: 1/2;
        align-self: center;
      }

      .detailsContent {
        grid-area: 2 / 1 / 2 / span 2;
      }
    }
  }

  .content-area textarea {
    min-height: 10rem;
  }
}

.entry-list {
  .h-entry {
    border-block-start: 1px solid var(--bg3);
    margin-block: 2em;
  }
}

.lede {
  font-size: 1.2em;
  font-style: italic;
  opacity: 0.8;
  margin-block-start: 0;

  h1:has(+ &) {
    margin-block-end: 0;
  }
}

.link-card {
  position: relative;

  &:hover {
    background: var(--bg2);
  }

  /* TODO: add all interactive elements */
  a,
  button,
  input,
  textarea,
  details {
    position: relative;
    z-index: 2;
  }

  .card-link {
    position: static;

    &,
    &:hover,
    &:focus-visible {
      text-decoration: none;
    }

    &::after {
      content: '';
      display: block;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 1;
    }
  }
}

.author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'photo name'
    'photo domain';
  gap: 0 0.5em;

  &:not(:hover, :focus-visible) {
    text-decoration: none;
  }

  .photo {
    grid-area: photo;
    height: 2.4em;
    width: 2.4em;
    border-radius: 9999em;
    align-self: center;
  }
}

.warn {
  --adm-icon: '⚠';
  --adm-fg: #a81;
  --adm-bg: #feaa;
  /* @media (prefers-color-scheme: dark) {
      --adm-fg: #dcae08;
      --adm-bg: #540a;
  } */
}

.bad {
  --adm-icon: '⌧';
  --adm-fg: #a22;
  --adm-bg: #e336;
  /* @media (prefers-color-scheme: dark) {
      --adm-fg: #ffaeae;
      --adm-bg: #822a;
  } */
}

.warn,
.bad {
  color: var(--adm-fg);
  padding: 1em 2em;

  position: relative;

  filter: drop-shadow(0 0 0.5em var(--adm-bg)) drop-shadow(
    0
    0
    1.0em
    var(--adm-bg)
  ) drop-shadow(0 0 1.5em var(--adm-bg)) drop-shadow(0 0 1.5em var(--adm-bg));

  &::before {
    content: var(--adm-icon);
    position: absolute;
    left: 0;
    padding-block: inherit;
  }
}

.tiny-header {
  font-size: inherit;
  font-weight: normal;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.1em;
  margin-inline-end: 1em;
}

.face {
  width: 1em;
  height: 1em;
  vertical-align: text-bottom;

  & + & {
    margin-left: -0.3em;
  }

  &.big {
    font-size: 12rem;
    margin: -2px;
  }
}

#webmentions {
  margin-block: 3em;
}


/*` /**/
