/* ---------- Back link ---------- */
.back-link {
  display: inline-block;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.6;
}

/* ---------- Markdown rendered content ---------- */
.md-rendered {
  font-size: 1.1rem;
  line-height: 1.4;
  letter-spacing: 0.1em;
}

.md-rendered h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: #c41230;
}

.md-rendered h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1rem 0 0.75rem;
  color: #c41230;
}

.md-rendered h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}

.md-rendered p {
  margin-bottom: 0.5rem;
}

.md-rendered hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2rem 0;
}

.md-rendered blockquote {
  border-left: 3px solid #c41230;
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: #555;
  font-style: italic;
}

.md-rendered code {
  background: #f4f4f4;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 1.05rem;
}

.md-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 1.05rem;
}

.md-rendered table tr:first-child td {
  font-weight: 700;
  border-bottom: 2px solid #2b2b2b;
}

.md-rendered table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e0e0e0;
}

.md-rendered img {
  max-width: 100%;
  border-radius: 5px;
  margin: 1rem 0;
}

.md-rendered a {
  color: #043673;
  text-decoration: underline;
}

.md-h1-divider {
  color: #b2b2b2;
  font-weight: 400;
}

.md-h1-link {
  font-size: 1.2rem;
  font-weight: 400;
}

.md-rendered strong {
  font-weight: 700;
}

.md-rendered em {
  font-style: italic;
}

.md-spacer {
  height: 0.3rem;
}

/* ---------- YouTube embed ---------- */
.md-video {
  position: relative;
  width: 50%;
  padding-bottom: 28.125%;
  margin: 1.5rem auto;
  border-radius: 5px;
  overflow: hidden;
}

.md-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.md-video-row {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.md-video-row .md-video {
  flex: 1;
  width: auto;
  padding-bottom: 28.125%;
  margin: 0;
}

/* ---------- Lists ---------- */
.md-rendered ul {
  margin: 0.75rem 0 1rem 1.5rem;
  list-style: disc;
}

.md-rendered li {
  margin-bottom: 0.35rem;
}

/* ---------- Image-beside-text layout ---------- */
.md-beside {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin: 1.5rem 0;
}

.md-beside__text {
  flex: 1;
}

.md-beside__img {
  flex: 0 0 38%;
}

.md-beside__img img {
  width: 100%;
  border-radius: 5px;
}

.md-beside__caption {
  text-align: center;
  font-size: 0.95rem;
  color: #777;
  font-style: italic;
  margin-top: 0.1rem;
}

@media (max-width: 768px) {
  .md-beside {
    flex-direction: column;
  }
  .md-beside--img-left {
    flex-direction: column;
  }
  .md-beside__img {
    flex: none;
    width: 100%;
  }
}
