/*
The frame every page shares: the header, the message strip, the footer, the pager, the error page, the signed-in
column, and the form fields allauth and form_tags render. Loaded after site.css on every page (web/base.html).
*/

/* ---- header (web/components/top_nav.html) ---- */

.site-nav {
  border-bottom: 1px solid var(--line);
  background: var(--color-base-100);
}
.site-nav-bar {
  min-height: 3.75rem;
  gap: 0.5rem;
  padding-inline: 1rem;
  @media (width >= 40rem) { gap: 0.875rem; padding-inline: 1.5rem; }
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-right: 0.5rem;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  @media (width >= 40rem) { margin-right: 1rem; }
}
/* the mark: the brand's initial on its gradient */
.site-logo {
  display: grid;
  width: 1.875rem;
  height: 1.875rem;
  place-items: center;
  border-radius: 0.5rem;
  background-image: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-primary-content) 18%, transparent);
  color: var(--color-primary-content);
  font-size: 15px;
  font-weight: 700;
}
/* on a phone the script switch needs the room, so the name gives way to the mark (the link keeps its label) */
.site-nav-bar:has(.site-script) .site-brand-name {
  @media (width < 40rem) { display: none; }
}
.site-sections {
  display: flex;
  gap: 0.125rem;
  margin-right: auto;
  @media (width >= 40rem) { gap: 0.25rem; }
}
/* a section: a ghost button with its icon, the current one in the brand's tint; daisyUI's own hover would be the
   page's grey */
.site-section {
  gap: 0.5rem;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  & svg { flex: none; width: 1rem; height: 1rem; }
  &:hover { background-color: var(--color-base-200); color: var(--color-base-content); }
  &[aria-current='page'] {
    background-color: color-mix(in oklab, var(--color-primary) 9%, transparent);
    color: var(--color-primary);
    font-weight: 600;
  }
}
/* the assistant's sparkle keeps the brand colour */
.site-ai { color: var(--color-accent); }
/* below sm a section is its icon; the name stays for screen readers */
@media (width < 40rem) {
  .site-sections .site-section {
    width: var(--size);
    padding-inline: 0;
    & > span {
      position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
  }
}
.site-script {
  margin-right: 0.25rem;
  & .tab { font-weight: 600; }
  @media (width >= 40rem) { margin-right: 0.75rem; }
}
.site-account-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 9999px;
  list-style: none;
  cursor: pointer;
  &::-webkit-details-marker { display: none; }
  &:hover, [open] > & { background: var(--color-base-200); }
}
.site-avatar {
  display: grid;
  width: 1.875rem;
  height: 1.875rem;
  place-items: center;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-content);
  font-size: 0.75rem;
  font-weight: 700;
}
.site-chevron {
  display: none;
  width: 0.875rem;
  height: 0.875rem;
  margin-right: 0.25rem;
  color: var(--muted);
  @media (width >= 40rem) { display: block; }
  [open] > * > & { rotate: 180deg; }
}
.site-account-menu {
  z-index: 30;
  width: 16rem;
  margin-top: 0.5rem;
  padding: 0.375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  background: var(--color-base-100);
  box-shadow: var(--shadow-lg);
  & .menu { width: 100%; padding: 0; }
  /* menu links are classless, so the base link look would colour them */
  & .menu a { color: inherit; }
  & .menu svg {
    width: 1rem; height: 1rem;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    color: var(--muted);
  }
}
.site-account-head {
  margin-bottom: 0.25rem;
  padding: 0.5rem 0.75rem 0.625rem;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  & p:first-child { font-weight: 600; }
}
.site-logout {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}
.site-guest {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ---- messages and the htmx error strip (web/base.html) ---- */

.site-error {
  display: flex;
  justify-content: space-between;
  border-width: 0 0 1px;
  border-radius: 0;
  padding: 0.625rem 1.5rem;
  font-size: 13px;
}
.site-messages {
  display: grid;
  gap: 0.5rem;
  padding-top: 1.25rem;
}
.site-message {
  display: flex;
  align-items: flex-start;
  font-size: 13.5px;
  & > div { flex: 1; }
}
.dismiss {
  font-size: 1.125rem;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
  &:hover { opacity: 1; }
}

/* ---- footer ---- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--color-base-100);
  & .page {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-block: 1.25rem;
    font-size: 13px;
    color: var(--subtle);
  }
}
.site-footer-link:hover { color: var(--color-primary); }

/* ---- pager (web/components/paginator_htmx.html) ---- */

.pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
}
.pager-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-variant-numeric: tabular-nums;
}
.pager-num { min-width: 2.25rem; }
/* white on the grey results pane, where daisyUI's plain button would be the page's own grey */
.pager-btn {
  --btn-color: var(--color-base-100);
  border-color: var(--line);
}
.pager-gap {
  min-width: 1.5rem;
  text-align: center;
  color: var(--muted);
}
.pager-range {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---- the error pages and the signed-in column ---- */

.error-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 36rem;
  margin-inline: auto;
  padding: 4rem 1.5rem;
}
.error-card {
  padding: 2rem;
  & h1 { margin-bottom: 0.5rem; }
  & p { font-size: 15px; }
  & .btn { align-self: flex-start; margin-top: 1.5rem; }
}
.app-main { padding-block: 2rem; }

/* ---- forms: allauth's elements and form_tags' fields ---- */

/* the signed-in account pages: one card in the column (allauth/layouts/manage.html) */
.manage-card {
  max-width: 48rem;
  margin-inline: auto;
  padding: 1.5rem;
  & h1 { margin-bottom: 1rem; }
  @media (width >= 40rem) { padding: 2rem; }
}
.allauth-heading { margin-bottom: 0.5rem; }
.allauth-panel {
  margin-top: 1.5rem;
  &:first-child { margin-top: 0; }
}
.allauth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.form-field { margin-bottom: 0.5rem; }
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  cursor: pointer;
}
