/* Utility classes */

.secondary {
  color: var(--text-light);
}

.heroicons {
  width: 1em;
  height: 1em;
  margin-top: -0.2em;
}

/* Trix styles */

.trix-content {
  h2 {
    font-size: 1.35em;
    margin-bottom: 0.5em;
  }
}

/* Page specific styles */

body.home_index {
  grid-template-columns: 1fr min(45rem, 70%) min(15rem, 20%) 1fr;
  grid-template-areas:
    "flash flash flash flash"
    "topnav topnav topnav topnav"
    "header header header header"
    ". main sidebar ."
    "footer footer footer footer";

  >main {
    grid-area: main;
    padding-right: 1rem;
  }

  >aside {
    grid-area: sidebar;
    margin-left: 1rem;
  }

  .image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 50px);
    gap: 5px;
  }

  .soundcloud-embed {
    margin-top: 20px;
  }

  .published-at {
    color: var(--text-light);
  }

  .excerpt {
    margin: 0.3rem 0;
  }

  .activity {
    clear: both;
    padding-top: 5px;
  }

  .activity-map {
    background-color: var(--accent-bg);
    border-radius: var(--standard-border-radius);
    padding: 10px;
    float: left;
    margin-right: 10px;

    .polyline {
      stroke: var(--accent);
      stroke-width: 1;
    }
  }

  @media (max-width: 720px) {
    grid-template-columns: 1fr min(90%, 70ch) 1fr;
    grid-template-areas:
      "topnav topnav topnav"
      "header header header"
      ". main ."
      ". sidebar ."
      "footer footer footer";

    >aside {
      margin-left: 0;
      margin-top: 2rem;
    }

    >main {
      padding-right: 0;
    }
  }
}

body.posts_show,
body.entries_show {
  main {
    grid-column-start: 1;
    grid-column-end: -1;

    >article,
    >section,
    >turbo-frame {
      display: grid;
      grid-template-columns: 1fr min(50rem, 90%) 1fr;

      >* {
        grid-column-start: 2;
      }
    }

    *:first-child {
      margin-top: 0;
    }

    .hero-image {
      width: 100%;
      height: auto;
      border-radius: var(--standard-border-radius);
      margin-bottom: 1rem;
    }
  }

  section.related-posts,
  section.subscribe {
    background-color: var(--accent-bg);
    padding: 20px 0;
    margin: 30px 0;
  }

  section.subscribe {
    form {
      display: flex;
      margin-top: 15px;
      margin-bottom: 10px;
      gap: 15px;
    }

    input[type="email"] {
      flex: auto;
    }
  }
}

/* Section specific styles */

section.comments {
  padding-left: 0;
  padding-right: 0;

  trix-toolbar {
    display: none;
  }

  trix-editor {
    margin-bottom: 10px;
  }

  .comment {
    display: flex;
    margin-top: 30px;
    gap: 10px;

    .side {
      img {
        border-radius: 50%;
      }
    }

    .header {
      line-height: 1em;
    }

    .content {
      margin-top: 5px;
    }
  }
}

section.filters {
  margin: 0;

  a.pill {
    background: var(--accent-bg);
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 15px;
    color: var(--accent);
    font-weight: bold;
    font-size: 0.8em;
    margin-right: 3px;
    white-space: nowrap;

    &.current {
      background: var(--accent);
      color: var(--accent-bg);
    }
  }
}

nav.logged-in {
  text-align: center;
  padding: 0.5rem 0;
  border-bottom: 1px dotted var(--border);
}

section.actions {
  margin: 1rem 0;
}

/* Page specific styles */

/* Pictures controller */

body.pictures_show {
  .actions {
    form {
      display: inline;
    }
  }
}

body.pictures_edit {
  .attachment {
    margin-bottom: 30px;
  }
}
