/* Главная Textorub — только секции homepage (общий стиль в style.css) */

/* Hero */
.home-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: 44px 0 72px;
  background: #07153f;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 80% at 12% 20%, rgba(37, 99, 235, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 55% 70% at 88% 18%, rgba(255, 106, 26, 0.42) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 70% 90%, rgba(30, 79, 214, 0.35) 0%, transparent 50%),
    linear-gradient(135deg, #06123a 0%, #0b1f5c 38%, #12307a 68%, #1a1450 100%);
  pointer-events: none;
}

.home-hero-bg::before {
  content: "";
  position: absolute;
  inset: -10% -5%;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.05) 42%, transparent 58%),
    linear-gradient(295deg, transparent 30%, rgba(255, 106, 26, 0.12) 52%, transparent 70%);
  transform: skewX(-18deg);
}

.home-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
  opacity: 0.28;
  mix-blend-mode: soft-light;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(6, 18, 58, 0.35) 0%,
    rgba(6, 18, 58, 0.08) 46%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}

.home-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 380px);
  gap: 24px 28px;
  align-items: center;
  min-height: 0;
}

.home-hero-copy {
  max-width: 34rem;
  justify-self: stretch;
  align-self: center;
  text-align: left;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.home-hero-title {
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.18;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}

.home-hero-lead {
  margin: 0;
  max-width: 32rem;
  font-size: clamp(0.98rem, 1.3vw, 1.08rem);
  font-weight: 600;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.home-hero-visual {
  min-height: 0;
  justify-self: stretch;
  width: 100%;
  max-width: none;
  align-self: center;
}

.home-showcase {
  position: relative;
  width: 100%;
}

.home-showcase-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.home-showcase-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.home-showcase-media {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background: linear-gradient(135deg, #12307a, #07153f);
}

.home-showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  /* чуть крупнее кадр — срезаем чёрные поля у сгенерированных картинок */
  transform: scale(1.14);
  transform-origin: center;
  transition: opacity 0.45s ease, transform 0.7s ease;
}

.home-showcase.is-swap .home-showcase-media img {
  opacity: 0;
  transform: scale(1.2);
}

.home-showcase-body {
  padding: 12px 14px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
}

.home-showcase-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 106, 26, 0.95);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.home-showcase-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 8px;
  min-height: 2.6em;
  font-family: "Unbounded", "Manrope", sans-serif;
  font-size: clamp(0.8rem, 1.2vw, 0.92rem);
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  letter-spacing: -0.02em;
  transition: opacity 0.35s ease;
}

.home-showcase.is-swap .home-showcase-title,
.home-showcase.is-swap .home-showcase-label {
  opacity: 0;
}

.home-showcase-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.home-showcase-dots button {
  appearance: none;
  border: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}

.home-showcase-dots button.is-active {
  width: 18px;
  background: #ff6a1a;
}

.home-showcase[data-loading="true"] .home-showcase-card {
  opacity: 0.72;
}

@media (max-width: 860px) {
  .home-hero {
    padding: 36px 0 48px;
  }
  .home-hero::before {
    background: linear-gradient(
      180deg,
      rgba(6, 18, 58, 0.25) 0%,
      rgba(6, 18, 58, 0.08) 100%
    );
  }
  .home-hero-inner {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 22px;
  }
  .home-hero-copy {
    max-width: none;
    justify-self: stretch;
    text-align: left;
  }
  .home-hero-visual {
    justify-self: stretch;
    max-width: none;
    min-height: 0;
  }
}

/* Chat block */
.home-main {
  max-width: 880px;
  margin: -44px auto 0;
  padding: 0 20px 48px;
  position: relative;
  z-index: 2;
}

.page-home #textorub-chat {
  background: #fff;
  border-radius: 18px;
  padding: 6px;
  border: 2px solid #c9dbff;
  box-shadow: 0 16px 40px rgba(30, 79, 214, 0.12);
}

.page-home #textorub-chat.is-open {
  border-color: #1e4fd6;
  box-shadow: 0 20px 50px rgba(30, 79, 214, 0.28);
  background: #f5f8ff;
}

/* Topics */
.home-topics {
  max-width: 1120px;
  margin: 8px auto 56px;
  padding: 0 20px;
}

.home-topics h2 {
  font-family: "Unbounded", sans-serif;
  font-size: 1.35rem;
  margin: 0 0 8px;
  color: var(--tr-ink);
}

.home-topics-lead {
  margin: 0 0 20px;
  color: var(--tr-muted);
}

.home-topic-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.home-topic-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: #fff;
  border-radius: 14px;
  border: 2px solid #d7e4ff;
}

.home-topic-card strong {
  display: block;
  font-family: "Unbounded", sans-serif;
  font-size: 1.05rem;
  color: var(--tr-blue);
}

.home-topic-card > span {
  color: var(--tr-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.home-topic-search {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 4px;
}

.home-topic-search input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 48px 11px 12px;
  border: 1px solid #c9dbff;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #f8fbff;
  color: var(--tr-ink);
}

.home-topic-search input::-webkit-search-decoration,
.home-topic-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.home-topic-search input:focus {
  outline: none;
  border-color: var(--tr-orange);
  background: #fff;
}

.home-topic-search-icon {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  background: transparent;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-topic-search-icon svg {
  display: block;
}

.home-topic-search-icon:hover svg circle:first-child {
  fill: #163db0;
}

.home-topic-search-icon:focus-visible {
  outline: 2px solid var(--tr-blue);
  outline-offset: 1px;
}

.home-topic-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--tr-orange);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  text-align: center;
}

.home-topic-go:hover {
  background: #e85d10;
  color: #fff;
}

.home-topic-card.is-frozen {
  opacity: 0.72;
  border-color: #e2e8f0;
  background: #f8fafc;
}

.home-topic-card.is-frozen strong {
  color: #64748b;
}

.home-topic-card.is-frozen .home-topic-search input {
  cursor: not-allowed;
  background: #eef2f7;
  color: #94a3b8;
  border-color: #e2e8f0;
}

.home-topic-card.is-frozen .home-topic-search-icon {
  cursor: not-allowed;
}

.home-topic-card.is-frozen .home-topic-search-icon:hover svg circle:first-child {
  fill: #94a3b8;
}

.home-topic-go.is-disabled {
  background: #cbd5e1;
  color: #64748b;
  pointer-events: none;
  cursor: not-allowed;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-search-results {
  margin-top: 18px;
  padding: 16px;
  background: #fff;
  border: 2px solid #d7e4ff;
  border-radius: 14px;
}

.home-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-search-head strong {
  font-family: "Unbounded", sans-serif;
  color: var(--tr-ink);
  font-size: 1rem;
}

.home-search-close {
  appearance: none;
  border: 1px solid #c9dbff;
  background: #f8fbff;
  color: var(--tr-muted);
  font: inherit;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.home-search-close:hover {
  border-color: var(--tr-orange);
  color: var(--tr-orange);
}

.home-search-status {
  margin: 0;
  color: var(--tr-muted);
  line-height: 1.5;
}

.home-search-status a {
  color: var(--tr-blue);
  font-weight: 700;
}

.home-search-list {
  display: grid;
  gap: 10px;
}

.home-search-item {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  background: #f8fbff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.home-search-item:hover {
  border-color: var(--tr-orange);
  background: #fff;
}

.home-search-item strong {
  display: block;
  color: var(--tr-blue);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.home-search-item span {
  display: block;
  color: var(--tr-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.home-search-more {
  margin: 12px 0 0;
  color: var(--tr-muted);
  font-size: 0.95rem;
}

.home-search-more a {
  color: var(--tr-orange);
  font-weight: 800;
}

@media (max-width: 860px) {
  .home-topic-row {
    grid-template-columns: 1fr;
  }
}
