/* ─────────────────────────────────────────────────────────────────────────
   JorTech — sections.css
   Styles for all main-site content sections below the hero.
   ───────────────────────────────────────────────────────────────────────── */


/* ── Section wrapper & header ── */
.sw { max-width: 960px; margin: 0 auto; padding: 5rem 2rem; }

.sh { margin-bottom: 2.5rem; }
.sh h2 {
  font-size:   1.5rem;
  font-weight: 800;
  display:     flex;
  align-items: center;
  gap:         .7rem;
}
/* Coloured left-border titleColor before each heading */
.sh h2::before {
  content:       "";
  display:       inline-block;
  width:         4px;
  height:        1.3em;
  background:    var(--titleColor);
  border-radius: 3px;
}
.sh p { color: var(--muted); font-size: .9rem; margin-top: .4rem; }


/* ── Expertise panels (alternating image/text) ── */
.panel {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  min-height:            480px;
  overflow:              hidden;
}
.panel.rev { direction: rtl; }
.panel.rev > * { direction: ltr; }

.panel-img {
  position:   relative;
  overflow:   hidden;
  min-height: 380px;
}
.panel-img img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  transition: transform .6s;
  filter:     brightness(.75) saturate(1.1);
}
.panel:hover .panel-img img { transform: scale(1.04); }

/* Right-fade into background */
.panel-img::after {
  content:        "";
  position:       absolute;
  inset:          0;
  background:     linear-gradient(to right, transparent 60%, var(--bg) 100%);
  pointer-events: none;
}
.panel.rev .panel-img::after {
  background: linear-gradient(to left, transparent 60%, var(--bg) 100%);
}

.panel-content {
  display:         flex;
  flex-direction:  column;
  justify-content: center;
  padding:         4rem 3rem 4rem 2rem;
  background:      var(--bg);
}
.panel.rev .panel-content { padding: 4rem 2rem 4rem 3rem; }

.pnum { font-size: .72rem; color: var(--titleColor); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 1rem; font-weight: 600; }
.ptitle {
  font-size:      clamp(1.4rem, 3vw, 2rem);
  font-weight:    800;
  letter-spacing: -.5px;
  line-height:    1.2;
  margin-bottom:  1rem;
}
.ptitle span { color: var(--titleColor); }
.pdesc { color: var(--muted); font-size: .92rem; margin-bottom: 1.5rem; line-height: 1.7; }

/* Technology tags */
.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
/* Section titleColor colour per section */
#qt       { --tagColor: 88,166,255; --tagColorText: #58a6ff; --titleColor: rgba(var(--tagColor), 1); }
#embedded { --tagColor: 63,185,80;  --tagColorText: #3fb950; --titleColor: rgba(var(--tagColor), 1); }
#quality  { --tagColor: 240,180,41; --tagColorText: #f0b429; --titleColor: rgba(var(--tagColor), 1); }
#services { --tagColor: 240,180,41; --tagColorText: #f0b429; }


/* Base tag */
.t {
  font-size:     .72rem;
  padding:       .25rem .6rem;
  border-radius: 4px;
  border:        1px solid transparent;
}

/* Primary tag — vibrant titleColor */
.t.tag--primary {
  background:   rgba(var(--tagColor), .15);
  border-color: rgba(var(--tagColor), .45);
  color:        var(--tagColorText);
}

/* Secondary tag — same colour, lower intensity */
.t.tag--secondary {
  background:   rgba(var(--tagColor), .06);
  border-color: rgba(var(--tagColor), .18);
  color:        color-mix(in srgb, var(--tagColorText) 55%, var(--muted));
}

/* ── Quality diagram panel ── */
.diag-panel {
  background:      #080C12;   /* même couleur que le fond global */
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  padding:         2rem;
  cursor:          zoom-in;   /* indique que c'est cliquable */
}

/* Supprime le dégradé latéral hérité de .panel-img::after */
.diag-panel::after { display: none; }

/* Icône "expand" en haut à droite — apparaît au hover */
.diag-panel::before {
  content:        "";
  position:       absolute;
  top:            .8rem;
  right:          .8rem;
  width:          32px;
  height:         32px;
  border-radius:  6px;
  background:
    rgba(255,255,255,.1)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  border:         1px solid rgba(255,255,255,.15);
  opacity:        0;
  transition:     opacity .2s, transform .2s;
  pointer-events: none;
  z-index:        3;
}
.diag-panel:hover::before  { opacity: 1; transform: scale(1.1); }

/* L'image SVG s'adapte en largeur, hauteur auto */
.diag-panel img {
  width:      100%;
  height:     auto !important;
  object-fit: contain;
  filter:     none;
  display:    block;
  margin:     auto;
  transition: opacity .2s;
}
.diag-panel:hover img  { opacity: .88; }
.diag-panel:hover img  { transform: none; } /* annule le scale du panel parent */


/* ── Diagram lightbox ────────────────────────────────────────────────────
   Ouverture via openDiagLb() (voir index.html).
   - Desktop : affiche quality-slide-horitonzal.svg
   - Mobile  : affiche quality-slide-vertical.svg
   Fermeture : clic backdrop | bouton ✕ | touche Escape
   ─────────────────────────────────────────────────────────────────────── */
.diag-lb {
  position:        fixed;
  inset:           0;
  z-index:         9999;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         2rem;

  /* Fond sombre flouté */
  background:      rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Caché par défaut */
  opacity:         0;
  pointer-events:  none;
  transition:      opacity .3s ease;
  cursor:          pointer; /* clic backdrop → ferme */
}
.diag-lb.open {
  opacity:        1;
  pointer-events: all;
}

/* Image dans le lightbox */
.diag-lb-img {
  max-width:     92vw;
  max-height:    88vh;
  width:         auto;
  height:        auto;
  border-radius: 12px;
  box-shadow:    0 32px 96px rgba(0,0,0,.7);
  cursor:        default; /* clic image → ne ferme pas */

  /* Animation d'entrée */
  transform:     scale(.92);
  transition:    transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}
.diag-lb.open .diag-lb-img { transform: scale(1); }

/* Bouton fermer ✕ */
.diag-lb-close {
  position:        absolute;
  top:             1.2rem;
  right:           1.2rem;
  width:           44px;
  height:          44px;
  border-radius:   50%;
  background:      rgba(255,255,255,.1);
  border:          1px solid rgba(255,255,255,.2);
  color:           #fff;
  font-size:       1.1rem;
  display:         flex;
  align-items:     center;
  justify-content: center;
  cursor:          pointer;
  transition:      background .2s, transform .2s;
  z-index:         1;
}
.diag-lb-close:hover { background: rgba(255,255,255,.22); transform: scale(1.1); }

/* Petit hint texte en bas */
.diag-lb-hint {
  position:    absolute;
  bottom:      1.2rem;
  left:        50%;
  transform:   translateX(-50%);
  font-size:   .75rem;
  color:       rgba(255,255,255,.35);
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
}


/* ── Service cards ── */
.g3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.6rem;
  position: relative;
  overflow: hidden;
}

/* Coloured top titleColor stripe */
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.card.c1::before { background: linear-gradient(90deg, var(--titleColor),  #0d6efd); }
.card.c2::before { background: linear-gradient(90deg, var(--accent2), #00ff88); }
.card.c3::before { background: linear-gradient(90deg, var(--accent3), #ff6b35); }

.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .6rem; }
.card ul { list-style: none; }
.card ul li { font-size: .84rem; color: var(--muted); padding: .2rem 0; }
.card ul li::before { content: "→ "; color: var(--titleColor); }


/* ── Tech stack grid ── */
.sg { display: grid; grid-template-columns: repeat(auto-fill, minmax(95px,1fr)); gap: .7rem; }

.si {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: var(--r);
  padding:       .9rem .5rem;
  text-align:    center;
  font-size:     .75rem;
  color:         var(--muted);
  transition:    border-color .2s, color .2s, transform .2s;
  cursor:        default;
}
.si .ico  { font-size: 1.5rem; margin-bottom: .3rem; display: block; }


/* ── Availability calendar ── */
.cals { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px,1fr)); gap: 2rem; }

.cw {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       1.8rem;
}
.cm { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.2rem; }

.cg {
  display:               grid;
  grid-template-columns: repeat(7,1fr);
  gap:                   3px;
}
.ch {
  font-size:      .68rem;
  font-weight:    600;
  color:          var(--muted);
  text-align:     center;
  padding:        .35rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cc {
  aspect-ratio:    1;
  border-radius:   6px;
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  font-size:       .8rem;
  font-weight:     600;
  transition:      transform .15s;
  cursor:          default;
}
.cc:not(.ce):hover { transform: scale(1.08); }
.cc span { font-size: .5rem; text-transform: uppercase; letter-spacing: .5px; margin-top: 1px; }

/* Day state colours */
.ce  { background: transparent; }
.cw2 { background: var(--surface2); color: var(--border); }
.cb  { background: rgba(247,129,102,.12); border: 1px solid rgba(247,129,102,.2); color: var(--accent3); }
.cb span { color: var(--accent3); }
.ca  { background: rgba(63,185,80,.1);   border: 1px solid rgba(63,185,80,.22);  color: var(--accent2); }
.ca span { color: var(--accent2); }

/* Legend */
.cal-legend { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.4rem; }
.cli { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); }
.cld { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* CTA row below calendar */
.cal-cta {
  margin-top:      2rem;
  padding:         1.4rem 1.8rem;
  background:      var(--surface);
  border:          1px solid var(--border);
  border-radius:   var(--r);
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  flex-wrap:       wrap;
  gap:             1rem;
}
.cal-cta p        { color: var(--muted); font-size: .9rem; }
.cal-cta p strong { color: var(--text); }


/* ── Contact box ── */
.cbox {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       3.5rem 2rem;
  text-align:    center;
  position:      relative;
  overflow:      hidden;
}
.cbox::before {
  content:    "";
  position:   absolute;
  inset:      0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(88,166,255,.06) 0%, transparent 70%);
}
.cbox h2 { font-size: 2rem; font-weight: 800; margin-bottom: .8rem; position: relative; }
.cbox p  { color: var(--muted); max-width: 500px; margin: 0 auto 2.5rem; font-size: .95rem; position: relative; }

.clinks { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; position: relative; }
.cc2 {
  display:       flex;
  align-items:   center;
  gap:           .5rem;
  background:    var(--surface2);
  border:        1px solid var(--border);
  padding:       .7rem 1.3rem;
  border-radius: var(--r);
  font-size:     .9rem;
  color:         var(--text);
  transition:    border-color .2s, transform .15s;
}
.cc2:hover { border-color: var(--titleColor); transform: translateY(-2px); text-decoration: none; }


/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding:    2rem;
  font-size:  .82rem;
  color:      var(--muted);
}


/* ── Responsive overrides ── */
@media (max-width: 768px) {
  .panel                { grid-template-columns: 1fr; }
  .panel-img            { min-height: 240px; }
  .panel-img::after     { background: linear-gradient(to top, var(--bg) 0%, transparent 60%) !important; }
  .panel-content        { padding: 2.5rem 1.5rem !important; }
  .panel.rev            { direction: ltr; }

  /* Lightbox : image plein écran sur mobile */
  .diag-lb-img {
    max-width:  96vw;
    max-height: 80vh;
  }
  .diag-lb { padding: 1rem; }
}

/* ── Experience section ── */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}

.exp-card:hover {
  transform: translateY(-3px);
  border-color: var(--titleColor);
}

.exp-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.exp-logo {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  background: #0d1117;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.exp-body {
  padding: 1rem 1rem 1.2rem;
}

.exp-meta {
  font-size: .75rem;
  color: var(--titleColor);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.exp-body h3 {
  font-size: 1rem;
  margin-bottom: .45rem;
}

.exp-desc {
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.6;
  margin-bottom: .8rem;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.exp-tag {
  font-size: .68rem;
  padding: .2rem .45rem;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}