/* Template page */

.tpl-workspace {
  max-width: 1240px;
  margin: 26px auto 80px;
  padding: 0 24px;
}

.tpl-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tpl-head h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tpl-head p {
  max-width: 560px;
  margin: 7px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8a8a93;
}

.tpl-count {
  flex: none;
  padding-bottom: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #71717a;
}

.tpl-toolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}

.tpl-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.tpl-search svg {
  position: absolute;
  left: 15px;
  width: 16px;
  height: 16px;
  color: #71717a;
  pointer-events: none;
}

.tpl-search-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 41px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: #141414;
  color: #fafafa;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tpl-search-input::placeholder {
  color: #71717a;
}

.tpl-search-input:focus {
  border-color: #2f6b9e;
  box-shadow: 0 0 0 3px rgba(9, 116, 241, 0.16);
}

.tpl-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.tpl-sort {
  position: relative;
  flex: none;
  width: 170px;
}

.tpl-sort-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.tpl-sort-select {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 14px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background-color: #141414;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23a1a1aa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  color: #e4e4e7;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tpl-sort-select:focus {
  border-color: #2f6b9e;
  box-shadow: 0 0 0 3px rgba(9, 116, 241, 0.16);
}

.tpl-filters {
  display: flex;
  gap: 3px;
  width: fit-content;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid #1f1f1f;
  border-radius: 12px;
  background: #171717;
}

.tpl-filter {
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #a1a1aa;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.tpl-filter:hover {
  color: #e4e4e7;
}

.tpl-filter.active {
  background: #2a2a2e;
  color: #fff;
}

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 22px;
  align-items: start;
}

/* card */

.card_template_content {
  position: relative;
  overflow: hidden;
  border: 1px solid #242424;
  border-radius: 16px;
  background: #151515;
  transition: border-color 0.2s;
}

.card_template_content:hover {
  border-color: #34343a;
}

.card_template_image {
  display: block;
  width: 100%;
  aspect-ratio: 660 / 433;
  object-fit: cover;
  border-radius: 15px 15px 0 0;
  background: #0c0c0c;
}

.favourite-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
  transition: color 0.15s, transform 0.15s;
}

.favourite-button:hover {
  transform: scale(1.08);
}

.favourite-button svg {
  width: 26px;
  height: 26px;
}

.favourite-button[aria-pressed="true"] {
  color: #ffb908;
}

.card_template {
  padding: 15px;
}

.info_container {
  display: flex;
  align-items: center;
  gap: 5px;
}

.info_container .avatar {
  flex: none;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: #000;
  object-fit: cover;
}

.info_container .flex {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.info_container .header {
  margin: 0 0 5px;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info_container .description {
  margin: 0;
  color: #a3a3a3;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
}

.tag_container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 12px 0 10px;
}

.tag {
  margin: 0;
  padding: 4px 10px;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #1c1c1c;
  color: #a1a1aa;
  font-size: 12px;
  line-height: 1.4;
}

.flex_info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.flex_info .info {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #a3a3a3;
}

.flex_info .info svg {
  flex: none;
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.flex_info .info .text {
  margin: 0;
  font-size: 13px;
  color: #a3a3a3;
}

.flex_info .info .aa {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #a3a3a3;
}

.card_button_container {
  display: flex;
  gap: 5px;
}

.card_button_container .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 15px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}

.card_button_container .button.use {
  flex: 1 1 0;
  min-width: 0;
  border: 1.6px solid rgba(54, 140, 190, 0.3);
  background: rgba(54, 140, 190, 0.1);
  color: rgb(84, 165, 210);
}

.card_button_container .button.use:hover {
  background: rgba(54, 140, 190, 0.2);
}

.card_button_container .button.use.applied {
  border-color: rgba(64, 190, 110, 0.5);
  background: rgba(64, 190, 110, 0.18);
  color: #66d99a;
}

.card_button_container .button.link {
  flex: 0 0 auto;
  border: 1.6px solid rgba(88, 101, 242, 0.3);
  background: rgba(88, 101, 242, 0.1);
  color: #7289da;
  font-size: 18px;
}

.card_button_container .button.link:hover {
  background: rgba(88, 101, 242, 0.2);
}

.card_button_container .button.view {
  flex: 0 0 auto;
  border: 1.6px solid rgba(89, 243, 166, 0.3);
  background: rgba(89, 243, 166, 0.1);
  color: #59f3a6;
  font-size: 18px;
}

.card_button_container .button.view:hover {
  background: rgba(89, 243, 166, 0.2);
}

.card_button_container .button svg {
  width: 18px;
  height: 18px;
}

.tpl-empty {
  margin: 34px 0;
  color: #71717a;
  font-size: 13px;
  text-align: center;
}

.tpl-note {
  margin: 26px 0 0;
  color: #71717a;
  font-size: 11.5px;
  line-height: 1.5;
}

.tpl-note code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #1c1c1c;
  color: #a1a1aa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

@media (max-width: 860px) {
  .tpl-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tpl-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 620px) {
  .tpl-workspace {
    margin-top: 18px;
    padding: 0 14px;
  }

  .tpl-head h1 {
    font-size: 22px;
  }

  .tpl-toolbar {
    flex-wrap: wrap;
  }

  .tpl-search {
    flex-basis: 100%;
  }

  .tpl-sort {
    width: 100%;
  }

  .tpl-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
