/* ===========================================================
   📐 CSS – Page Structure Tyshara (Structure & Navigation)
   Cible : Template page-structure.php
   =========================================================== */

/* Layout principal */
.ty-page-structure {
  position: relative;
  padding: var(--space-xl) var(--space-md);
}

.ty-layout-structure {
  display: flex;
  flex-direction: row;
  gap: var(--space-lg);
}

/* ===============================
   ⎯⎯⎯⎯ MENU ASIDE (sticky + nav) ⎯⎯⎯⎯
   =============================== */
.ty-aside-menu {
  position: sticky;
  top: 6rem;
  align-self: flex-start;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  background-color: var(--ty-nuage);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 250px;
  z-index: 10;
}

#ty-aside-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  list-style: none;
  padding: 0;
  margin: 0;
}

.ty-anchor-link {
  font-family: var(--font-main);
  font-weight: 600;
  color: var(--ty-prusse);
  text-decoration: none;
  transition: color 0.3s ease;
}

.ty-anchor-link:hover {
  color: var(--ty-anthracite-velours);
  text-decoration: underline;
}

/* ⎯⎯⎯⎯ Niveaux hiérarchiques ⎯⎯⎯⎯ */
li.aside-depth-h1 { margin-left: 0rem; }
li.aside-depth-h2 { margin-left: 1rem; }
li.aside-depth-h3 { margin-left: 2rem; }
li.aside-depth-h4 { margin-left: 3rem; }
li.aside-depth-h5 { margin-left: 4rem; }
li.aside-depth-h6 { margin-left: 5rem; }

/* ===============================
   ⎯⎯⎯⎯ ZONE CONTENU ⎯⎯⎯⎯
   =============================== */
.ty-content-area {
  flex-grow: 1;
  max-width: 100%;
}

/* ===============================
   ⎯⎯⎯⎯ ARTICLE STRUCTURÉ ⎯⎯⎯⎯
   =============================== */
.ty-structured-article h1,
.ty-structured-article h2,
.ty-structured-article h3,
.ty-structured-article h4,
.ty-structured-article h5,
.ty-structured-article h6 {
  scroll-margin-top: 8rem;
  margin-top: var(--space-lg);
}

/* ===============================
   ⎯⎯⎯⎯ Bouton haut de page ⎯⎯⎯⎯
   =============================== */
.ty-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ty-prusse);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50%;
  font-size: 1.5rem;
  z-index: 20;
  cursor: pointer;
  display: none;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

.ty-back-to-top:hover {
  background: var(--ty-bleu-mystique);
}

/* Responsive */
@media (max-width: 768px) {
  .ty-layout-structure {
    flex-direction: column;
  }

  .ty-aside-menu {
    display: none;
  }

  .ty-back-to-top {
    font-size: 1.2rem;
  }
}
