/* Дополнительные стили для раздела статей (Блог) */

*, *::before, *::after {
    touch-action: pan-y;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

/* Контейнеры статей и документов - единые 1200px */
.article-container {
    width: 100%;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 2.5rem 24px 4rem 24px;
    box-sizing: border-box;
}

.legal-container {
    max-width: 1280px !important;
}

.legal-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 1.05rem;
    box-sizing: border-box;
}

.legal-content h2 {
    color: #fff;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

.legal-content p {
    margin-bottom: 1.25rem;
}

.legal-content ul {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

/* Заголовок статьи */
.article-header {
    text-align: center;
    margin-bottom: 3rem;
    width: 100%;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.article-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* Контент статьи */
.article-content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto !important; /* Центрируем сам блок контента */
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
    font-size: 1.1rem;
    box-sizing: border-box;
}

.article-content h2 {
    color: #fff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Спойлер (Details / Summary) */
.prompt-spoiler {
    background: rgba(20, 26, 38, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin: 1.5rem 0;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    width: 100%;
}

.prompt-spoiler:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.prompt-spoiler-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    font-size: 1.1rem;
    list-style: none; /* Убираем стандартную стрелку */
    user-select: none;
}

/* Убираем стрелку в WebKit */
.prompt-spoiler-header::-webkit-details-marker {
    display: none;
}

.spoiler-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spoiler-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.5);
}

.prompt-spoiler[open] .spoiler-icon {
    transform: rotate(180deg);
}

.spoiler-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Блок с промптом внутри спойлера */
.prompt-content-wrapper {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
    padding-top: 1.5rem;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.copy-btn:active {
    transform: scale(0.95);
}

.copy-btn.success {
    background: #28a745;
    color: #fff;
}

.prompt-text {
    font-family: 'Inter', monospace;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
    color: #e0e6ed;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Навигация (Hub) */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); /* Изменено на auto-fit и 340px */
    gap: 2rem;
    margin-top: 3rem;
    width: 100%;
}

.article-card {
    background: rgba(20, 26, 38, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    touch-action: pan-y !important;
}

.article-card:hover {
    background: rgba(30, 38, 56, 0.8);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Изменено для нормального отображения картинки */
.article-card-image {
    width: 100%;
    aspect-ratio: 16 / 9; /* Жестко задаем соотношение сторон 16:9 */
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.2));
    border-radius: 10px;
    margin-bottom: 1.5rem;
    object-fit: cover; /* Картинка будет красиво обрезаться, не искажаясь */
    display: block;
}

.article-card h3 {
    color: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.article-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.article-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

.read-more {
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.article-card:hover .read-more svg {
    transform: translateX(4px);
}

/* ── BENTO GRID LAYOUT & CARD STYLES FOR GUIDES ────────── */
:root {
  --card-bg: rgba(20, 26, 38, 0.55);
  --card-border: rgba(255, 255, 255, 0.08);
  --radius-lg: 24px;
  --radius-md: 14px;
  --brand-primary: #5e6ad2;
  --brand-accent: #00f2fe;
  --brand2: #a5b4fc;
  --gold: #ffd700;
  --red: #ff6b6b;
  --green: #10b981;
  --hint-color: #8b9bb4;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: stretch;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 8; }
.bento-col-7  { grid-column: span 7; }
.bento-col-6  { grid-column: span 6; }
.bento-col-5  { grid-column: span 5; }
.bento-col-4  { grid-column: span 4; }
.bento-col-3  { grid-column: span 3; }

@media (max-width: 800px) {
  .bento-grid {
    gap: 16px;
  }
  .bento-col-12,
  .bento-col-8,
  .bento-col-7,
  .bento-col-6,
  .bento-col-5,
  .bento-col-4,
  .bento-col-3 {
    grid-column: span 12;
  }
}

.bento-grid .card {
  margin-bottom: 0;
  height: 100%;
}

.card {
  background: rgba(14, 18, 28, 0.88);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 0;
  position: relative;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  touch-action: pan-y !important;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 254, 0.15);
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(94, 106, 210, 0.25));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

@media (max-width: 768px) {
  .card {
    padding: 24px 20px;
  }
}

.card h1 {
  font-size: 32px;
  font-weight: 850;
  margin-bottom: 20px;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, #ffffff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .card h1 {
    font-size: 26px;
  }
}

.card h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

@media (max-width: 768px) {
  .card h2 {
    font-size: 18px;
  }
}

.card .lead {
  font-size: 17px;
  color: var(--hint-color);
  margin-bottom: 30px;
  font-weight: 400;
}

.prompt-code {
  font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', Courier, monospace;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--brand-accent);
  font-size: 13.5px;
  word-break: break-all;
  margin: 10px 0;
  display: block;
}

.section-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(94, 106, 210, 0.15);
  border-radius: 8px;
  color: var(--brand-accent);
  flex-shrink: 0;
}

.section-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

.alert-box {
  background: rgba(94, 106, 210, 0.07);
  border-left: 3px solid var(--brand-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
}

.alert-box.tip {
  background: rgba(16, 185, 129, 0.06);
  border-left-color: var(--green);
  color: #cbd5e1;
}

.alert-box strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #fff;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

th, td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--hint-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.8px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.model-name {
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.step-number {
  font-size: 12px;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand2);
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.cta-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: #080d14;
}

.token-icon {
  width: 1.2em;
  height: 1.2em;
  display: inline-block;
  vertical-align: -0.2em;
  margin: 0 0.2em;
}
