/* =====================================================
   course.css — Course detail page styles
   Loaded after base.css + layout.css. Course pages are intentionally
   lean (hero + curriculum + pricing); they do NOT load home.css.

   Sections:
     1. .course-hero                     — course identity + CTA
     2. .section-course-curriculum       — what the course teaches
     3. .section-course-pricing          — pricing card with CTA
   ===================================================== */

/* ---------------------------------------------------------------------
   Shared "title-em" recipe — gold SVG underline behind <em> accents
   in section titles. Same recipe used by the homepage's section titles
   (we duplicate it here so course.css stays self-contained).
--------------------------------------------------------------------- */
.course-curriculum-title-em,
.course-pricing-title-em {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--text-main);
  white-space: nowrap;
}
.course-curriculum-title-em::after,
.course-pricing-title-em::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: -0.12em;
  height: 0.32em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 18' preserveAspectRatio='none'><path d='M4 12 Q 80 2, 160 8 T 316 6' fill='none' stroke='%23F59E0B' stroke-width='5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}

/* =====================
   1. COURSE HERO — Right-half image with feathered cream blends
   The photograph occupies the right ~55% of the section. Cream
   gradient overlays paint on top of the image at its left/top/bottom
   edges so it blends into the surrounding cream background without
   any hard cut. The left half is pure cream — content reads cleanly.
   ===================== */
.course-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(560px, 78vh, 720px);
  /* Symmetric vertical padding — the visible top gap (padding-top minus the
     fixed header height) matches the bottom gap so the hero is balanced. */
  padding: calc(var(--header-h) + var(--sp-xl)) 0 var(--sp-xl);
  background-color: var(--bg-cream);
}

/* Background photograph — constrained to the right side only */
.course-hero-visual {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 55%;
  z-index: 0;
}
.course-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
}

/* Cream gradient overlays — feather the image's left/top/bottom edges
   into the surrounding cream background. Stacked on top of the image
   in the same right-half region; the right edge stays opaque (against
   the viewport's right edge it doesn't need to blend). */
.course-hero-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 55%;
  z-index: 1;
  background:
    /* Left edge: solid cream fading into transparent across ~38% of the image */
    linear-gradient(90deg,
      var(--bg-cream) 0%,
      rgba(250, 247, 243, 0.85) 8%,
      rgba(250, 247, 243, 0.4) 22%,
      transparent 42%),
    /* Top edge: cream fade so the image doesn't butt against the section top */
    linear-gradient(180deg,
      var(--bg-cream) 0%,
      rgba(250, 247, 243, 0.6) 6%,
      transparent 16%),
    /* Bottom edge: same as top, mirrored */
    linear-gradient(0deg,
      var(--bg-cream) 0%,
      rgba(250, 247, 243, 0.6) 6%,
      transparent 16%);
  pointer-events: none;
}

.course-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ---- Text column — anchored left, width-capped for line length ---- */
.course-hero-text {
  max-width: 560px;
}

/* Breadcrumb — replaces the old eyebrow tag. Mirrors the JSON-LD
   BreadcrumbList structure: ホーム › 英検®3級対策コース. */
.course-hero-breadcrumb {
  /* Top margin mirrors .course-hero-sub's trailing margin-bottom (1.85rem) so
     the text block sits symmetrically between the hero's top/bottom padding. */
  margin: 1.85rem 0 1.25rem;
}
.course-hero-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}
.course-hero-breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.course-hero-breadcrumb-item + .course-hero-breadcrumb-item::before {
  content: '/';
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1;
}
.course-hero-breadcrumb-link {
  color: var(--text-light);
  transition: color var(--transition);
}
.course-hero-breadcrumb-link:hover {
  opacity: 1;
  color: var(--primary);
}
.course-hero-breadcrumb-current {
  /* This is the page's <h1> — reset heading defaults so it visually
     reads as a breadcrumb item, not a marketing headline. */
  margin: 0;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  color: var(--text-main);
}

.course-hero-headline {
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.42;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  letter-spacing: 0.005em;
  /* Light text shadow keeps the headline crisp against the overlay's
     softer fade zone near the middle of the screen. */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.course-hero-headline-accent {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--primary);
  white-space: nowrap;
}
.course-hero-underline {
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: -0.18em;
  width: calc(100% + 0.08em);
  height: 0.28em;
  color: var(--accent);
  pointer-events: none;
}

.course-hero-sub {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.95;
  margin-bottom: 1.85rem;
  max-width: 480px;
  /* Match the headline's subtle shadow for legibility consistency */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}
.course-hero-sub em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
  position: relative;
  padding: 0 0.1em;
  z-index: 0;
}
.course-hero-sub em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 0.3em;
  background: rgba(245, 158, 11, 0.22);
  z-index: -1;
}

/* Arrow span used by the pricing-card CTA — kept here since the
   styling pairs naturally with the hero/figure aesthetics. */
.course-hero-cta-arrow {
  display: inline-block;
  margin-left: 0.35em;
  transition: transform var(--transition);
}
.btn:hover .course-hero-cta-arrow {
  transform: translateX(4px);
}

/* ---- Responsive ----
   1023 → tablet: tighten image area, narrower text column
   767  → phone: image goes full-width as a soft backdrop with strong
          cream wash so full-width text remains legible. */
@media (max-width: 1023px) {
  .course-hero-visual,
  .course-hero-overlay { width: 50%; }
  .course-hero { min-height: clamp(500px, 68vh, 620px); }
  .course-hero-text { max-width: min(480px, 50%); }
  .course-hero-headline { font-size: clamp(1.85rem, 3.4vw, 2.4rem); }
}
@media (max-width: 767px) {
  /* Mobile: image becomes a soft full-width backdrop anchored to the
     bottom of the section; vertical cream wash makes the top of the
     frame bright enough for the headline to read against. */
  .course-hero-visual { width: 100%; }
  .course-hero-img { object-position: 60% 92%; }
  .course-hero-overlay {
    width: 100%;
    background:
      linear-gradient(
        180deg,
        rgba(250, 247, 243, 0.96) 0%,
        rgba(250, 247, 243, 0.88) 45%,
        rgba(250, 247, 243, 0.55) 100%
      );
  }
  .course-hero {
    min-height: auto;
    padding: calc(var(--header-h) + var(--sp-xl)) 0 var(--sp-xl);
    align-items: stretch;
  }
  .course-hero-text { max-width: 100%; }
  .course-hero-sub { max-width: 100%; }
}
@media (max-width: 520px) {
  .course-hero { padding-top: calc(var(--header-h) + var(--sp-lg)); padding-bottom: var(--sp-lg); }
  .course-hero-headline { font-size: 1.65rem; line-height: 1.5; }
}

/* =====================
   2. CURRICULUM — Editorial vertical list
   Magazine layout: handwritten number + EN eyebrow on the left,
   title + body on the right. Dashed dividers between items.
   ===================== */
.section-course-curriculum {
  background: var(--bg-white);
  position: relative;
  overflow: hidden;
}
.course-curriculum-header {
  position: relative;
  z-index: 1;
  margin: 0 0 3.5rem;
}
.course-curriculum-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}
.course-curriculum-item {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  align-items: start;
  gap: 2.5rem;
  padding: 2rem 0;
  border-bottom: 1px dashed var(--border-warm);
}
.course-curriculum-item:first-child { padding-top: 0; }
.course-curriculum-item:last-child  { border-bottom: 0; padding-bottom: 0; }

.course-curriculum-item-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.course-curriculum-item-num {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 0.85;
  letter-spacing: 0;
  transform: rotate(-4deg);
  transform-origin: left center;
}
.course-curriculum-item-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1;
  padding-left: 0.95rem;
  position: relative;
}
.course-curriculum-item-eyebrow::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.85;
}

.course-curriculum-item-body { min-width: 0; }
.course-curriculum-item-title {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.55;
  color: var(--text-main);
  margin: 0 0 0.65rem;
}
.course-curriculum-item-text {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.95;
  margin: 0;
}
.course-curriculum-item-text em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
  position: relative;
  padding: 0 0.1em;
  z-index: 0;
}
.course-curriculum-item-text em::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0.08em;
  height: 0.3em;
  background: rgba(245, 158, 11, 0.22);
  z-index: -1;
}

@media (max-width: 720px) {
  .course-curriculum-item {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.65rem 0;
  }
  .course-curriculum-item-head { flex-direction: row; align-items: baseline; gap: 1rem; }
  .course-curriculum-item-num { font-size: 2.6rem; }
}

/* =====================
   3. PRICING — Flows directly into the section, no card wrapper
   Width and spec-row rhythm match the CURRICULUM list above so the
   two sections read as a consistent pair.
   ===================== */
.section-course-pricing {
  position: relative;
  overflow: hidden;
  background: var(--bg-white);
}
.section-course-pricing::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(245, 158, 11, 0.08) 1px, transparent 1.2px);
  background-size: 28px 28px;
  opacity: 0.5;
  pointer-events: none;
}
.course-pricing-header {
  position: relative;
  z-index: 1;
  margin: 0 0 3.5rem;
}

.course-pricing-body {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 4.5rem);
}

/* LEFT column — Featured headline: course tag + big price */
.course-pricing-headline {
  text-align: left;
  margin: 0;
  padding: 0;
}
.course-pricing-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.course-pricing-price {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0;
  margin: 0;
}
.course-pricing-price-num {
  font-size: clamp(2.8rem, 5.5vw, 4rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -0.02em;
}
.course-pricing-price-unit {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-left: 0.15rem;
  padding-bottom: 0.2rem;
}
.course-pricing-price-cycle {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-light);
  margin-left: 0.45rem;
  padding-bottom: 0.15rem;
}

/* RIGHT column — Details + CTA wrapper */
.course-pricing-details {
  min-width: 0;
}

/* Spec rows — mirror .course-curriculum-item rhythm, slightly tighter
   label column to fit the narrower right column in the 2-column layout. */
.course-pricing-specs {
  margin: 0 0 2rem;
  padding: 0;
}
.course-pricing-spec {
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px dashed var(--border-warm);
}
.course-pricing-spec:last-child { border-bottom: 0; }
.course-pricing-spec-label {
  position: relative;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
  line-height: 1;
  padding-left: 0.95rem;
}
.course-pricing-spec-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.85;
}
.course-pricing-spec-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.55;
  margin: 0;
}
.course-pricing-spec-value small {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.course-pricing-cta {
  text-align: left;
}
.course-pricing-cta .btn:hover { transform: none; }
.course-pricing-cta-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}

/* Tablet — collapse to single column, recenter the headline */
@media (max-width: 900px) {
  .course-pricing-body {
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 640px;
  }
  .course-pricing-headline {
    text-align: center;
    padding-bottom: 1.75rem;
    border-bottom: 1px dashed var(--border-warm);
  }
  .course-pricing-price { justify-content: center; }
  .course-pricing-specs { border-top: 0; }
  .course-pricing-cta { text-align: center; }
}

@media (max-width: 720px) {
  /* Mirror .course-curriculum-item's mobile stacking */
  .course-pricing-spec {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 1.25rem 0;
  }
}
@media (max-width: 520px) {
  .course-pricing-price-num { font-size: 2.4rem; }
  .course-pricing-price-unit { font-size: 0.95rem; }
  .course-pricing-price-cycle { font-size: 0.78rem; }
  .course-pricing-cta .btn { width: 100%; }
}

/* =====================
   4. BOTTOM CTA — Mirrored from home.css so partials/cta.php renders
   correctly without needing home.css loaded on course pages.
   ===================== */
.section-cta {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-cream);
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(420px, 56vh, 560px);
  padding: clamp(var(--sp-xl), 8vw, var(--sp-2xl)) 0;
}
.cta-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.cta-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 50%;
  display: block;
}
.cta-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      90deg,
      rgba(250, 247, 243, 0.96) 0%,
      rgba(250, 247, 243, 0.92) 30%,
      rgba(250, 247, 243, 0.78) 46%,
      rgba(250, 247, 243, 0.35) 62%,
      rgba(250, 247, 243, 0)    80%
    );
  pointer-events: none;
}
.cta-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}
.cta-content { max-width: min(540px, 50%); }
.cta-header {
  position: relative;
  z-index: 1;
  margin: 0 0 1.75rem;
}
.cta-title {
  font-size: clamp(1.55rem, 1.55vw + 1.1rem, 2.25rem);
  font-weight: 800;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}
.cta-title-em {
  position: relative;
  display: inline-block;
  font-style: normal;
  color: var(--text-main);
  white-space: nowrap;
}
.cta-title-em::after {
  content: '';
  position: absolute;
  left: -0.04em;
  right: -0.04em;
  bottom: -0.12em;
  height: 0.32em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 18' preserveAspectRatio='none'><path d='M4 12 Q 80 2, 160 8 T 316 6' fill='none' stroke='%23F59E0B' stroke-width='5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
}
.cta-title-break { display: inline; }
.cta-header-desc {
  font-size: clamp(0.86rem, 0.35vw + 0.78rem, 1rem);
  color: var(--text-light);
  line-height: 1.95;
  margin-top: 1.1rem;
}
.cta-header-desc em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
}
.cta-header-desc sup {
  font-size: 0.6em;
  vertical-align: super;
}
.cta-header-break { display: inline; }
.cta-body {
  position: relative;
  z-index: 1;
}
.cta-action { margin: 0 0 1.25rem; }
.cta-btn:hover { transform: none; }
.cta-btn-arrow {
  display: inline-block;
  margin-left: 0.35em;
  transition: transform var(--transition);
}
.cta-btn:hover .cta-btn-arrow { transform: translateX(4px); }
.cta-btn-note {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-light);
}
.cta-checks {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.4rem 1.25rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.cta-checks li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
}
.cta-check-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 174, 239, 0.12);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.cta-alt {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 1.85rem 0 0;
}
.cta-alt-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ja);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  padding-bottom: 2px;
}
.cta-alt-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.cta-alt-link:hover { opacity: 1; }
.cta-alt-link:hover::after { transform: scaleX(1); }
.cta-alt-arrow {
  display: inline-block;
  margin-left: 0.35em;
  transition: transform var(--transition);
}
.cta-alt-link:hover .cta-alt-arrow { transform: translateX(4px); }

@media (max-width: 1023px) {
  .cta-img { object-position: 86% 50%; }
  .cta-overlay {
    background:
      linear-gradient(
        90deg,
        rgba(250, 247, 243, 0.97) 0%,
        rgba(250, 247, 243, 0.93) 38%,
        rgba(250, 247, 243, 0.70) 58%,
        rgba(250, 247, 243, 0.25) 82%,
        rgba(250, 247, 243, 0)    100%
      );
  }
  .section-cta { min-height: clamp(400px, 50vh, 520px); }
  .cta-content { max-width: min(460px, 60%); }
}
@media (max-width: 767px) {
  .cta-img { object-position: 70% 92%; }
  .cta-overlay {
    background:
      linear-gradient(
        180deg,
        rgba(250, 247, 243, 0.96) 0%,
        rgba(250, 247, 243, 0.90) 50%,
        rgba(250, 247, 243, 0.55) 100%
      );
  }
  .section-cta {
    min-height: auto;
    padding: var(--sp-xl) 0;
    align-items: stretch;
  }
  .cta-content { max-width: 100%; }
  .cta-header { margin-bottom: 1.5rem; }
}
@media (max-width: 520px) {
  .cta-header-break { display: none; }
  .cta-btn { width: 100%; }
  .cta-btn-note { font-size: 0.74rem; }
  .cta-checks { gap: 0.4rem 0.95rem; margin-top: 1rem; }
  .cta-checks li { font-size: 0.75rem; }
  .cta-alt { margin-top: 1.5rem; }
}

/* ---------------------------------------------------------------------
   Reduced motion
--------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .course-hero-cta-arrow,
  .course-hero-figure-frame,
  .cta-btn-arrow,
  .cta-alt-arrow { transition: none; }
}
