﻿/* ============================================
   ScenarioStep — Component Styles
   ============================================ */

/* Image + text sections (visual only) */
.scenario-section {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.scenario-image-section {
  flex: 0 0 auto;
  padding-top: clamp(8px, 2svh, 16px);
}

.scenario-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(26svh, 160px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  margin: 0 auto;
}

.scenario-text-section {
  flex: 0 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.scenario-text-block,
.scenario-text-block p,
.scenario-text-block * {
    word-break: keep-all;
    overflow-wrap: break-word;
    line-break: auto;
    white-space: normal;
    font-size: 1rem;
    font-weight: 500;
}
.scenario-text-block span { display: inline; }
.scenario-text-block { hyphens: auto; }

/* Options area (non-scrolling grid) */
.scenario-options-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 0.5rem;
}

/* 2×2 grid; 3-up override with .three */
.scenario-option-wrapper {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 0.35rem;
  row-gap: 0.9rem;
  justify-items: center;
  align-items: center;
  padding: 0.5rem clamp(0.75rem, 6vw, 1.75rem) 1rem;
  box-sizing: border-box;
}

.scenario-option-wrapper.three {
  grid-template-columns: repeat(3, 1fr) !important;
  column-gap: 0.5rem;
  row-gap: 0.75rem;
  padding-left: clamp(0.5rem, 4vw, 1rem);
  padding-right: clamp(0.5rem, 4vw, 1rem);
}
.scenario-option-wrapper.three .scenario-option-button {
  min-width: 0;
  max-width: none;
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* Option cards */
.scenario-option-button {
  position: relative;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 110px;
  min-width: 100px;
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f2f2f2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: opacity .35s ease, transform .35s ease, box-shadow .35s ease, filter .35s ease;
}
.scenario-option-button:hover { transform: scale(1.03); }
@media (pointer: coarse) { .scenario-option-button:hover { transform: none; } }

.scenario-option-button img {
  width: clamp(28px, 8vw, 40px);
  height: clamp(28px, 8vw, 40px);
  margin-bottom: 0.25rem;
}

/* Reveal states (used by markup: ghost/revealed) */
.scenario-option-button.ghost {
  opacity: 0;
  filter: grayscale(100%);
  transform: translateY(6px) scale(.985);
}
.scenario-option-button.revealed {
  opacity: 1;
  filter: none;
  transform: translateY(0) scale(1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

/* Incorrect state (cross out + grey) */
.scenario-option-button.incorrect {
  filter: grayscale(100%);
  opacity: 0.55;
}
.scenario-option-button.incorrect > div {
  text-decoration: line-through;
}
.scenario-option-button.incorrect img {
  opacity: .85;
}

/* Disabled logic:
   - Do NOT hide disabled cards globally (keeps wrong picks visible)
   - Still block interaction
*/
.scenario-option-button:disabled {
  pointer-events: none;
}
.scenario-option-button:disabled:not(.incorrect) {
  /* keep the current visual (ghost or revealed) */
}

/* Prompt row */
.scenario-how-might-feel-row {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.25rem;
}

/* Prompt mirrors card behavior; stays in flow even when hidden */
.scenario-how-might-feel-text {
  font-size: 1.15rem;
  font-weight: bold;
  color: #333;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.scenario-how-might-feel-text.ghost {
  opacity: 0;
  visibility: visible; /* explicitly keep space reserved */
}

.scenario-how-might-feel-text.revealed {
  opacity: 1;
}


/* Tiny phones */
@media (max-width: 350px) {
  .scenario-option-button {
    min-width: 90px;
    max-width: 100px;
    font-size: 0.75rem;
  }
  .scenario-option-button img {
    width: 28px;
    height: 28px;
  }
  .scenario-option-wrapper {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 0.3rem;
    row-gap: 0.8rem;
    padding: 0.5rem 1rem 0.9rem;
  }
  .scenario-option-wrapper.three {
    grid-template-columns: repeat(3, 1fr) !important;
    column-gap: 0.35rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .scenario-option-wrapper.three .scenario-option-button {
    font-size: 0.72rem;
  }
}

/* (Optional) simple fade keyframes if needed elsewhere */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Footer button stays in flow but untouchable when hidden */
.footer-btn-hidden {
  opacity: 0;                 /* visually gone */
  visibility: visible;        /* still occupies space */
  pointer-events: none;       /* can't be tapped */
  transition: opacity .25s ease;
}

.scenario-option-button.ghost {
  opacity: 0;
  filter: grayscale(100%);
  transform: translateY(6px) scale(.985);
  visibility: visible; /* keep in flow; space reserved */
}
