/* ==========================================================================
   Software Experiments — feuille de style
   Direction : Material Design moderne, coloré, épuré (sans emprunts "geek")
   Typo : Poppins (titres) + Roboto (texte courant)
   ========================================================================== */

:root{
  /* --- Palette de la charte graphique --- */
  --c-blue:       #4A6FA5;
  --c-sage:       #6B9080;
  --c-terracotta: #C97B63;
  --c-lavender:   #7C83AB;
  --c-ochre:      #D9A05B;
  --c-olive:      #8A9B6E;
  --c-cream:      #F4F1EA;
  --c-beige:      #E8E2D5;
  --c-charcoal:   #4A4A48;
  --c-warmgrey:   #8C8C86;

  /* --- Rôles --- */
  --identity:  var(--c-charcoal); /* en-tête, favicon : couleur de marque */
  --primary:   var(--c-blue);     /* accent interactif : liens, focus, boutons admin */

  --surface-1: var(--c-cream);
  --surface-2: var(--c-beige);

  --text-primary:       var(--c-charcoal);
  --text-secondary:     var(--c-warmgrey);
  --text-on-color:      #FFFFFF;
  --text-on-color-dark: var(--c-charcoal); /* pour accents clairs : terracotta, ocre */

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-1: 0 2px 8px rgba(74,74,72,0.12);
  --shadow-2: 0 10px 30px rgba(74,74,72,0.20);

  --font-heading: 'Poppins', 'Segoe UI', sans-serif;
  --font-body: 'Roboto', 'Segoe UI', sans-serif;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-1);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

/* ---------- En-tête ---------- */
.masthead{
  background: var(--identity);
  color: var(--text-on-color);
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
}

.masthead .logo{
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.masthead .tagline{
  margin-top: 0.9rem;
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 400;
  color: rgba(244,241,234,0.82); /* crème atténuée */
}

.lang-switch{
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.35rem;
  background: rgba(244,241,234,0.14);
  padding: 0.3rem;
  border-radius: 999px;
}
.lang-switch a{
  text-decoration: none;
  color: rgba(244,241,234,0.85);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.lang-switch a.active{
  color: #FFFFFF;
  background: var(--primary);
}

/* ---------- Bandes de logiciels ---------- */
.entry{
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 4rem 6vw;
}

.entry.surface-1{ background: var(--surface-1); }
.entry.surface-2{ background: var(--surface-2); }

.entry.layout-right{ flex-direction: row; }
.entry.layout-left{ flex-direction: row-reverse; }

.entry-media,
.entry-text{
  flex: 1 1 50%;
  min-width: 0;
}

.entry-media{
  display: flex;
  align-items: center;
  justify-content: center;
}

/* cadre photo : conserve le même encombrement, mais sans boîte/fond visible
   — les photos gardent leurs proportions naturelles avec une ombre portée */
.photo-frame{
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 3;
}

.photo-frame img{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition: opacity 0.9s ease-in-out;
}
.photo-frame img.is-active{ opacity: 1; }

.photo-frame.has-photos{ cursor: pointer; }
.photo-frame.has-photos:hover img.is-active{
  box-shadow: 0 16px 38px rgba(32,33,36,0.26);
}
.photo-frame.has-photos:focus-visible{
  outline: 3px solid var(--primary);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}

.photo-frame .no-photo{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.entry-text{
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.entry-name{
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  margin: 0 0 0.9rem;
  color: var(--text-primary);
}

.entry-desc{
  font-size: 1.04rem;
  line-height: 1.7;
  margin: 0 0 1.7rem;
  max-width: 48ch;
  color: var(--text-secondary);
}

.entry-buttons{
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.entry-btn{
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--text-on-color);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.entry-btn:hover{ box-shadow: var(--shadow-2); transform: translateY(-2px); filter: brightness(0.93); }
.entry-btn:focus-visible{ outline: 3px solid var(--text-primary); outline-offset: 2px; }

.entry-btn.btn-blue{ background: var(--c-blue); color: var(--text-on-color); }
.entry-btn.btn-sage{ background: var(--c-sage); color: var(--text-on-color); }
.entry-btn.btn-lavender{ background: var(--c-lavender); color: var(--text-on-color); }
.entry-btn.btn-olive{ background: var(--c-olive); color: var(--text-on-color); }
.entry-btn.btn-terracotta{ background: var(--c-terracotta); color: var(--text-on-color-dark); }
.entry-btn.btn-ochre{ background: var(--c-ochre); color: var(--text-on-color-dark); }

/* ---------- Pied de page ---------- */
.site-footer{
  background: var(--surface-1);
  color: var(--text-secondary);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.85rem;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.site-footer a{ color: var(--primary); text-decoration: none; font-weight: 500; }

.empty-state{
  color: var(--text-secondary);
  background: var(--surface-2);
  text-align: center;
  padding: 5rem 1.5rem;
  font-size: 1.05rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px){
  .entry, .entry.layout-left, .entry.layout-right{
    flex-direction: column;
    padding: 3rem 6vw;
    gap: 2rem;
  }
  /* flex-basis en % ne se résout pas de façon fiable sur une hauteur de
     conteneur indéfinie en colonne (certains navigateurs mobiles réduisent
     alors la zone photo à 0px) : on repasse en taille naturelle. */
  .entry-media,
  .entry-text{
    flex: none;
    width: 100%;
  }
  /* texte puis photo, quel que soit l'ordre normal (gauche/droite) */
  .entry-text{ order: 1; }
  .entry-media{ order: 2; }

  .photo-frame{
    max-width: 100%;
    min-height: 220px; /* garde-fou si aspect-ratio n'était pas respecté */
  }
}

@media (prefers-reduced-motion: reduce){
  .photo-frame img{ transition: none; }
  html{ scroll-behavior: auto; }
}

/* ---------- Lightbox plein écran ---------- */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 22, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 1000;
}
.lightbox.is-open{
  opacity: 1;
  visibility: visible;
}

.lightbox-img{
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
}

.lightbox-close{
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
}
.lightbox-close:hover{ color: rgba(255,255,255,0.7); }

.lightbox-nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.14);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-nav:hover{ background: rgba(255,255,255,0.28); }
.lightbox-prev{ left: 1.25rem; }
.lightbox-next{ right: 1.25rem; }

.lightbox-counter{
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

@media (max-width: 600px){
  .lightbox-nav{ width: 40px; height: 40px; font-size: 1.15rem; }
  .lightbox-prev{ left: 0.5rem; }
  .lightbox-next{ right: 0.5rem; }
  .lightbox-close{ top: 0.75rem; right: 0.75rem; }
}

/* ==========================================================================
   admin.php — styles
   ========================================================================== */
.admin-body{
  background: var(--surface-2);
  font-family: var(--font-body);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
}
.admin-wrap{
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}
.admin-header{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
}
.admin-header h1{
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
  color: var(--identity);
}
.admin-header a{
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--primary);
}
.admin-card{
  background: var(--surface-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 1.85rem;
  margin-bottom: 1.75rem;
}
.admin-card h2{
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  margin-top: 0;
  color: var(--text-primary);
}
.field{ margin-bottom: 1.1rem; }
.field label{
  display: block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}
.field input[type=text],
.field input[type=url],
.field input[type=password],
.field textarea{
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid #DADCE0;
  border-radius: var(--radius-sm);
  background: #FAFAFB;
  transition: border-color 0.15s ease;
}
.field input:focus,
.field textarea:focus{
  outline: none;
  border-color: var(--primary);
}
.field textarea{ min-height: 90px; resize: vertical; }
.field input[type=range]{
  accent-color: var(--primary);
}
.field input[type=color]{
  border: 1.5px solid #DADCE0;
  border-radius: var(--radius-sm);
  background: #FAFAFB;
}
.field-row{ display: flex; gap: 1.2rem; flex-wrap: wrap; }
.field-row .field{ flex: 1 1 260px; }

.btn{
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover{ filter: brightness(0.92); box-shadow: var(--shadow-2); }
.btn.btn-danger{ background: var(--c-terracotta); color: var(--text-on-color-dark); }
.btn.btn-danger:hover{ filter: brightness(0.92); }
.btn.btn-ghost{ background: transparent; color: var(--primary); box-shadow: none; border: 1.5px solid #DADCE0; }
.btn.btn-ghost:hover{ background: var(--surface-2); box-shadow: none; }

.software-row{
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #EEEEF0;
}
.software-row:last-child{ border-bottom: none; }
.thumb{
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #E0E0E0;
  flex-shrink: 0;
}
.software-row .thumb{
  width: 68px;
  height: 68px;
}
.software-row .meta{ flex: 1; min-width: 0; }
.software-row .meta strong{ font-family: var(--font-heading); font-weight: 600; }
.software-row .meta span{ display: block; font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.15rem; }
.software-row .actions{ display: flex; gap: 0.5rem; flex-shrink: 0; }

.reorder{
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}
.reorder form{ margin: 0; }
.btn-arrow{
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1.5px solid #DADCE0;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-arrow:hover:not(:disabled){ background: var(--surface-2); border-color: var(--primary); }
.btn-arrow:disabled{ opacity: 0.3; cursor: default; }

.login-wrap{
  max-width: 380px;
  margin: 6rem auto;
  padding: 2.25rem;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
}
.login-wrap h1{
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  color: var(--identity);
}
.msg{
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  border-left: 4px solid transparent;
  color: var(--text-primary);
}
.msg.msg-ok{ background: rgba(107,144,128,0.14); border-left-color: var(--c-sage); }
.msg.msg-err{ background: rgba(201,123,99,0.16); border-left-color: var(--c-terracotta); }
.hint{ font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.35rem; }
