@use "../../../../../tools/node_modules/@picocss/pico/scss" with (
  $modules: (
    // Layout
    "layout/landmarks": false,
    "layout/section": false,

    // Forms
    "forms/checkbox-radio-switch": false,
    "forms/input-color": false,
    "forms/input-date": false,
    "forms/input-file": false,
    "forms/input-range": false,

    // Components
    "components/accordion": false,
    "components/card": false,
    "components/dropdown": false,
    "components/group": false,
    "components/loading": false,
    "components/modal": false,
    "components/progress": false,
    "components/tooltip": false,
  )
);

// Global Set
:root {
  --pico-border-radius: .5rem;
}

body {
  cursor: auto;
  margin: 0;
}

:not(.fmt a) {
  text-decoration: none;
}

// button[type=submit],
// input[type=submit] {
//   display: inline-block;
//   width: auto !important;
// }

// Theme
[data-theme="light"],
:root:not([data-theme="dark"]) {
  --pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(50, 60, 68)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}

@media only screen and (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(194, 199, 208)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
  }
}

[data-theme="dark"] {
  --pico-icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(194, 199, 208)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
}

// Content
h1, h2, h3, h4, h5 { line-height: 1.2; }

// Icon Size
.is-sm {
  width: 1.25em;
  height: 1.25em;
}

// Utilities
.text-muted,
.text-muted a {
  color: var(--pico-secondary);
}

.text-muted a:hover {
  color: var(--pico-secondary-hover);
}

.text-center {
  text-align: center;
}

.text-end {
  text-align: right;
}

.ms-2 {
  margin-left: .5rem;
}

.me-2 {
  margin-right: .5rem;
}

.mx-2 {
  margin-left: .5rem;
  margin-right: .5rem;
}

.list-inline {
  padding-left: 0;
  list-style: none;
  margin-bottom: 0;

  li {
    display: inline-block;
    margin-bottom: 0;

    &:not(:last-child) { margin-right: 1rem; }
  }

  svg { vertical-align: text-bottom; }
}

// Layout

main.container {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.container-thin {
  margin-left: auto;
  margin-right: auto;
  max-width: 40rem;
}

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.justify-content-end {
  justify-content: end;
}

.align-self-center {
  align-self: center;
}

// Header & Navbar
.site-navbar {
  a {
    color: inherit;

    &:focus {
      background-color: var(--pico-text-selection-color);
    }
  }

  .site-name {
    flex-grow: 1;
  }

  .brand {
    font-size: 1.25rem;
    font-weight: 700;
  
    img {
      max-height: 2rem;
    }
  }

  .desc {
    color: var(--pico-secondary);
    display: none;
      @media (min-width: 576px) {
        display: inline-block;
      }
  }
}

.site-nav {
  display: block;
}

#nav-toggler {
  display: none;

  &:checked ~ .nav-menu {
    display: block;
  }
}

.nav-toggler-btn {
  cursor: pointer;
}

// Dropdown Menu
.nav-menu {
  display: none;

  li {
    display: block;
    padding: .5rem;
  }

  form {
    margin-bottom: 0;

    input[type=search] {
      height: 50px;
      background-size: auto;

      &:not(:focus) {
        padding: 0;
        border: none;
        width: 30px;
        padding-inline-start: 0;
        background-position: center center;
        background-color: inherit;
        color: transparent;
        cursor: pointer;
      }
    }
  }
}

@media (min-width: 1024px) {
  .site-navbar,
  .site-nav { display: flex; }
  .site-navbar nav:first-child { flex-grow: 1; }
  .nav-toggler-btn { display: none; }
  .nav-menu {
    display: flex !important;
    li:not(:last-child) { margin-right: .5rem; }
  }
}

// Posts
.post-separator {
  margin: 4rem 0;
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-title {
  margin-bottom: 1rem;

  a { color: var(--pico-h2-color); }
}

.entry-meta {
  font-size: .875rem;
}

.feather-calendar::before,
.feather-folder::before,
.feather-message::before {
  content: "";
  display: inline-block;
  margin-right: .25rem;
  background: url("../img/calendar.svg") no-repeat center center / contain;
  width: 1rem;
  height: 1rem;
  vertical-align: text-top;
  fill: #396;
}
.feather-folder::before {
  background-image: url("../img/folder.svg");
}
.feather-message::before {
  background-image: url("../img/message-circle.svg");
}



.entry-content .more {
  text-align: center;
  a {
    display: inline-block;
    font-size: .875rem;
    padding: 6px 16px;
    border: 1px solid var(--pico-muted-border-color);
    color: var(--pico-muted-color);
    border-radius: 100px;
    text-decoration: none;

    &:focus {
      background-color: var(--pico-text-selection-color);
    }
  }
}

.post-nav {
  border-top: 1px solid var(--pico-muted-border-color);
  margin: 4rem 0;
  
  a {
    color: inherit;
  }
}

// Format
.fmt {
  line-height: 1.6;
}

// Footer
.site-footer {
  padding-bottom: 1rem;
}

// Comments
.comment-list {
  list-style: none;
  padding: 0;
}

.comment-body {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.comment-by-author > .comment-author::after {
  content: "OP";
  margin-left: .25rem;
  color: var(--pico-muted-color);
  padding: 1px .375rem;
  border: 1px solid var(--pico-muted-color);
  font-size: .75rem;
  border-radius: 2rem;
}

.comment-author {
  display: inline-block;

  .avatar {
    margin-right: .25rem;
    width: 2rem;
    border-radius: 48px;
  }

  cite,
  cite a {
    font-style: normal;
    font-weight: 700;
    color: var(--pico-h2-color);
  }
}

.comment-meta a,
.comment-reply a {
  font-size: .875em;
  color: var(--pico-secondary);

  &:hover { color: var(--pico-secondary-hover); }
}

.comment-meta {
  display: inline-block;
  color: var(--pico-muted-color);
  margin-left: .25rem;
  &::before {
    content: "·";
    margin-right: .25rem;
  }
}

.comment-content {
  margin-top: 1rem;
}

.comment-reply:blank {
  margin-top: 0;
}

.comment-awaiting-moderation {
  margin-left: .5rem;
  font-size: .875em;
  color: var(--pico-del-color);
}

.comment-children {
  margin-bottom: -1rem;
}

#response {
  margin-bottom: 1rem;
}

#cancel-comment-reply-link {
  font-size: .875em;
}

.respond {
  margin-top: 1.5rem;

  .comment-body & {
    margin-top: 1rem;
  }
}

#comment-form textarea {
  resize: vertical;
}

// page nav
.page-navigator {
  margin: 0;
  flex: 1;

  .current a {
    text-decoration: underline;
    color: inherit;
    pointer-events: none;
  }

  a:focus {
    background-color: var(--pico-text-selection-color);
  }

  .prev {
    margin-right: auto;
    a::before {
      content: "‹";
      margin-right: .25rem;
    }
  }
  .next {
    margin-left: auto;
    text-align: right;
    a::after {
      content: "›";
      margin-left: .25rem;
    }
  }
}
