/* ==========================================================================
   IFSI Mende · Documentation & Références Pédagogiques
   Design System cohérent, typographie médicale soignée, confort iPad / Apple HIG
   ========================================================================== */

.doc-page {
  margin: 0;
  padding: 0;
  background-color: var(--paper, #fbfaf6);
  color: var(--ink, #142a25);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.doc-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px max(24px, env(safe-area-inset-right, 0px)) 64px max(24px, env(safe-area-inset-left, 0px));
}

.doc-article {
  background: var(--paper-card, #ffffff);
  border: 1px solid var(--line, #e3ded5);
  border-radius: var(--radius-lg, 16px);
  padding: clamp(24px, 5vw, 48px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(20, 42, 37, 0.05));
  color: var(--ink, #142a25);
  line-height: 1.7;
}

.doc-article h1 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", serif;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--green, #175848);
  margin-top: 0;
  margin-bottom: 20px;
  line-height: 1.25;
  border-bottom: 2px solid var(--green-light, #e8f2ee);
  padding-bottom: 14px;
}

.doc-article h2 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: var(--green-dark, #0f3d32);
  margin-top: 36px;
  margin-bottom: 14px;
  line-height: 1.35;
  border-bottom: 1px solid var(--line, #e3ded5);
  padding-bottom: 8px;
}

.doc-article h3 {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 600;
  color: var(--ink-soft, #2d453e);
  margin-top: 28px;
  margin-bottom: 10px;
}

.doc-article p {
  margin: 14px 0;
  font-size: 1rem;
}

.doc-article ul, .doc-article ol {
  margin: 14px 0;
  padding-left: 28px;
}

.doc-article li {
  margin-bottom: 8px;
}

.doc-article a {
  color: var(--green, #175848);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
  touch-action: manipulation;
}

.doc-article a:hover {
  color: var(--gold, #b17b31);
}

.doc-article code {
  background: var(--paper, #fbfaf6);
  border: 1px solid var(--line, #e3ded5);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.doc-article pre {
  background: #142a25;
  color: #e8f2ee;
  padding: 16px 20px;
  border-radius: var(--radius-md, 10px);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 20px 0;
}

.doc-article pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

.doc-article blockquote {
  border-left: 4px solid var(--gold, #b17b31);
  background: var(--gold-light, #fef8ee);
  padding: 14px 20px;
  border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
  margin: 20px 0;
  color: #453216;
  font-style: italic;
}

/* Responsive Table Wrapper */
.doc-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border: 1px solid var(--line, #e3ded5);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 1px 4px rgba(20, 42, 37, 0.04);
}

.doc-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 600px;
  text-align: left;
}

.doc-table-wrap th {
  background: var(--green-light, #e8f2ee);
  color: var(--green-dark, #0f3d32);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line-strong, #c8c2b5);
}

.doc-table-wrap td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line, #e3ded5);
  vertical-align: top;
}

.doc-table-wrap tr:nth-child(even) {
  background: #fbfaf8;
}

.doc-table-wrap tr:last-child td {
  border-bottom: none;
}

/* Footer */
.doc-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px max(24px, env(safe-area-inset-right, 0px)) max(40px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px));
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted, #536b63);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.doc-footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.doc-footer-links a {
  color: var(--green, #175848);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm, 6px);
  background: var(--paper-card, #ffffff);
  border: 1px solid var(--line, #e3ded5);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.doc-footer-links a:hover {
  background: var(--green-light, #e8f2ee);
  border-color: var(--green, #175848);
}

@media (max-width: 900px) {
  .notes-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .notes-header-brand {
    justify-content: flex-start;
  }
  .notes-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}
