/* Merged CSS: generated by reorg */

/* --- css/main.css --- */
.page-notes-wrapper{border:1px dashed #bbb;border-radius:12px;padding:12px;background:#fff}
#page-notes[contenteditable="true"]{min-height:120px;outline:none;cursor:text}
#page-notes:empty:before{content:attr(data-placeholder);opacity:.6}
.page-notes-toolbar{display:flex;align-items:center;gap:8px;font-size:12px;color:#555;margin-bottom:6px}
.page-notes-toolbar button{padding:6px 10px;border-radius:10px;border:1px solid #ddd;background:#f7f7f7}


/* --- css/main.css --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #444;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Header */
header {
    border-bottom: 1px solid #ddd;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 40px;
}

.logo span {
    font-weight: bold;
    font-size: 1.2rem;
    color: #444;
}

nav {
    display: flex;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

nav a:hover,
nav a.active {
    color: #9D4C2D;
    font-weight: bold;
}

.burger {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* Main */
main {
    padding: 3rem 2rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .burger {
        display: block;
    }

    nav {
        display: none;
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 1rem;
    }

    /*nav.show*/ nav.open {
        display: flex;
    }

    .container {
        flex-direction: column;
        align-items: flex-start;
    }
}


.logo img {
    height: 60px;
}

.logo span {
    font-weight: bold;
    font-size: 1.6rem;
    color: #444;
}

.logo .logi {
    color: #9D4C2D; /* rouge brique */
}

header {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 1rem 0 1rem;
    position: relative;
    background-color: #f0f0f0; /* Gris légèrement plus soutenu */
    border-bottom: 3px solid #9D4C2D;
}

.logo-left {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.header-logo {
    height: 50px;
}

.title {
    font-weight: bold;
    font-size: 1.65rem;
    color: #444;
    line-height: 1;
    margin-bottom: 7px;
}

.logi {
    color: #9D4C2D;
}

nav {
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: center;
    flex-grow: 1;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
    font-size: 1.2rem;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

nav a.active {
    color: #9D4C2D;
    font-weight: bold;
}

nav a:hover {
    color: #9D4C2D;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    top: -2px;
}

.user-name {
    font-size: 1.15rem;
    font-weight: bold;
    color: #444;
}

.user-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}


/* ===== Mobile overrides from V7.4 (logo centering, names hidden) ===== */
@media (max-width: 900px) {
  header { position: relative; padding-bottom: 5px; }
  header img[src*="LOGO.png"] {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 100%;
  }
  .title, .user-name { display: none !important; }
}


/* ===== V7.6 mobile tweaks (logo margin + burger menu) ===== */
@media (max-width: 900px) {
  header { position: relative; padding-bottom: 5px; }

  /* Logo centré avec 5px de marge haut/bas */
  header img[src*="LOGO.png"] {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: calc(100% - 7.5px); /* 2.5px top + 5px bottom */
    margin-top: 2.5px;
    margin-bottom: 5px;
  }

  /* Burger visible à droite */
  .burger {
    display: block;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 8px;
    font-size: 26px;
  }

  /* Nav replié par défaut en mobile */
  header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #eee;
    border-top: 3px solid #9D4C2D;
    padding: 8px 12px;
    z-index: 50;
  }
  header nav.open { display: block; }

  /* List styling for dropdown */
  header nav ul {
    flex-direction: column;
    gap: 10px;
    padding: 6px 0;
    margin: 0;
  }
  header nav li { list-style: none; }
  header nav a { display: block; padding: 6px 4px; }
  
  /* Masquer les textes "ArchiLogi" et nom utilisateur en mobile */
  .title, .user-name { display: none !important; }
}


/* ==== V9.1.1 Bento Grid (index only) ==== */
:root{
  --brique:#9D4C2D;
  --header-gray:#F2F2F2; /* Ajuste si ton header utilise un autre gris */
  --page-bg:#FFFFFF;
  --radius:14px;
  --gap:12px;
}

body { background: var(--page-bg); }

.bento{
  padding: clamp(12px,2.5vw,24px);
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--gap);
  grid-auto-rows: clamp(130px, 22vw, 180px); /* cartes carrées */
}

@media (min-width: 700px){
  .bento{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width: 1024px){
  .bento{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width: 1440px){
  .bento{ grid-template-columns: repeat(5, minmax(0,1fr)); }
}

.card{
  background: var(--header-gray);
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:14px;
}
.card > header{ font-weight:700; }

.card-hero{
  grid-column: 1 / -1;
  display:block;
  padding: clamp(16px,3vw,28px);
}
.card-hero h1{ margin:0 0 6px; font-size: clamp(22px, 3.4vw, 36px); }
.card-hero .muted{ margin:0 0 14px; opacity:.7; }
.hero-notes{
  background:#fff; border:1px dashed rgba(0,0,0,.12);
  padding:12px; border-radius:12px;
}

.span-c-2{ grid-column: span 2; }
.span-c-3{ grid-column: span 3; }
.span-c-4{ grid-column: span 4; }
.span-r-2{ grid-row: span 2; }
.span-r-3{ grid-row: span 3; }
.span-r-4{ grid-row: span 4; }
/* ==== /V9.1.1 Bento Grid ==== */


/* ==== V9.1.6 — Overlap Kill + Strict Squares ==== */

/* Reset earlier square/row hacks */
.bento .card::before{ content:none !important; }
.bento{ grid-auto-rows: auto !important; align-items: stretch !important; }
.bento .card{
  position: relative;
  height: auto !important;
  min-height: 0;
}

/* Grid definition (unchanged responsive cols) */
.bento{
  padding: clamp(12px,2.5vw,24px);
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
  grid-auto-flow: row dense;
}
@media (min-width:700px){ .bento{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width:1024px){ .bento{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width:1440px){ .bento{ grid-template-columns: repeat(5, minmax(0,1fr)); } }

/* Hero always on top, full width, no ratio */
.card-hero{ grid-column: 1 / -1; order: -1; min-height: clamp(240px, 38vw, 420px); }
.card-hero .hero-notes{ background:#fff; border:1px dashed rgba(0,0,0,.12); padding:12px; border-radius:12px; }
.card-h{ color:#9D4C2D; font-weight:700; border: none; }

/* Squares & expansions (no row spans to avoid overlap) */
.card.square{ aspect-ratio: 1 / 1; }
.card.wide-2{ grid-column: span 2; aspect-ratio: 2 / 1; }
.card.big-2x2{ grid-column: span 2; aspect-ratio: 1 / 1; }

/* Visuals */
:root{ --header-gray:#F2F2F2; --page-bg:#FFFFFF; }
body{ background:var(--page-bg); }
.card{ background:var(--header-gray); border:1px solid rgba(0,0,0,.06); border-radius:14px; padding:14px; }


/* ==== V9.1.7 — Titles red, squares everywhere (mobile), dedupe, no overlap ==== */

/* Titles: red, no bottom rule */
.card-h, .card > header {
  color:#9D4C2D !important;
  border-bottom:none !important;
  font-weight:700;
}

/* Grid: safe flow, no forced row heights */
.bento { grid-auto-rows: auto !important; grid-auto-flow: row !important; }

/* Cards base */
.card { height:auto !important; min-height:0; background:#F2F2F2; border:1px solid rgba(0,0,0,.06); border-radius:14px; }
body { background:#FFFFFF; }

/* Squares by default (except hero) */
.card.square, .bento .card:not(.card-hero):not(.wide-2):not(.big-2x2):not(.tall-2) {
  aspect-ratio:1/1;
}

/* Desktop/Large: allow special spans */
@media (min-width:1024px){
  .card.wide-2{ grid-column: span 2; aspect-ratio: 2 / 1; }
  .card.big-2x2{ grid-column: span 2; aspect-ratio: 1 / 1; } /* 2 cols wide, height auto based on width so square */
}

/* Mobile/Tablet: normalize heights → all squares even when spanning 2 cols */
@media (max-width:1023.98px){
  .card.wide-2{ grid-column: span 2; aspect-ratio: 1 / 1; }
  .card.big-2x2{ grid-column: span 2; aspect-ratio: 1 / 1; }
}

/* Ensure hero full width and not square */
.card-hero{ grid-column:1 / -1; aspect-ratio:auto; min-height: clamp(240px, 38vw, 420px); }
.card-hero .hero-notes{ background:#fff; border:1px dashed rgba(0,0,0,.12); padding:12px; border-radius:12px; }

/* Kill any legacy decorative underline */
.card .underline, .card hr { display:none !important; }


/* ==== V9.1.9 — Desktop Flow & Alignment Fix ==== */
@media (min-width:1024px){
  .bento{
    grid-auto-flow: row !important; /* no dense packing */
    align-items: start !important;  /* top alignment for all cards */
  }
  .bento .card{
    height: auto !important; /* let content dictate height */
  }
}



/* ==== V9.2.0 — Masonry Grid (JS-assisted) ==== */
:root{ --gap: 12px; }
.bento{
  padding: clamp(12px,2.5vw,24px);
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--gap);
  grid-auto-rows: var(--row, 8px);
  align-items: start;
}
@media (min-width:700px){ .bento{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (min-width:1024px){
  .bento{
    grid-template-columns: repeat(4, minmax(0,1fr));
    grid-auto-flow: dense; /* back-fill holes */
  }
}
@media (min-width:1440px){ .bento{ grid-template-columns: repeat(5, minmax(0,1fr)); } }

/* Column spans */
.card.size-2x1, .card.size-2x2{ grid-column: span 2; }
/* Row spans are computed by JS to match visual height */

/* Visuals preserved */
.card-h{ color:#9D4C2D; font-weight:700; border:none; }
.card{
  background: var(--header-gray, #F2F2F2);
  border:1px solid rgba(0,0,0,.06);
  border-radius:14px;
  padding:14px;
  box-sizing:border-box;
  overflow:hidden;
}
.card-hero{ grid-column:1 / -1; height:auto; }



/* ==== V9.2.1 — Fix: mobile dense + dedupe ==== */
.bento{ grid-auto-flow: dense !important; } /* allow back-fill on all widths */



/* ==== V9.2.2 — Dedupe + No Masonry on Mobile ==== */

  .bento .size-1x2, .bento .size-2x1, .bento .size-2x2{ grid-column: span 2; } /* fill width nicely */
}


/* ==== V9.2.4 — Restore masonry on mobile ==== */
@media (max-width:699px){
  .bento{
    grid-auto-flow: dense !important;
  }
}

/* ==== V9.2.5 — Mobile strict 2-col, no overflow ==== */
.bento{ overflow-x: hidden; }

@media (max-width:699px){
  .bento{
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    grid-auto-flow: dense !important;
    align-items: start !important;
  }
  .bento .card{
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    height: auto !important;
    grid-row-end: auto !important;
  }
  .bento .card.card-hero{ grid-column: 1 / -1; }
  .bento .card.size-1x1{ aspect-ratio: 1 / 1; grid-column: span 1; }
  .bento .card.size-2x1{ aspect-ratio: 2 / 1; grid-column: span 2; }
  .bento .card.size-1x2{ aspect-ratio: 1 / 2; grid-column: span 1; }
  .bento .card.size-2x2{ aspect-ratio: 1 / 1; grid-column: span 2; }
}


/* === V12.1.1 burger fix === */
@media (max-width: 900px) {
  header nav { 
    display: none; 
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  header nav.open { 
    display: flex; 
  }
  header nav ul { 
    flex-direction: column; 
    gap: 0; 
  }
  header nav li { 
    border-top: 1px solid rgba(0,0,0,0.08);
    padding: 10px 0;
  }
}






/* === V12.1.4 mobile menu: full-width opaque background + higher z-index, header unchanged before click === */
@media (max-width: 900px) {
  /* Keep the header row; allow wrap only for the nav line when opened */
  header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* nav will take the next line */
    height: 58px; /* unchanged when closed */
    position: sticky;
    top: 0;
    z-index: 1500;
    background: #f5f5f5;
  }

  /* Dropdown nav line */
  header nav {
    order: 4;
    display: none;
    flex-basis: 100%;
    width: 100%;
    background: #f0f0f0;           /* opaque background */
    border-top: 1px solid #ddd;
    position: relative;             /* enable z-index */
    z-index: 2001;                  /* above page content */
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  }
  header nav.open { display: block; }

  header nav ul {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    margin: 0;
    gap: 0;
  }
  header nav li { 
    list-style: none;
    border-top: 1px solid rgba(0,0,0,0.06);
  }
  header nav li:first-child { border-top: none; }
  header nav a {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
  }

  /* Keep the burger + avatar exactly where they are */
  .logo-left { order: 1; }
  .user-info  { order: 2; }
  #burger     { order: 3; }
}


/* === V12.2.0 Dual header (mobile-only subheader with menu between red bars) === */
#mobile-subheader { display: none; }

@media (max-width: 900px) {
  header nav#main-nav { display: none !important; }

  #mobile-subheader {
    display: block;
    width: 100%;
  }

  #mobile-subheader .mobile-menu-wrap {
    background: #f0f0f0;
    border-top: 3px solid #9D4C2D;
    border-bottom: 3px solid #9D4C2D;
    display: none;
  }

  #mobile-subheader.open .mobile-menu-wrap { display: block; }

  #mobile-menu ul {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
  }
  #mobile-menu li { border-top: 1px solid rgba(0,0,0,0.08); }
  #mobile-menu li:first-child { border-top: none; }
  #mobile-menu a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #444;
    font-weight: 500;
  }

  
}


/* === V12.2.1 Mobile subheader fixed overlay + body scroll lock === */
@media (max-width: 900px) {
  /* Lock scroll when menu is open */
  body.menu-open {
    overflow: hidden;
    height: 100vh;
  }

  /* Subheader container fixed under main header with full width */
  #mobile-subheader.open {
    position: fixed;
    top: calc(58px + 3px); /* header height + red bar */
    left: 0;
    right: 0;
    z-index: 3000;
    width: 100vw;
  }

  #mobile-subheader .mobile-menu-wrap {
    background: #f0f0f0;
    border-top: 3px solid #9D4C2D;
    border-bottom: 3px solid #9D4C2D;
    max-height: 70vh;           /* prevent covering entire screen */
    overflow-y: auto;           /* scroll inside menu if needed */
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
  }

  #mobile-menu ul { padding: 8px 0; }
  #mobile-menu a { padding: 14px 18px; }
}


/* === V12.2.2: remove top red bar on mobile menu === */
@media (max-width: 900px) {
  #mobile-subheader .mobile-menu-wrap {
    border-top: none !important;   /* keep only the bottom red bar */
    border-bottom: 3px solid #9D4C2D !important;
  }
}



/* === Notes de page: style plein + sans cadre === */
.hero-notes{
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
}
.hero-notes .hero-notes-input{
  width: 100%;
  min-height: 180px;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;         /* on colle au conteneur */
  margin-top: 8px;    /* petit espace sous le titre */
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}
.hero-notes .hero-notes-input:focus{
  outline: none;
  box-shadow: none;
}


/* Auto-resize textarea: no manual resize, no scrollbars */
.hero-notes .hero-notes-input {
  resize: none;
  overflow: hidden;
  min-height: calc(1.4em * 4); /* ~4 lignes */
}


/* --- V12.6.2: 4 lignes visibles exactes --- */
.hero-notes .hero-notes-input{
  line-height: 1.3;     /* base for height calc */
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;     /* no scrollbar */
  resize: none;         /* user won't change height manually */
}


/* 1000-char counter */
.hero-notes .notes-counter{
  margin-top: 6px;
  font-size: 0.85rem;
  opacity: 0.65;
  text-align: right;
}


/* warning message under notes */
.hero-notes .notes-warning{
  margin-top: 4px;
  font-size: 0.85rem;
  color: #9D4C2D; /* brick red */
}


/* V12.6.6: 2-line base height */
.hero-notes .hero-notes-input{
  min-height: calc(1.3em * 2); /* ~2 lignes */
}

/* Counter hidden by default; red when shown */
.hero-notes .notes-counter{
  display: none;
  color: #b00020; /* red */
  font-weight: 600;
}


/* V13.1.4: neutralize link look on card titles */
.card-h a,
.card-h a:visited,
.card-h a:hover,
.card-h a:active,
.card-h a:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
}
.card-h a { display: inline-block; width: 100%; }


/* V13.1.6: unify burger menu on `.open` */
@media (max-width: 768px) {
  header nav#main-nav { display: none !important; width: 100%; }
  header nav#main-nav.open { display: flex !important; flex-direction: column; width: 100%; }
  header nav#main-nav.open ul { flex-direction: column; gap: 1rem; margin-top: 1rem; }
  /* Also for optional mobile menu block */
  #mobile-subheader .mobile-menu-wrap { display: none; }
  #mobile-subheader.open .mobile-menu-wrap { display: block; }
}


/* V13.1.6: generic fallback for `.open` */
header nav.open { display: block; }


/* === V17.1.1: Mobile header from V12 structure === */
.burger {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* Mobile menu wrapper */
#mobile-subheader {
  display: none;
}
#mobile-subheader.open {
  display: block;
}
#mobile-subheader .mobile-menu-wrap {
  background: #f0f0f0;
  border-top: 3px solid #9D4C2D;
  border-bottom: 3px solid #9D4C2D;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

@media (max-width: 900px) {
  .burger { display: block; }
  /* Hide desktop nav inside header when mobile menu is shown (optional) */
  body.menu-open #main-nav { display: none; }
  body.menu-open { overflow: hidden; height: 100vh; }
}


/* === V17.1.3: Center logo on mobile & keep burger at right === */
@media (max-width: 900px) {
  header { position: sticky; top: 0; z-index: 1000; }
  header .title, header .user-name { display: none !important; }
  header .logo-left {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  header .burger {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }
  /* Hide desktop nav in mobile viewport to prevent duplication */
  #main-nav { display: none; }
}


/* === V17.1.4: Mobile header layout ===
   - Logo centered
   - Burger at LEFT
   - User photo at RIGHT
*/
@media (max-width: 900px) {
  header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 58px; /* ensure enough height for vertical centering */
  }

  /* Hide text labels in mobile */
  header .title,
  header .user-name { display: none !important; }

  /* Center logo block */
  header .logo-left {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Burger LEFT */
  header .burger {
    position: absolute;
    left: 12px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
  }

  /* User photo RIGHT */
  header .user-info {
    position: absolute;
    right: 12px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  header .user-info .user-photo {
    display: block;
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 50%;
  }

  /* Hide desktop nav in mobile viewport to prevent duplication */
  #main-nav { display: none; }
}


/* --- v17.4.1 Notes polish --- */
/* Carte 1 : pas de cadre dans le cadre, seul l'éditeur est blanc */
.card.card-hero{ background:#f3f4f6; border:1px solid #e5e7eb; border-radius:12px; }
.card.card-hero .hero-notes{ background:transparent; border:none; padding:0; }
.page-notes{ border:none; background:transparent; padding:0; }
.page-notes__toolbar{ margin-bottom:8px; } /* boutons et date reposent sur le fond gris */

/* L'éditeur 'Notes de page' : seul bloc blanc/bordé */
.page-notes__editor{
  background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; min-height:80px;
}

/* Carte 2 : pleine largeur (déjà via span-c-3), garder le style Accueil */
.bento .span-c-3{ grid-column: 1 / -1; }

/* Editeur de la carte 2 : blanc/bordé, le reste sur le fond gris de la carte */
.span-c-3 .js-cards-board .editor textarea{
  width:100%; background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; min-height:120px;
}


/* --- v17.4.2 Notes — 2 couleurs par carte, gris = header, suppression espaces --- */

/* Unifier le gris au gris du header partout */
.card,
.card.card-hero,
.span-c-3 .js-cards-board{ background: var(--header-gray) !important; }

/* Pas d'autres gris/bordures visibles dans la carte 1 (hors éditeur) */
.card.card-hero .hero-notes{ background: transparent !important; border: none !important; padding: 0 !important; }
.page-notes{ border: none !important; background: transparent !important; padding: 0 !important; }
.page-notes__toolbar{ margin-bottom: 8px; }
.page-notes__btn{ background: transparent !important; border: 1px solid #d1d5db; } /* boutons sur fond gris */

/* Seule la zone éditable est blanche */
.page-notes__editor{ background: #fff !important; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px; }

/* Carte 2 : textarea blanc, le reste gris (pas d'autres cadres) */
.span-c-3 .js-cards-board .editor{ margin: 0; }
.span-c-3 .js-cards-board .editor textarea{ background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:12px; min-height:120px; }
.span-c-3 .js-cards-board .create-status{ margin-left:8px; }

/* Réduire l'espace inutile sous la liste */
.span-c-3 .js-cards-board{ padding-bottom: 8px !important; }
.cards-list{ margin-bottom: 0 !important; }
.bento{ gap: 14px !important; } /* léger compactage */


/* --- v17.4.3 Notes — marges extérieures alignées + espace bas réduit --- */
/* 1) Marges extérieures = gap interne */
.bento{ padding-left: var(--gap) !important; padding-right: var(--gap) !important; }
/* 2) Réduire l’espace vide sous la liste des notes */
.span-c-3 .js-cards-board{ padding-bottom: 0 !important; }
.cards-list{ margin-bottom: 0 !important; }
.span-c-3 .js-cards-board > *:last-child{ margin-bottom: 0 !important; }


/* --- v17.4.4 Notes — suppression espace bas par override grid-auto-rows --- */
.notes-bento{ grid-auto-rows: auto !important; } /* cartes s'ajustent à leur contenu */
/* Sécurité : pas de marge/padding résiduel sous la liste */
.notes-bento .js-cards-board{ padding-bottom: 0 !important; margin-bottom: 0 !important; }
.notes-bento .cards-list{ margin-bottom: 0 !important; padding-bottom: 0 !important; }
.notes-bento .cards-list > *:last-child{ margin-bottom: 0 !important; }


/* --- v17.4.6 Notes — alignement haut + suppression hauteurs forcées --- */
.notes-bento{ grid-auto-rows: auto !important; } /* sécurité */
.notes-bento .card{ height:auto !important; min-height:0 !important; align-self:start !important; }
.notes-bento .js-cards-board{ height:auto !important; min-height:0 !important; }
.notes-bento .cards-list{ display:flex !important; flex-direction:column; gap:12px; justify-content:flex-start; align-items:stretch; }
.notes-bento .card-item{ min-height:unset !important; }
.notes-bento .cards-list > *{ margin:0 !important; }
.notes-bento .js-cards-board > *:last-child{ margin-bottom:0 !important; }


/* --- v17.4.7 Notes — désactivation du grid sur cette page pour supprimer l'espace dépendant de la largeur --- */
.notes-bento{
  display:block !important; /* on quitte la grille responsive, cartes empilées */
}
.notes-bento > .card{
  width:100%;
  margin-bottom: var(--gap);
}
.notes-bento > .card:last-child{ margin-bottom: 0; }

/* Neutraliser toutes les règles du bento sur cette page */
.notes-bento{ grid-auto-rows: auto !important; }
.notes-bento > .card{ grid-column:auto !important; grid-row:auto !important; height:auto !important; min-height:0 !important; }



.btn{
  display:inline-block;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}
.btn:disabled{ opacity:.6; cursor:not-allowed; }
.btn.danger{ border-color:#ef4444; color:#b91c1c; }


/* v17.8.1 – Style bouton unifié (a/button) */
.btn, a.btn, a.btn:link, a.btn:visited{
  display:inline-block;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.btn.danger{ border-color:#ef4444; color:#b91c1c; background:#fff; }
.btn:disabled{ opacity:.6; cursor:not-allowed; }


/* v17.8.2 — Notes actives en bento 1×1 (identique petits blocs accueil) */
.page-notes .js-cards-board .cards-status{ display:none !important; } /* retire le titre "Notes actives" */
.page-notes .js-cards-board .cards-list{
  display:grid !important;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--gap);
}
@media (min-width:700px){
  .page-notes .js-cards-board .cards-list{ grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (min-width:1024px){
  .page-notes .js-cards-board .cards-list{ grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width:1440px){
  .page-notes .js-cards-board .cards-list{ grid-template-columns: repeat(5, minmax(0,1fr)); }
}
/* Donner à chaque item l'apparence d'une carte .card de l'accueil */
.page-notes .js-cards-board .card-item{
  background: var(--header-gray);
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,.06);
  padding: 14px;
  display:flex;
  flex-direction: column;
  min-height: 140px;
}
.page-notes .js-cards-board .card-item__meta{ font-weight:600; margin-bottom:6px; }
.page-notes .js-cards-board .card-item__actions{ margin-top:auto; display:flex; gap:8px; flex-wrap:wrap; }

/* v17.8.6 — Notes : couleur de fond personnalisée pour la 2e fiche */
.page-notes .card-notes{
  background: #E7E4D5 !important;
}
/* Neutralise le fond forcé à l'intérieur pour voir la couleur de la carte */
.page-notes .card-notes .js-cards-board{ 
  background: transparent !important; 
}

/* v17.8.8 — Bandeau top gris au sein de la 2e fiche, sans impacter la liste */
.page-notes .card-notes .card-notes-top{
  background: var(--header-gray);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.page-notes .card-notes .card-notes-top .editor textarea{
  width:100%; min-height:140px; border:1px solid #e5e7eb; border-radius:10px; padding:10px; background:#fff;
}
.page-notes .card-notes .card-notes-top .btn{ margin-top:8px; }

/* v17.8.9 — Titre dans le bandeau gris */
.page-notes .card-notes .card-notes-top .card-h{ margin: 0 0 8px; }

/* v17.8.10 — Masquer le 1er titre "Nouvelles notes" au-dessus du bandeau gris */
.page-notes .card-notes > .card-h{ display:none !important; }


/* v17.8.11 — Ajustements présentation notes actives */
/* 1) Réduire la marge extérieure "sable" de la 2e fiche */
.page-notes .card-notes{
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: var(--gap);
  padding-right: var(--gap);
}

/* 2) Centrer les boutons dans chaque note */
.page-notes .js-cards-board .card-item__actions{
  justify-content: center;
  align-items: center;
}

/* 3) Mettre un fond blanc derrière le texte central */
.page-notes .js-cards-board .card-item__body{
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}


/* v17.8.12 — Wrapping du texte + marge entre texte et boutons */
/* Empêcher tout débordement : retour à la ligne automatique y compris mots longs */
.page-notes .js-cards-board .card-item__body{
  white-space: normal;
  overflow-wrap: anywhere;       /* force wrap even on longs mots/URLs */
  word-break: break-word;        /* compat anciens navigateurs */
  word-wrap: break-word;         /* legacy */
  hyphens: auto;
  max-width: 100%;
  box-sizing: border-box;
}

/* Espace constant entre le texte et les boutons */
.page-notes .js-cards-board .card-item{ gap: 10px; }                /* espace entre meta/body/actions */
.page-notes .js-cards-board .card-item__actions{
  margin-top: 10px;              /* mini marge */
}


/* v17.8.13 — Ajuste espacements (x0.5) + supprime marge externe sable */
/* 1) Moitié de l'espace entre texte et boutons */
.page-notes .js-cards-board .card-item{ gap: 5px; }
.page-notes .js-cards-board .card-item__actions{ margin-top: 5px; }

/* 2) Marges externes de la 2e fiche à 0 */
.page-notes .card-notes{ 
  margin: 0 !important;
  padding-left: var(--gap);
  padding-right: var(--gap);
}


/* v17.8.14 — Réduction au max du fond sable + meta allégée */
/* 1) Supprimer marges ET padding externes de la 2e fiche + du board interne */
.page-notes .card-notes{ margin:0 !important; padding:0 !important; }
.page-notes .card-notes .js-cards-board{ padding:0 !important; }
/* 2) Meta : masquer le n° de note, garder seulement l'horodatage, plus petit et gris foncé */
.page-notes .js-cards-board .card-item__meta{ 
  font-size: 60%;
  color: #444;            /* gris foncé */
}
.page-notes .js-cards-board .card-item__meta span:first-child{ display:none; }  /* cache #id */
.page-notes .js-cards-board .card-item__meta span::before{ content:'' !important; } /* supprime le séparateur éventuel */


/* v17.8.15 — Masonry columns sur la liste : largeur fixe, hauteur auto selon contenu */
.page-notes .js-cards-board .cards-list{
  display: block !important;        /* quitte le grid pour masonry */
  column-gap: var(--gap);
  column-fill: balance;
}
@media (max-width: 699px){ .page-notes .js-cards-board .cards-list{ column-count: 1; } }
@media (min-width: 700px){ .page-notes .js-cards-board .cards-list{ column-count: 2; } }
@media (min-width: 1024px){ .page-notes .js-cards-board .cards-list{ column-count: 3; } }
@media (min-width: 1280px){ .page-notes .js-cards-board .cards-list{ column-count: 4; } }
@media (min-width: 1536px){ .page-notes .js-cards-board .cards-list{ column-count: 5; } }

/* Les cartes deviennent des blocs inline pour s'écouler dans les colonnes, avec hauteur basée sur leur contenu */
.page-notes .js-cards-board .card-item{
  display: inline-block;
  width: 100%;
  min-height: 0;                    /* supprime min-height fixe */
  margin: 0 0 var(--gap);
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

/* Conserve les réglages existants */
.page-notes .js-cards-board .card-item__actions{ margin-top: 5px; justify-content: center; }

/* v17.8.16 — Carte 2 auto-hauteur + marge verticale des notes = gap colonnes */
.page-notes .js-cards-board .card-item{ margin: 0 0 var(--gap); }

/* v17.8.17 — Carte 2 full-width, hauteur auto + marge bottom 20px par note */
.page-notes .card-notes{
  height: auto !important;
  min-height: 0 !important;
  grid-row-end: auto !important;
  aspect-ratio: auto !important;
}
/* Bottom-only spacing between notes */
.page-notes .js-cards-board .card-item{
  margin: 0 0 20px 0 !important;
}


/* v17.8.18 — Ajustements demandés */
/* 1) Espacement uniquement en bas des notes = 12px */
.page-notes .js-cards-board .card-item{ margin: 0 0 12px 0 !important; }

/* 2) Retirer le fond sable de la 2e fiche */
.page-notes .card-notes{ background: transparent !important; }

/* 3) Liseré rouge brique autour du bandeau gris de l’éditeur */
:root{ --brick-red: #B7410E; }
.page-notes .card-notes .card-notes-top{
  border: 1px solid var(--brick-red);
  box-shadow: 0 0 0 1px rgba(183,65,14,0.06) inset; /* léger renfort */
  border-radius: 12px;
}

/* 4) Titre principal 50% moins grand sur cette page */
.page-notes .card-hero h1{ font-size: clamp(11px, 1.7vw, 18px) !important; }


/* v17.8.20 — Bordures et horodatage (sans id) */
/* Retirer les filets gris sur les zones grises et la grande 2e fiche */
.page-notes .js-cards-board .card-item{ border: none !important; }
.page-notes .card-notes{ border: none !important; }

/* Ajouter une bordure 1px sur chaque zone de texte (contenu des notes) */
.page-notes .js-cards-board .card-item__body{
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

/* Meta : taille +20% versus l'état 60% => 72%, gris un peu plus clair */
.page-notes .js-cards-board .card-item__meta{
  font-size: 72%;
  color: #555;
}


/* v18.0.1 — Corrige la disparition de la date: forcer l'affichage de .note-date */
.page-notes .js-cards-board .card-item__meta .note-date{ display: inline !important; }

/* v18.0.2 — Texte des notes actives en semi-bold (600) */
.page-notes .js-cards-board .card-item__body{
  font-weight: 600;
}
.page-notes .js-cards-board .card-item__meta,
.page-notes .js-cards-board .card-item__actions{
  font-weight: normal;
}
