/* Shared styles for the /learn content section.
   Matches the parchment-card look of about.html / faq.html / privacy.html,
   with additions for long-form articles: table of contents, scoring tables,
   callouts, example hands, and the related-reading grid. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><path d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/></g></g></svg>') repeat,
    linear-gradient(135deg, #2c5234 0%, #8B4513 100%);
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 60px;
}

/* ---------- Section navigation (above the card) ---------- */

.learn-nav {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  margin-bottom: 14px;
}

.learn-nav a {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.learn-nav a:hover {
  color: #ffd700;
  text-decoration: underline;
}

.learn-nav a.home {
  color: #ffd700;
}

.learn-nav .sep {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.9rem;
}

/* ---------- The parchment article card ---------- */

.doc {
  width: 100%;
  max-width: 860px;
  background: #e7dcc3;
  padding: 40px clamp(20px, 5vw, 52px);
  border-radius: 16px;
  border: 2px solid #ffd700;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.top-link,
.back-link {
  display: inline-block;
  color: #8B4513;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.top-link { margin-bottom: 12px; }
.back-link { margin-top: 36px; }

.top-link:hover,
.back-link:hover {
  text-decoration: underline;
}

.cards-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8B4513;
  margin-bottom: 8px;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  color: #2c5234;
  margin-bottom: 8px;
  line-height: 1.2;
}

.subtitle {
  color: #5b5342;
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 26px;
}

h2 {
  font-size: 1.32rem;
  color: #2c5234;
  margin-top: 38px;
  margin-bottom: 12px;
  scroll-margin-top: 20px;
}

h3 {
  font-size: 1.08rem;
  color: #3d6b46;
  margin-top: 26px;
  margin-bottom: 8px;
}

p, li {
  color: #2d2a22;
  line-height: 1.68;
  font-size: 1rem;
}

p { margin-bottom: 14px; }

ul, ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

li { margin-bottom: 8px; }

a { color: #8B4513; }

strong { color: #2c5234; }

hr {
  border: none;
  border-top: 1px solid rgba(139, 69, 19, 0.25);
  margin: 34px 0;
}

/* ---------- Table of contents ---------- */

.toc {
  background: rgba(44, 82, 52, 0.07);
  border: 1px solid rgba(44, 82, 52, 0.2);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 8px;
}

.toc h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8B4513;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.toc li {
  margin-bottom: 5px;
  font-size: 0.95rem;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  overflow: hidden;
}

caption {
  caption-side: top;
  text-align: left;
  font-size: 0.85rem;
  color: #5b5342;
  font-style: italic;
  padding-bottom: 8px;
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(139, 69, 19, 0.18);
  font-size: 0.95rem;
  color: #2d2a22;
  line-height: 1.5;
}

th {
  background: #2c5234;
  color: #f4ecd8;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  border-bottom: none;
}

tbody tr:last-child td { border-bottom: none; }

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Callouts ---------- */

.callout {
  border-left: 4px solid #8B4513;
  background: rgba(139, 69, 19, 0.08);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 20px 0;
}

.callout p:last-child { margin-bottom: 0; }

.callout .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8B4513;
  margin-bottom: 6px;
}

.callout.tip {
  border-left-color: #2c5234;
  background: rgba(44, 82, 52, 0.09);
}

.callout.tip .label { color: #2c5234; }

/* ---------- Example hands ---------- */

.hand {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2c5234;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(44, 82, 52, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

.red { color: #a11b28; }

.example {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(139, 69, 19, 0.22);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 20px 0;
}

.example h3 {
  margin-top: 0;
  font-size: 1rem;
}

.example p:last-child,
.example ul:last-child { margin-bottom: 0; }

.example .total {
  border-top: 1px solid rgba(139, 69, 19, 0.3);
  margin-top: 10px;
  padding-top: 10px;
  font-weight: 700;
  color: #2c5234;
}

/* ---------- Glossary definition list ---------- */

dl.glossary { margin-bottom: 8px; }

dl.glossary dt {
  font-weight: 700;
  color: #2c5234;
  font-size: 1.02rem;
  margin-top: 20px;
  scroll-margin-top: 20px;
}

dl.glossary dd {
  margin: 5px 0 0;
  color: #2d2a22;
  line-height: 1.65;
  font-size: 1rem;
}

.alpha-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.alpha-index a {
  display: inline-block;
  min-width: 30px;
  text-align: center;
  padding: 4px 6px;
  background: rgba(44, 82, 52, 0.1);
  border: 1px solid rgba(44, 82, 52, 0.22);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

.alpha-index a:hover {
  background: #2c5234;
  color: #f4ecd8;
}

/* ---------- Related reading grid ---------- */

.related {
  margin-top: 40px;
  border-top: 1px solid rgba(139, 69, 19, 0.25);
  padding-top: 26px;
}

.related h2 {
  margin-top: 0;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8B4513;
  margin-bottom: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.card-grid a {
  display: block;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(139, 69, 19, 0.25);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.card-grid a:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: #8B4513;
  transform: translateY(-2px);
}

.card-grid .card-title {
  display: block;
  font-weight: 700;
  color: #2c5234;
  font-size: 1.02rem;
  margin-bottom: 5px;
}

.card-grid .card-desc {
  display: block;
  color: #5b5342;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ---------- Play call-to-action ---------- */

.play-cta {
  margin-top: 34px;
  background: linear-gradient(135deg, rgba(44, 82, 52, 0.12), rgba(139, 69, 19, 0.12));
  border: 1px solid rgba(44, 82, 52, 0.3);
  border-radius: 12px;
  padding: 22px 24px;
  text-align: center;
}

.play-cta p {
  margin-bottom: 14px;
  color: #2d2a22;
}

.play-cta .btn {
  display: inline-block;
  background: #2c5234;
  color: #ffd700;
  padding: 11px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  border: 1px solid #ffd700;
}

.play-cta .btn:hover { background: #3d6b46; }

/* ---------- Footer ---------- */

footer.page-footer {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.7;
  max-width: 860px;
}

footer.page-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

footer.page-footer a:hover {
  color: #ffd700;
  text-decoration: underline;
}

footer.page-footer .footer-nav {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: center;
}
