@import url("./reset.css");

@import url("./ui-range.css");
@import url("./ui-select.css");

html {
  font: 100% / 1.5 system-ui, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: ui-rounded, sans-serif;
  text-box: trim-both cap alphabetic;
  hyphens: auto;
  text-wrap: balance;
}

:is(h2, h3, h4, h5, h6):not(.flow :is(h2, h3, h4, h5, h6)) {
  margin-top: 1em;
}

h1 {
  font-size: 3rem;
  margin-top: 0;
}

h2 {
  font-size: 2.5rem;
}

h3 {
  font-size: 2rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.33rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-top: 1em;
}

.flow section > * + * {
  margin-block-start: var(--flow-space, 1em);
}

:is(p, ol, ul) + :is(h1, h2, h3, h4, h5, h6) {
  --flow-space: 2em;
}

li {
  list-style-position: inside;
  margin-block-start: 0.5rem;
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1rem;
}

pre {
  width: 100%;
  overflow-inline: auto;
  padding: 1rem;
  border-radius: 1rem;
  background: rgb(0 0 0 / 10%);
  margin-block: 1rem;
}

share-button {
  display: block;
}

/* General */

body {
  /* background: #fbfbe9; */
  background: #ffecff url("../img/squiggles_alpha_violet.png");
  background-size: 250px 250px;
}

.site-header {
  padding-block: 1rem;
}

main {
  padding-block: 2rem;
}

.logo {
  display: flex;
  gap: 0.125em;
  font-family: ui-rounded, sans-serif;
  font-size: 2rem;
  font-weight: 1000;
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-10px);
}

.logo span {
  transform: translate(0, random(0px, 10px)) rotate(random(-20deg, 20deg));
  color: var(--char-color);
  text-shadow: 0 1px oklch(from var(--char-color, #f00) calc(l - 0.025) c h),
  0 2px oklch(from var(--char-color, #f00) calc(l - 0.05) c h),
  0 3px oklch(from var(--char-color, #f00) calc(l - 0.075) c h),
  0 4px oklch(from var(--char-color, #f00) calc(l - 0.1) c h),
  0 5px oklch(from var(--char-color, #f00) calc(l - 0.125) c h);
  --outline-color: oklch(from var(--char-color, #f00) calc(l * 0.5) c h);
  filter: drop-shadow(0 1px var(--outline-color)) drop-shadow(1px 0px var(--outline-color)) drop-shadow(0 -1px var(--outline-color)) drop-shadow(-1px 0 var(--outline-color))
}

.logo span:nth-child(1) {
  transform: matrix(0.992398, -0.123072, 0.123072, 0.992398, 0, 6.541959);
}

.logo span:nth-child(2) {
  transform: matrix(0.969376, -0.24558, 0.24558, 0.969376, 0, 3.039786);
}

.logo span:nth-child(3) {
  transform: matrix(0.967744, 0.251937, -0.251937, 0.967744, 0, 6.46263);
}

.logo span:nth-child(4) {
  transform: matrix(0.978612, 0.205714, -0.205714, 0.978612, 0, 4.488445);
}

.logo span:nth-child(5) {
  transform: matrix(0.986639, -0.162924, 0.162924, 0.986639, 0, 3.97727);
}

.logo span:nth-child(6) {
  transform: matrix(0.98205, 0.18862, -0.18862, 0.98205, 0, 7.248411);
}

.logo span:nth-child(1) {
  --char-color: oklch(80% 41% 0);
}

.logo span:nth-child(2) {
  --char-color: oklch(80% 41% 60deg);
}

.logo span:nth-child(3) {
  --char-color: oklch(80% 41% 120deg);
}

.logo span:nth-child(4) {
  --char-color: oklch(80% 41% 180deg);
}

.logo span:nth-child(5) {
  --char-color: oklch(80% 41% 240deg);
}

.logo span:nth-child(6) {
  --char-color: oklch(80% 41% 300deg);
}

.site-header .container {
  display: flex;
}

.main-nav {
  margin-inline-start: auto;
}

.main-nav ul {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.main-nav a {
  text-decoration: none;
  color: #000;
}

.main-nav [aria-current="page"] {
  text-decoration: underline;
}

.site-heading {
  margin-block-end: 0.75em;
}

.newsletter-wrapper {
  margin-block: 2rem;
}

.site-footer {
  padding-block: 1rem;
}

/* Landing Page */

.hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  height: 50vh;
  min-height: 400px;
}

.hero h1 {
  font-size: 3rem;
  text-transform: uppercase;
}

.hero .tagline {
  font-size: 2rem;
}

.hero-search {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-block: 1rem;
}

.hero-search input {
  display: block;
  font-size: 2rem;
  border: 4px #822300 solid;
  border-radius: 1.5rem;
  padding: 0.5rem 1rem;
  width: 100%;
  box-shadow: 0 6px 0 #822300;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
}

.article-list li + li {
  margin-block-start: 1rem;
}

.article-title-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.25rem;
  text-underline-offset: 0.25rem;
}

.article-title-link:hover {
  color: rgb(0 0 0 / 80%);
}


/* Article Detail Page */

.article-title {
  padding-block: 2rem;
  font-size: 4rem;
}

.article-description {
  margin-bottom: 2rem;
  font-size: 1.2rem;
}

.article-navigation ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  gap: 1rem;
  margin-block: 1rem calc(1rem + 6px);
}

.btn.btn-primary {
  display: inline-block;
  text-decoration: none;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 3px solid #822300;
  border-radius: 1.5rem;
  color: #822300;
  box-shadow: 0 6px 0 #822300;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  /* transition: all 180ms ease-in-out; */
  transition: 300ms ease;
  transition-property: transform, box-shadow;
}

.btn.btn-primary:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #822300;
}

.article-filters {
  margin-block: 2rem;
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
  background: hsl(0 0% 100% / 50%);
  backdrop-filter: blur(20px);
  padding: 1rem;
  border-radius: 1.5rem;
}

.article-filters form {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.article-filters .filter-item {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: start;
}

.article-filters fieldset {
  display: contents;
}

.article-section + .article-section {
  margin-block-start: 4rem;
}

.article-category-heading {
  margin-block-end: 2rem;
  scroll-margin-block: 4rem;
}

.article-card-list {
  list-style: none;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.article-card {
  padding: 2rem;
  border-radius: 1.5rem;
  background: #fffa;
  border: 3px solid #822300;
  box-shadow: 0 6px 0 #822300;
  overflow: hidden;
  height: 100%;
  backdrop-filter: blur(10px);
}

.article-card + .article-card {
  margin-block-start: 2rem;
}

.article-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.article-card-tags {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.article-card-tags li {
  background: lightsalmon;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  white-space: nowrap;
  margin: 0;
}

/* Card Details */

.card-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-block-end: calc(2rem + 6px);
}

.card-embed-wrapper {
  width: 100%;
}

.flow .card-embed-wrapper {
  margin-block-start: 0;
}

@media (min-width: 768px) {
  .card-embed-wrapper {
    width: 50%;
  }
}

:nth-child(odd of .card-embed-wrapper) {
  float: inline-start;
  margin-inline-end: 2rem !important;
}

:nth-child(even of .card-embed-wrapper) {
  float: inline-end;
  margin-inline-start: 2rem !important;
}