#article .article-thumbnail {
  margin: 0;
  width: inherit;
  aspect-ratio: 3 / 2;
  position: relative;
  padding: 2rem;
  gap: 3rem;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

#article .article-thumbnail .article-thumbnail-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2;
  box-shadow:
    inset 0 1px 0 #fff98c,
    0 0.55rem 1rem rgba(0, 0, 0, 0.35);
}

#article .article-thumbnail .article-title {
  max-width: min(34rem, calc(100% - 4.5rem));
  margin: auto 0 0;
  font-size: clamp(2.75rem, 6vw, 4.25rem) !important;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--dm-contrast);
  text-shadow:
    0 0 3px rgba(18, 11, 32, 0.9),
    0 0.45rem 1.5rem rgba(0, 0, 0, 0.45),
    0.15rem 0.15rem 0 var(--bg-dm-primary);
  line-height: 1;
  transition: transform 0.2s ease;
  will-change: transform;
}

#article .article-bottom {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.8rem;
}

#article .article-programs-detailed {
  margin: 0;
}

#article .article-categories + .article-programs-detailed {
  margin-top: -0.1rem;
}

#article .article-programs-detailed .article-program {
  gap: 0.6rem;
  padding: 0.28rem 0.8rem 0.28rem 0.28rem;
  border-radius: 999px;
  background: rgba(18, 11, 32, 0.72);
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

#article .article-programs-detailed .article-program-icon-shell {
  width: 2.1rem;
  height: 2.1rem;
  flex-basis: 2.1rem;
}

#article .article-programs-detailed .article-program-text {
  color: var(--dm-contrast);
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

#article .article-categories {
  margin-top: 0;
}

#article .article-divider {
  margin: 3rem 0;
}

/* #article .article-date {
  padding: 4px 15px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--dm-contrast);
  border-radius: var(--border-radius);
} */

#article .article-content {
  margin-top: 0;
}

#article .article-content * {
  font-weight: 400;
}

/* markdown content */

.article-content * {
  line-height: 180%;
}
.article-content p {
  margin: 0 0 1.75rem 0;
  padding: 0;
}
.article-content a {
  color: var(--dm-contrast);
  border-bottom: 3px solid var(--dm-contrast);
}
.article-content h1 {
  font-size: 2rem;
}
.article-content h2 {
  font-size: 1.8rem;
}
.article-content h3 {
  font-size: 1.6rem;
}
.article-content h4 {
  font-size: 1.4rem;
}
.article-content h5 {
  font-size: 1.2rem;
}
.article-content h6 {
  font-size: 1rem;
}
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin: 1.75rem 0;
  font-weight: bolder !important;
}
.article-content blockquote {
  padding-left: 1.42188rem;
  margin-bottom: 1.75rem;
  font-style: italic;
  font-weight: 100;
  border-left: 0.3rem solid var(--dm-contrast);
  font-size: 1.2rem;
}
.article-content strong {
  font-weight: bold;
}
.article-content ul {
  margin-left: 1rem;
  margin-bottom: 1.75rem;
}
.article-content ol {
  margin-left: 1.75rem;
  margin-bottom: 1.75rem;
}
.article-content ol * ol,
.article-content ul * ul {
  margin-left: 1rem;
  margin-bottom: 0;
}
.article-content table {
  width: 100%;
  max-width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
}
.article-content table th {
  background-color: var(--text-dm-primary);
  color: var(--bg-dm-primary);
  border: 1px solid var(--bg-dm-primary);
}
.article-content table * {
  border: 1px solid var(--text-dm-primary);
  padding: 0.2rem;
}
.article-content img {
  max-width: 100%;
  margin: 1rem 0;
}

.article-content .media-figure {
  width: 100%;
  margin: 1.5rem 0 2rem;
  position: relative;
  z-index: 1;
}

.article-content .media-figure a {
  border-bottom: 0;
}

.article-content .media-figure > :first-child {
  margin-top: 0;
}

.article-content .media-figure img,
.article-content .media-figure video,
.article-content .media-figure iframe {
  display: block;
  width: 100%;
  margin: 0;
}

.article-content .media-frame {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  padding: 1px;
  border-radius: var(--border-radius);
  overflow: visible;
  box-sizing: border-box;
  background: rgba(75, 50, 125, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1rem 2.1rem rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.article-content .media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(75, 50, 125, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  z-index: 2;
}

.article-content .media-frame:focus-within {
  background: rgba(75, 50, 125, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 1rem 2.1rem rgba(0, 0, 0, 0.22);
}

.article-content .media-frame > img,
.article-content .media-frame > a,
.article-content .media-frame > .media-embed-shell {
  position: relative;
  display: block;
  width: 100%;
  z-index: 1;
}

.article-content .media-embed-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--border-radius) - 1px);
  overflow: hidden;
  background: rgba(18, 11, 32, 0.78);
}

.article-content .media-frame > img,
.article-content .media-frame > a > img {
  display: block;
  width: 100%;
  margin: 0;
  background: rgba(18, 11, 32, 0.78);
  border-radius: calc(var(--border-radius) - 1px);
}

.article-content .media-embed-shell iframe,
.article-content .media-embed-shell video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
}

.article-content .media-embed-shell iframe:focus,
.article-content .media-embed-shell iframe:focus-visible,
.article-content .media-embed-shell video:focus,
.article-content .media-embed-shell video:focus-visible {
  outline: none;
  box-shadow: none;
}

.article-content .media-caption {
  margin-top: 0.75rem;
  color: var(--text-dm-primary);
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.58;
  text-align: center;
  text-wrap: balance;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: fit-content;
  max-width: 100%;
  margin: 2.5rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0.45rem 1rem rgba(0, 0, 0, 0.15);
}

.post-author-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(251, 255, 69, 0.78);
  box-shadow:
    0 0 0 4px rgba(200, 167, 255, 0.12),
    0 0.6rem 1.2rem rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.post-author-copy {
  min-width: 0;
}

.post-author-label,
.post-author-name {
  margin: 0;
  line-height: 1.25;
}

.post-author-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.post-author-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dm-contrast);
}

/* pre , code */
.article-content .highlighter-rouge,
.article-content .highlight,
.article-content pre,
.article-content pre code {
  overflow-x: auto !important;
}

.article-content pre {
  background: var(--bg-dm-secondary) !important;
  padding: 1rem 2rem;
  margin-bottom: 1.75rem;
}

.article-content code {
  padding: 3px 5px;
  color: var(--text-dm-secondary);
  white-space: pre;
  background: var(--bg-dm-secondary) !important;
}

/* lbox */

#article .article-content img {
  cursor: zoom-in;
}

#lightbox {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

#lightbox.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#lightbox .lightbox-viewer {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
}

#lightbox .lightbox-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

#lightbox img {
  max-width: calc(100vw - 4rem);
  max-height: calc(100vh - 4rem);
  outline: none;
  border: none;
  background: transparent;
  transform-origin: center center;
  transition: transform 0.18s ease;
  will-change: transform;
  user-select: none;
  -webkit-user-select: none;
}

#lightbox img {
  cursor: zoom-in;
}

#lightbox.is-zoomed img {
  cursor: grab;
  transition: none;
}

#lightbox.is-animating img {
  transition: transform 0.18s ease;
}

#lightbox.is-dragging img {
  cursor: grabbing;
  transition: none;
}

.lightbox-close-button {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  z-index: 1001;
  background: var(--dm-contrast);
  color: var(--bg-dm-secondary);
  box-shadow:
    inset 0 1px 0 #fff98c,
    0 0.55rem 1rem rgba(0, 0, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  #article .article-thumbnail:hover,
  #article .article-thumbnail .article-title:hover,
  #article .article-programs-detailed .article-program:hover,
  .article-content .media-frame:hover,
  .post-author:hover .post-author-avatar {
    transform: translateY(-3px);
  }
}

#article .article-thumbnail:focus-within,
.article-content .media-frame:focus-within {
  transform: translateY(-3px);
}

@media screen and (min-width: 651px) {
  #article .article-thumbnail {
    justify-content: flex-start;
    gap: 1rem;
  }

  #article .article-thumbnail .article-title {
    max-width: min(18rem, calc(100% - 4.5rem));
    margin: 0;
    padding-top: 0;
    line-height: 0.98;
    text-wrap: balance;
  }

  #article .article-bottom {
    margin-top: auto;
    width: 100%;
  }
}

.lightbox-close-icon {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 700px) {
  .lightbox-close-button {
    top: max(0.9rem, env(safe-area-inset-top));
    right: max(0.9rem, env(safe-area-inset-right));
  }

  #lightbox img {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 2rem);
  }
}

@media screen and (max-width: 650px) {
  .blogfeed:not(.blogfeed-home) .page-shell {
    padding-top: var(--shell-padding);
  }

  #article .article-thumbnail {
    aspect-ratio: 2 / 3;
    min-height: 16rem;
    padding: 1.35rem;
    gap: 2.2rem;
  }

  #article .article-thumbnail .article-thumbnail-arrow {
    top: 1rem;
    right: 1rem;
  }

  #article .article-thumbnail .article-title {
    max-width: calc(100% - 3.3rem);
    font-size: clamp(2rem, 10vw, 3rem) !important;
  }

  #article .article-programs-detailed {
    gap: 0.5rem;
  }

  #article .article-programs-detailed .article-program {
    gap: 0.45rem;
    padding-right: 0.65rem;
  }

  #article .article-programs-detailed .article-program-icon-shell {
    width: 1.9rem;
    height: 1.9rem;
    flex-basis: 1.9rem;
  }

  #article .article-programs-detailed .article-program-text {
    font-size: 0.72rem;
  }

  #article .article-divider {
    margin: 2.5rem 0;
  }

  .article-content .media-caption {
    font-size: 0.95rem;
  }

  .post-author {
    width: 100%;
    box-sizing: border-box;
    border-radius: 1.25rem;
  }
}
