/* ═══════════════════════════════════════════════════════
   Layout — Reset + Structure principale
   ═══════════════════════════════════════════════════════ */

/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
}

/* ─── Structure principale ─── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content {
  padding: 24px 40px 40px;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* ─── Headings globaux ─── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-1);
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* ─── Utility: signature Fraunces (à utiliser partout où on veut l'accent éditorial) ─── */
.accent-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  background: linear-gradient(135deg, var(--blue-deep), var(--indigo));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  padding-right: 4px;
}

/* ─── Scrollbar fine (cohérent avec le design premium) ─── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(197, 205, 224, 0.5);
  border-radius: 10px;
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Sidebar scrollbar dark */
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(126, 184, 247, 0.1);
  border-color: var(--chrome-bg);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(126, 184, 247, 0.2);
}

/* ─── Focus ring accessible ─── */
*:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Responsive (mobile) ─── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--t-base);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    left: 0;
  }

  .content {
    padding: 16px 20px 32px;
  }
}
