/*
Theme Name: Cocoon Child Manga
Template: cocoon
Description: Modular manga and ebook portal child theme for Cocoon.
Author: Site Admin
Version: 1.0.0
Text Domain: cocoon-child-manga
*/

/* Base child overrides. Portal-specific styles are loaded from /css/*.css on front page. */
.portal-home {
  margin-block: 0 2.5rem;
}

.portal-home * {
  box-sizing: border-box;
}

/* Section title baseline accent */
.portal-home .section-title {
  position: relative;
  padding-left: 14px;
}

.portal-home .section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 5px;
  height: 1.1em;
  border-radius: 999px;
  background: #d9d9d9;
}

/* Highlight the active featured section title */
.portal-home.is-feature-freeworks #featured .section-title::before,
.portal-home.is-feature-ranking #ranking .section-title::before,
.portal-home.is-feature-newbooks #new-releases .section-title::before,
.portal-home.is-feature-salebooks #sales .section-title::before,
.portal-home.is-feature-mediaworks #media .section-title::before {
  width: 8px;
  height: 1.25em;
  background: var(--portal-highlight, #ff9900);
}

.portal-home.is-feature-freeworks #featured .section-title,
.portal-home.is-feature-ranking #ranking .section-title,
.portal-home.is-feature-newbooks #new-releases .section-title,
.portal-home.is-feature-salebooks #sales .section-title,
.portal-home.is-feature-mediaworks #media .section-title {
  color: var(--portal-highlight-strong, #e68700);
}

/* Optional subtle featured section background */
.portal-home.is-feature-freeworks #featured {
  background: linear-gradient(180deg, rgba(255, 153, 0, 0.05) 0%, rgba(255, 153, 0, 0) 100%);
}

.portal-home.is-feature-ranking #ranking {
  background: linear-gradient(180deg, rgba(34, 34, 34, 0.04) 0%, rgba(34, 34, 34, 0) 100%);
}

.portal-home.is-feature-newbooks #new-releases {
  background: linear-gradient(180deg, rgba(42, 125, 225, 0.05) 0%, rgba(42, 125, 225, 0) 100%);
}

.portal-home.is-feature-salebooks #sales {
  background: linear-gradient(180deg, rgba(240, 90, 40, 0.05) 0%, rgba(240, 90, 40, 0) 100%);
}

.portal-home.is-feature-mediaworks #media {
  background: linear-gradient(180deg, rgba(122, 77, 232, 0.05) 0%, rgba(122, 77, 232, 0) 100%);
}

/* First-card cover emphasis in the featured section only */
.portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child .book-cover,
.portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child .book-cover,
.portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child .book-cover,
.portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child .book-cover,
.portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child .book-cover {
  box-shadow: inset 0 0 0 2px var(--portal-highlight, #ff9900), 0 10px 24px rgba(0, 0, 0, 0.12);
  background: color-mix(in srgb, var(--portal-highlight, #ff9900) 12%, #efefef);
  transform: translateY(-2px);
}

.portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child .book-placeholder,
.portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child .book-placeholder,
.portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child .book-placeholder,
.portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child .book-placeholder,
.portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child .book-placeholder {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--portal-highlight, #ff9900) 16%, #f3f3f3) 0%,
    #e8e8e8 100%
  );
}

/* Featured section: subtly emphasize the first card only */
.portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child,
.portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child,
.portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child,
.portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child,
.portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child {
  border-color: rgba(255, 153, 0, 0.28);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  min-width: 86%;
}

@media (min-width: 768px) {
  .portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child,
  .portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child,
  .portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child,
  .portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child,
  .portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child {
    min-width: 54%;
  }
}

@media (min-width: 1024px) {
  .portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child,
  .portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child,
  .portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child,
  .portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child,
  .portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child {
    min-width: calc((100% - 32px) / 3 + 40px);
  }
}

/* Slightly stronger title and CTA for the first featured card */
.portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child .book-title,
.portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child .book-title,
.portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child .book-title,
.portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child .book-title,
.portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child .book-title {
  font-size: 1.04rem;
}

.portal-home.is-feature-freeworks #featured .scroll-row > .book-card:first-child::after,
.portal-home.is-feature-ranking #ranking .scroll-row > .book-card:first-child::after,
.portal-home.is-feature-newbooks #new-releases .scroll-row > .book-card:first-child::after,
.portal-home.is-feature-salebooks #sales .scroll-row > .book-card:first-child::after,
.portal-home.is-feature-mediaworks #media .scroll-row > .book-card:first-child::after {
  content: "注目";
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 26px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--portal-highlight, #ff9900);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  z-index: 2;
}

/* =========================
   主役セクション別 カラー変数
   cards.css の --portal-highlight-soft / dark を上書き
========================= */

.portal-home.is-feature-freeworks {
  --portal-highlight: #ff9900;
  --portal-highlight-dark: #d97f00;
  --portal-highlight-soft: #fff0d9;
}

.portal-home.is-feature-ranking {
  --portal-highlight: #222222;
  --portal-highlight-dark: #000000;
  --portal-highlight-soft: #ececec;
}

.portal-home.is-feature-newbooks {
  --portal-highlight: #2a7de1;
  --portal-highlight-dark: #1f63b6;
  --portal-highlight-soft: #dcebff;
}

.portal-home.is-feature-salebooks {
  --portal-highlight: #f05a28;
  --portal-highlight-dark: #d94816;
  --portal-highlight-soft: #ffe0d4;
}

.portal-home.is-feature-mediaworks {
  --portal-highlight: #7a4de8;
  --portal-highlight-dark: #6038bf;
  --portal-highlight-soft: #e9deff;
}
