/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

* {
  font-size: 1rem;
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  /* background-color: #f0f0f0; */
  margin: 0;
  background-color: #f0f0f0;
}

button,
.button-link,
input[type="submit"] {
  background-color: #efefef;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  color: inherit;
  font-weight: normal;
}

button:hover,
.button-link:hover,
input[type="submit"]:hover {
  background-color: #d9d9d9;
}

p {
  margin: 0;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  padding: 0.5rem 1rem;
  align-items: center;
  border-bottom: 1px solid black;
  background-color: #bbdff6;
  z-index: 99;
}

.header-left,
.header-right {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
}

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

/* =========================================
   Neural Grid
   ========================================= */

.neural-grid-page {
  margin: 3.5rem 1rem 1rem 1rem;
}

.neural-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(200px, calc((100% - 1rem) / 2)), 1fr)
  );
  grid-auto-rows: auto;
  gap: 1rem;
  max-width: 2000px;
  margin: 0 auto;
  position: relative;
}

.grid-card {
  position: relative;
  border: 1px solid black;
  /* background-color: transparent; */
  background-color: #f0f0f0;
  padding: 1rem;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.grid-card:hover {
  /* background-color: #f0f0f0; */
  background-color: #bbdff6;
}

.neural-grid.has-expanded .grid-card:not(.expanded) {
  opacity: 0.3;
  pointer-events: none;
}

.grid-card.expanded {
  grid-column: span 2;
  grid-row: span 2;
  border-color: black;
  /* background-color: #f0f0f0; */
  background-color: #bbdff6;
  overflow: auto;
  cursor: default;
}

.grid-card.empty {
  cursor: default;
  opacity: 0.2;
}

.card-content {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  -webkit-box-flex: 1;
  max-height: calc(1.4em * 5);
}

.neural-grid .grid-card .card-content {
  white-space: pre-wrap;
}

.grid-card.expanded .card-content,
.profile-card .card-content,
.about-card .card-content {
  -webkit-line-clamp: unset;
  overflow: visible;
  padding-right: 3.5rem;
}

.card-actions {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.grid-card.expanded .card-actions,
.profile-card .card-actions,
.about-card .card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-meta {
  border-top: 1px solid black;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.card-meta * {
  font-size: 0.7rem;
}

.card-meta .time,
.card-meta span:last-child {
  text-align: right;
}

.card-meta a {
  margin-right: 0.5rem;
}

.card-meta .author {
  max-width: 60%;
  word-break: break-word;
}

.card-tags {
  font-size: 0.7rem;
  margin-top: auto;
  text-align: right;
}

.grid-card .date-time {
  display: none;
}

.grid-card.expanded .date-only {
  display: none;
}

.grid-card.expanded .date-time {
  display: inline;
}

.profile-card {
  max-width: 2000px;
  margin: 3.5rem 1rem 0 1rem;
  cursor: default;
  aspect-ratio: unset;
}

.profile-card + .neural-grid-page {
  margin-top: 1rem;
}

.about-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background-color: #bbdff6;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  border-top: 1px solid black;
}

.about-panel.open {
  transform: translateY(0);
}

.about-card {
  max-width: 2000px;
  margin: 0 auto;
  aspect-ratio: unset;
  cursor: default;
}

.form-card {
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: unset;
  cursor: default;
}

.form-card p {
  margin-bottom: 1rem;
}

.form-card a {
  display: block;
  margin-bottom: 0.3rem;
}

.form-card label {
  margin-bottom: 0.2rem;
  display: block;
}

.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="text"],
.form-card textarea {
  width: 100%;
}

.form-actions {
  display: flex;
  justify-content: space-between;
}

.banner-notification {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f0f0f0;
  border: 1px solid black;
  padding: 1rem;
  z-index: 98;
  animation: slideDown 0.3s ease;
  display: flex;
  gap: 1rem;
  align-items: center;
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-100%);
  }
  to {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 500px) {
  .card-content {
    -webkit-line-clamp: 3;
    max-height: calc(1.4em * 3);
  }
}

@media (max-width: 700px) {
  * {
    font-size: 14px;
  }

  .header-right {
    gap: 0.5rem;
  }

  header {
    grid-template-columns: auto 1fr auto;
  }
}
