/* Homepage: remove Cassiopeia's inset content columns */
/* Full-width layout for the native homepage */
body:has(.rs-homepage) .site-grid > .container-component {
  grid-column: full-start / full-end;
}

body:has(.rs-homepage) .container-component > main {
  margin-top: 0;
}

/* Ruby-Sapphire native homepage slideshow */

.rs-homepage {
  width: 100%;
}

.rs-slider {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: #212326;
  overflow: hidden;
}

.rs-slider-images img {
  display: block;
  width: 100%;
  height: auto;
}

.rs-slider-images img[hidden] {
  display: none !important;
}

.rs-slider-images {
  position: relative;
}

.rs-slider-prev,
.rs-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: 0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  background: rgba(0, 0, 0, 0.28);
  color: white;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

.rs-slider-prev { left: 16px; }
.rs-slider-next { right: 16px; }

.rs-slider-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.rs-slider-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid white;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.rs-slider-dot[aria-current="true"] {
  background: white;
}

.rs-slider button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Homepage category cards */
.rs-home-content {
  background: #383639 url('/images/main-texture.png') repeat;
  color: #f0f4fb;
  padding: 60px 24px 80px;
}

.rs-home-heading {
  max-width: 1096px;
  margin: 0 auto 30px;
  color: #fff;
  font-size: 24px;
}

.rs-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  max-width: 1096px;
  margin: 0 auto;
}

.rs-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  background: #1f2223;
}

.rs-card-image img {
  display: block;
  width: 100%;
  aspect-ratio: 250 / 165;
  object-fit: cover;
}

.rs-card h3 {
  margin: 20px 0 12px;
  font-size: 22px;
}

.rs-card h3 a {
  color: #f0f4fb;
}

.rs-card p {
  flex: 1;
  color: #aaa;
  line-height: 1.6;
}

.rs-card-button {
  align-self: flex-start;
  padding: 10px 18px;
  background: #8e1a27;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.rs-card-button:hover {
  background: #b02a3d;
  color: #fff;
}

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

@media (max-width: 600px) {
  .rs-card-grid {
    grid-template-columns: 1fr;
  }

  .rs-home-intro h1 {
    font-size: 34px;
  }
}

/* Homepage alignment and card links */
.rs-homepage {
  width: 100%;
  max-width: none;
  margin: 0;
}

.rs-card h3 a,
.rs-card h3 a:hover {
  text-decoration: none;
}

.rs-card h3 a:hover {
  color: #c15369;
}

/* Homepage book promotions */
.rs-home-books {
  background: #383639 url('/images/main-texture.png') repeat;
  color: #fff;
  padding: 40px 24px 80px;
}

.rs-home-books h2 {
  max-width: 1096px;
  margin: 0 auto 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid #555;
  font-size: 24px;
  color: #fff;
}

.rs-book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  max-width: 1096px;
  margin: 0 auto;
}

.rs-book {
  text-align: center;
}

.rs-book img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 300px;
  object-fit: contain;
  margin: 0 auto 18px;
}

.rs-book h3 {
  color: #f0f4fb;
  font-size: 18px;
  line-height: 1.4;
}

@media (max-width: 800px) {
  .rs-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .rs-book-grid {
    grid-template-columns: 1fr;
  }
}


/* Slider caption: understated, upper-left */
.rs-slider-caption {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  font-family: "Oswald", sans-serif;
  line-height: 1.2;
  top: 18px;
  left: 24px;
  transform: none;
  width: auto;
  max-width: calc(100% - 48px);
  text-align: left;
  font-size: clamp(18px, 2.4vw, 30px);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

@media (max-width: 600px) {
  .rs-slider-caption {
    top: 12px;
    left: 14px;
    max-width: calc(100% - 28px);
    font-size: 18px;
  }
}

/* Homepage introduction — restrained editorial styling */
.rs-home-intro {
  max-width: 960px;
  margin: 0 auto 50px;
  text-align: center;
  padding: 0 20px;
}

.rs-home-intro h1 {
  font-family: "Oswald", sans-serif;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.3;
  color: #e6e2df;
  margin: 0 0 16px;
}

.rs-home-intro .rs-home-description {
  font-family: Georgia, serif;
  font-size: clamp(15px, 1.5vw, 19px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.6;
  color: #bdb9b6;
  margin: 0 0 22px;
}

.rs-home-intro .rs-home-lotus {
  font-family: "Source Sans Pro", sans-serif;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 400;
  letter-spacing: 0.015em;
  line-height: 1.6;
  color: #a6a3a1;
  margin: 0;
}

.rs-home-intro .rs-home-lotus a {
  color: #b77783;
  text-decoration: none;
  transition: color 0.2s ease;
}

.rs-home-intro .rs-home-lotus a:hover {
  color: #e6e2df;
  text-decoration: underline;
}

/* Center slideshow arrows precisely */
.rs-slider-prev,
.rs-slider-next {
  display: grid;
  place-items: center;
  padding: 0;
  font-family: Arial, sans-serif;
  font-size: 0;
}

.rs-slider-prev::after,
.rs-slider-next::after {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 30px;
  line-height: 1;
}

.rs-slider-prev::after {
  content: "‹";
}

.rs-slider-next::after {
  content: "›";
}

/* Optical centering of slideshow arrow symbols */
.rs-slider-prev::after,
.rs-slider-next::after {
  transform: translateY(-3px);
}
