/* ============================================================
   Inclusive Design Persona Cards — Main Stylesheet
   Colors: #000, #fff, #fffbed, #f6f3f3
   WCAG 2.2 AA compliant
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Atkinson Hyperlegible', sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  color: #000;
  background-color: #fff;
}

/* --- Visually Hidden (accessible text) -------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Skip Link --------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.75rem 1.5rem;
  background: #000;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  text-decoration: none;
  z-index: 1000;
  border-bottom-right-radius: 4px;
}

.skip-link:focus {
  top: 0;
}

/* --- Focus Styles (WCAG 2.2 AA) ---------------------------- */
:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

a:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout ------------------------------------------------- */
.site-header {
  background-color: #000;
  color: #fff;
  padding: 2rem 1.5rem;
}

.site-header .header-inner {
  max-width: 75rem;
  margin: 0 auto;
}

.site-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.site-header .tagline {
  font-size: 1rem;
  color: #fffbed;
  font-style: italic;
}

.site-header a {
  color: #fffbed;
  text-decoration: underline;
}

.site-header a:hover {
  color: #fff;
}

.site-header a:focus-visible {
  outline-color: #fffbed;
}

main {
  max-width: 75rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.site-footer {
  background-color: #f6f3f3;
  border-top: 2px solid #000;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 3rem;
}

/* --- Home Page: Intro -------------------------------------- */
.page-intro {
  max-width: 50rem;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background-color: #fffbed;
  border-left: 4px solid #000;
}

.page-intro p {
  font-size: 1.1rem;
  line-height: 1.75;
}

/* --- Category Sections ------------------------------------- */
.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 0.5rem 1rem;
  background-color: #000;
  color: #fff;
  margin-bottom: 1.25rem;
  border-radius: 2px;
}

/* --- Cards Grid (Home Page) -------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1.25rem;
  list-style: none;
}

/* Each list item wraps an article */
.cards-grid li {
  display: flex;
}

/* --- Card (Home Page Preview) ------------------------------ */
.card-preview {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.card-preview:hover {
  box-shadow: 4px 4px 0 #000;
}

.card-preview__header {
  background-color: #f6f3f3;
  padding: 0.875rem 1rem 0.75rem;
  border-bottom: 1px solid #000;
}

.card-preview__category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background-color: #fffbed;
  color: #000;
  border: 1px solid #000;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.5rem;
}

.card-preview h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.card-preview__name {
  font-size: 0.9rem;
  font-style: italic;
  color: #333;
}

.card-preview__body {
  padding: 0.875rem 1rem;
  flex-grow: 1;
}

.card-preview__backstory {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #222;
}

.card-preview__footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid #000;
  background-color: #f6f3f3;
}

.card-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: bold;
  color: #000;
  text-decoration: underline;
  padding: 0.35rem 0.75rem;
  border: 2px solid #000;
  border-radius: 2px;
  background-color: #fffbed;
  transition: background-color 0.15s ease;
}

.card-link:hover {
  background-color: #000;
  color: #fff;
  text-decoration: none;
}

/* --- Breadcrumb -------------------------------------------- */
.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #000;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.25rem;
  color: #000;
}

.breadcrumb a {
  color: #000;
  text-decoration: underline;
  font-weight: bold;
}

.breadcrumb a:hover {
  text-decoration: none;
}

.breadcrumb [aria-current="page"] {
  font-weight: normal;
  color: #333;
}

/* --- Card Detail Page -------------------------------------- */
.card-detail {
  max-width: 50rem;
}

.card-detail__header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #000;
}

.card-detail__category {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background-color: #000;
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

.card-detail h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.card-detail__persona-name {
  font-size: 1rem;
  font-style: italic;
  color: #333;
}

.card-detail__backstory {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background-color: #f6f3f3;
  border-left: 4px solid #000;
  font-size: 1rem;
  line-height: 1.65;
}

/* Card sections */
.card-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #000;
}

.card-section:last-of-type {
  border-bottom: none;
}

.card-section h2 {
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 2px solid #000;
  display: inline-block;
}

.card-section p {
  line-height: 1.7;
  font-size: 1rem;
}

/* Assistive Technologies list — inline text block, same treatment as clinical examples */
.assistive-tech-list {
  list-style: none;
  padding: 0.75rem 1rem;
  background-color: #f6f3f3;
  border-radius: 2px;
  margin-top: 0.25rem;
}

.assistive-tech-list li {
  display: inline;
  font-size: 0.9rem;
  color: #333;
}

.assistive-tech-list li + li::before {
  content: ", ";
}

/* Clinical Examples */
.clinical-examples {
  font-size: 0.9rem;
  font-style: italic;
  color: #333;
  background-color: #f6f3f3;
  padding: 0.75rem 1rem;
  border-radius: 2px;
}

/* AI Prompt section */
.ai-prompt-section {
  background-color: #fffbed;
  border: 2px solid #000;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.ai-prompt-section h2 {
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.ai-prompt-section p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* AI Prompt wrapper toolbar */
.ai-prompt-wrapper {
  margin: 1rem 0;
}

.ai-prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #000;
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 2px 2px 0 0;
}

.ai-prompt-label {
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Courier New', Courier, monospace;
}

.copy-prompt-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: bold;
  color: #fff;
  background: transparent;
  border: 1px solid #fff;
  border-radius: 2px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.copy-prompt-btn:hover {
  background-color: #fff;
  color: #000;
}

.copy-prompt-btn:focus-visible {
  outline: 3px solid #fffbed;
  outline-offset: 2px;
}

/* AI Prompt code block */
.ai-prompt-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  background-color: #fff;
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 2px 2px;
  padding: 1rem 1.25rem;
  margin: 0;
  overflow-x: auto;
  tab-size: 2;
}

.ai-prompt-code code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
}

.ai-prompt-link {
  display: inline-block;
  font-weight: bold;
  font-size: 1rem;
  color: #000;
  text-decoration: underline;
  padding: 0.6rem 1.25rem;
  border: 2px solid #000;
  border-radius: 2px;
  background-color: #000;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ai-prompt-link:hover {
  background-color: #fff;
  color: #000;
  text-decoration: underline;
}

.ai-prompt-link:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* Related cards inside the card article */
.related-cards-section {
  border-bottom: none;
}

/* --- Related Cards ----------------------------------------- */
.related-cards {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #000;
}

.related-cards h2 {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.related-cards-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.related-cards-list a {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px solid #000;
  border-radius: 2px;
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
  background-color: #f6f3f3;
  transition: background-color 0.15s ease;
}

.related-cards-list a:hover {
  background-color: #000;
  color: #fff;
}

.related-cards-list a[aria-current="page"] {
  background-color: #fffbed;
  border-style: dashed;
  cursor: default;
  pointer-events: none;
}

/* --- Print Button ------------------------------------------ */
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0;
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  font-weight: bold;
  color: #000;
  background-color: #f6f3f3;
  border: 2px solid #000;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.print-btn:hover {
  background-color: #000;
  color: #fff;
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 40rem) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 1.25rem 1rem;
  }

  .site-header {
    padding: 1.25rem 1rem;
  }
}

@media (min-width: 40.0625rem) and (max-width: 64rem) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  }
}

/* --- Print Styles ------------------------------------------ */
@page {
  size: letter portrait;
  margin: 0.5in;
}

@media print {
  /* Hide non-essential elements */
  .no-print,
  .skip-link,
  .site-header,
  .site-footer,
  .breadcrumb,
  .print-btn,
  .related-cards {
    display: none !important;
  }

  html, body {
    font-size: 10pt;
    background: #fff;
    color: #000;
  }

  main {
    padding: 0;
    max-width: 100%;
  }

  /* ── Print card layout ──────────────────────────────────────
     Portrait letter page: 8.5" × 11" with 0.5" margins.
     Usable area: 7.5" wide × 10" tall.
     The card occupies the top half (~5" tall, full 7.5" width).
     Front = left half (3.75" wide), Back = right half (mirrored).
     Fold the right panel behind the left — double-sided card.
     ─────────────────────────────────────────────────────────── */

  .print-card-wrapper {
    display: flex;
    flex-direction: row;
    width: 7.5in;
    height: 4.75in;
    border: 1px solid #000;
    page-break-after: always;
    overflow: hidden;
  }

  .print-card-front,
  .print-card-back {
    width: 50%;
    flex-shrink: 0;
    padding: 0.4in;
    overflow: hidden;
    box-sizing: border-box;
  }

  .print-card-front {
    border-right: 1px dashed #000;
    background: #fff;
  }

  .print-card-back {
    background: #fff;
  }

  .print-card-front .print-category {
    font-size: 7pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid #000;
    display: inline-block;
    padding: 2pt 5pt;
    margin-bottom: 6pt;
  }

  .print-card-front h1 {
    font-size: 14pt;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 3pt;
  }

  .print-card-front .print-name {
    font-size: 9pt;
    font-style: italic;
    margin-bottom: 8pt;
    color: #333;
  }

  .print-card-front .print-backstory {
    font-size: 8.5pt;
    line-height: 1.5;
    padding: 6pt 8pt;
    background: #f6f3f3;
    border-left: 3pt solid #000;
    margin-bottom: 8pt;
  }

  .print-card-front .print-condition {
    font-size: 8.5pt;
    line-height: 1.55;
  }

  .print-card-back h3 {
    font-size: 8pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4pt;
    margin-top: 8pt;
    border-bottom: 1pt solid #000;
    padding-bottom: 2pt;
  }

  .print-card-back h3:first-child {
    margin-top: 0;
  }

  .print-card-back p,
  .print-card-back ul {
    font-size: 8pt;
    line-height: 1.5;
  }

  .print-card-back ul {
    list-style: disc;
    padding-left: 12pt;
  }

  .print-card-back .print-ai-url {
    font-size: 7.5pt;
    font-family: 'Courier New', Courier, monospace;
    word-break: break-all;
    margin-top: 3pt;
  }

  /* Related cards on print front */
  .print-related {
    font-size: 7.5pt;
    margin-top: 8pt;
    padding-top: 6pt;
    border-top: 1pt solid #000;
    line-height: 1.5;
  }

  /* Fold guide at bottom of top half */
  .print-fold-guide {
    display: block !important;
    width: 8.5in;
    text-align: center;
    font-size: 7pt;
    color: #666;
    padding: 4pt 0;
    border-top: 1px dashed #999;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  /* Hide the regular card detail layout during print */
  .card-detail,
  .ai-prompt-section {
    display: none !important;
  }

  /* Show print-only wrapper */
  .print-only {
    display: block !important;
  }
}

/* Hide print-only elements on screen */
.print-only {
  display: none;
}

.print-fold-guide {
  display: none;
}
