/* ===== Grid ===== */
.qb-grid { display: grid; gap: 1.5rem; }
.qb-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qb-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qb-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .qb-grid--3, .qb-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .qb-grid--2, .qb-grid--3, .qb-grid--4 { grid-template-columns: 1fr; }
}

/* ===== Card ===== */
.qb-card {
  border: 1px solid var(--sl-border-light);
  background: var(--sl-white);
  overflow: hidden;
}

.qb-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.qb-card__thumb img {
  width: 100%;
  height: auto;
}

.qb-card__body {
  padding: 1rem;
}

.qb-card__title {
  font-size: var(--sl-text-lg);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.qb-card__meta {
  font-size: var(--sl-text-sm);
  color: var(--sl-text-meta);
  margin-bottom: 0.75rem;
}

.qb-card__title a {
  color: inherit;
  text-decoration: none;
}

.qb-card__cat {
  display: block;
  font-size: var(--sl-text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sl-plum);
  text-decoration: none;
  margin-bottom: 0.35rem;
}

.qb-card__excerpt {
  color: var(--sl-text-body);
  font-size: var(--sl-text-base);
  margin: 0;
}

/* ===== Hero ===== */
.qb-hero {
  border: 1px solid var(--sl-border-light);
  background: var(--sl-white);
  overflow: hidden;
  margin-bottom: 2rem;
}

.qb-hero__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
}

.qb-hero__thumb a {
  display: block;
  height: 100%;
}

.qb-hero__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qb-hero__body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.qb-hero__cat {
  display: block;
  font-size: var(--sl-text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sl-plum);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.qb-hero__title {
  font-size: var(--sl-text-h2);
  font-family: var(--sl-font-heading);
  line-height: var(--sl-leading-snug);
  color: var(--sl-plum);
  margin: 0 0 0.75rem;
}

.qb-hero__title a {
  color: inherit;
  text-decoration: none;
}

.qb-hero__excerpt {
  color: var(--sl-text-body);
  font-size: var(--sl-text-base);
  line-height: var(--sl-leading-body);
  margin: 0 0 1rem;
}

.qb-hero__more {
  color: var(--sl-rose);
  text-decoration: underline;
  font-weight: 600;
}

.qb-hero__more:hover {
  color: var(--sl-plum);
}

@media (max-width: 768px) {
  .qb-hero__inner {
    grid-template-columns: 1fr;
  }
  .qb-hero {
    border: none;
    margin-bottom: 1.5rem;
  }
  .qb-hero__body {
    padding: 1rem 0 0;
  }
  .qb-card {
    border: none;
  }
  .qb-card__body {
    padding: 1rem 0;
  }
  .qb-grid {
    gap: 1rem;
  }

  /* Tighten GP one-container 40px padding on mobile */
  .one-container .site-content {
    padding: 1.25rem;
  }
}

/* ===== Button ===== */
.qb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--sl-radius-md);
  border: 1px solid var(--sl-border-light);
  background: var(--sl-white);
  color: var(--sl-text-body);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.qb-btn--primary {
  background: var(--sl-btn-bg);
  color: var(--sl-btn-text);
  border-color: var(--sl-btn-bg);
}
.qb-btn--primary:hover {
  background: var(--sl-btn-bg-hover);
  border-color: var(--sl-btn-bg-hover);
  text-decoration: none;
}

.qb-btn--secondary {
  background: transparent;
  color: var(--sl-btn-alt-bg);
  border: 2px solid var(--sl-btn-alt-bg);
}
.qb-btn--secondary:hover {
  background: var(--sl-btn-alt-bg);
  color: var(--sl-btn-alt-text);
  text-decoration: none;
}

/* ===== Section ===== */
.qb-section {
  padding: 2.5rem 0;
}
.qb-section__title {
  margin-bottom: 1.5rem;
}
.qb-section--separator {
  border-top: 1px solid var(--sl-border-light);
}
.qb-section__link {
  color: inherit;
  text-decoration: none;
}
.qb-section__link:hover {
  color: var(--sl-rose);
}

/* ===== Feature (image overlay + text list) ===== */
.qb-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.qb-feature__hero {
  position: relative;
  overflow: hidden;
}
.qb-feature__hero a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.qb-feature__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.qb-feature__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}
.qb-feature__title {
  color: #fff;
  font-size: var(--sl-text-h3);
  font-family: var(--sl-font-heading);
  line-height: var(--sl-leading-heading);
  margin: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.qb-feature__list {
  display: flex;
  flex-direction: column;
}
.qb-feature__item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--sl-border-light);
}
.qb-feature__item:first-child {
  padding-top: 0;
}
.qb-feature__item:last-child {
  border-bottom: none;
}
.qb-feature__item-title {
  font-size: var(--sl-text-lg);
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.qb-feature__item-title a {
  color: var(--sl-text-heading);
  text-decoration: none;
}
.qb-feature__item-title a:hover {
  color: var(--sl-rose);
}
.qb-feature__item-excerpt {
  color: var(--sl-text-body);
  font-size: var(--sl-text-base);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 768px) {
  .qb-feature {
    grid-template-columns: 1fr;
  }
}

/* ===== Category Box (remaining categories directory) ===== */
.qb-catbox {
  border: 1px solid var(--sl-border-light);
  background: var(--sl-white);
  padding: 1.25rem;
}
.qb-catbox__title {
  font-family: var(--sl-font-heading);
  font-size: var(--sl-text-h4);
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sl-border-light);
}
.qb-catbox__title a {
  color: var(--sl-plum);
  text-decoration: none;
}
.qb-catbox__title a:hover {
  color: var(--sl-rose);
}
.qb-catbox__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.qb-catbox__list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--sl-border-light);
}
.qb-catbox__list li:last-child {
  border-bottom: none;
}
.qb-catbox__list a {
  color: var(--sl-text-body);
  text-decoration: none;
  font-size: var(--sl-text-base);
}
.qb-catbox__list a:hover {
  color: var(--sl-rose);
}

/* ===== Author Box ===== */
.ml-author-box__toggle { display: none; }
.ml-author-box__more { display: none; }

.ml-author-box {
  border: 1px solid var(--sl-border-light);
  background: var(--sl-bg-subtle);
  padding: 1.5rem;
  margin-top: 2rem;
}
.ml-author-box__header {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1.5rem;
}
.ml-author-box__avatar img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.ml-author-box__name {
  font-family: var(--sl-font-heading);
  color: var(--sl-plum);
  font-size: var(--sl-text-h3);
  line-height: var(--sl-leading-heading);
  margin: 0 0 0.75rem;
}
.ml-author-box__bio {
  color: var(--sl-text-body);
  font-size: var(--sl-text-base);
  line-height: var(--sl-leading-body);
}
.ml-author-box__bio p:last-child {
  margin-bottom: 0;
}
.ml-author-box__links {
  border-top: 1px solid var(--sl-border-light);
  margin-top: 1.25rem;
  padding-top: 1rem;
}
.ml-author-box__links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.ml-author-box__link {
  font-size: var(--sl-text-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sl-rose);
  text-decoration: none;
}
.ml-author-box__link:hover {
  color: var(--sl-plum);
}
@media (max-width: 600px) {
  .ml-author-box__header {
    grid-template-columns: 1fr;
  }
  .ml-author-box__avatar img {
    width: 120px;
    height: 120px;
  }

  /* Mobile accordion: collapsed bio peek + gradient */
  .ml-author-box__bio {
    max-height: calc(var(--sl-leading-body) * 1em);
    overflow: hidden;
    position: relative;
  }
  .ml-author-box__bio::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1.5em;
    background: linear-gradient(transparent, var(--sl-bg-subtle));
    pointer-events: none;
  }
  .ml-author-box__links { display: none; }
  .ml-author-box__more { display: block; cursor: pointer; color: var(--sl-rose); font-size: var(--sl-text-sm); font-weight: 600; margin-top: 0.75rem; }
  .ml-author-box__less-text { display: none; }

  /* Expanded state */
  .ml-author-box__toggle:checked ~ .ml-author-box__header .ml-author-box__bio { max-height: none; }
  .ml-author-box__toggle:checked ~ .ml-author-box__header .ml-author-box__bio::after { display: none; }
  .ml-author-box__toggle:checked ~ .ml-author-box__links { display: block; }
  .ml-author-box__toggle:checked ~ .ml-author-box__more .ml-author-box__more-text { display: none; }
  .ml-author-box__toggle:checked ~ .ml-author-box__more .ml-author-box__less-text { display: inline; }
}

/* ===== Table of Contents ===== */

/* Mobile (default): bordered box above article text */
.sl-toc {
  border: 1px solid var(--sl-border-light);
  background: var(--sl-bg-subtle);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  max-width: var(--sl-measure);
  margin-left: auto;
  margin-right: auto;
}
.sl-toc__title {
  font-family: var(--sl-font-heading);
  font-size: var(--sl-text-lg);
  font-weight: 600;
  color: var(--sl-text-heading);
  margin: 0 0 0.75rem;
}
.sl-toc__list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
.sl-toc__list li {
  margin-bottom: 0.35rem;
}
.sl-toc__list ol {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  list-style: none;
}
.sl-toc .sl-toc__list a {
  color: var(--sl-text-body);
  text-decoration: none;
  font-size: var(--sl-text-sm);
  line-height: var(--sl-leading-small);
}
.sl-toc .sl-toc__list a:hover {
  color: var(--sl-rose);
}
.sl-toc .sl-toc__list a:visited {
  color: var(--sl-text-body);
}
.sl-toc .sl-toc__list a.is-active,
.sl-toc .sl-toc__list a.is-active:visited {
  color: var(--sl-plum);
  font-weight: 700;
}

/* Desktop (≥1200px): sticky sidebar in left margin */
@media (min-width: 1200px) {
  .has-toc .entry-content {
    position: relative;
  }
  .sl-toc {
    position: absolute;
    left: calc(50% - var(--sl-measure) / 2 - 220px - 2rem);
    top: 0;
    bottom: 0;
    width: 220px;
    transform: none;
    margin: 0;
    border: none;
    background: none;
    padding: 0;
    max-width: none;
  }
  .sl-toc__inner {
    position: sticky;
    top: 2rem;
  }
}
