/* ============================================================
   FMPM - Radiologie Thoracique / Tuberculose
   Modern UI — 2024 redesign
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- Reset & Box-sizing ------------------------------------ */
html { height: 100%; box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; margin: 0; padding: 0; }

/* --- Design tokens ---------------------------------------- */
:root {
  --primary:       #1a5f8e;
  --primary-dark:  #134a6e;
  --secondary:     #2d9cdb;
  --accent-red:    #e74c3c;
  --accent-green:  #27ae60;
  --bg:            #edf2f7;
  --card:          #ffffff;
  --text:          #2c3e50;
  --text-light:    #636e72;
  --border:        #d6e4f0;
  --shadow:        0 4px 20px rgba(26, 95, 142, 0.12);
  --radius:        12px;
}

/* --- Base -------------------------------------------------- */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  min-height: 100%;
}

p {
  padding: 0 0 16px 0;
  line-height: 1.8em;
  color: var(--text);
}

img { border: 0; max-width: 100%; height: auto; }

/* --- Typography -------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  color: var(--primary) !important;
  margin: 0 0 16px 0 !important;
  padding: 14px 0 8px 0 !important;
  font-weight: 700 !important;
  line-height: 1.3;
}

h1 {
  font-size: 22px !important;
  border-bottom: 2px solid var(--border);
  padding-bottom: 14px !important;
  margin-bottom: 20px !important;
}

h2 { font-size: 19px !important; }

h3 {
  font-size: 16px !important;
  color: var(--primary) !important;
  padding: 0 0 8px 0 !important;
}

h4, h5, h6 {
  font-size: 14px !important;
  color: var(--text) !important;
  padding: 0 0 4px 0 !important;
  margin: 0 0 8px 0 !important;
}

/* --- Links ------------------------------------------------- */
a, a:link {
  color: var(--primary) !important;
  text-decoration: none !important;
  transition: color 0.18s;
}
a:visited { color: #5a6fa0 !important; }
a:hover   { color: var(--secondary) !important; text-decoration: underline !important; }
a:active  { color: var(--primary-dark) !important; }

/* --- Lists ------------------------------------------------- */
ul  { margin: 4px 0 18px 22px; }
ol  { margin: 8px 0 18px 26px; }
ol li { margin: 0 0 10px 0; }

/* ============================================================
   ANKI RESOURCES BANNER (injected by enhancements.js)
   ============================================================ */
#anki-banner {
  background: linear-gradient(90deg, var(--primary-dark) 0%, var(--secondary) 100%);
  color: #fff;
  padding: 9px 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.anki-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
}

.anki-label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  opacity: 0.95;
}

.anki-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.15);
  color: #fff !important;
  text-decoration: none !important;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 4px 13px;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.anki-link:hover {
  background: rgba(255,255,255,0.28) !important;
  border-color: rgba(255,255,255,0.7);
  color: #fff !important;
  text-decoration: none !important;
}

.anki-backup {
  background: rgba(39,174,96,0.28);
  border-color: rgba(39,174,96,0.55);
}
.anki-backup:hover { background: rgba(39,174,96,0.45) !important; }

.anki-source {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.25);
}

/* ============================================================
   LAYOUT
   ============================================================ */
#container_header { display: none !important; }
#container_footer { display: none !important; }

/* Lone paragraph left after container_header removal */
body > p[style*="float: left"] { display: none !important; }

#main {
  width: 100% !important;
  max-width: 1020px;
  margin: 28px auto !important;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  padding-bottom: 0 !important;
}

/* ============================================================
   HEADER / BANNER
   ============================================================ */
#header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--secondary) 100%);
  width: 100% !important;
  padding: 0 !important;
  position: relative;
}

#banner {
  width: 100% !important;
  height: 110px !important;
  background: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 6px;
}

#banner::before {
  content: "Radiologie Thoracique — Tuberculose";
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

#banner::after {
  content: "FMPM · Module d'auto-apprentissage en Pneumologie";
  color: rgba(255,255,255,0.72);
  font-size: 12.5px;
  font-weight: 400;
  text-align: center;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#menubar {
  width: 100% !important;
  height: auto !important;
  background: var(--primary-dark) !important;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0;
}

#nav, #nav ul {
  float: none !important;
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap;
  line-height: normal !important;
  font-size: 13.5px !important;
  font-family: inherit !important;
}

#nav li, #nav li.last {
  float: none !important;
  flex: 1;
  border-right: 1px solid rgba(255,255,255,0.10) !important;
  height: auto !important;
  display: flex;
  align-items: stretch;
  transition: background 0.18s;
}

#nav li.last { border-right: none !important; }

#nav li a, #nav li.last a {
  color: rgba(255,255,255,0.82) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: auto !important;
  padding: 13px 8px !important;
  text-align: center;
  text-decoration: none !important;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.18s;
  letter-spacing: 0.1px;
}

#nav li:hover, #nav li.sfhover { background: var(--secondary) !important; }
#nav li:hover a, #nav li.sfhover a { color: #fff !important; }
#nav a:hover { color: #fff !important; text-decoration: none !important; }

/* selected state */
#nav li.selected { background: rgba(255,255,255,0.08); }

/* Dropdown sub-nav (not used here, but kept safe) */
#nav li ul {
  position: absolute;
  background: #1a5f8e;
  width: auto;
  left: -999em;
  flex-direction: column;
}
#nav li:hover ul { left: auto; }

/* ============================================================
   CONTENT AREA
   ============================================================ */
#site_content {
  width: 100% !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--card) !important;
}

#content {
  text-align: left;
  width: 100% !important;
  padding: 30px 40px !important;
  margin: 0 !important;
  float: none !important;
}

.content_item {
  width: 100% !important;
  margin-bottom: 20px;
}

/* Override fixed-width inline styles */
.content_item > div[style],
div[style*="width:860px"],
div[style*="width: 860px"],
div[style*="width:880px"],
div[style*="width: 880px"] {
  width: 100% !important;
  float: none !important;
}

/* ============================================================
   BREADCRUMB (.clear)
   ============================================================ */
.clear {
  margin-bottom: 20px;
  padding: 8px 14px;
  background: #f0f6fd;
  border-left: 3px solid var(--secondary);
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.clear:empty { display: none; }

.clear a {
  color: var(--primary) !important;
  text-decoration: none !important;
  font-weight: 500;
}
.clear a:hover { text-decoration: underline !important; }

/* ============================================================
   CLINICAL CASE IMAGES (X-rays)
   ============================================================ */
img[src*="cas_pics"] {
  display: block;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  background: #111;
  max-width: 100%;
}

/* ============================================================
   ANSWER / BACK BUTTONS
   ============================================================ */
h3 > a[href*="rcc"],
h3 > a[href*="cc"] {
  display: inline-block;
  background: var(--primary);
  color: #fff !important;
  padding: 9px 22px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  margin-top: 4px;
  transition: background 0.18s, transform 0.12s;
  box-shadow: 0 2px 8px rgba(26,95,142,0.25);
}
h3 > a[href*="rcc"]:hover,
h3 > a[href*="cc"]:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  text-decoration: none !important;
  color: #fff !important;
}

/* ============================================================
   CASE LIST TABLE (cc.html, sommaire.html)
   ============================================================ */
table {
  width: 100% !important;
  border-collapse: collapse;
  margin-bottom: 12px;
}

table td {
  padding: 5px 8px;
  vertical-align: middle;
  line-height: 1.6;
}

/* Category section headers */
table td[colspan="3"] {
  padding-top: 14px;
  padding-bottom: 4px;
}

/* Case links */
table a[href*="cc"] {
  color: var(--primary) !important;
  font-weight: 500;
  text-decoration: none !important;
  transition: color 0.15s;
}
table a[href*="cc"]:hover {
  color: var(--secondary) !important;
  text-decoration: underline !important;
}

/* Hide old GIF bullet images */
img[src*="arr54.gif"],
img[src*="arr6.gif"],
img[src*="3.gif"] {
  display: none !important;
}

/* Style replacement bullets via pseudo-content on parent td */
td:not([colspan]) > img[src*="3.gif"] + a::before {
  content: "▸ ";
  color: var(--secondary);
}

/* Category spans */
.Style1, .Style3 { font-weight: 700 !important; }
.Style2 { color: var(--primary) !important; font-weight: 600 !important; }
.Style5 { color: var(--accent-red) !important; }
.Style6 { color: var(--accent-red) !important; font-weight: 700 !important; }
.Style4 { color: var(--accent-red) !important; font-weight: 700 !important; }

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  width: 100% !important;
  background: var(--primary-dark) !important;
  color: rgba(255,255,255,0.80) !important;
  text-align: center;
  padding: 16px 24px !important;
  margin-bottom: 0 !important;
  height: auto !important;
  font-size: 13px !important;
  font-family: inherit !important;
  border-top: 1px solid rgba(255,255,255,0.08);
}

#footer a,
#footer a:link,
#footer a:visited {
  color: rgba(255,255,255,0.88) !important;
  background: transparent !important;
  text-decoration: none !important;
  font-weight: 500;
  padding: 0 4px;
}
#footer a:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

/* Copyright bar (bottom of body) */
body > div[style*="margin: 1em"] {
  text-align: center !important;
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 800px) {
  #main {
    margin: 0 !important;
    border-radius: 0;
    max-width: 100%;
  }

  #content {
    padding: 20px 18px !important;
  }

  #nav {
    flex-direction: column !important;
  }

  #nav li, #nav li.last {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  }

  #nav li a, #nav li.last a {
    padding: 11px 18px !important;
    justify-content: flex-start !important;
  }

  #banner {
    height: 90px !important;
  }
  #banner::before {
    font-size: 17px;
  }

  .anki-banner-inner {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .anki-link {
    justify-content: center;
  }
}

/* Commented-out legacy cruft from old CSS — kept for reference
a:link { }
a:active { }
a:visited { }
a:hover { }
*/
