/* ---------- Desktop / default ---------- */
#MainBody .SynopsisWrap {
  /* create a new block formatting context so the float self-contains */
  display: flow-root;             /* prevents the float from leaking out */
  margin: 0 auto;
}

/* Float the image so text wraps beside and then underneath it */
#MainBody .SynopsisWrap img {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
  max-width: 45%;
  height: auto;
  border-radius: 6px;
  box-shadow: 4px 4px 15px rgba(0,0,0,0.7);
}

/* Let the article be normal flow text so it wraps under the float */
#MainBody .Synopsis {
  font: 1rem/1.5 Arial, Helvetica, sans-serif;
  color: var(--color-text);
  text-align: justify;
  text-justify: inter-word;
  min-width: 0;
}

/* Add vertical spacing between stacked sections */
.Synopsis section + section {
  margin-top: 3rem;
}

/* Affects all H3 except by floating image */
#MainBody .Synopsis h3 {
  margin: 2rem 0 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #FFD9B3;
  display: block;
  background: linear-gradient(
    to right,
    #320000 0,
    #320000 8em,
    #4A0000 100%
  );
  border-radius: 0.5rem;
}

/* only offset the special heading beside the float */
#MainBody .Synopsis h3.portrait-heading {
  margin-left: calc(28% + 1.5rem);  /* tuned value per page */
}

#MainBody .lance-message h4 {
  text-align: center;
  font-weight: normal;
  color: var(--color-text);
  margin: 1rem 0 0.75rem;
  letter-spacing: 0;
}

/* --- Episode auxiliary buttons --- */
.overview-aux {
  text-align: center;
  margin-top: 5px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
}
.overview-aux .ep-btn {
  display: inline-block;
  background: #3A0000;
  color: #C0C0C0;
  text-decoration: none;
  padding: 10px 22px;
  border: 1px solid #660000;
  border-radius: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.overview-aux .ep-btn:hover,
.overview-aux .ep-btn:focus {
  background: #990000;
  color: #FFFFFF;
  text-decoration: underline;
  box-shadow: 0 0 10px rgba(255, 200, 150, 0.35);
}
.overview-aux .sep {
  display: inline-block;
  color: #C0C0C0;
  margin: 0 12px;
  font-weight: normal;
  vertical-align: middle;
}
@media (max-width:700px) {
  .overview-aux {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .overview-aux .sep { display: none; }
  .overview-aux .ep-btn {
    width: 80%;
    text-align: center;
  }
}

.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ov-title {
  text-align: center;
  margin: 20px 0;
}

.ov-title img {
  display: inline-block;
  border: none;
  max-width: 100%;
  height: auto;
}

/* Episode info table — matches site frame */
#MainBody .ep-info-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #380000;
  color: var(--color-text);
  border: 1px solid #990000;
  border-radius: 8px;
  overflow: hidden;                            /* rounds the outer corners */
  table-layout: fixed;                         /* clean wrapping */
  font: 1rem/1.5 Arial, Helvetica, sans-serif; /* match Index page */
}

/* Header */
#MainBody .ep-info-table thead th {
  text-align: center;
  padding: 10px 12px;
  background: linear-gradient(#5a0000, #380000);
  color: #FFD9B3;
  font-weight: bold;
  border-bottom: 1px solid #660000;
}

/* Body cells */
#MainBody .ep-info-table td {
  background: #3A0000;
  text-align: center;                          /* center by default */
  vertical-align: top;
  padding: 12px;
  border-top: 1px solid #660000;
  word-wrap: break-word;
}

/* section heading formatting */
.lance-message h3 {
  text-align: center;
  color: var(--color-text);
  font: 1rem/1.5 Arial, Helvetica, sans-serif;
  font-weight: normal;
  margin: 1rem 0 0.75rem;
  letter-spacing: 0;
  text-shadow: none;
}

.ep-info-table {
  margin-top: 2rem;
}

/* ---------- Mobile ---------- */
@media (max-width:700px) {
  #MainBody .SynopsisWrap {
    display: block;
    text-align: center;
  }

  #MainBody .SynopsisWrap img {
    float: none;              /* cancel the desktop float */
    display: block;
    margin: 0 auto 16px;      /* centers image horizontally */
    max-width: 100%;
    height: auto;
  }

  #MainBody .Synopsis {
    width: 100%;
    text-align: left;
  }

  #MainBody .Synopsis h3.portrait-heading {
    margin-left: 0;   /* cancel the desktop shift on mobile */
  }

}