/* Learn Curling pages (docs/learn/) */

.learn .page-eyebrow a {
  color: inherit;
  text-decoration: none;
}

.learn .page-eyebrow a:hover { color: var(--blue-dim); }

.learn a { text-decoration: none; }
.learn a:hover { text-decoration: underline; }

.learn p + p,
.learn hr + p,
.learn .diagram-row + p { margin-top: 1.1rem; }

.learn hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.25rem 0;
}

/* Glossary terms: tap to open the definition, as in the game */
.tip {
  font: inherit;
  color: inherit;
  background: rgba(46,123,196,0.14);
  border: none;
  border-radius: 3px;
  padding: 0 0.2em;
  cursor: pointer;
}

.tip:hover,
.tip:focus-visible { background: rgba(46,123,196,0.26); }

.tip-popover {
  max-width: min(24rem, calc(100vw - 3rem));
  margin: auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--dark-card);
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: 0 20px 40px rgba(14,30,48,0.18);
}

.tip-popover strong { color: var(--text); font-weight: 700; }

.tip-popover::backdrop { background: rgba(14,30,48,0.15); }

/* Diagrams: side by side at the game's relative widths, on every screen size */
.diagram-row {
  display: flex;
  justify-content: center;
  gap: 3%;
  margin: 2rem 0;
}

.diagram {
  display: block;
  height: auto;
  min-width: 0;
}

/* Section contents (Basics intro page) */
.learn-toc {
  margin-top: 2.5rem;
  list-style: none;
  counter-reset: toc;
  border-top: 1px solid var(--rule);
  padding-left: 0 !important;
}

.learn-toc li {
  counter-increment: toc;
  border-bottom: 1px solid var(--rule);
  margin-top: 0 !important;
}

.learn-toc a {
  display: flex;
  gap: 1rem;
  padding: 0.9rem 0;
  color: var(--text);
  font-weight: 500;
}

.learn-toc a::before {
  content: counter(toc);
  color: var(--blue);
  font-weight: 700;
  min-width: 1.25rem;
}

/* Back / Next */
.learn-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.learn-pager a {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: var(--blue);
}

.learn-pager span {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.learn-next { text-align: right; margin-left: auto; }

.learn p strong { font-weight: 600; color: var(--text); }

/* Column rows (text beside a diagram, caption rows, side-by-side text), as laid out in the game */
.learn-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3%;
  margin: 2rem 0;
}

/* Text beside a diagram: any spare columns go between them, diagram against the right edge */
.learn-row-mixed { justify-content: space-between; }

.learn-row-text { align-items: stretch; }

.learn-row-captions {
  align-items: flex-end;
  margin-bottom: -1rem;
}

.learn-row-captions p {
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
}

.learn-col { min-width: 0; }
.learn-col p + p { margin-top: 0.9rem; }
.learn-col .diagram { width: 100%; }

.learn-row-text .learn-col {
  padding: 1.25rem 1.5rem;
  background: var(--dark-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.violation { color: var(--stone); }

/* Phones: stack text-and-diagram rows; diagram rows and caption rows stay side by side, as in the game */
@media (max-width: 560px) {
  .learn-row-mixed,
  .learn-row-text { flex-direction: column; gap: 1.25rem; }
  .learn-row-mixed .learn-col,
  .learn-row-text .learn-col { width: 100% !important; }
  .learn-row-mixed .learn-col-diagram { width: 55% !important; }
}

/* Landing page: topics by section */
.learn-topics-heading {
  margin-top: 2.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone);
}

.learn-topics {
  list-style: none;
  padding-left: 0 !important;
  margin-top: 1rem !important;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}

.learn-topics > li { margin-top: 0 !important; }

.learn-topic-section {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.learn-topics .learn-toc { margin-top: 1rem; }

@media (max-width: 640px) {
  .learn-topics { grid-template-columns: 1fr; }
}

/* Section pages: "On this page", then each topic as its own section */
.learn-onpage {
  margin-top: 2.5rem;
  padding: 1.25rem 1.5rem 0.5rem;
  background: var(--dark-card);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.learn-onpage > p {
  font-size: 0.68rem !important;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--stone) !important;
}

.learn-onpage .learn-toc { margin-top: 0.5rem; border-top: none; }
.learn-onpage .learn-toc li:last-child { border-bottom: none; }

.learn-topic {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 5rem;
}

.learn-topic h2 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .learn-topic { scroll-margin-top: 8rem; }
}
