/* ========================================
   Wonderland Post Page (/wonderland/<id>)
   Today's Wonderland look, applied plainly: a centered reading column on a glass card over the
   midnight background. The markup is generated by wonderland-post.py render; PRD 04 restyles it.
   No animation: nothing here moves.
   ======================================== */

body {
  background-color: #021826; /* Wonderland midnight, behind the page edges */
}

main {
  min-height: 100vh;
  padding: 9rem 3rem 8rem; /* the top clears the fixed Menu button */
  font-family: var(--font-primary);
  /* Wonderland's celestial midnight gradient (.section-wonderland in wonderland.css) */
  background: linear-gradient(135deg, #021826 0%, #011c26 30%, #012840 70%, #021826 100%);
}

.wonderland-post img,
.post-related img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ----------------------------------------
   Article: the reading column (about 720px of text) on a glass card
   ---------------------------------------- */

.wonderland-post {
  max-width: 80rem;
  margin: 0 auto;
  padding: 4rem;
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--color-black-10);
  background: rgba(255, 255, 255, 0.92);
  border: 4px solid rgba(255, 180, 111, 0.3);
  border-radius: 24px;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Breadcrumb and meta line: small, muted */
.post-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
  font-size: var(--font-size-tiny);
}

.post-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Wonderland's takeaway blue (#0d7ea8), darkened to pass 4.5:1 on the card */
.post-breadcrumb a {
  font-weight: 600;
  color: #0a5f80;
  text-decoration: none;
}

.post-breadcrumb a:hover {
  text-decoration: underline;
}

.post-header {
  margin-bottom: 2.4rem;
}

.post-title {
  margin: 1.2rem 0 1rem;
  font-weight: 700;
  font-size: var(--font-size-4xl);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-black-100);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  font-size: var(--font-size-small);
}

.post-author {
  font-weight: 600;
}

.post-meta-separator {
  opacity: 0.5;
}

/* Media: 16:9 at full column width, rounded like the Featured image */
.post-media {
  margin: 0 0 2.4rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: var(--color-black-70);
}

.post-media-link,
.post-play,
.post-player,
.post-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.post-media img {
  object-fit: cover;
}

.post-player {
  border: 0;
}

/* Play button: the whole image, with the play icon centered over it */
.post-play {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.post-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8rem;
  height: 8rem;
  padding-left: 0.5rem; /* centers the triangle optically */
  font-size: 3.2rem;
  line-height: 1;
  color: var(--color-accent-1);
  background: rgba(26, 26, 25, 0.8);
  border: 3px solid rgba(252, 231, 134, 0.8);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.post-play:hover .post-play-icon,
.post-play:focus-visible .post-play-icon {
  color: var(--color-black-100);
  background: var(--color-accent-2);
  border-color: var(--color-accent-2);
}

.post-description {
  margin-bottom: 2.4rem;
}

/* Main button: Wonderland's source-link style */
.post-action {
  margin-bottom: 3.2rem;
}

.post-source-link {
  display: inline-flex;
  align-items: center;
  min-height: 4.4rem;
  padding: 1rem 2rem;
  font-weight: 700;
  font-size: var(--font-size-base);
  line-height: 1.3;
  color: var(--color-accent-1);
  text-decoration: none;
  background: linear-gradient(135deg, var(--color-black-1) 0%, rgba(26, 26, 25, 0.95) 100%);
  border: 3px solid rgba(252, 231, 134, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: none; /* site.css animates links inside <p> */
}

.post-source-link::after {
  content: none; /* site.css's underline for links inside <p> */
}

.post-source-link:hover {
  color: var(--color-black-100);
  background: var(--color-accent-2);
  border-color: var(--color-accent-2);
}

/* Carlo's take: Wonderland's takeaway treatment */
.post-take {
  margin-bottom: 3.2rem;
  padding: 1.6rem 2rem;
  background: rgba(119, 191, 226, 0.12);
  border-left: 4px solid rgba(119, 191, 226, 0.6);
  border-radius: 8px;
}

.post-take-label {
  /* Wonderland's "Read Carlo's take" link lands here: clear the fixed Menu button, keep the box's top in view */
  scroll-margin-top: 9.6rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
  font-size: var(--font-size-base);
  letter-spacing: 0.02em;
  color: #0a5f80;
}

/* Underlined, since "Carlo" has the same color as the rest of the label */
.post-take-label a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Categories as tag pills, Share at the end of the row */
.post-footer {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.6rem;
}

.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding: 0;
  list-style: none;
}

.post-categories a {
  display: inline-flex;
  align-items: center;
  min-height: 3.2rem;
  padding: 0.4rem 1.2rem;
  font-weight: 600;
  font-size: var(--font-size-tiny);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-black-100);
  background: rgba(119, 191, 226, 0.25);
  border: 1px solid rgba(119, 191, 226, 0.4);
  border-radius: 20px;
}

.post-categories a:hover {
  background: rgba(119, 191, 226, 0.45);
}

.post-share {
  min-width: 4.4rem;
  min-height: 4.4rem;
  padding: 1rem 2.4rem;
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--color-black-10);
  background: rgba(252, 231, 134, 0.35);
  border: 2px solid rgba(246, 202, 0, 0.7);
  border-radius: 12px;
  cursor: pointer;
}

.post-share:hover {
  color: var(--color-black-100);
  background: var(--color-accent-2);
}

/* Under the Share button, outside the row's layout, so an empty status takes no space */
.post-share-status {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: var(--font-size-small);
}

.post-share-copy {
  flex-basis: 100%;
}

.post-share-copy label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: var(--font-size-small);
}

.post-share-field {
  width: 100%;
  padding: 0.8rem 1.2rem;
  font-family: var(--font-primary);
  font-size: var(--font-size-small);
  color: var(--color-black-100);
  background: var(--color-white);
  border: 2px solid #0a5f80;
  border-radius: 8px;
}

/* ----------------------------------------
   More in <category> and the closing line, on the midnight background
   ---------------------------------------- */

.post-related,
.post-closing {
  max-width: 80rem;
  margin: 5rem auto 0;
}

.post-related-heading {
  margin-bottom: 2rem;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--font-size-3xl);
  color: var(--color-primary);
}

.post-related-heading a {
  color: inherit;
  text-decoration: none;
}

.post-related-heading a:hover {
  text-decoration: underline;
}

.post-related-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 0;
  list-style: none;
}

.post-related-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  border: 4px solid rgba(119, 191, 226, 0.3);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.post-related-link {
  display: block;
  color: var(--color-black-100);
  text-decoration: none;
}

.post-related-link img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-related-title {
  display: block;
  padding: 1.2rem 1.6rem 0.4rem;
  font-weight: 600;
  font-size: var(--font-size-base);
  line-height: 1.3;
}

.post-related-link:hover .post-related-title {
  text-decoration: underline;
}

.post-related-creator {
  display: block;
  padding: 0 1.6rem 1.6rem;
  font-size: var(--font-size-tiny);
  color: var(--color-black-10);
}

.post-closing {
  font-size: var(--font-size-small);
  line-height: 1.7;
  text-align: center;
  color: var(--color-accent-10);
}

.post-closing a {
  font-size: inherit;
}

/* ----------------------------------------
   Focus: 3px ring with a 3px gap, dark on the light card, yellow on the midnight background.
   The media and related cards clip their content, so the ring goes on the figure or card itself.
   ---------------------------------------- */

.wonderland-post a:focus-visible,
.post-share:focus-visible,
.post-share-field:focus-visible,
.post-media:focus-within {
  outline: 3px solid var(--color-tertiary);
  outline-offset: 3px;
}

.post-media a:focus-visible,
.post-media button:focus-visible,
.post-related-link:focus-visible {
  outline: none;
}

.post-related-heading a:focus-visible,
.post-related-item:focus-within,
.post-closing a:focus-visible {
  outline: 3px solid var(--color-accent-2);
  outline-offset: 3px;
}

/* site.css animates the underline of links inside <p> */
@media (prefers-reduced-motion: reduce) {
  .post-closing a,
  .post-closing a::after {
    transition: none;
  }
}

/* ----------------------------------------
   Tablet and mobile
   ---------------------------------------- */

@media (max-width: 768px) {
  main {
    padding: 8rem 1.6rem 6rem;
  }

  .wonderland-post {
    padding: 2.4rem;
    border-radius: 20px;
  }

  .post-title {
    font-size: var(--font-size-3xl);
  }

  .post-related-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .wonderland-post {
    padding: 2rem 1.6rem;
    border-width: 3px;
  }

  .post-title {
    font-size: var(--font-size-2xl);
  }

  .post-play-icon {
    width: 6.4rem;
    height: 6.4rem;
    font-size: 2.4rem;
  }
}
