/* Minimal blog custom styles - works on top of Pico CSS classless */

/* Layout */
body {
  max-width: 90ch;
  margin: 0 auto;
  padding: 0;
}

header {
  padding: 1rem;
  border-bottom: 1px solid var(--muted-border-color);
  margin-bottom: 2rem;
}

header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  max-width: 90ch;
  margin: 0 auto;
}

main {
  padding: 0 1rem;
}

article {
  max-width: 90ch;
  margin: 0 auto 2rem;
  padding: 0;
}

article h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

article header p {
  color: var(--muted-color);
  margin-bottom: 2rem;
  font-size: 0.875rem;
}

footer {
  max-width: 90ch;
  margin: 0 auto;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--muted-color);
  border-top: 1px solid var(--muted-border-color);
}

/* Code blocks */
pre {
  overflow-x: auto;
  padding: 1rem;
  font-size: 0.875rem;
}

code {
  font-size: 0.875em;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

/* Navigation */
nav a {
  margin-right: 1rem;
}

/* Sidebar details */
details {
  margin: 1rem 0;
}

details ul {
  list-style: none;
  padding-left: 0;
}

details li {
  padding: 0.25rem 0;
}

/* Collapsible sidebar items (ablog default templates) */
.ablog-sidebar-item > ul {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.ablog-sidebar-item > h3 {
  cursor: pointer;
}

.ablog-sidebar-item > h3::after {
  content: ' ▸';
  float: right;
  font-size: 0.8em;
}

.ablog-sidebar-item:hover > ul,
.ablog-sidebar-item:focus-within > ul {
  max-height: 3000px;
}

.ablog-sidebar-item:hover > h3::after,
.ablog-sidebar-item:focus-within > h3::after {
  content: ' ▾';
}

/* Post footer nav */
article footer nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--muted-border-color);
}

/* Search form */
form[method="get"][action] {
  display: flex;
  gap: 0.5rem;
}

form[method="get"][action] input[type="search"] {
  flex: 1;
}

/* Remove basic theme's navigation sidebar */
.related {
  display: none;
}

/* Post list styling */
ul.postlist {
  list-style: none;
  padding-left: 0;
}

ul.postlist li {
  margin-bottom: 1.5rem;
}

/* ablog postcard styling */
aside dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  font-size: 0.875rem;
}

aside dt {
  font-weight: 600;
}

/* Make sidebars appear as a column on the right for post pages */
@media (min-width: 768px) {
  main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
    max-width: 120ch;
    padding: 0 1rem;
  }
  
  article {
    grid-column: 1;
  }
  
  aside, details {
    grid-column: 2;
  }
}
