body.home {
  overflow-x: clip;
}

body.home #bd-home-genre-shortcuts,
body.home #bd-popular-week,
body.home #bd-home-layout {
  min-width: 0;
  margin-bottom: 0;
}

body.home .bd-home-genre-shortcuts ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bd-ui-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

body.home .bd-home-genre-shortcuts a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: var(--bd-ui-space-2) var(--bd-ui-space-4);
  border: 1px solid var(--bd-ui-border);
  border-radius: var(--bd-ui-radius-sm);
  background: var(--bd-ui-surface);
  color: var(--bd-ui-text);
  font-size: 14px;
  line-height: 1.5;
}

body.home .bd-home-genre-shortcuts a:hover,
body.home .bd-home-genre-shortcuts a:focus-visible {
  border-color: var(--bd-ui-accent);
  background: var(--bd-ui-accent-soft);
  color: var(--bd-ui-accent-link);
}

body.home #bd-popular-week,
body.home #bd-korean-top-views {
  font-family: 'Kanit', sans-serif;
}
body.home #bd-popular-week .bd-korean-top-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--bd-ui-space-4);
}

body.home #bd-popular-week .bd-korean-top-card {
  min-width: 0;
  margin: 0;
}

body.home #bd-popular-week .item-thumb,
body.home #bd-popular-week .item-thumb a,
body.home #bd-popular-week .item-thumb img {
  display: block;
  width: 100%;
}

body.home #bd-popular-week .item-thumb {
  overflow: hidden;
  aspect-ratio: 350 / 476;
  border-radius: var(--bd-ui-radius-md);
  background: var(--bd-ui-surface);
}

body.home #bd-popular-week .item-thumb img {
  height: 100%;
  object-fit: cover;
}

body.home #bd-popular-week .bd-korean-top-card-title {
  margin: var(--bd-ui-space-2) 0 0;
  color: var(--bd-ui-text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.home #bd-popular-week .bd-korean-top-card-title a {
  color: inherit;
}

body.home #bd-popular-week .bd-korean-top-card-title a:hover,
body.home #bd-popular-week .bd-korean-top-card-title a:focus-visible {
  color: var(--bd-ui-accent-link);
}

body.home .bd-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr);
  align-items: start;
  gap: var(--bd-ui-space-6);
  width: 100%;
}

body.home .bd-home-editorial {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: var(--bd-ui-space-8);
  overflow-wrap: anywhere;
}

body.home .bd-home-main,
body.home .bd-home-sidebar,
body.home .bd-home-main > .main-col {
  min-width: 0;
}
/* Section panels share the sidebar surface and full-width heading bars. */
body.home .bd-home-main .main-col-inner {
  overflow: hidden;
  border: 1px solid var(--bd-ui-border);
  border-radius: var(--bd-ui-radius-md);
  background: var(--bd-ui-surface);
}
body.home .bd-home-main .main-col-inner > .c-blog__heading.style-2 {
  border-radius: 0;
}
body.home .bd-home-main .main-col-inner > .c-blog-listing {
  padding: 0 var(--bd-ui-space-4) var(--bd-ui-space-4);
}
body.home #bd-popular-week,
body.home #bd-korean-top-views {
  overflow: hidden;
  border: 1px solid var(--bd-ui-border);
  border-radius: var(--bd-ui-radius-md);
  background: var(--bd-ui-surface);
  margin: 0;
  padding: 0;
}
body.home .bd-korean-top-heading {
  border-radius: 0;
}
body.home .bd-korean-top-grid {
  padding: 0 var(--bd-ui-space-4) var(--bd-ui-space-4);
}

body.home .bd-home-main > .main-col {
  float: none;
  width: 100%;
  max-width: none;
  padding: 0;
}

body.home .bd-home-main #loop-content .item-thumb,
body.home .bd-home-main #loop-content .item-thumb a,
body.home .bd-home-main #loop-content .item-thumb img {
  display: block;
  width: 100%;
}

body.home .bd-home-main #loop-content .item-thumb {
  overflow: hidden;
  aspect-ratio: 350 / 476;
  border-radius: var(--bd-ui-radius-md);
}

body.home .bd-home-main #loop-content .item-thumb img {
  height: 100%;
  object-fit: cover;
}

body.home .bd-home-main #loop-content .post-title,
body.home .bd-home-main #loop-content .post-title a {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.home .bd-home-sidebar {
  display: grid;
  gap: var(--bd-ui-space-6);
}

body.home .bd-home-genres {
  padding: var(--bd-ui-space-4);
  overflow: hidden;
  border: 1px solid var(--bd-ui-border);
  border-radius: var(--bd-ui-radius-md);
  background: var(--bd-ui-surface);
}
body.home .bd-home-genres .bd-ui-section-heading {
  margin: calc(-1 * var(--bd-ui-space-4)) calc(-1 * var(--bd-ui-space-4)) var(--bd-ui-space-4);
  padding: var(--bd-ui-space-3) var(--bd-ui-space-4);
  border-bottom: 2px solid var(--bd-ui-accent);
  background: var(--bd-ui-surface-raised);
}

/* Genre chips keep their muted count readable in every interaction state. */
body.home .bd-home-genres ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bd-ui-space-2) var(--bd-ui-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

body.home .bd-home-genres a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: var(--bd-ui-space-1) var(--bd-ui-space-3);
  border: 1px solid var(--bd-ui-border);
  border-radius: var(--bd-ui-radius-sm);
  background: var(--bd-ui-surface-raised);
  color: var(--bd-ui-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

body.home .bd-home-genres a:hover,
body.home .bd-home-genres a:focus-visible {
  background: var(--bd-ui-accent-soft);
  border-color: var(--bd-ui-accent);
  color: var(--bd-ui-accent-link);
}

body.home .bd-home-genres .bd-home-genres-count {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--bd-ui-muted);
}

body.home .bd-home-sidebar-empty {
  color: var(--bd-ui-muted);
}

@media (max-width: 991px) {
  body.home .bd-home-layout {
    grid-template-columns: 1fr;
  }

  body.home .bd-home-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 766px) and (max-width: 991px) {
  body.home #bd-popular-week .bd-korean-top-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 765px) {

  body.home #bd-popular-week .bd-korean-top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bd-ui-space-3);
  }

  body.home .bd-home-sidebar {
    grid-template-columns: 1fr;
  }
}

/*
 * Latest Manga loop: reference-inspired card style.
 * Desktop 4-up / tablet 3-up / mobile 2-up, centered two-line titles, and two
 * rounded chapter rows (chapter name left, date right) under each cover.
 * Scoped to the homepage loop only; archives keep the existing 6-up grid.
 */
body.home #loop-content.page-content-listing.item-big_thumbnail {
  gap: var(--bd-ui-space-5) var(--bd-ui-space-4);
}

body.home #loop-content.page-content-listing.item-big_thumbnail .post-title h3 {
  display: -webkit-box;
  min-height: 2.6em;
  margin: 0;
  overflow: hidden;
  color: var(--bd-ui-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.home #loop-content.page-content-listing.item-big_thumbnail .post-title h3 a {
  color: inherit;
}

body.home #loop-content.page-content-listing.item-big_thumbnail .post-title h3 a:hover,
body.home #loop-content.page-content-listing.item-big_thumbnail .post-title h3 a:focus-visible {
  color: var(--bd-ui-accent-link);
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter {
  margin-top: var(--bd-ui-space-3);
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  gap: var(--bd-ui-space-2);
  margin-bottom: var(--bd-ui-space-2);
  padding: var(--bd-ui-space-2) var(--bd-ui-space-3);
  border: 1px solid transparent;
  border-radius: var(--bd-ui-radius-sm);
  background: var(--bd-ui-surface-raised);
  transition: background-color 140ms ease, border-color 140ms ease;
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item:last-child {
  margin-bottom: 0;
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item:hover,
body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item:focus-within {
  border-color: var(--bd-ui-accent);
  background: var(--bd-ui-accent-soft);
}

/* Neutralize the parent-theme chapter chip (max-width 60% / borders) — the
 * .chapter-item row itself is the whole button. */
body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter {
  min-width: 0;
  flex: 1 1 auto;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter a {
  display: block;
  overflow: hidden;
  color: var(--bd-ui-text);
  font-size: 13px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* Stretched link: the whole chapter row is clickable. */
body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item .chapter a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--bd-ui-radius-sm);
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item .chapter a:focus-visible {
  outline: none;
}

body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item .chapter a:focus-visible::after {
  outline: 2px solid var(--bd-ui-accent-link);
  outline-offset: 2px;
}

/* Age label on the right of the chapter row (Thai relative, from
 * inc/chapter-meta.php). "NEW" arrives wrapped in .bd-age-new. */
body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .post-on {
  display: block;
  flex: 0 0 auto;
  margin-left: var(--bd-ui-space-2);
  color: var(--bd-ui-muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
}
body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .post-on .bd-age-new {
  display: inline-block;
  padding: 1px 6px 2px;
  border-radius: var(--bd-ui-radius-sm);
  background: var(--bd-ui-accent);
  color: var(--bd-ui-on-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

@media (prefers-reduced-motion: reduce) {
  body.home #loop-content.page-content-listing.item-big_thumbnail .list-chapter .chapter-item {
    transition-property: none;
  }
}

@media (min-width: 768px) {
  body.home #loop-content.page-content-listing.item-big_thumbnail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  body.home #loop-content.page-content-listing.item-big_thumbnail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 2026-09-04: mobile — keep popular-week/korean boxes inset from screen
 * edges (bootstrap gutters not applied here). */
@media (max-width: 991.98px) {
  body.home #bd-popular-week,
  body.home #bd-korean-top-views {
    width: auto;
    margin: 0;
    padding: 0;
  }
  body.home #bd-home-layout {
    padding-right: 0;
    padding-left: 0;
  }
}
/* Stack homepage sections with an explicit gap at every width — section
 * margins are zeroed so the flex gap is the single source of spacing. */
body.home .content-area > .container > .row {
  display: flex;
  flex-direction: column;
  gap: var(--bd-ui-space-6);
}
