/*
 * Éléments communs de l’interface de Plan-de-classe.fr :
 * en-tête, navigation du compte et pied de page.
 */

.site-header {
  position: sticky;
  top: 0;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 6px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border, #d8dee6);
  box-shadow: 0 2px 10px rgba(20, 30, 50, .06);
  z-index: 100;
}

.site-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.site-brand picture {
  min-width: 0;
  display: flex;
}

.site-logo {
  width: min(360px, 36vw);
  height: auto;
  flex: 0 0 auto;
  display: block;
}

.site-tagline {
  max-width: 260px;
  margin: 0;
  color: var(--muted, #667085);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.app-main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.app-main-nav a {
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--muted, #667085);
  text-decoration: none;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.app-main-nav a:hover,
.app-main-nav a:focus-visible,
.app-main-nav a[aria-current="page"] {
  color: var(--primary, #2563eb);
  background: #eef4ff;
}

.account-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid var(--border, #d8dee6);
}

.app-main-nav .account-nav .account-link {
  width: 165px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.app-main-nav .account-nav .account-link[hidden] {
  display: none !important;
}

.app-main-nav .account-register {
  color: #344054;
  border: 1px solid var(--border, #d8dee6);
  background: #f8fafc;
}

.app-main-nav .account-register:hover,
.app-main-nav .account-register:focus-visible {
  color: var(--primary, #2563eb);
  border-color: #9db8ec;
  background: #eef4ff;
}

.app-main-nav .account-account {
  color: #344054;
  border: 1px solid var(--border, #d8dee6);
  background: #f8fafc;
}

.app-main-nav .account-account:hover,
.app-main-nav .account-account:focus-visible {
  color: var(--primary, #2563eb);
  border-color: #9db8ec;
  background: #eef4ff;
  text-decoration: none;
}

.account-nav .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.app-legal-footer {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 12px;
  max-width: calc(100vw - 28px);
  padding: 7px 10px;
  border: 1px solid rgba(216, 222, 230, .95);
  border-radius: 9px;
  color: var(--muted, #667085);
  background: rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-sm, 0 4px 14px rgba(20, 30, 50, .10));
  font-size: 11px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.app-legal-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.app-legal-footer a:hover,
.app-legal-footer a:focus-visible {
  color: var(--primary, #2563eb);
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-tagline {
    display: none;
  }

  .site-logo {
    width: min(330px, 50vw);
  }
}

@media (max-width: 850px) {
  .app-legal-footer {
    position: static;
    justify-content: center;
    max-width: none;
    margin: 8px 12px 12px;
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .site-brand {
    justify-content: center;
  }

  .site-logo {
    width: min(330px, 88vw);
  }

  .app-main-nav {
    justify-content: center;
    flex-wrap: wrap;
    border-right: 0;
  }

  .account-nav {
    width: 100%;
    justify-content: center;
    margin-left: 0;
    padding: 6px 0 0;
    border-top: 1px solid var(--border, #d8dee6);
    border-left: 0;
  }
}


/* Navigation responsive et pied de page éditorial */
.site-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--border, #d8dee6);
  border-radius: 8px;
  color: var(--text, #20262e);
  background: #fff;
  font-weight: 750;
  cursor: pointer;
}
.site-nav-toggle svg { width: 20px; height: 20px; }
.site-generator-cta {
  margin-left: 4px;
  color: #fff !important;
  background: var(--primary, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, .2);
}
.site-generator-cta:hover,
.site-generator-cta:focus-visible { background: var(--primary-dark, #1d4ed8) !important; }
.site-footer {
  display: block;
  flex: 0 0 auto;
  padding: 0;
  border-top: 0;
  color: #dbe5f4;
  background: #172033;
  font-size: initial;
}
.site-footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) repeat(3, minmax(150px, 1fr));
  gap: 38px;
  padding: 48px 0 36px;
}
.site-footer strong { display: block; margin-bottom: 12px; color: #fff; font-size: 15px; }
.site-footer p { max-width: 330px; margin: 0; color: #aebcd0; font-size: 14px; line-height: 1.65; }
.site-footer nav { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.site-footer a { color: #c4d0e0; text-decoration: none; font-size: 13px; line-height: 1.5; }
.site-footer a:hover, .site-footer a:focus-visible { color: #fff; text-decoration: underline; }
.site-footer-bottom { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.12); color: #93a4ba; text-align: center; font-size: 12px; }

@media (max-width: 1040px) {
  .site-header { grid-template-columns: minmax(220px, 1fr) auto; }
  .site-logo { width: min(310px, 34vw); }
  .app-main-nav a { padding-inline: 7px; font-size: 12px; }
}
@media (max-width: 820px) {
  .site-header { grid-template-columns: 1fr auto; padding: 7px 14px; }
  .site-brand { justify-content: flex-start; }
  .site-logo { width: min(290px, 68vw); }
  .site-nav-toggle { display: inline-flex; }
  .app-main-nav {
    grid-column: 1 / -1;
    display: none;
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0 2px;
    border: 0;
    border-top: 1px solid var(--border, #d8dee6);
  }
  .app-main-nav.is-open { display: flex; }
  .app-main-nav > a { width: 100%; padding: 10px 12px; text-align: center; }
  .account-nav { width: 100%; margin: 3px 0 0; padding: 7px 0 0; justify-content: center; border-left: 0; border-top: 1px solid var(--border, #d8dee6); }
  .site-generator-cta { margin: 4px 0 0; }
  .site-footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
}
@media (max-width: 520px) {
  .site-nav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .site-footer-inner { grid-template-columns: 1fr; padding-top: 36px; }
}
