/* ============================================================
   BLENDING VIEW SPECIFIC STYLES (merged, no duplication)
   ============================================================ */
.page-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: 0.75rem;
}

/* Page Header (unique to blending page) */
.page-header {
  text-align: center;
  padding: 1rem 1rem 2rem;
  margin-bottom: 1rem;
}

.page-header p {
  color: var(--text-soft);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ----- SECTION TOGGLES (Main Categories) ----- */
.section {
  margin-bottom: 1.75rem;
}

.section-toggle {
  width: 100%;
  background: var(--bg-soft);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-btn);
  padding: 1rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
}

.section-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  background: #f9fdf5;
}

.section-toggle span:first-child {
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* Inherits base .toggle-icon styles from shared-ui.css */

.section-toggle.active {
  border-color: var(--accent);
  background: #f2f7eb;
  box-shadow: var(--shadow-md);
}

.section-toggle.active .toggle-icon {
  background: var(--accent);
  color: white;
}

/* Section Body (Collapsible) */
.section-body {
  display: none;
  margin-top: 0.75rem;
  background: var(--bg-card);
  border-radius: 28px;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.section-body.expanded {
  display: block;
  animation: fadeSlideIn 0.3s ease;
  padding: 1rem 1.5rem;
}

.letter-group-cards,
.blend-letter-cards,
.letter-combo-panel .syllables-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 1.5rem;
}

.letter-group-cards,
.blend-letter-cards {
  margin: 0 auto;
}

.letter-group-cards > .letter-combo-card,
.blend-letter-cards > .letter-combo-card,
.letter-combo-panel .syllables-grid > .syllable-card {
  flex: 0 1 calc(25% - 1.125rem);
  max-width: calc(25% - 1.125rem);
  min-width: min(100%, 240px);
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- BLEND GROUPS (CVC Section) ----- */
.blend-group {
  margin-bottom: 2rem;
  border-radius: 30px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.blend-group-header {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.2rem 1.5rem;
  background: #f3efe3;
  border: none;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: inherit;
  text-align: right;
}

.blend-group-header:hover {
  background: #efeadb;
}

.blend-group-header > div:not(.completion-indicator) {
  flex: 1;
  text-align: right;
}

.blend-group-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #3b5e36;
  margin-bottom: 0.2rem;
}

.blend-group-header p {
  font-size: 1rem;
  line-height: 1.5;
  color: #6e7c55;
  margin: 0;
}

.blend-group-header .toggle-icon {
  margin-right: 1rem;
  flex-shrink: 0;
}

.blend-group-header > .completion-indicator {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  border-radius: 50%;
  align-self: center;
  margin-inline-end: 0.6rem;
}

.blend-group-header.active .toggle-icon {
  background: var(--accent);
  color: white;
}

.blend-group-body {
  display: none;
  padding: 1.5rem;
  background: var(--bg-card);
}

.blend-group-body.expanded {
  display: block;
  animation: fadeSlideIn 0.25s ease;
}

/* Letter Combo Card (each letter tile) */
.letter-combo-card {
  background: var(--bg-card);
  border-radius: 28px;
  border: 2px solid var(--border-light);
  overflow: hidden;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.letter-combo-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.letter-card-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.3rem;
  background: #faf7ef;
  border: none;
  border-bottom: 1px solid var(--border-light);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.letter-card-toggle:hover {
  background: #f5f0e4;
}

.letter-card-toggle .toggle-icon {
  margin-right: 0.5rem;
}

.letter-card-toggle.active .toggle-icon {
  background: var(--accent);
  color: white;
}

.letter-combo-panel {
  display: none;
  padding: 1.25rem;
  background: #fffdf8;
}

.letter-combo-panel.expanded {
  display: block;
  animation: fadeSlideIn 0.2s ease;
}

/* Small syllable card variant (for blends) */
.small-syllable-card {
  background: #faf5e8;
  border-radius: 24px;
  padding: 0.8rem;
  border: 1px solid var(--border-light);
  transition: transform 0.15s;
  display: flex;
  justify-content: center;
}

.small-syllable-card .syllable-card {
  box-shadow: none;
  background: transparent;
  padding: 0.5rem;
  width: 100%;
  margin: 0 auto;
}

/* Keep completion badge perfectly circular in blending combo cards */
.letter-combo-panel .syllable-card > .completion-indicator,
.small-syllable-card .syllable-card > .completion-indicator {
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  min-height: 28px;
  max-height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 28px;
}

.syllable-card,
.syllable-text,
.breakdown {
  text-align: center;
}

.breakdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-width: -webkit-fill-available;
  min-width: fit-content;
}

.section-body,
.blend-group-body {
  scroll-margin-top: 1rem;
}

/* Responsive refinements for blending view */
@media (max-width: 1024px) {
  .letter-group-cards > .letter-combo-card,
  .blend-letter-cards > .letter-combo-card,
  .letter-combo-panel .syllables-grid > .syllable-card {
    flex-basis: calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
  }
}

@media (max-width: 700px) {
  .letter-group-cards,
  .blend-letter-cards,
  .letter-combo-panel .syllables-grid {
    gap: 1rem;
  }

  .letter-group-cards > .letter-combo-card,
  .blend-letter-cards > .letter-combo-card,
  .letter-combo-panel .syllables-grid > .syllable-card {
    flex-basis: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .section-toggle {
    padding: 0.8rem 1.2rem;
  }

  .blend-group-header {
    padding: 1rem;
  }

  .blend-group-header h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .letter-card-toggle {
    font-size: 1.2rem;
    padding: 0.9rem 1rem;
  }
  /* .toggle-icon responsive overrides belong in shared-ui.css for consistency */
}

/* Additional focus enhancement for blending buttons */
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 20px;
}
