/* Existing content from conditionals.css */
:root {
  /* Primary accent only for actionable UI */
  --cond-primary: #00bfa6;
  --cond-primary-hover: #009e89;
  /* Spacing scale (rem) */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 2.75rem;
}

/* Centred reading column */
.container {
  max-width: 680px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 1.5rem);
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
}

p, li { font-weight: 400; }
.list li + li { margin-top: var(--space-1); }

/*************************  Pill navigation  *************************/
.cond-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0 2.25rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 680px;
  margin-inline: auto;
}

.cond-nav .nav-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

.cond-nav a {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--cond-primary);
  text-decoration: none;
  text-align: center;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: background 180ms ease, color 180ms ease;
}

.cond-nav a:hover {
  background: var(--cond-primary-hover);
  color: #ffffff;
}

.cond-nav a.active {
  background: var(--cond-primary);
  color: #ffffff;
  border-color: var(--cond-primary);
  pointer-events: none;
}

/* Adjust for mobile */
@media (max-width: 480px) {
  .cond-nav .nav-links {
    grid-template-columns: 1fr; /* Stack vertically on mobile */
  }

  .cond-nav a {
    padding: 0.75rem 1rem;
  }
}
/*************************  Comparison table  *************************/
.cond-table th,
.cond-table td {
  border-bottom: 1px solid #e5e7eb;
}
.cond-table th {
  font-weight: 600;
  background: #f3f4f6;
}
.cond-table td,
.cond-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.93rem;
}
.cond-table code {
  background: #eef0f2;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.9em;
}

/*************************  Cards  *************************/
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
}

.card {
  padding: 1.75rem;
  border: none;
  border-radius: 1rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
}
.card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
}
.card .btn { align-self: flex-start; }

/*************************  Buttons  *************************/
.btn-outline {
  border: 2px solid var(--cond-primary);
  color: var(--cond-primary);
  padding: 0.45rem 1.1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.btn-outline:hover {
  background: var(--cond-primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

/*************************  Dark‑mode tweaks  *************************/
@media (prefers-color-scheme: dark) {
  :root {
    --cond-primary: #16e1c4;
    --cond-primary-hover: #12c6ad;
  }
  body { background: #111827; color: #e5e7eb; }
  .cond-table th,
  .cond-table td { border-bottom-color: #374151; }
  .cond-table th { background: #1f2937; }
  .cond-table code { background: #374151; }
  .card { background: #1f2937; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
}

/*************************  Simple click‑carousel  *************************/

.cond-carousel {
  max-width: 420px;
  margin: 0 auto var(--space-4);   /* centred + consistent bottom gap  */
  position: relative;

  /* NEW → centre whole block */
  display: flex;
  flex-direction: column;
  align-items: center;             /* centres slides & arrow row */
}

.slide { display: none; }

.slide.active {
  /* NEW → flex so card can be centred */
  display: flex;
  justify-content: center;
  width: 100%;
}

/* keep card auto-centred on very wide screens */
.cond-carousel .card { margin-inline: auto; }

/* arrow row already centred, no change */
.cond-arrows {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.cond-arrow {
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--cond-primary);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.cond-arrow:hover    { background: var(--cond-primary-hover); transform: translateY(-2px); }
.cond-arrow:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/*************************  More Examples Section  *************************/
.more-examples {
  max-width: 680px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 1.5rem); /* Matches .container padding */
}

/* ==========================================================
   Grammar-tree polish (accordion, CTA, micro-animations)
   ========================================================== */

/* 1. Soft page tint so white cards stand out */
body.page-grammar { background: var(--clr-bg-alt); }          /* add .page-grammar to <body> */

/* 2. Re-skin <details>/<summary> as clean cards */
details {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
  transition: box-shadow .25s ease, transform .25s ease;
}
details:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.06); }

details[open] { box-shadow: 0 4px 20px rgba(0,0,0,.08); }

/* 3. Tidy the summary row */
details summary {
  list-style: none;
  padding: 1rem 1.25rem;
  cursor: pointer;
  position: relative;
  font-weight: 600;
  line-height: 1.4;
}
details summary::-webkit-details-marker { display: none; }    /* Chrome/Safari */
details summary::marker            { content: ''; }          /* Firefox */

details summary::after {           /* animated plus → minus */
  content: '+';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.35rem;
  color: var(--clr-accent);
  transition: transform .25s ease;
}
details[open] summary::after {
  content: '–';
  transform: translateY(-50%) rotate(180deg);
}

/* 4. Inner list alignment */
details ul.list {
  margin: 0.75rem 1.5rem 1rem;
  padding-left: 1rem;          /* uniform indent */
}
details ul.list li { line-height: 1.55; }

/* 5. Dimmed future topics */
.topic-disabled { opacity: .55; }

/* 6. CTA button pop */
.btn { box-shadow: 0 4px 18px rgba(37,99,235,.25); }
@media (hover:hover) {
  .btn:hover { transform: translateY(-2px) scale(1.03); }
}

/* 7. Responsive breathing room */
@media (max-width: 480px) {
  details summary { padding: .85rem 1rem; }
  details ul.list { margin-inline: 1rem; }
}