/* TrendyPicker T.P Magazine
   /main/magazine, /board/?id=magazine, /board/view?id=magazine
   Pair: app/javascript/js/trendypicker-magazine.js
   Upload: firstmall-workskin/MAGAZINE-UPLOAD.md

   1. Page chrome / tokens
   2. Hero / shell / image hover
   3. List (tabs, iframe, lead, latest, popular, newsletter)
   4. Detail (article, related, actions)
   5. Scroll reveal
   6. Responsive — last
*/

/* ——— Page chrome ——— */
.magazine-main,
.bo-magazine-board,
.bo-magazine-iframe {
  --magazine-bg: #f6f3ff;
  --magazine-card: #fff;
  --magazine-line: #e7ddff;
  --magazine-muted: #6d657c;
  --magazine-ink: #171320;
  --magazine-purple: #7b3fe4;
}

.bo-magazine-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

body.is-magazine-page,
body:has(.magazine-main) {
  background: #202020;
  overflow-x: hidden;
  overflow-y: auto;
}

body.is-magazine-page #layout_wrap,
body.is-magazine-page #layout_body,
body:has(.magazine-main) #layout_wrap,
body:has(.magazine-main) #layout_body {
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
  background: #202020;
  overflow: visible;
}

/*
  Firstmall #layout_body is often a fixed/left-biased column.
  Break magazine-main out to the real viewport, then center the shell inside it.
*/
.magazine-main {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  max-width: 100vw;
  min-width: 0;
  margin: 0;
  margin-left: calc(50% - 50vw);
  padding: 0;
  float: none;
  clear: both;
  background: #202020;
}

/* ——— Hero / shell ——— */
.magazine-hero {
  position: relative;
  display: block;
  align-self: stretch;
  width: 100%;
  min-height: clamp(234px, 24vw, 468px);
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.9), transparent 5%),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.7), transparent 8%),
    linear-gradient(135deg, #efe8ff 0%, #cdeaff 43%, #ffe6f2 100%);
}

.magazine-hero::before,
.magazine-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.magazine-hero::before {
  left: -9%;
  top: -28%;
  width: 39%;
  height: 82%;
  border-radius: 50%;
  background:
    repeating-linear-gradient(118deg, rgba(123, 63, 228, 0.16) 0 18px, transparent 18px 38px),
    linear-gradient(135deg, rgba(49, 19, 108, 0.22), transparent);
  transform: rotate(-12deg);
}

.magazine-hero::after {
  right: -7%;
  bottom: -32%;
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 42%, rgba(255, 255, 255, 0.9) 0 24%, transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.56), rgba(123, 63, 228, 0.16));
}

.magazine-hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  padding: clamp(74px, 7.2vw, 135px) 22px 0;
  text-align: center;
}

.magazine-hero-copy p {
  margin: 0 0 9px;
  color: var(--magazine-purple);
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 900;
}

.magazine-hero-copy h1 {
  margin: 0;
  color: #31136c;
  font-size: clamp(45px, 5.4vw, 97px);
  line-height: 0.94;
  font-weight: 900;
}

.magazine-hero-copy span {
  max-width: 468px;
  margin-top: 16px;
  color: #534864;
  font-size: clamp(13px, 0.9vw, 16px);
  line-height: 1.45;
  font-weight: 600;
}

.magazine-shell,
.magazine-detail-shell {
  position: relative;
  z-index: 3;
  box-sizing: border-box;
  display: block;
  flex: 0 0 auto;
  width: min(1350px, calc(100vw - 80px));
  max-width: 100%;
  height: auto;
  min-height: 0;
  margin-top: clamp(-65px, -3.8vw, -43px);
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;
  padding: clamp(34px, 3.2vw, 61px);
  border-radius: 25px 25px 0 0;
  overflow: visible;
  background: var(--magazine-bg);
  box-shadow: 0 -16px 30px rgba(123, 63, 228, 0.16);
}

.magazine-detail-shell {
  background: #fff;
}


/* Image hover zoom (prototype .magazine-image::before) */
.magazine-image,
.bo-magazine-feature-media.magazine-image,
.bo-magazine-side-thumb.magazine-image,
.bo-magazine-post-image.magazine-image {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
}

.magazine-image::before,
.bo-magazine-feature-media.magazine-image::before,
.bo-magazine-side-thumb.magazine-image::before,
.bo-magazine-post-image.magazine-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: transparent;
  background-image: inherit;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 0.35s ease;
  pointer-events: none;
}

.magazine-image:hover::before,
.bo-magazine-feature-media.magazine-image:hover::before,
.bo-magazine-side-thumb.magazine-image:hover::before,
.bo-magazine-post-image.magazine-image:hover::before {
  transform: scale(1.04);
}

.magazine-image > img,
.bo-magazine-feature-media.magazine-image > img,
.bo-magazine-side-thumb.magazine-image > img,
.bo-magazine-post-image.magazine-image > img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.magazine-image:hover > img,
.bo-magazine-feature-media.magazine-image:hover > img,
.bo-magazine-side-thumb.magazine-image:hover > img,
.bo-magazine-post-image.magazine-image:hover > img {
  transform: scale(1.04);
}

/* ——— List ——— */
.magazine-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 36px;
  color: #8f86a0;
  font-size: 14px;
}

.magazine-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.magazine-breadcrumb span:last-child {
  color: #171320;
  font-weight: 600;
}

.magazine-topic-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 2.7vw, 52px);
  max-width: 100%;
  margin-bottom: clamp(32px, 3.2vw, 58px);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.magazine-topic-tabs::-webkit-scrollbar {
  display: none;
}

.magazine-topic-tabs a {
  position: relative;
  flex: 0 0 auto;
  padding: 9px 0 5px;
  color: #aca4bb;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.magazine-topic-tabs a.is-active,
.magazine-topic-tabs a:hover,
.magazine-topic-tabs a:focus-visible {
  color: var(--magazine-purple);
}

.magazine-topic-tabs a.is-active {
  font-weight: 700;
}

.magazine-topic-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--magazine-purple);
}

.magazine-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}

/*
  iframe document: no nested scrollport.
  (overflow-x:hidden + overflow-y:visible computes to overflow-y:auto and
  traps wheel events inside a short iframe — Popular Posts gets clipped.)
  Parent page scrolls; iframe height is grown to fit full content.
*/
html.bo-magazine-iframe,
html.bo-magazine-iframe body {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
  background: transparent;
  overflow: hidden;
}

/* Bottom padding only — side padding misaligned nav (parent) vs feature image (iframe). */
html.bo-magazine-iframe body {
  padding: 0 0 56px;
}

html.bo-magazine-iframe #layout_wrap,
html.bo-magazine-iframe #layout_body,
html.bo-magazine-iframe #boardlayout,
html.bo-magazine-iframe .subpage_wrap,
html.bo-magazine-iframe .subpage_container,
html.bo-magazine-iframe #bbslist {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  float: none;
  left: auto;
  right: auto;
  position: static;
  box-sizing: border-box;
  background: transparent;
  overflow: visible;
}

html.bo-magazine-iframe #layout_header,
html.bo-magazine-iframe #layout_footer,
html.bo-magazine-iframe #subpageLNB,
html.bo-magazine-iframe #subAllButton {
  display: none;
}

.bo-magazine-board,
.bo-magazine-board * {
  box-sizing: border-box;
}

.bo-magazine-board {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  float: none;
  color: var(--magazine-ink);
  background: transparent;
  overflow: visible;
}

.bo-magazine-board img {
  max-width: 100%;
}

.bo-magazine-lead,
.bo-magazine-popular,
.bo-magazine-popular-grid,
.bo-magazine-category-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  float: none;
  overflow: visible;
  box-sizing: border-box;
}

.bo-magazine-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
  gap: clamp(25px, 2.7vw, 50px);
  align-items: start;
  padding-bottom: 8px;
  animation: magazineLeadReveal 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Start with the first paint, independently of iframe scripts and image loads. */
@keyframes magazineLeadReveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bo-magazine-feature {
  display: grid;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  border: 1px solid rgba(123, 63, 228, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 13px 27px rgba(64, 47, 88, 0.08);
  cursor: pointer;
}

.bo-magazine-feature.magazine-scroll-reveal,
.bo-magazine-feature.magazine-scroll-reveal.is-inview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.bo-magazine-feature-media,
.bo-magazine-side-thumb,
.bo-magazine-post-image {
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 0;
  background: #ebe4f7;
  cursor: pointer;
}

.bo-magazine-feature-media {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 802 / 500;
  border-radius: 14px 14px 0 0;
}

.bo-magazine-feature-media img,
.bo-magazine-side-thumb img,
.bo-magazine-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bo-magazine-feature-copy {
  padding: 22px 25px 25px;
}

.bo-magazine-feature-copy h3,
.bo-magazine-side-card h3,
.bo-magazine-post-card h3 {
  margin: 0;
}

.bo-magazine-feature-copy button,
.bo-magazine-side-card h3 button,
.bo-magazine-post-card h3 button {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: #111;
  background: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.bo-magazine-feature-copy h3 button {
  font-size: 27px;
  line-height: 1.08;
  padding-bottom: 8px;
  padding-top: 8px;
}

.bo-magazine-feature-copy > p:not(.bo-magazine-excerpt),
.bo-magazine-side-card > div > p,
.bo-magazine-post-card > p:first-of-type:not(.bo-magazine-post-excerpt) {
  color: var(--magazine-purple);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.bo-magazine-side-card > div > p {
  font-size: 12px;
}

.bo-magazine-feature-copy > p.bo-magazine-excerpt,
.bo-magazine-excerpt,
.bo-magazine-post-excerpt {
  display: -webkit-box;
  margin: 2px 0 0;
  overflow: hidden;
  color: #111;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  text-overflow: ellipsis;
  max-height: calc(1.4em * 2);
  min-height: calc(1.4em * 2);
}

.bo-magazine-post-excerpt {
  min-height: calc(1.4em * 2);
}

/* Post date under the excerpt (popular grid). */
.bo-magazine-post-date {
  margin: 5px 0 0;
  padding: 0 14px;
  color: #6d657c;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bo-magazine-feature-copy time,
.bo-magazine-side-card time {
  display: inline-block;
  color: var(--magazine-muted);
  font-size: 13px;
  font-weight: 500;
}

.bo-magazine-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.bo-magazine-section-head h2,
.bo-magazine-popular-head h2 {
  margin: 0;
  color: #111;
  font-size: clamp(23px, 1.6vw, 31px);
  line-height: 1.1;
  font-weight: 800;
}

.bo-magazine-latest {
  min-width: 0;
  padding: 22px;
  overflow: visible;
  border: 1px solid rgba(123, 63, 228, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 13px 27px rgba(64, 47, 88, 0.08);
}

.bo-magazine-latest-list {
  display: grid;
  gap: 0;
}

.bo-magazine-side-card {
  display: grid;
  grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--magazine-line);
  cursor: pointer;
}

.bo-magazine-side-card:first-of-type {
  border-top: 0;
}

.bo-magazine-side-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 802 / 500;
  border-radius: 9px;
}

.bo-magazine-side-card h3 {
  margin: 0 0 5px;
}

.bo-magazine-side-card h3 button {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.22;
}

.bo-magazine-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.bo-magazine-post-card {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  box-sizing: border-box;
  overflow: visible;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 13px 27px rgba(64, 47, 88, 0.08);
  padding-bottom: 15px;
  cursor: pointer;
}

.bo-magazine-post-image {
  aspect-ratio: 802 / 500;
  border-radius: 14px 14px 0 0;
  margin-bottom: 5px;
}

.bo-magazine-post-card h3 {
  margin: 0;
  padding: 0 14px;
  color: #111;
}

.bo-magazine-post-card h3 button,
.bo-magazine-post-card h3 button.boad_view_btn {
  display: -webkit-box;
  overflow: hidden;
  width: 100%;
  font-size: 18px;
  line-height: 1.25;
  color: #111;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  text-overflow: ellipsis;
  max-height: calc(1.25em * 3);
}

.bo-magazine-post-card > p,
.bo-magazine-post-excerpt {
  padding: 0 14px 5px;
}

.bo-magazine-post-excerpt {
  margin-top: 5px;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Short (1-line) titles: allow excerpt up to 3 lines */
.bo-magazine-post-card.is-title-one-line .bo-magazine-post-excerpt {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  max-height: calc(1.4em * 3);
}

/* Popular grid: balance the title/excerpt so each card is 5 lines tall —
   a 2-line title gets a 3-line excerpt, a 3-line title gets a 2-line excerpt. */
.bo-magazine-popular-grid .bo-magazine-post-card.is-title-2-lines .bo-magazine-post-excerpt {
  -webkit-line-clamp: 3;
  line-clamp: 3;
  /* line-clamp is inert on this grid-item box (it blockifies to flow-root), so
     max-height crops the text; -1px keeps a sub-pixel of the 4th line from
     peeking under the crop. */
  max-height: calc(1.4em * 3 - 1px);
  min-height: calc(1.4em * 3 - 1px);
}

.bo-magazine-popular-grid .bo-magazine-post-card.is-title-3-lines .bo-magazine-post-excerpt {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-height: calc(1.4em * 2 - 1px);
  min-height: calc(1.4em * 2 - 1px);
}

.bo-magazine-popular {
  position: relative;
  margin-top: clamp(52px, 4.5vw, 86px);
  margin-bottom: 0;
  padding: 0 0 8px;
  border-top: 0;
  overflow: visible;
}

.bo-magazine-popular-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 25px);
  justify-items: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 22px;
  overflow: visible;
  border: 1px solid rgba(123, 63, 228, 0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 13px 27px rgba(64, 47, 88, 0.08);
}

.bo-magazine-popular-head {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
  padding-right: 108px;
}

.bo-magazine-popular-head p {
  margin: 5px 0 0;
  color: #756d7c;
  font-size: 14px;
  line-height: 1.4;
}

.bo-magazine-popular-grid .bo-magazine-post-card {
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.bo-magazine-popular-grid .bo-magazine-post-card.is-popular-visible {
  display: grid;
  /* Size each card to its own content. Without this, the grid stretches every
     card to the tallest one while the card packs its content to the top
     (align-content: start), leaving a large empty gap under the date on the
     shorter cards. */
  align-self: start;
}

.bo-magazine-popular .magazine-popular-controls {
  display: flex;
  position: absolute;
  top: 0;
  right: 0;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
}

.bo-magazine-popular .magazine-popular-controls[hidden] {
  display: none;
}

.bo-magazine-popular .magazine-popular-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(123, 63, 228, 0.38);
  border-radius: 50%;
  color: var(--magazine-purple);
  background: #fff;
  box-shadow: 0 8px 18px rgba(64, 47, 88, 0.12);
  cursor: pointer;
  transition: color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}

.bo-magazine-popular .magazine-popular-arrow:hover {
  color: #fff;
  background: var(--magazine-purple);
}

.bo-magazine-popular .magazine-popular-arrow:disabled {
  opacity: 0.38;
  cursor: default;
}

.bo-magazine-popular .magazine-popular-arrow:disabled:hover {
  color: var(--magazine-purple);
  background: #fff;
}

.bo-magazine-popular .magazine-popular-arrow svg {
  width: 20px;
  height: 20px;
}

.bo-magazine-popular .magazine-popular-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.magazine-newsletter.editors-newsletter,
.magazine-newsletter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 423px);
  align-items: center;
  gap: 31px;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-height: 114px;
  margin: 72px 0 0;
  padding: 25px 86px;
  border-radius: 12px;
  color: #fff;
  background: #000;
}

.magazine-newsletter h2,
.magazine-newsletter p {
  margin: 0;
}

.magazine-newsletter h2 {
  font-size: 21px;
  line-height: 1.15;
  font-weight: 600;
}

.magazine-newsletter p {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 500;
}

.magazine-newsletter form {
  display: grid;
  grid-template-columns: 1fr 128px;
  width: 100%;
  height: 39px;
  overflow: hidden;
  border-radius: 999px;
  background: #fff;
}

.magazine-newsletter input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 22px;
  border: 0;
  outline: none;
  color: #111;
  background: #fff;
  font-size: 12px;
}

.magazine-newsletter button {
  margin: 4px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--magazine-purple);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.magazine-newsletter button:hover,
.magazine-newsletter button:focus-visible {
  background: #31136c;
}

.bo-magazine-empty {
  margin: 24px 0;
  padding: 48px 20px;
  border: 1px dashed #d9c9ff;
  border-radius: 12px;
  color: #756d7c;
  text-align: center;
  background: #fff;
}

/* ——— Pagination ——— */
.paging_navigation.bo-magazine-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 35px;
}

.paging_navigation.bo-magazine-pagination a,
.paging_navigation.bo-magazine-pagination input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  color: #7d7691;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.paging_navigation.bo-magazine-pagination a:hover,
.paging_navigation.bo-magazine-pagination a:focus-visible {
  border-color: var(--magazine-purple);
  color: var(--magazine-purple);
  background: #f3ebff;
}

.paging_navigation.bo-magazine-pagination a.on {
  border-color: var(--magazine-purple);
  background-color: var(--magazine-purple) !important;
  color: #fff !important;
  cursor: default;
}

.paging_navigation.bo-magazine-pagination a.prev,
.paging_navigation.bo-magazine-pagination a.next,
.paging_navigation.bo-magazine-pagination a[rel="prev"],
.paging_navigation.bo-magazine-pagination a[rel="next"] {
  overflow: visible;
  text-indent: 0;
  background-image: none;
  font-size: 0;
}

.paging_navigation.bo-magazine-pagination a.prev::before,
.paging_navigation.bo-magazine-pagination a[rel="prev"]::before {
  content: "\2039";
  font-size: 16px;
}

.paging_navigation.bo-magazine-pagination a.next::before,
.paging_navigation.bo-magazine-pagination a[rel="next"]::before {
  content: "\203a";
  font-size: 16px;
}

.paging_navigation.bo-magazine-pagination a.first,
.paging_navigation.bo-magazine-pagination a.last,
.paging_navigation.bo-magazine-pagination a.end,
.paging_navigation.bo-magazine-pagination a[rel="first"],
.paging_navigation.bo-magazine-pagination a[rel="last"],
.paging_navigation.bo-magazine-pagination a[rel="end"] {
  display: none;
}

.bo-magazine-write {
  display: none;
}

.bo-magazine-search-form {
  display: none;
}

/* Category board chrome inside board/index.html */
.subpage_wrap:has(.bo-magazine-board) .title_container,
.subpage_wrap:has(.bo-magazine-board) .ajaxLineMap {
  display: none;
}

/* ——— Detail ——— */
.magazine-view-layout,
.magazine-view-layout .subpage_wrap,
.magazine-view-layout .subpage_container,
.magazine-view-layout #bbsview {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  float: none;
  background: transparent;
}

.magazine-detail-main {
  --magazine-detail-text-width: 980px;
  --magazine-detail-image-width: 802px;
  padding-bottom: 0;
}

/* Detail page: no thumbnail hover zoom (except Related cards) */
.magazine-detail-shell .magazine-image::before,
.magazine-detail-shell .magazine-image:hover::before,
.magazine-detail-shell .magazine-image:hover > img,
.magazine-detail-hero-image::before,
.magazine-detail-hero-image:hover::before,
.magazine-detail-hero-image:hover > img {
  transform: none !important;
}

.magazine-detail-shell .magazine-related-grid .magazine-image:hover::before,
.magazine-detail-shell .magazine-related-grid .magazine-image:hover > img {
  transform: scale(1.04) !important;
}

.magazine-detail-hero {
  position: relative;
  align-self: stretch;
  width: 100%;
  min-height: clamp(180px, 18vw, 280px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.92), transparent 7%),
    radial-gradient(circle at 78% 20%, rgba(255, 255, 255, 0.74), transparent 9%),
    linear-gradient(135deg, #ffe0ee 0%, #e9ddff 46%, #d8f4ff 100%);
}

.magazine-detail-hero-copy {
  width: min(100%, var(--magazine-detail-text-width));
  margin: 0 auto 14px;
}

.magazine-detail-hero-copy > p {
  margin: 0 0 12px;
  color: var(--magazine-purple);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.magazine-detail-hero-copy > p a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.magazine-detail-hero-copy > p a:hover,
.magazine-detail-hero-copy > p a:focus-visible {
  opacity: 0.72;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.magazine-detail-hero-copy h1 {
  margin: 0;
  color: #111;
  font-size: clamp(24px, 2.8vw, 40px);
  line-height: 1.12;
  font-weight: 700;
}

.magazine-article-head {
  width: 100%;
  margin: 12px 0 0;
}

.magazine-article-head div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  row-gap: 6px;
}

.magazine-article-head p,
.magazine-article-head time,
.magazine-article-editor {
  margin: 0;
  color: var(--magazine-muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
}

.magazine-article-head p {
  color: var(--magazine-purple);
}

.magazine-article-head time,
.magazine-article-editor {
  display: inline-flex;
  align-items: center;
}

.magazine-article-head time::before,
.magazine-article-editor::before {
  content: "|";
  margin: 0 12px;
  color: #c7badf;
  font-weight: 500;
}

.magazine-article-editor {
  color: #31136c;
}

.magazine-detail-hero-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto 0;
  border-radius: 22px;
  background: none;
  pointer-events: none;
  overflow: visible;
}

.magazine-detail-hero-image > img {
  position: static;
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  opacity: 1;
  object-fit: contain;
  border-radius: 22px;
}

.magazine-article-layout {
  width: min(100%, var(--magazine-detail-text-width));
  margin: 20px auto 0;
}

.magazine-article-body {
  color: #191521;
  font-size: 18px;
  line-height: 1.72;
}

.magazine-article-body h2,
.magazine-article-body h3 {
  margin: 46px 0 16px;
  color: #111;
  font-size: clamp(24px, 2.2vw, 36px);
  line-height: 1.12;
  font-weight: 700;
}

/*
  Editor-uploaded article images:
  - keep editor size / horizontal placements (float, inline, % width)
  - only cap overflow and restore radius
*/
.magazine-article-body img,
.magazine-detail-shell .board_detail_contents img,
.magazine-detail-shell .content img {
  max-width: 100%;
  height: auto;
  border-radius: 18px;
  vertical-align: middle;
}

.magazine-article-body table,
.magazine-detail-shell .board_detail_contents table,
.magazine-detail-shell .content table {
  max-width: 100%;
  border-collapse: collapse;
}

.magazine-article-body td img,
.magazine-detail-shell .content td img {
  max-width: 100%;
  height: auto;
}

.magazine-article-body .magazine-image {
  display: inline-block;
  width: auto;
  max-width: 100%;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 18px;
  background: none;
  pointer-events: none;
  overflow: hidden;
  vertical-align: middle;
}

.magazine-article-body .magazine-image::before,
.magazine-detail-hero-image::before {
  content: none;
}

.magazine-article-body .magazine-image > img,
.magazine-article-body .magazine-image.has-image-bg > img,
.magazine-detail-shell .magazine-image.has-image-bg > img {
  position: static;
  max-width: 100%;
  height: auto;
  opacity: 1;
  border-radius: 18px;
}

.magazine-image.has-image-bg > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.magazine-detail-shell .magazine-image.has-image-bg > img {
  position: static;
  width: auto;
  height: auto;
  opacity: 1;
}

/* Related cards keep list-style hover zoom */
.magazine-detail-shell .magazine-related-grid .magazine-image.has-image-bg > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
}

.magazine-detail-shell .magazine-related-grid .magazine-image::before {
  content: "";
}

/* Related posts — 3x .bo-magazine-post-card */
.magazine-related {
  width: 100%;
  margin-top: clamp(48px, 4.2vw, 72px);
  padding-top: clamp(36px, 3.2vw, 52px);
  border-top: 1px solid var(--magazine-line);
}

.magazine-related[hidden] {
  display: none !important;
}

.magazine-related-head {
  margin-bottom: 18px;
}

.magazine-related-head a {
  flex: 0 0 auto;
  color: var(--magazine-purple);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.magazine-related-head a:hover,
.magazine-related-head a:focus-visible {
  opacity: 0.72;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.magazine-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  min-height: 0;
}

.magazine-related-grid .bo-magazine-post-card {
  display: grid;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  cursor: pointer;
}

/* Detail action buttons */
.magazine-detail-actions {
  box-sizing: border-box;
  width: min(100%, var(--magazine-detail-text-width));
  margin-left: auto;
  margin-right: auto;
}

.magazine-detail-shell .magazine-detail-actions,
.magazine-detail-shell ul.board_detail_btns.magazine-detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 28px auto 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.magazine-detail-shell .magazine-detail-actions:not(:has(button)) {
  display: none;
}

.magazine-detail-actions > li,
.magazine-detail-actions > li.right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  text-align: left;
}

.magazine-detail-actions > li.right {
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.magazine-detail-actions .btn_resp,
.magazine-detail-actions button.btn_resp {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  height: 44px;
  margin: 0;
  padding: 0 22px;
  border: 1px solid var(--magazine-line);
  border-radius: 999px;
  color: var(--magazine-ink);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.magazine-detail-actions .btn_resp:hover,
.magazine-detail-actions .btn_resp:focus-visible,
.magazine-detail-actions button.btn_resp:hover,
.magazine-detail-actions button.btn_resp:focus-visible {
  border-color: var(--magazine-purple);
  color: var(--magazine-purple);
  background: #faf8ff;
  box-shadow: 0 8px 18px rgba(123, 63, 228, 0.12);
}

.magazine-detail-actions .btn_resp.color2,
.magazine-detail-actions button.btn_resp.color2 {
  border-color: var(--magazine-purple);
  color: #fff;
  background: var(--magazine-purple);
}

.magazine-detail-actions .btn_resp.color2:hover,
.magazine-detail-actions .btn_resp.color2:focus-visible,
.magazine-detail-actions button.btn_resp.color2:hover,
.magazine-detail-actions button.btn_resp.color2:focus-visible {
  border-color: #31136c;
  color: #fff;
  background: #31136c;
  box-shadow: 0 10px 22px rgba(49, 19, 108, 0.18);
}

/* ——— Scroll reveal ——— */
/*
  Hide only after JS marks the document ready. Otherwise a slow iframe
  (Firstmall chrome + board.js) leaves lead/latest stuck at opacity:0.
*/
html.is-magazine-reveal-ready .magazine-scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--magazine-reveal-delay, 0s);
  will-change: opacity, transform;
}

html.is-magazine-reveal-ready .magazine-scroll-reveal.is-inview {
  opacity: 1;
  transform: translateY(0);
}

/* Newsletter: clearer bottom -> up */
.magazine-newsletter.magazine-scroll-reveal,
.magazine-newsletter.editors-newsletter.magazine-scroll-reveal {
  transform: translateY(40px);
}

.magazine-newsletter.magazine-scroll-reveal.is-inview,
.magazine-newsletter.editors-newsletter.magazine-scroll-reveal.is-inview {
  transform: translateY(0);
}

/* Related: keep section/divider space, reveal head + cards */
.magazine-related.magazine-scroll-reveal {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.magazine-related.magazine-scroll-reveal .magazine-related-head,
.magazine-related.magazine-scroll-reveal .magazine-related-grid .bo-magazine-post-card {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.magazine-related.magazine-scroll-reveal.is-inview .magazine-related-head {
  opacity: 1;
  transform: translateY(0);
}

.magazine-related.magazine-scroll-reveal.is-inview .magazine-related-grid .bo-magazine-post-card {
  opacity: 1;
  transform: translateY(0);
}

.magazine-related.magazine-scroll-reveal.is-inview .magazine-related-grid .bo-magazine-post-card:nth-child(1) {
  transition-delay: 0.05s;
}

.magazine-related.magazine-scroll-reveal.is-inview .magazine-related-grid .bo-magazine-post-card:nth-child(2) {
  transition-delay: 0.12s;
}

.magazine-related.magazine-scroll-reveal.is-inview .magazine-related-grid .bo-magazine-post-card:nth-child(3) {
  transition-delay: 0.19s;
}

@media (prefers-reduced-motion: reduce) {
  html.is-magazine-reveal-ready .magazine-scroll-reveal,
  .magazine-newsletter.magazine-scroll-reveal,
  .magazine-newsletter.editors-newsletter.magazine-scroll-reveal,
  .magazine-related.magazine-scroll-reveal .magazine-related-head,
  .magazine-related.magazine-scroll-reveal .magazine-related-grid .bo-magazine-post-card,
  .bo-magazine-lead,
  .bo-magazine-feature,
  .bo-magazine-latest,
  .bo-magazine-side-card {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
}

/* ——— Responsive ——— */
@media (max-width: 1120px) {
  body.is-magazine-page #layout_wrap,
  body.is-magazine-page #layout_body,
  body:has(.magazine-main) #layout_wrap,
  body:has(.magazine-main) #layout_body,
  body:has(.magazine-detail-main) #layout_wrap,
  body:has(.magazine-detail-main) #layout_body {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .magazine-main,
  .magazine-detail-main {
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .magazine-shell,
  .magazine-detail-shell {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    margin-top: -38px;
    margin-right: 0;
    margin-left: 0;
    padding: 38px clamp(20px, 4vw, 40px) 61px;
    border-radius: 25px 25px 0 0;
  }

  .magazine-breadcrumb {
    display: none;
  }

  .magazine-topic-tabs {
    justify-content: flex-start;
  }

  .bo-magazine-lead {
    grid-template-columns: 1fr;
  }

  .bo-magazine-latest {
    padding: 20px;
  }

  .bo-magazine-latest .bo-magazine-section-head {
    margin-bottom: 9px;
  }

  .bo-magazine-side-card {
    grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 16px 0;
  }

  .bo-magazine-side-thumb {
    width: 100%;
    aspect-ratio: 802 / 500;
  }

  .bo-magazine-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .bo-magazine-popular-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .bo-magazine-popular-head {
    padding-right: 100px;
  }

  .magazine-newsletter.editors-newsletter,
  .magazine-newsletter {
    min-height: 106px;
    margin-top: 50px;
    padding: 22px 36px;
  }

  .magazine-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .paging_navigation.bo-magazine-pagination {
    gap: 7px;
    margin-top: 28px;
  }

  .paging_navigation.bo-magazine-pagination a,
  .paging_navigation.bo-magazine-pagination input {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--magazine-line, #e7ddff);
    border-radius: 8px;
    color: var(--magazine-purple, #7b3fe4);
    background-color: #f3ebff;
  }

  .paging_navigation.bo-magazine-pagination a.on {
    border-color: var(--magazine-purple, #7b3fe4);
    background-color: var(--magazine-purple, #7b3fe4) !important;
    color: #fff !important;
  }

  .magazine-hero {
    min-height: 225px;
  }

  .magazine-hero-copy {
    padding: 52px 20px 0;
  }

  .magazine-hero-copy h1 {
    font-size: 38px;
  }

  .magazine-hero-copy span {
    max-width: 270px;
    margin-top: 11px;
    font-size: 12px;
  }

  .magazine-shell,
  .magazine-detail-shell {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    margin-top: -25px;
    margin-right: 0;
    margin-left: 0;
    /* Narrow side padding: the shell is edge-to-edge here and the board
       inside the iframe carries its own gutter, so a wide inset here just
       squeezes the content. */
    padding: 25px 20px 36px;
    border-radius: 22px 22px 0 0;
  }

  .magazine-topic-tabs {
    justify-content: flex-start;
    gap: 22px;
    margin-bottom: 23px;
  }

  /* Single-column at this width, so the base padding-bottom just adds a gap
     the stacked cards already provide. */
  .bo-magazine-lead {
    padding: 0;
  }

  .bo-magazine-feature-copy {
    padding: 16px 14px 18px;
  }

  .bo-magazine-feature-copy h3 button {
    font-size: 20px;
  }

  .bo-magazine-side-card {
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    align-items: start;
  }

  .bo-magazine-side-card > div {
    min-width: 0;
  }

  /* Keep right copy from growing past the thumb: title max 3 lines */
  .bo-magazine-side-card h3 button,
  .bo-magazine-side-card h3 button.boad_view_btn {
    display: -webkit-box;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    text-overflow: ellipsis;
    max-height: calc(1.22em * 3);
  }

  .bo-magazine-category-grid,
  .bo-magazine-popular-grid {
    grid-template-columns: 1fr;
  }

  .bo-magazine-popular-head {
    padding-right: 96px;
  }

  .bo-magazine-popular .magazine-popular-arrow {
    width: 36px;
    height: 36px;
  }

  .magazine-newsletter.editors-newsletter,
  .magazine-newsletter {
    grid-template-columns: 1fr;
    gap: 10px;
    min-height: 106px;
    margin-top: 34px;
    padding: 19px 16px 15px;
    border-radius: 12px;
  }

  .magazine-newsletter h2 {
    font-size: 14px;
  }

  .magazine-newsletter form {
    grid-template-columns: 1fr 94px;
    height: 40px;
  }

  .magazine-newsletter input {
    padding: 0 11px;
    font-size: 12px;
  }

  .magazine-newsletter button {
    margin: 0;
    font-size: 12px;
  }

  .magazine-detail-hero {
    min-height: 120px;
  }

  .magazine-detail-hero-copy h1 {
    font-size: 22px;
  }

  .magazine-detail-hero-image {
    border-radius: 16px;
  }

  .magazine-article-body {
    font-size: 16px;
  }

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

  .magazine-detail-actions,
  .magazine-detail-shell ul.board_detail_btns.magazine-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .magazine-detail-actions > li,
  .magazine-detail-actions > li.right {
    width: 100%;
  }

  .magazine-detail-actions > li.right {
    justify-content: stretch;
  }

  .magazine-detail-actions .btn_resp,
  .magazine-detail-actions button.btn_resp {
    width: 100%;
  }
}

/* Narrow phones (<375): same one-column list with a horizontal card as every
   other mobile width — only the spacing and type scale down. The layout used
   to flip to a 2-up vertical grid here, which made Latest look like a
   different component on small phones. */
@media (max-width: 374px) {
  .bo-magazine-latest {
    padding: 14px 12px;
  }

  .bo-magazine-side-card {
    gap: 10px;
    padding: 11px 0;
  }

  .bo-magazine-side-card h3 {
    margin: 0 0 4px;
  }

  .bo-magazine-side-card h3 button,
  .bo-magazine-side-card h3 button.boad_view_btn {
    font-size: 13px;
    line-height: 1.25;
    max-height: calc(1.25em * 3);
  }

  .bo-magazine-side-card time {
    font-size: 11px;
  }
}
