/* Реестр репозиториев deynekin.com — стили секции на главной странице. */

.repo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 24px 0 16px;
}

.repo-search-wrap {
  position: relative;
  flex: 1 1 320px;
  min-width: 240px;
}

.repo-search-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.repo-search {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px 12px 40px;
  border-radius: 12px;
  border: 1px solid rgba(107, 114, 128, .35);
  background: rgba(255, 255, 255, .75);
  color: #111827;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.repo-search:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
}

html.dark .repo-search {
  background: rgba(15, 23, 42, .7);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, .12);
}

.repo-sort {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(107, 114, 128, .35);
  background: rgba(255, 255, 255, .75);
  color: #111827;
  font-size: 14px;
  cursor: pointer;
}

html.dark .repo-sort {
  background: rgba(15, 23, 42, .7);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, .12);
}

.repo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.repo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(107, 114, 128, .35);
  background: rgba(255, 255, 255, .6);
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}

.repo-chip span {
  font-size: 12px;
  opacity: .7;
}

html.dark .repo-chip {
  background: rgba(15, 23, 42, .55);
  color: #d1d5db;
  border-color: rgba(255, 255, 255, .1);
}

.repo-chip:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.repo-chip.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
}

.repo-chip.active span { opacity: .85; }

.repo-group { margin-bottom: 32px; }
.repo-group:last-child { margin-bottom: 0; }

.repo-group-head h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
}

.repo-group-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 17px;
  line-height: 1;
}

.repo-group-count {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(99, 102, 241, .15);
  color: #818cf8;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  min-width: 0;
}

.repo-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(107, 114, 128, .22);
  background: rgba(255, 255, 255, .72);
  color: #111827;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.repo-title,
.repo-name,
.repo-desc,
.repo-tag,
.repo-alt,
.repo-meta {
  overflow-wrap: anywhere;
  word-break: break-word;
}

html.dark .repo-card {
  background: rgba(15, 23, 42, .62);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, .08);
}

.repo-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, .55);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}

.repo-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.repo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 21px;
  line-height: 1;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, #4b5563, #1f2937);
}

.accent-emerald { background: linear-gradient(135deg, #10b981, #047857); }
.accent-sky     { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.accent-amber   { background: linear-gradient(135deg, #f59e0b, #b45309); }
.accent-violet  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.accent-rose    { background: linear-gradient(135deg, #f43f5e, #be123c); }
.accent-cyan    { background: linear-gradient(135deg, #06b6d4, #0e7490); }
.accent-indigo  { background: linear-gradient(135deg, #6366f1, #4338ca); }
.accent-slate   { background: linear-gradient(135deg, #64748b, #334155); }
.accent-teal    { background: linear-gradient(135deg, #14b8a6, #0f766e); }

.repo-head-text { min-width: 0; flex: 1; }

.repo-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
}

.repo-title a { color: inherit; text-decoration: none; }
.repo-title a:hover { color: #818cf8; }

.repo-name {
  margin-top: 2px;
  font-size: 12px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.dark .repo-name { color: #8b95a5; }

.repo-badge {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(245, 158, 11, .15);
  color: #f59e0b;
}

.repo-desc {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #4b5563;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html.dark .repo-desc { color: #aeb7c4; }

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

html.dark .repo-meta { color: #8b95a5; }

.repo-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.repo-lang-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.repo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.repo-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(99, 102, 241, .1);
  color: #818cf8;
}

.repo-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(107, 114, 128, .2);
}

html.dark .repo-foot { border-color: rgba(255, 255, 255, .07); }

.repo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(107, 114, 128, .3);
  background: transparent;
  color: #374151;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}

html.dark .repo-btn {
  color: #d1d5db;
  border-color: rgba(255, 255, 255, .12);
}

.repo-btn:hover {
  border-color: #6366f1;
  color: #818cf8;
  background: rgba(99, 102, 241, .08);
}

.repo-btn-readme {
  border-color: rgba(16, 185, 129, .45);
  color: #10b981;
}

.repo-alt-row {
  margin-top: 8px;
  font-size: 11.5px;
}

.repo-alt {
  color: #6366f1;
  text-decoration: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.repo-alt:hover { text-decoration: underline; }

.repo-empty {
  padding: 40px 12px;
  text-align: center;
  color: #8b95a5;
}

/* Модальное окно README */
.repo-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5vh 2.5vw;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(6px);
}

.repo-modal[hidden] { display: none; }

.repo-modal-box {
  display: flex;
  flex-direction: column;
  width: 95vw;
  height: 90vh;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  background: #0d1117;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
  transition: width .2s ease;
}

.repo-modal-box.is-narrow { width: 70vw; }

.repo-modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  color: #e6edf3;
  font-size: 14px;
}

.repo-modal-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
  max-width: 42%;
}

.repo-modal-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 4px;
  border: 1px solid #30363d;
  border-radius: 9px;
  background: #0d1117;
}

.repo-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 27px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #c9d1d9;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.repo-tool:hover { background: #21262d; color: #fff; }
.repo-tool[aria-pressed="true"] { background: #21262d; border-color: #30363d; color: #fff; }

.repo-tool-sep {
  width: 1px;
  height: 18px;
  margin: 0 2px;
  background: #30363d;
}

.repo-tool-label {
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  color: #9198a1;
  user-select: none;
}

.repo-modal-open {
  flex: none;
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: transparent;
  color: #58a6ff;
  font-size: 13px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.repo-modal-open:hover { background: #21262d; text-decoration: underline; }

.repo-modal-close {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #30363d;
  background: transparent;
  color: #e6edf3;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.repo-modal-close:hover { background: #21262d; }

.repo-modal iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: #0d1117;
}

body.repo-modal-open { overflow: hidden; }

@media (max-width: 640px) {
  .repo-grid { grid-template-columns: minmax(0, 1fr); }
  .repo-modal { padding: 8px; }
  .repo-modal-box { width: 96vw; height: 92vh; border-radius: 12px; }
  .repo-modal-head { flex-wrap: wrap; gap: 8px; }
  .repo-modal-title { flex: 1 1 100%; max-width: 100%; order: 1; }
  .repo-modal-tools { order: 2; margin-left: 0; }
  .repo-modal-open { order: 3; margin-left: auto; }
  .repo-modal-close { order: 4; }
}
