@import url('base.css');

.feed-hero {
  padding: 34px 0 20px;
  text-align: left;
}
.feed-hero h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(38px, 6vw, 96px);
  font-weight: 400;
  letter-spacing: .08em;
  text-align: center;
}
.feed-hero p {
  margin: 0 auto;
  max-width: 720px;
  color: var(--muted);
  text-align: center;
  font-size: 17px;
}

.guest-banner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 18px 0 28px;
  background: rgba(217, 217, 217, .22);
  text-align: center;
}
.guest-banner h2 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; }
.guest-banner p { margin: 0 0 16px; color: var(--muted); }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.filter-bar {
  max-width: min(100%, 980px);
  margin: 0 auto 32px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(217, 217, 217, .27);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.filter-label,
.filter-sep { display: none; }
.filter-btn {
  flex: 0 0 auto;
  min-width: 112px;
  text-align: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}
.filter-btn:hover,
.filter-btn.active {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(255, 254, 250, .7);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(383px, 1fr));
  gap: 34px;
  align-items: start;
  max-width: calc(3 * 383px + 2 * 34px); /* 1217px */
  margin: 0 auto;
}

.project-card {
  position: relative;
  min-height: 392px;
  color: var(--ink);
  overflow: visible;
}
.project-card:hover .card-paper { transform: rotate(-.5deg) translateY(-3px); }
.card-paper {
  position: relative;
  display: block;
  height: 305px;
  padding: 24px 22px 70px;
  overflow: hidden;
  text-decoration: none;
  background: rgba(0, 0, 0, .06);
  border-radius: 9px;
  color: var(--ink);
  box-shadow: 0 4px 11px rgba(49, 48, 42, .18);
  transition: transform .18s;
}
.paper-content {
  font-family: var(--display);
  color: rgba(0, 0, 0, .66);
  font-size: 23px;
  line-height: 1.25;
  max-height: 215px;
  overflow: hidden;
}
.paper-presentation-card,
.paper-mixed-card {
  position: relative;
  height: 100%;
  min-height: 200px;
  overflow: hidden;
  border-radius: 7px;
}
.paper-presentation-card {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(49,48,42,.14), rgba(217,217,217,.72));
}
.paper-slide-bg {
  position: absolute;
  inset: -28px;
  width: calc(100% + 56px);
  height: calc(100% + 56px);
  object-fit: cover;
  filter: blur(24px) saturate(1.25);
  opacity: .65;
}
.paper-slide-main {
  position: relative;
  z-index: 1;
  width: 82%;
  max-height: 170px;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 9px 24px rgba(49,48,42,.24);
}
.paper-slide-frame {
  height: 170px;
  border: 0;
  background: #fff;
}
.paper-slide-file {
  position: relative;
  z-index: 1;
  width: 80%;
  min-height: 150px;
  border: 1px solid rgba(49,48,42,.24);
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: rgba(255,254,250,.74);
}
.paper-slide-file span,
.paper-stack-slide span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--muted);
}
.paper-slide-file strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.paper-mixed-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 12px;
}
.paper-mixed-text {
  font-family: var(--display);
  color: rgba(0, 0, 0, .66);
  font-size: 21px;
  line-height: 1.22;
  overflow: hidden;
}
.paper-slide-stack {
  display: grid;
  gap: 7px;
  align-content: start;
}
.paper-stack-slide {
  height: 54px;
  border-radius: 6px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255,254,250,.72);
  border: 1px solid rgba(49,48,42,.16);
  box-shadow: 0 4px 10px rgba(49,48,42,.12);
}
.paper-stack-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.paper-fade {
  position: absolute;
  inset: auto 0 0;
  height: 110px;
  background: linear-gradient(to bottom, transparent, rgba(242, 242, 242, .9));
}
.card-complete {
  position: absolute;
  top: -12px;     /* ← изменить с -25 на -12 */
  right: -8px;    /* ← изменить с -10 на -8 */
  width: 46px;    /* ← увеличить с 36-50 на 46 */
  height: 52px;   /* ← увеличить с 42-70 на 52 */
  z-index: 10;    /* ← ДОБАВИТЬ */
}

.card-star-row {
  position: absolute;
  left: 26px;
  bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 34px;
  color: var(--ink);
  text-shadow: 0 3px 12px rgba(0, 0, 0, .28);
}
.card-star-row .drawn-star { width: 60px; height: 60px; }
.card-footer-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: -50px;
  padding: 0 12px 0 24px;
  position: relative;
  z-index: 2;
  
}
.card-footer-left { min-width: 0; padding-top: 54px; margin-right: 40px;}
.card-footer-title {
  display: block;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.1;
  text-shadow: 0 3px 12px rgba(0, 0, 0, .18);
  overflow-wrap: anywhere;

}
.card-footer-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.dot { opacity: .5; }

.card-author-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  display: block;  /* Добавить */
}

.card-author-avatar-wrap {
  position: relative;
  display: flex;  /* Изменить с inline-block на flex */
  justify-content: center;  /* Центрирование по горизонтали */
  align-items: center;  /* Центрирование по вертикали */
  width: 90px;  /* Сделать одинаковым с avatar */
  height: 90px;  /* Сделать одинаковым с avatar */
}

.card-footer-author {
  position: absolute;
  bottom: 50px;
  right: -20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  width: auto;
  min-width: 90px;  /* Добавить - минимальная ширина равна ширине аватарки */
}

.card-author-name {
  max-width: 90px;  /* Сделать равным ширине аватарки */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  text-align: center;
  display: block;
  width: 100%;
  margin: 0;  /* Убрать margin: 0 auto (он не нужен при flex-родителе) */
}
.card-author-avatar-wrap > .card-author-avatar {
  display: block;
}
.card-coauthor-stack {
  position: absolute;
  right: -8px;
  bottom: 4px;
  display: flex;
  align-items: center;
}
.card-coauthor-stack img,
.card-coauthor-stack span {
  width: 34px;
  height: 34px;
  margin-left: 0px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--card2);
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(49,48,42,.16);
}
.card-coauthor-stack img + *,
.card-coauthor-stack span + * {
  margin-left: -16px;
}

.card-coauthor-stack span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

/* Аватар поверх карточки, в правом нижнем углу */




.coauthor-stack {
  position: absolute;
  right: 86px;
  bottom: 14px;
  display: flex;
}
.coauthor-stack img,
.coauthor-more {
  width: 32px;
  height: 32px;
  margin-left: -9px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--card2);
}
.coauthor-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.pinned-section { margin-bottom: 32px; }
.pinned-label {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

@media (max-width: 760px) {
  .feed-hero h1 { font-size: 38px; letter-spacing: .03em; }
  .filter-bar {
    width: calc(100vw - 20px);
    margin-left: 50%;
    transform: translateX(-50%);
    border-radius: 18px;
    padding: 8px;
  }
  .filter-btn {
    min-width: max-content;
    padding: 8px 13px;
  }
  .projects-grid { grid-template-columns: 1fr; gap: 18px; }
  .project-card { min-height: 292px; }
  .card-paper {
    height: 226px;
    padding: 18px 16px 58px;
    border-radius: 8px;
  }
  .paper-content {
    max-height: 158px;
    font-size: 18px;
    line-height: 1.22;
  }
  .paper-mixed-card {
    grid-template-columns: minmax(0, 1fr) 68px;
    gap: 8px;
  }
  .paper-mixed-text {
    font-size: 17px;
  }
  .paper-stack-slide {
    height: 41px;
  }
  .paper-slide-main {
    max-height: 126px;
  }
  .paper-fade { height: 82px; }
  .card-star-row {
    left: 16px;
    bottom: 2px;
    gap: 5px;
    font-size: 25px;
  }
  .card-star-row .drawn-star { width: 46px; height: 46px; }
  .card-footer-row {
    margin-top: -38px;
    padding: 0 86px 0 16px;
  }
  .card-footer-left {
    max-width: 100%;
    padding-top: 42px;
  }
  .card-footer-title {
    max-width: 100%;
    font-size: 19px;
    line-height: 1.08;
  }
  .card-footer-author {
    right: 12px;
    bottom: 30px;
    gap: 2px;
  }

  .card-coauthor-stack img,
  .card-coauthor-stack span {
    width: 24px;
    height: 24px;
    margin-left: -7px;
    font-size: 9px;
  }
  .card-author-name {
    max-width: 74px;
    font-size: 11px;
  }
  .card-complete {
    top: -8px;
    right: 0;
    width: 38px;
    height: 43px;
  }
}

@media (max-width: 380px) {
  .project-card { min-height: 276px; }
  .card-paper { height: 214px; }
  .paper-content { max-height: 150px; font-size: 17px; }
  .card-footer-row { padding-right: 78px; }
  .card-footer-title { font-size: 18px; }
  .card-footer-author { right: 8px; bottom: 28px; }
  .card-author-avatar,
  .card-author-avatar-wrap { width: 20px; height: 20px; }
  .card-author-name { max-width: 68px; }
}
