/* Balanced typography scale for Pico.css overrides */
html {
  font-size: 15px; /* Base ~15px (between 14px and 16px) */
  line-height: 1.5;
}

body {
  font-size: 1rem; /* ~15px */
  line-height: 1.55;
}

/* Headings: scale them down from Pico’s defaults, but keep hierarchy */
h1 {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
} /* ~27px */
h2 {
  font-size: 1.45rem;
  margin-bottom: 0.5rem;
} /* ~22px */
h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
} /* ~18px */
h4,
h5,
h6 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

/* Paragraphs and lists */
p,
li {
  font-size: 1rem; /* same as body */
  margin-bottom: 0.7rem;
}

/* Form inputs and buttons */
input,
select,
textarea,
button {
  font-size: 0.95rem; /* ~14.5px */
  padding: 0.4rem 0.6rem;
}

/* Sidebar, small text */
aside,
small,
.muted {
  font-size: 0.9rem; /* ~13.5px */
}

/* Placeholder list items */
.placeholder-list code {
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  min-height: calc(100dvh - 40px);
}

aside {
  border-right: 1px solid var(--muted-border-color, #dde1e6);
  padding: 1rem;
  background-color: hsl(var(--sidebar-background));
}

.docs-list button {
  width: 100%;
}

.muted {
  opacity: 0.75;
}

.preview-toolbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.placeholder-list code {
  font-size: 0.9em;
}

.missing {
  color: #b54708;
}

/* amber-ish */
.ok {
  color: #157f3b;
}

/* green-ish */
.stack {
  display: grid;
  gap: 0.75rem;
}

/* ::: pico css updates ::: */
.origin-top-center .grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
}
:root {
  --pico-font-size: auto !important;
  --sidebar-background: 0 0% 98%;
  --sidebar-foreground: 240 5.3% 26.1%;
  --sidebar-accent: 240 4.8% 95.9%;
  --sidebar-accent-foreground: 240 5.9% 10%;
}
.backdrop-blur [type="button"] {
  --pico-background-color: transparent !important;
  --pico-border-color: transparent !important;
  margin-bottom: 0px !important;
  padding: 5px 10px !important;
}
.backdrop-blur button {
  --pico-border-color: transparent !important;
}
.backdrop-blur nav li {
  padding: 0 7px !important;
}
article.crumbs-wrapper {
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0px !important;
}
article.crumbs-wrapper li {
  padding: 0 10px !important;
}
footer ul li {
  list-style: none !important;
}
#content ul,
#content ol {
  padding-left: 35px !important;
}
input:not([type="checkbox"], [type="radio"]),
select,
textarea,
section,
article {
  margin-bottom: 0px !important;
}
.docs-list button {
  margin-bottom: 0px !important;
}
.docs-list li {
  padding: 0px !important;
  margin-bottom: 0px;
}
.stack h3 {
  margin-bottom: 0px;
  margin-top: 10px;
}
.docs-list [data-sidebar="menu-button"] {
  align-items: flex-start !important;
}
#policy-form h2 {
  margin-top: 5px !important;
}
/* dark mode pico overrides > starts */
h1,
h2,
h3,
h4,
h5,
h6 {
  --pico-color: #2d3138 !important;
}
article {
  background: #fff !important;
}
input,
select {
  background: #fbfcfc !important;
  color: #2d3138 !important;
  border-color: #cfd5e2 !important;
}
input:active,
input:focus,
select:active,
select:focus,
textarea:active,
textarea:focus {
  --pico-border-color: #0172ad !important;
}
fieldset legend,
label {
  color: #2d3138 !important;
}
#show-form-btn,
[data-sidebar="menu-button"] {
  color: #2d3138 !important;
}
address,
blockquote,
dl,
ol,
p,
pre,
table,
ul {
  color: #2d3138 !important;
}
b,
strong {
  font-weight: 700 !important;
}
.text-muted-foreground {
  color: #6b7280 !important;
}
/* dark mode pico overrides > ends */

/* ::: pico css updates ends ::: */

/* Sidebar Menu Styles */
[data-sidebar="menu"] {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
}

[data-sidebar="menu-item"] {
  position: relative;
}

#show-form-btn,
[data-sidebar="menu-button"] {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  border-radius: 0.375rem;
  padding: 0.5rem;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
  transition: background-color 0.2s;
  border: none;
  background-color: transparent;
  color: inherit;
  font-weight: normal;
}

#show-form-btn:hover,
[data-sidebar="menu-button"]:hover {
  background-color: hsl(var(--sidebar-accent));
  color: hsl(var(--sidebar-accent-foreground));
}

#show-form-btn[data-active="true"],
[data-sidebar="menu-button"][data-active="true"] {
  background-color: hsl(var(--sidebar-accent));
  font-weight: 500;
  color: hsl(var(--sidebar-accent-foreground));
}

[data-sidebar="menu-button"]:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

[data-sidebar="menu-button"] .truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Placeholder section styles */
aside h4 {
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--sidebar-foreground));
  opacity: 0.7;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

aside .muted {
  padding: 0 0.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

#placeholder-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#placeholder-list li {
  font-size: 0.8125rem; /* 13px */
  padding: 0.25rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 0.25rem;
}

#placeholder-list li:hover {
  background-color: hsl(var(--sidebar-accent));
}

#placeholder-list li code {
  font-family: monospace;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

/* Responsive layout */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  aside {
    border-right: none;
    border-bottom: 1px solid var(--muted-border-color, #dde1e6);
    padding-bottom: 1rem;
  }
}
