/* ═══════════════════════════════════════════════════════════════════════════
   SailSchool — Template Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Lesson Template ───────────────────────────────────────────────────── */
.lesson__header { margin-bottom: 1.5rem; }
.lesson__header h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.lesson__subtitle { font-size: 1.05rem; color: var(--text-light); margin-bottom: 0.5rem; }

.lesson__objectives,
.lesson__prerequisites {
  background: var(--sea-pale);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
}

.lesson__objectives h3,
.lesson__prerequisites h3 {
  font-size: 0.9rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.lesson__objectives ul,
.lesson__prerequisites ul {
  list-style: none;
  padding: 0;
}

.lesson__objectives li::before { content: '✓ '; color: var(--teal); font-weight: 700; }
.lesson__prerequisites li::before { content: '→ '; color: var(--accent); }

.lesson__section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.lesson__section:last-child { border-bottom: none; }

.lesson__section h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--sea-pale);
}

.lesson__section p { margin-bottom: 0.75rem; }

.lesson__figure {
  margin: 1rem 0;
  text-align: center;
}

.lesson__figure img {
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.lesson__figure figcaption {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.4rem;
  font-style: italic;
}

.lesson__steps {
  counter-reset: step-counter;
  list-style: none;
  padding: 0;
}

.lesson__step {
  position: relative;
  padding: 0.75rem 0 0.75rem 3rem;
  border-left: 2px solid var(--sea-pale);
  counter-increment: step-counter;
}

.lesson__step::before {
  content: counter(step-counter);
  position: absolute;
  left: -14px;
  top: 0.7rem;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

.lesson__summary {
  background: var(--sand);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.lesson__summary h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }

.lesson__key-terms {
  margin-top: 1.5rem;
}

.lesson__key-terms h3 { font-size: 1.1rem; margin-bottom: 0.75rem; }

.lesson__key-terms dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
}

.lesson__key-terms dt {
  font-weight: 700;
  color: var(--navy);
}

.lesson__key-terms dd {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

/* ─── Callouts ──────────────────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  margin: 1rem 0;
}

.callout__icon { font-size: 1.3rem; flex-shrink: 0; }
.callout p { margin-bottom: 0.4rem; }
.callout p:last-child { margin-bottom: 0; }

.callout--tip     { background: #e8f8f5; border-left: 4px solid var(--teal); }
.callout--warning { background: #fef9e7; border-left: 4px solid var(--amber); }
.callout--info    { background: var(--sea-pale); border-left: 4px solid var(--accent); }
.callout--danger  { background: #fdedec; border-left: 4px solid var(--coral); }

/* ─── Example Box ───────────────────────────────────────────────────────── */
.example-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
}

.example-box__header {
  background: var(--navy);
  color: var(--white);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.example-box__body {
  padding: 1rem;
  background: var(--gray-50);
}

.example-box__body p { margin-bottom: 0.5rem; }

/* ─── Try It Box ────────────────────────────────────────────────────────── */
.try-it {
  border: 2px solid var(--teal);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.25rem 0;
}

.try-it__header {
  background: var(--teal);
  color: var(--white);
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.try-it__body { padding: 1rem; }
.try-it__prompt { font-weight: 500; margin-bottom: 0.75rem; }

.try-it__options { display: flex; flex-direction: column; gap: 0.5rem; }

.try-it__option {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
  transition: all 0.15s;
}

.try-it__option:hover { border-color: var(--accent); background: var(--sea-pale); }
.try-it__option.correct { border-color: var(--teal); background: #e8f8f5; }
.try-it__option.incorrect { border-color: var(--coral); background: #fdedec; }

.try-it__feedback {
  margin-top: 0.75rem;
  padding: 0.6rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.try-it__reveal-btn {
  margin-top: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.try-it__answer {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: 4px;
  border-left: 3px solid var(--teal);
}

/* ─── Reference Template ────────────────────────────────────────────────── */
.reference__header { margin-bottom: 1.5rem; }
.reference__header h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.reference__subtitle { color: var(--text-light); font-size: 1.05rem; }
.reference__intro { margin-bottom: 1.5rem; }

.reference__filter { margin-bottom: 1.25rem; }

.reference__filter input {
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: var(--font-body);
}

.reference__filter input:focus {
  outline: none;
  border-color: var(--accent);
}

.reference__table-wrap { margin-bottom: 2rem; }
.reference__table-wrap h2 { font-size: 1.3rem; margin-bottom: 0.75rem; }

.table-scroll { overflow-x: auto; }

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.ref-table th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ref-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}

.ref-table tr:hover td { background: var(--sea-pale); }

.ref-table__img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
}

.ref-table__color {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
}

.reference__card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: box-shadow 0.15s;
}

.reference__card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.reference__card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.reference__card h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.reference__tags { margin-top: 0.5rem; }

/* ─── Quiz Template ─────────────────────────────────────────────────────── */
.quiz__header { margin-bottom: 1.5rem; }
.quiz__header h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.quiz__subtitle { color: var(--text-light); margin-bottom: 0.5rem; }
.quiz__meta { display: flex; gap: 0.5rem; }

.quiz__question {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.quiz__question-num {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.quiz__question-text { font-size: 1.1rem; margin-bottom: 0.75rem; }

.quiz__question-img {
  max-width: 400px;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.quiz__options { display: flex; flex-direction: column; gap: 0.4rem; }

.quiz__option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.quiz__option:hover { border-color: var(--accent); background: var(--sea-pale); }

.quiz__option input { margin-top: 0.25rem; accent-color: var(--accent); }

.quiz__option.correct { border-color: var(--teal); background: #e8f8f5; }
.quiz__option.incorrect { border-color: var(--coral); background: #fdedec; }

.quiz__explanation {
  margin-top: 0.5rem;
  padding: 0.6rem;
  background: var(--gray-50);
  border-radius: 4px;
  font-size: 0.9rem;
  border-left: 3px solid var(--accent);
}

.quiz__actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }

.quiz__results {
  margin-top: 1.5rem;
  text-align: center;
  padding: 2rem;
  border-radius: 10px;
  background: var(--gray-50);
}

.quiz__score { font-family: var(--font-heading); }

.quiz__score-num {
  font-size: 3rem;
  font-weight: 700;
  color: var(--navy);
}

.quiz__score-total {
  font-size: 1.5rem;
  color: var(--text-light);
}

.quiz__result-msg {
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

/* ─── Diagram Template ──────────────────────────────────────────────────── */
.diagram-page__header { margin-bottom: 1.5rem; }
.diagram-page__header h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.diagram-page__subtitle { color: var(--text-light); font-size: 1.05rem; }
.diagram-page__intro { margin-bottom: 1.5rem; }

.diagram-section { margin-bottom: 2rem; }
.diagram-section h2 { font-size: 1.3rem; margin-bottom: 0.75rem; }

.diagram-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  margin-bottom: 1rem;
}

.diagram-container {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray-50);
}

.diagram-img { display: block; width: 100%; }

.hotspot {
  position: absolute;
  background: none;
  border: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.hotspot__dot {
  display: block;
  width: 16px;
  height: 16px;
  background: var(--coral);
  border: 2px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(231,76,60,0.3);
  animation: hotspot-pulse 2s infinite;
}

@keyframes hotspot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(231,76,60,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(231,76,60,0.1); }
}

.hotspot__label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 0.15em 0.6em;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.diagram-info-panel {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  align-self: start;
  position: sticky;
  top: calc(var(--topnav-h) + 1rem);
}

.diagram-info-panel__placeholder { color: var(--text-light); font-style: italic; font-size: 0.9rem; }

.diagram-info-panel h4 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: var(--navy);
}

/* ─── Cheatsheet Template ───────────────────────────────────────────────── */
.cheatsheet__header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.cheatsheet__header h1 { font-size: 2rem; }
.cheatsheet__subtitle { color: var(--text-light); font-size: 1.05rem; }

.cheatsheet__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.cheatsheet__card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  background: var(--white);
  transition: box-shadow 0.15s;
}

.cheatsheet__card:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.06); }

.cheatsheet__card--blue   { border-top: 4px solid var(--accent); }
.cheatsheet__card--green  { border-top: 4px solid var(--teal); }
.cheatsheet__card--red    { border-top: 4px solid var(--coral); }
.cheatsheet__card--yellow { border-top: 4px solid var(--amber); }

.cheatsheet__card-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }

.cheatsheet__card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.cheatsheet__card ul {
  list-style: none;
  padding: 0;
}

.cheatsheet__card li {
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.9rem;
}

.cheatsheet__card li:last-child { border-bottom: none; }

/* ─── DIY Guide Template ────────────────────────────────────────────────── */
.diy__tools {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-left: 4px solid var(--steel);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.diy__tools h4 {
  font-size: 0.82rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.diy__tools ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.diy__tools li {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2em 0.65em;
  font-size: 0.85rem;
}

.callout--pro {
  background: #f0f3f6;
  border-left: 4px solid var(--steel);
}

/* ─── Responsive overrides ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .diagram-wrap { grid-template-columns: 1fr; }
  .diagram-info-panel { position: static; }
  .lesson__key-terms dl { grid-template-columns: 1fr; }
  .quiz__option { flex-direction: column; }
}

@media print {
  .try-it, .quiz__actions, .reference__filter { display: none !important; }
  .cheatsheet__grid { grid-template-columns: repeat(2, 1fr); }
}
