:root {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  color: #f5f5f5;
  background-color: #444746;
  line-height: 1.6;
  --link-color: #f0d899;
  --link-hover-color: #ffeac5;
  --page-pad-x: clamp(1rem, 5vw, 3rem);
  --card-pad: 1.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem var(--page-pad-x);
  background-color: #444746;
}

a {
  color: var(--link-color);
  transition: color 0.2s ease;
}

a:visited {
  color: var(--link-color);
}

a:hover,
a:focus-visible {
  color: var(--link-hover-color);
}

body > header,
body > nav,
main,
.pagination {
  max-width: 56rem;
  margin: 0 auto;
}

header {
  margin-bottom: 1rem;
}

header h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
}

.site-nav {
  display: flex;
  gap: 1rem;
  border: 1px solid #33363f;
  border-radius: 999px;
  padding: 0.4rem;
  margin-bottom: 2rem;
  background-color: #111213;
}

.site-nav a {
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--link-color);
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
  background-color: #1f2024;
}

.site-nav a.active {
  background-color: #f0d899;
  color: #1f1c16;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

article {
  background-color: #111213;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

article h2 {
  margin: 0.2rem 0 0.75rem;
  font-size: 1.4rem;
  color: #ffe9c3;
}

article .date {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #dbc8a3;
}

.pagination {
  margin: 2.5rem auto 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  color: #f5e3bd;
}

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

.topics-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.topics-list section {
  background-color: #111213;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.topics-list h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.topics-list ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.topics-list a {
  text-decoration: none;
  color: var(--link-color);
}

.topics-list a:hover {
  text-decoration: underline;
}

.topic-entry-header {
  max-width: 56rem;
  margin: 0 auto 1.5rem;
  padding: 0 0.5rem;
}

.topic-entry-header .breadcrumbs {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  color: #f5dfb8;
}

.topic-entry-header .breadcrumbs a {
  color: var(--link-color);
  text-decoration: none;
}

.topic-entry-header .breadcrumbs span {
  margin: 0 0.35rem;
}

.topic-entry-body {
  max-width: 56rem;
  margin: 0 auto 2.5rem;
  background-color: #111213;
  border-radius: 1rem;
  padding: var(--card-pad);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.topic-entry-body .date {
  margin: 0 0 1.25rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: #dbc8a3;
}

.topic-entry-body h1,
.topic-entry-body h2,
.topic-entry-body h3 {
  color: #d3bd8a;
}

.topic-entry-body p,
.topic-entry-body li {
  color: #fff2dc;
}

.topic-entry-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.75rem;
  background-color: #0e0f12;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.topic-entry-body th,
.topic-entry-body td {
  border: 1px solid #c3b082;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.topic-entry-body thead th {
  background-color: #1a1b20;
  color: #e7d5ad;
  font-weight: 700;
}

.topic-entry-body a {
  color: var(--link-color);
}

.topic-entry-body img {
  display: block;
  max-width: min(
    100%,
    calc(100vw - 2 * var(--page-pad-x) - 2 * var(--card-pad))
  );
  height: auto;
  margin: 1.25rem auto;
  border-radius: 0.75rem;
}

.topic-entry-body .topic-image-link {
  display: block;
}

.resources {
  max-width: 56rem;
  margin: 0 auto 2.5rem;
  background-color: #111213;
  border-radius: 1rem;
  padding: 1.75rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.resources section + section {
  margin-top: 1.5rem;
}

.resources .resources-intro {
  margin-top: 0;
  margin-bottom: 1.25rem;
  color: #f6e1bf;
}

.resources h2 {
  margin-top: 0;
  color: #ffe9c3;
}

.resource-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resource-list p {
  margin: 0.25rem 0 0;
  color: #fff2dc;
}

.feed iframe,
.topic-entry-body iframe,
.resources iframe,
.youtube-placeholder {
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
  border: none;
  border-radius: 0.75rem;
  background-color: #000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  margin-top: 1rem;
}

.youtube-placeholder {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  aspect-ratio: 16 / 9;
  background: #000;
  background-image: var(--thumb-url);
  background-size: contain;
  background-position: center;
  color: #fff;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.youtube-placeholder-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

@supports not (aspect-ratio: 1 / 1) {
  .youtube-placeholder {
    height: 0;
    padding-bottom: 56.25%;
  }
}

.youtube-placeholder-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.65) 100%
  );
  text-align: center;
}

.youtube-placeholder-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 60px;
  border-radius: 16px;
  background-color: rgba(0, 0, 0, 0.55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.youtube-placeholder-play::before {
  content: "";
  display: block;
  margin-left: 5px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 12px 0 12px 18px;
  border-color: transparent transparent transparent #ffffff;
}

.youtube-placeholder-text {
  display: none;
}

.youtube-placeholder:hover,
.youtube-placeholder:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
}

.youtube-placeholder:focus-visible {
  outline: 2px solid #f0d899;
  outline-offset: 4px;
}

@media (max-width: 640px) {
  :root {
    --page-pad-x: clamp(0.75rem, 4vw, 1.25rem);
    --card-pad: 1.25rem;
  }

  .site-nav {
    flex-direction: column;
    border-radius: 0.9rem;
    gap: 0.35rem;
    padding: 0.3rem;
  }

  .site-nav a {
    padding: 0.4rem 0.75rem;
    font-size: 0.95rem;
  }

  body {
    padding: 1.5rem var(--page-pad-x);
  }

  article {
    padding: 1.25rem;
  }
}
