/*
Theme Name: CoursMission Foundation
Theme URI: https://coursmission.ma/
Author: The Architector
Description: Lean technical foundation for the CoursMission.ma custom website (Direction B — Le carnet clair).
Version: 0.2.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: coursmission-foundation
*/

:root {
  --ink: #17233b;
  --royal: #174ac6;
  --red: #e64d5b;
  --yellow: #f7c94b;
  --sky: #e8f1ff;
  --paper: #fffdfa;
  --white: #fff;
  --muted: #5e6b80;
  --line: #d8deea;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.shell { width: min(1160px, calc(100% - 44px)); margin: auto; }

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  transform: translateY(-140%);
  background: var(--ink);
  color: #fff;
  padding: 12px;
  z-index: 30;
}
.skip:focus { transform: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 4px solid var(--red);
  outline-offset: 3px;
}

.header {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, .95);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
body.admin-bar .header { top: 32px; }

.nav {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  font-family: "Nunito Sans", sans-serif;
  font-weight: 900;
  font-size: 1.3rem;
  text-decoration: none;
  letter-spacing: -.04em;
}
.brand span { color: var(--royal); }

.navlinks {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.navlinks a {
  text-decoration: none;
  font-size: .91rem;
  font-weight: 700;
}
.navlinks a:hover { color: var(--royal); }

.menu {
  display: none;
  margin-left: auto;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  min-width: 46px;
  min-height: 46px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  background: var(--white);
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cta.primary { background: var(--yellow); }
.cta:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}
.cta.primary:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.cta:not(.primary):hover {
  background: var(--ink);
  color: #fff;
}
.cta:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ink);
}

.hero {
  padding: 70px 0 80px;
  display: grid;
  grid-template-columns: 1.14fr .86fr;
  gap: 54px;
  align-items: center;
}
.hero > div { min-width: 0; }
.crumb {
  font-size: .78rem;
  font-weight: 700;
  color: var(--royal);
  text-transform: uppercase;
  letter-spacing: .11em;
}
.hero h1, h2, h3 {
  font-family: "Nunito Sans", sans-serif;
  line-height: 1.04;
  letter-spacing: -.04em;
}
.hero h1 {
  font-size: clamp(2.65rem, 4vw, 4rem);
  font-weight: 900;
  margin: 18px 0 24px;
  max-width: 15ch;
}
.hero h1 mark {
  background: var(--yellow);
  color: inherit;
  padding: 0 .08em;
  border-radius: 3px;
  white-space: nowrap;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lead {
  font-size: 1.19rem;
  color: var(--muted);
  max-width: 620px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.note {
  position: relative;
  background: var(--white);
  border: 2px solid var(--ink);
  padding: 34px 32px 28px;
  box-shadow: 12px 12px 0 var(--sky);
  transform: none;
}
.note:before {
  content: "POUR COMMENCER";
  position: absolute;
  top: -18px;
  left: 28px;
  background: var(--red);
  color: #fff;
  padding: 8px 14px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.note h2 {
  font-size: 1.85rem;
  margin: 12px 0 18px;
}
.prompt {
  display: flex;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px dashed #a8b2c4;
}
.prompt b {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  height: 34px;
  background: var(--sky);
  border-radius: 50%;
  font-family: "Nunito Sans", sans-serif;
}
.prompt span { font-size: .96rem; }
.note small {
  display: block;
  color: var(--muted);
  margin-top: 14px;
}
.tabbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.tabbar button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 13px;
  font: inherit;
  font-size: .88rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.tabbar button:hover, .tabbar button.active {
  background: var(--royal);
  color: #fff;
  border-color: var(--royal);
}

.trustbar {
  background: var(--ink);
  color: #fff;
}
.trustgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.trustitem {
  padding: 24px 28px;
  border-right: 1px solid rgba(255, 255, 255, .2);
}
.trustitem:last-child { border: 0; }
.trustitem b {
  display: block;
  font-family: "Nunito Sans", sans-serif;
  font-size: 1.15rem;
}
.trustitem span {
  font-size: .88rem;
  color: #cbd4e6;
}

.section { padding: 92px 0; }
.section.white {
  background: #fff;
  border-block: 1px solid var(--line);
}
.sectionhead {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 48px;
  margin-bottom: 42px;
  align-items: end;
}
.eyebrow {
  font-size: .76rem;
  color: var(--royal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.sectionhead h2, .method h2, .faq h2 {
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -.04em;
  margin: 8px 0 0;
}
.sectionhead p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 620px;
}

.subjectgrid {
  display: grid;
  grid-template-columns: 1fr 1fr .72fr;
  gap: 18px;
}
.subject {
  position: relative;
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 30px;
  min-height: 285px;
  display: flex;
  flex-direction: column;
}
.subject.maths { border-top: 8px solid var(--royal); }
.subject.physics { border-top: 8px solid var(--red); }
.subject.future {
  border-top: 8px solid var(--yellow);
  background: #fff;
}
.subject .code {
  font-family: "Nunito Sans", sans-serif;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .1em;
  color: var(--muted);
}
.subject h3 {
  font-family: "Nunito Sans", sans-serif;
  font-size: 1.75rem;
  margin: 24px 0 12px;
}
.subject p {
  color: var(--muted);
  margin: 0;
}
.textlink {
  display: inline-flex;
  margin-top: auto;
  padding-top: 24px;
  font-weight: 700;
  text-underline-offset: 5px;
  transition: transform .2s ease, color .2s ease;
}
.textlink:hover {
  transform: translateX(5px);
  color: var(--red);
}

.experience {
  padding: 76px 0;
  background: var(--royal);
  color: #fff;
}
.experiencegrid {
  display: grid;
  grid-template-columns: .62fr 1.38fr;
  gap: 60px;
  align-items: center;
}
.bigproof {
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(4.8rem, 10vw, 8rem);
  line-height: .8;
  font-weight: 900;
  letter-spacing: -.07em;
  color: var(--yellow);
}
.bigproof span {
  display: block;
  font-family: "Atkinson Hyperlegible", sans-serif;
  font-size: .9rem;
  line-height: 1.3;
  letter-spacing: .02em;
  color: #fff;
  margin-top: 20px;
}
.experience h2 {
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -.04em;
  margin: 8px 0 18px;
  max-width: 15ch;
}
.experience p {
  color: #e4ebff;
  max-width: 680px;
}
.experience .eyebrow { color: var(--yellow); }

.formatgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.format {
  background: #fff;
  border: 1px solid var(--line);
  padding: 28px;
  min-height: 230px;
  position: relative;
}
.format:before {
  content: attr(data-mode);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--yellow);
  font-family: "Nunito Sans", sans-serif;
  font-weight: 900;
}
.format h3 {
  font-family: "Nunito Sans", sans-serif;
  font-size: 1.5rem;
  margin: 26px 0 10px;
}
.format p {
  color: var(--muted);
  margin: 0;
}
.sectionaction { margin-top: 30px; }

.needs {
  padding: 86px 0;
  background: var(--sky);
  border-block: 1px solid #cbd9f3;
}
.needgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.need {
  background: #fff;
  border: 1px solid #c8d3e7;
  padding: 24px;
  min-height: 220px;
}
.need b {
  font-family: "Nunito Sans", sans-serif;
  font-size: .75rem;
  letter-spacing: .1em;
  color: var(--royal);
}
.need h3 {
  font-size: 1.25rem;
  margin: 22px 0 9px;
}
.need p {
  color: var(--muted);
  margin: 0;
  font-size: .95rem;
}

.method {
  padding: 95px 0;
  background: #fff;
  border-block: 1px solid var(--line);
}
.methodgrid {
  display: grid;
  grid-template-columns: .76fr 1.24fr;
  gap: 62px;
  align-items: start;
}
.methodintro {
  position: sticky;
  top: 112px;
}
.methodintro p {
  color: var(--muted);
  max-width: 460px;
}
.timeline { counter-reset: steps; }
.line {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 20px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}
.line:before {
  content: counter(steps);
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--yellow);
  font-family: "Nunito Sans", sans-serif;
  font-weight: 900;
}
.line h3 {
  font-family: "Nunito Sans", sans-serif;
  margin: 0 0 6px;
  font-size: 1.28rem;
}
.line p {
  margin: 0;
  color: var(--muted);
}

.progress { padding: 90px 0; }
.progressgrid {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 56px;
  align-items: center;
}
.progress h2, .resources h2 {
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3.65rem);
  line-height: 1.03;
  letter-spacing: -.04em;
  margin: 8px 0 18px;
}
.progresscopy p {
  color: var(--muted);
  max-width: 560px;
}
.progressboard {
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 var(--yellow);
  padding: 30px;
}
.progressboard > span {
  font-size: .75rem;
  color: var(--royal);
  font-weight: 700;
  letter-spacing: .1em;
}
.progressrow {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 14px;
  padding: 19px 0;
  border-bottom: 1px dashed #a8b2c4;
}
.progressrow:last-child { border: 0; }
.progressrow i {
  display: block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--ink);
  margin-top: 5px;
}
.progressrow:nth-child(2) i { background: var(--royal); }
.progressrow:nth-child(3) i { background: var(--yellow); }
.progressrow:nth-child(4) i { background: var(--red); }
.progressrow b {
  display: block;
  font-family: "Nunito Sans", sans-serif;
}
.progressrow small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.resources {
  padding: 92px 0;
  background: var(--ink);
  color: #fff;
}
.resources .eyebrow { color: var(--yellow); }
.resourcehead {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 40px;
}
.resourcehead p {
  margin: 0;
  color: #cbd4e6;
  max-width: 650px;
}
.resourcegrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.resource {
  background: #fff;
  color: var(--ink);
  padding: 25px;
  min-height: 260px;
  border-top: 7px solid var(--royal);
  display: flex;
  flex-direction: column;
}
.resource:nth-child(2) { border-color: var(--red); }
.resource:nth-child(3) { border-color: var(--yellow); }
.resource:nth-child(4) { border-color: #69c7ad; }
.resource .status {
  align-self: flex-start;
  background: var(--sky);
  padding: 6px 9px;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .09em;
}
.resource h3 {
  font-size: 1.35rem;
  margin: 25px 0 10px;
}
.resource p {
  color: var(--muted);
  margin: 0;
}
.resource small {
  margin-top: auto;
  padding-top: 20px;
  font-weight: 700;
  color: var(--royal);
}
.resources .sectionaction {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.resources .sectionaction span {
  color: #cbd4e6;
  font-size: .9rem;
}
.resources .cta { color: var(--ink); }

.faq { padding: 95px 0; }
.faqhead {
  max-width: 720px;
  margin-bottom: 38px;
}
.faqhead p { color: var(--muted); }
.faqlist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.faq details {
  background: #fff;
  border: 1px solid var(--line);
  padding: 0 22px;
}
.faq details[open] {
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--sky);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 38px 20px 0;
  font-family: "Nunito Sans", sans-serif;
  font-weight: 800;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:after {
  content: "+";
  position: absolute;
  right: 0;
  top: 13px;
  font-size: 1.7rem;
  color: var(--royal);
}
.faq details[open] summary:after { content: "−"; }
.faq details p {
  color: var(--muted);
  margin: 0;
  padding: 0 0 22px;
}

.contact {
  margin: 10px auto 85px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 30px;
  background: var(--ink);
  color: #fff;
  padding: 44px;
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 var(--yellow);
}
.contact h2 {
  font-family: "Nunito Sans", sans-serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1;
  margin: 0;
  max-width: 16ch;
}
.contact p {
  color: #cbd4e6;
  margin: 12px 0 0;
}
.contactactions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.contact .cta {
  background: #fff;
  color: var(--ink);
}
.contact .cta.primary { background: var(--yellow); }

footer {
  padding: 26px 0 40px;
  color: var(--muted);
  font-size: .86rem;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.foot a { text-underline-offset: 4px; }

@media (max-width: 960px) {
  .navlinks { gap: 14px; }
  .navlinks a:nth-child(5) { display: none; }
  .subjectgrid { grid-template-columns: 1fr 1fr; }
  .subject.future { grid-column: 1 / -1; min-height: auto; }
  .experiencegrid { grid-template-columns: .8fr 1.2fr; }
  .needgrid, .resourcegrid { grid-template-columns: 1fr 1fr; }
  .need:nth-child(2), .need:nth-child(4) { transform: none; }
  .methodgrid { grid-template-columns: 1fr; }
  .methodintro { position: static; }
  .faqlist { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .navlinks, .nav > .cta { display: none; }
  .menu { display: block; }
  .nav.open .navlinks {
    display: flex;
    position: absolute;
    top: 76px;
    left: 20px;
    right: 20px;
    flex-direction: column;
    background: #fff;
    padding: 22px;
    border: 2px solid var(--ink);
    box-shadow: 7px 7px 0 var(--sky);
  }
  .nav.open .navlinks a { display: block; }
  .hero { grid-template-columns: 1fr; }
  .note { max-width: 650px; }
  .trustgrid { grid-template-columns: 1fr; }
  .trustitem {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
  }
  .sectionhead, .experiencegrid, .progressgrid, .resourcehead { grid-template-columns: 1fr; }
  .bigproof { font-size: 5.8rem; }
  .formatgrid { grid-template-columns: 1fr 1fr; }
  .format:last-child { grid-column: 1 / -1; }
  .contact { grid-template-columns: 1fr; }
  .contactactions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .shell { width: calc(100% - 28px); }
  .nav { height: 68px; }
  .nav.open .navlinks {
    top: 68px;
    left: 14px;
    right: 14px;
  }
  .hero {
    padding: 50px 0 62px;
    gap: 48px;
  }
  .hero h1 {
    font-size: 2.14rem;
    line-height: 1.08;
    max-width: 14ch;
  }
  .lead { font-size: 1.05rem; }
  .actions { flex-direction: column; }
  .cta {
    width: 100%;
    padding-inline: 14px;
  }
  .note {
    padding: 32px 21px 24px;
    box-shadow: 7px 7px 0 var(--sky);
  }
  .note h2 { font-size: 1.6rem; }
  .trustitem { padding: 19px 0; }
  .section, .needs, .method, .progress, .resources, .faq { padding: 70px 0; }
  .sectionhead, .resourcehead { gap: 20px; }
  .sectionhead h2, .method h2, .progress h2, .resources h2, .faq h2 { font-size: 2.25rem; }
  .subjectgrid, .needgrid, .formatgrid, .resourcegrid { grid-template-columns: 1fr; }
  .subject.future, .format:last-child { grid-column: auto; }
  .subject { min-height: 245px; }
  .need { min-height: auto; }
  .experience { padding: 62px 0; }
  .bigproof { font-size: 5rem; }
  .line {
    grid-template-columns: 52px 1fr;
    gap: 14px;
  }
  .line:before {
    width: 42px;
    height: 42px;
  }
  .progressboard {
    padding: 23px;
    box-shadow: 7px 7px 0 var(--yellow);
  }
  .resource { min-height: 225px; }
  .faq details { padding: 0 17px; }
  .contact {
    margin-bottom: 70px;
    padding: 30px 24px;
    box-shadow: 7px 7px 0 var(--yellow);
  }
  .contactactions { flex-direction: column; }
  .foot { flex-direction: column; }
}
.footnav {
  margin-top: 8px;
  display: block;
}
.wa-float {
  display: none;
}
@media (max-width: 860px) {
  .wa-float {
    display: block;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--yellow);
    color: var(--ink);
    padding: 12px 18px;
    border: 2px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    font-family: "Nunito Sans", sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
