/* APAFEM — Cabinet APAFEM Cameroun, Centre de Formation
   Professionnelle. Vert profond et pierre, serif, phone-first
   and light. No web fonts, no frameworks: one small file. */

:root {
  --main: #166534;
  --main-deep: #14532d;
  --stone: #f1f6ef;
  --stone-edge: #b9d2ba;
  --ink: #1d2b1d;
  --ink-soft: #4d6350;
  --paper: #ffffff;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.6;
}

.wrap { max-width: 44rem; margin: 0 auto; padding: 0 1rem; }

/* Header */
header.site {
  background: var(--main);
  color: #ffffff;
  border-bottom: 4px solid #f2c230;
}
header.site .wrap { padding-top: 1.1rem; padding-bottom: 0.9rem; }
.school-name {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0;
  letter-spacing: 0.02em;
  font-weight: bold;
}
.school-line { margin: 0.25rem 0 0; font-style: italic; color: #f2c230; font-size: 0.98rem; }

nav.main { background: var(--main-deep); }
nav.main .wrap {
  display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem;
  padding-top: 0.55rem; padding-bottom: 0.55rem;
}
nav.main a {
  color: #ffffff; text-decoration: none; font-size: 1rem;
  padding: 0.3rem 0.1rem;
}
nav.main a:hover, nav.main a:focus { text-decoration: underline; }

/* Body */
main .wrap { padding-top: 1.4rem; padding-bottom: 2rem; }

h1 {
  font-size: 1.65rem; line-height: 1.25; color: var(--main-deep);
  margin: 0 0 0.8rem; border-bottom: 2px solid var(--stone-edge);
  padding-bottom: 0.45rem;
}
h2 { font-size: 1.25rem; color: var(--main); margin: 1.6rem 0 0.5rem; }
h3 { font-size: 1.08rem; margin: 1.2rem 0 0.3rem; }
p { margin: 0.55rem 0; }
.small { font-size: 0.92rem; color: var(--ink-soft); }
.note {
  background: var(--paper); border: 1px solid var(--stone-edge);
  border-left: 4px solid var(--main);
  padding: 0.8rem 1rem; margin: 1rem 0;
}
ol.steps li, ul.plain li { margin: 0.4rem 0; }

/* Doors */
.doors { display: block; margin: 1.2rem 0; }
.door {
  display: block; background: var(--paper); border: 1px solid var(--stone-edge);
  border-top: 4px solid var(--main); padding: 1rem 1.1rem; margin: 0 0 1rem;
  color: var(--ink); text-decoration: none;
}
.door strong { color: var(--main-deep); font-size: 1.12rem; }
.door:hover, .door:focus { border-color: var(--main); }
@media (min-width: 36rem) {
  .doors { display: flex; gap: 1rem; }
  .door { flex: 1; margin: 0; }
}

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 0.8rem 0; background: var(--paper); }
th, td { border: 1px solid var(--stone-edge); padding: 0.5rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--main); color: #ffffff; font-weight: bold; }
caption { caption-side: top; text-align: left; font-style: italic; color: var(--ink-soft); padding-bottom: 0.4rem; }

/* Level sections */
.level { background: var(--paper); border: 1px solid var(--stone-edge); padding: 0.9rem 1.1rem; margin: 0 0 1rem; }
.level h3 { margin-top: 0; color: var(--main-deep); }
.level ul { margin: 0.3rem 0 0.2rem; padding-left: 1.2rem; }
.level li { margin: 0.25rem 0; }

/* Forms */
form { background: var(--paper); border: 1px solid var(--stone-edge); padding: 1rem 1.1rem; }
label { display: block; margin: 0.9rem 0 0.25rem; font-weight: bold; }
input, select, textarea {
  width: 100%; max-width: 30rem; padding: 0.6rem;
  font: inherit; color: var(--ink);
  border: 1px solid var(--ink-soft); background: #fff;
}
button, .btn {
  display: inline-block; background: var(--main); color: #ffffff;
  border: none; padding: 0.75rem 1.4rem; font: inherit; cursor: pointer;
  text-decoration: none; margin-top: 1rem;
}
button:hover, .btn:hover, button:focus, .btn:focus { background: var(--main-deep); }

/* Footer */
footer.site {
  border-top: 2px solid var(--stone-edge);
  color: var(--ink-soft); font-size: 0.92rem;
}
footer.site .wrap { padding-top: 1rem; padding-bottom: 1.6rem; }
footer.site a { color: var(--main); }

/* Education button: gentle blink to draw attention. Its colour comes from
   the nav.main a rule above, exactly like every other navigation button. */
@keyframes edu-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
nav.main a.edu-link { animation: edu-pulse 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  nav.main a.edu-link { animation: none; }
}

/* Referral button glow (SOP 308/309, added 2026-11-16): warm-gold gentle pulse */
a.referral-link{display:inline-block;padding:.15em .7em;border-radius:999px;background:linear-gradient(180deg,#ffe9a8,#f5c542);color:#4a3200;font-weight:700;text-decoration:none;animation:referral-glow 1.8s ease-in-out infinite;box-shadow:0 0 .45em rgba(245,197,66,.85),0 0 1.1em rgba(245,197,66,.5)}
@keyframes referral-glow{0%,100%{box-shadow:0 0 .35em rgba(245,197,66,.6),0 0 .9em rgba(245,197,66,.38);text-shadow:0 0 .25em rgba(255,215,100,.45)}50%{box-shadow:0 0 .75em rgba(255,205,60,.95),0 0 1.7em rgba(255,180,40,.65);text-shadow:0 0 .45em rgba(255,220,120,.9)}}
@media (prefers-reduced-motion: reduce){.referral-link{animation:none}}

/* Header home links (house standard, 2026-11-16): the school's name and
   line in the header lead back to this school's homepage. The look of the
   header is unchanged; the links show themselves on hover and on keyboard
   focus, and carry a visible focus outline for keyboard visitors. */
header.site a.home-link { color: inherit; text-decoration: none; }
header.site a.home-link:hover, header.site a.home-link:focus { text-decoration: underline; }
header.site a.home-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* Text-fit (house standard, 2026-11-16): every text fits its container on
   every screen — fitting only; no words, colours or content change.
   Long unbreakable strings (the school's email addresses among them) wrap
   inside their box instead of pushing the page wider than the screen.
   On narrow screens tables take the screen's own width with fixed layout
   and their words wrap inside their cells, so no table is ever wider
   than the visitor's screen. Wide screens are untouched. */
img, video, iframe, svg { max-width: 100%; }
p, li, td, th, label, caption, .note, .door, .level { overflow-wrap: break-word; }
button, .btn { max-width: 100%; white-space: normal; overflow-wrap: break-word; }
input, select, textarea { max-width: 100%; }
table { max-width: 100%; }
@media (max-width: 36rem) {
  table { table-layout: fixed; font-size: 0.94rem; }
  th, td { padding: 0.4rem 0.35rem; overflow-wrap: break-word; }
}

/* Referral flash (SOP 328, added 2026-11-16 at first build): the gold
   referral band under the nav, shown by the flash script at most twice
   per browser era. Colours match the referral-link glow above. */
.flash{position:relative;background:linear-gradient(180deg,#fff3cf,#ffe9a8);border-bottom:2px solid #f5c542;padding:12px 44px 12px 18px;animation:referral-glow 1.8s ease-in-out infinite}
.flash-text{max-width:44rem;margin:0 auto;color:#4a3200}
.flash-close{position:absolute;top:6px;right:12px;background:none;border:none;font-size:1.5rem;color:#4a3200;cursor:pointer;line-height:1}
@media (prefers-reduced-motion: reduce){.flash{animation:none}}

/* Illustration figures (added for APAFEM at first build, 2026-11-16):
   generated images, always captioned as illustrations. */
figure.hero { margin: 1rem 0; }
figure.hero img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--stone-edge);
}
figure.hero figcaption {
  font-size: 0.9rem; color: var(--ink-soft); font-style: italic;
  padding-top: 0.35rem;
}
