/*
Theme Name: Casaby
Theme URI: https://www.casaby.com/
Author: Casaby
Description: Thème bloc sur mesure de Casaby (Casablanca) — domiciliation d'entreprise, assistance aux formalités juridiques et hébergement de serveurs. Mise en page à repères d'adresse : filet, marqueur carré et étiquettes en capitales, pour un contenu qui décrit des emplacements et des procédures.
Version: 1.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: casaby
Tags: block-templates, full-site-editing, one-column, custom-colors, editor-style
*/

/* ---------------------------------------------------------------
   1. Repères
--------------------------------------------------------------- */
:root {
  --cb-ink: var(--wp--preset--color--contrast, #1B1A17);
  --cb-ocre: var(--wp--preset--color--primary, #9E6F33);
  --cb-blue: var(--wp--preset--color--accent, #2C6E8F);
  --cb-line: var(--wp--preset--color--line, #E2DCD1);
  --cb-muted: var(--wp--preset--color--muted, #6B6459);
  --cb-surface: var(--wp--preset--color--surface, #F7F5F1);
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ---------------------------------------------------------------
   2. En-tête : le filet ocre/bleu, signature du site
--------------------------------------------------------------- */
.cb-header { border-bottom: 1px solid var(--cb-line); }
.cb-header::after {
  content: "";
  display: block;
  height: 3px;
  margin-top: var(--wp--preset--spacing--30);
  background: linear-gradient(90deg, var(--cb-ocre) 0 42%, var(--cb-blue) 42% 58%, transparent 58%);
}
.cb-header .wp-block-navigation a {
  text-decoration: none;
  font-family: var(--wp--preset--font-family--display, sans-serif);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--cb-ink);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.cb-header .wp-block-navigation a:hover { border-bottom-color: var(--cb-ocre); }

/* ---------------------------------------------------------------
   3. Corps éditorial — le marqueur carré « adresse »
--------------------------------------------------------------- */
.entry-content > h2 {
  position: relative;
  margin-top: var(--wp--preset--spacing--50);
  margin-bottom: var(--wp--preset--spacing--30);
  padding-top: 1.05rem;
  padding-left: 1.15rem;
  border-top: 1px solid var(--cb-line);
}
.entry-content > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.55rem;
  width: 7px;
  height: 7px;
  background: var(--cb-ocre);
}

.entry-content > h3 {
  margin-top: var(--wp--preset--spacing--40);
  margin-bottom: var(--wp--preset--spacing--20);
  padding-left: 1.15rem;
  border-left: 2px solid var(--cb-line);
}

/* Chapô : premier paragraphe */
.entry-content > p:first-of-type {
  font-size: 1.14rem;
  line-height: 1.6;
  background: var(--cb-surface);
  border-left: 3px solid var(--cb-blue);
  padding: 1.1rem 1.3rem;
  margin-bottom: var(--wp--preset--spacing--40);
}

.entry-content ul { list-style: none; padding-left: 0; }
.entry-content ul > li { position: relative; padding-left: 1.35rem; margin-bottom: 0.45rem; }
.entry-content ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--cb-ocre);
}
.entry-content ol { padding-left: 1.2rem; }
.entry-content ol > li { margin-bottom: 0.45rem; }
.entry-content ol > li::marker { color: var(--cb-ocre); font-weight: 700; }

/* ---------------------------------------------------------------
   4. Tableaux
--------------------------------------------------------------- */
.entry-content table, .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  margin: var(--wp--preset--spacing--40) 0;
}
.wp-block-table { overflow-x: auto; }
.entry-content th, .wp-block-table th {
  background: var(--cb-ocre);
  color: #fff;
  text-align: left;
  font-family: var(--wp--preset--font-family--display, sans-serif);
  font-weight: 600;
  padding: 0.7rem 0.85rem;
  border: none;
}
.entry-content td, .wp-block-table td {
  padding: 0.65rem 0.85rem;
  border: none;
  border-bottom: 1px solid var(--cb-line);
  vertical-align: top;
}
.entry-content tbody tr:nth-child(even) td { background: var(--cb-surface); }

/* ---------------------------------------------------------------
   5. FAQ dépliante
--------------------------------------------------------------- */
.entry-content details {
  border: 1px solid var(--cb-line);
  border-left: 3px solid var(--cb-ocre);
  padding: 0.85rem 1.05rem;
  margin-bottom: 0.6rem;
  background: #fff;
}
.entry-content details[open] { background: var(--cb-surface); }
.entry-content summary {
  cursor: pointer;
  font-family: var(--wp--preset--font-family--display, sans-serif);
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 1.7rem;
}
.entry-content summary::-webkit-details-marker { display: none; }
.entry-content summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: -0.15rem;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--cb-ocre);
}
.entry-content details[open] summary::after { content: "\2212"; }
.entry-content details > p { margin: 0.6rem 0 0; }

/* ---------------------------------------------------------------
   6. Encarts et fiches
--------------------------------------------------------------- */
.cb-note, .entry-content .cb-note {
  background: var(--cb-surface);
  border-left: 3px solid var(--cb-blue);
  padding: 1rem 1.2rem;
  font-size: 0.95rem;
  color: var(--cb-muted);
  margin: var(--wp--preset--spacing--40) 0;
}
.cb-note strong { color: var(--cb-ink); }
.cb-note p:last-child { margin-bottom: 0; }

/* Fiche de service : un cadre net, une étiquette en capitales */
.cb-card {
  border: 1px solid var(--cb-line);
  border-top: 3px solid var(--cb-ink);
  padding: 1.4rem 1.5rem;
  height: 100%;
  background: #fff;
}
.cb-card h3 { margin-top: 0; padding-left: 0; border-left: none; }
.cb-card p:last-child { margin-bottom: 0; }

/* Étiquette mono en surtitre */
.cb-label {
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cb-ocre);
  margin-bottom: 0.55rem;
}
.cb-label-blue { color: var(--cb-blue); }

/* Liste de caractéristiques en deux colonnes serrées */
.cb-specs { border-top: 1px solid var(--cb-line); }
.cb-specs p {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--cb-line);
  padding: 0.55rem 0;
  margin: 0;
  font-size: 0.95rem;
}
.cb-specs p strong { flex: 0 0 45%; font-weight: 600; }

/* ---------------------------------------------------------------
   7. Listes d'articles
--------------------------------------------------------------- */
.cb-item { border-top: 1px solid var(--cb-line); padding-top: var(--wp--preset--spacing--30); }
.cb-item .wp-block-post-title { margin: 0 0 0.35rem; font-size: 1.2rem; line-height: 1.3; }
.cb-item .wp-block-post-title a { text-decoration: none; color: var(--cb-ink); }
.cb-item .wp-block-post-title a:hover { color: var(--cb-ocre); }
.cb-item .wp-block-post-excerpt { color: var(--cb-muted); font-size: 0.96rem; }
.cb-item .wp-block-post-date { color: var(--cb-muted); }

.wp-block-query-pagination { border-top: 1px solid var(--cb-line); padding-top: var(--wp--preset--spacing--30); }
.wp-block-query-pagination a { text-decoration: none; }
.wp-block-query-pagination .current { font-weight: 700; color: var(--cb-ocre); }

/* ---------------------------------------------------------------
   8. Pied de page
--------------------------------------------------------------- */
.cb-footer, .cb-footer p, .cb-footer li { color: #D6CFC2; }
.cb-footer h3 {
  color: #fff;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--wp--preset--font-family--mono, monospace);
  font-weight: 400;
}
.cb-footer a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.26); }
.cb-footer a:hover { border-bottom-color: var(--cb-ocre); }

/* ---------------------------------------------------------------
   9. Divers
--------------------------------------------------------------- */
.wp-block-post-terms a { text-decoration: none; color: var(--cb-ocre); }
.entry-content a { text-underline-offset: 0.15em; }
.wp-block-post-featured-image img { display: block; width: 100%; height: auto; }

@media (max-width: 700px) {
  .entry-content > p:first-of-type { font-size: 1.06rem; }
  .cb-header::after { background: var(--cb-ocre); }
  .cb-specs p { flex-direction: column; gap: 0.1rem; }
  .cb-specs p strong { flex: none; }
}

@media print {
  .cb-header, .cb-footer, .wp-block-query-pagination, .wp-block-navigation { display: none !important; }
  .entry-content details { border: none; padding: 0; }
  .entry-content details[open] { background: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
}
