/* Custom styles — Tailwind via CDN for utilities */
[x-cloak] {
    display: none !important;
}

.home-hero {
    position: relative;
}

.home-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Миниатюра в шапке статьи блога — без обрезки */
.blog-hero-thumb__img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}

/* Статьи блога (AI и HTML-редактор) */
.blog-article.rich-content {
    width: 100%;
    max-width: none;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.blog-article.rich-content img {
    max-width: 100%;
    height: auto;
}

.blog-hero-thumb {
    width: 100%;
}

.blog-article.rich-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.blog-article.rich-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.blog-article.rich-content h4 {
    font-size: 1.125rem;
    margin: 1.25rem 0 0.5rem;
}

.blog-article.rich-content p {
    margin: 0.75rem 0;
}

.blog-article.rich-content ul,
.blog-article.rich-content ol {
    margin: 0.75rem 0 1rem;
    padding-left: 1.5rem;
}

.blog-article.rich-content li {
    margin: 0.5rem 0;
}

/* Оглавление статьи */
.blog-toc {
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    background: #f9fafb;
    padding: 1rem 1.25rem;
}

.blog-toc__title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.75rem;
}

.blog-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-toc__item {
    margin: 0.35rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.blog-toc__item a {
    color: #374151;
    text-decoration: none;
}

.blog-toc__item a:hover {
    color: #ea580c;
    text-decoration: underline;
}

.blog-toc__item--h3 { padding-left: 0.75rem; }
.blog-toc__item--h4 { padding-left: 1.5rem; }
.blog-toc__item--h5 { padding-left: 2.25rem; }
.blog-toc__item--h6 { padding-left: 3rem; font-size: 0.8125rem; }

/* Блок автора E-E-A-T */
.blog-author {
    border: 1px solid #fed7aa;
    border-radius: 1rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%);
    padding: 1.25rem;
}

.blog-author__inner {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.blog-author__photo {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 9999px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #fed7aa;
}

.blog-author__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f97316;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
}

.blog-author__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9a3412;
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.blog-author__name {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

a.blog-author__name:hover {
    color: #ea580c;
}

.blog-author__role {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.blog-author__bio {
    font-size: 0.875rem;
    color: #374151;
    margin: 0.5rem 0 0;
    line-height: 1.55;
}

.blog-author__date {
    display: block;
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-top: 0.75rem;
}

.blog-article.rich-content h2[id],
.blog-article.rich-content h3[id],
.blog-article.rich-content h4[id],
.blog-article.rich-content h5[id],
.blog-article.rich-content h6[id] {
    scroll-margin-top: 5rem;
}

/* Перелинковка статей в конце записи */
.blog-related__title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 1.25rem;
}

.blog-related__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blog-related__link {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.875rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.blog-related__link:hover {
    border-color: #fdba74;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.08);
}

.blog-related__thumb {
    flex-shrink: 0;
    width: 7.5rem;
    height: 4.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f3f4f6;
}

.blog-related__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-related__body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.blog-related__date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.blog-related__name {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}

.blog-related__link:hover .blog-related__name {
    color: #ea580c;
}

.blog-related__excerpt {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-related__all {
    margin: 1.25rem 0 0;
    font-size: 0.9375rem;
}

.blog-related__all a {
    color: #f97316;
    font-weight: 600;
    text-decoration: none;
}

.blog-related__all a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .blog-related__link {
        flex-direction: column;
    }

    .blog-related__thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 10;
    }
}

/* Контент из HTML-редактора (страницы geo, услуг и т.д.) */
.rich-content {
    width: 100%;
    max-width: none;
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
}

.rich-content h2,
.rich-content h3,
.rich-content h4,
.rich-content h5,
.rich-content h6 {
    color: #111827;
    line-height: 1.35;
    font-weight: 700;
}

.rich-content h2 { font-size: 1.375rem; margin: 1.25rem 0 0.625rem; }
.rich-content h3 { font-size: 1.125rem; margin: 1rem 0 0.5rem; }
.rich-content h4 { font-size: 1rem; margin: 0.875rem 0 0.5rem; font-weight: 600; }
.rich-content h5 { font-size: 0.9375rem; margin: 0.75rem 0 0.375rem; font-weight: 600; color: #1f2937; }
.rich-content h6 { font-size: 0.875rem; margin: 0.625rem 0 0.375rem; font-weight: 600; color: #374151; text-transform: uppercase; letter-spacing: 0.02em; }

.rich-content h2:first-child,
.rich-content h3:first-child,
.rich-content h4:first-child,
.rich-content h5:first-child,
.rich-content h6:first-child {
    margin-top: 0;
}

.rich-content p,
.rich-content li {
    font-size: inherit;
}

.rich-content p { margin: 0.5rem 0; }

.rich-content u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rich-content s,
.rich-content strike,
.rich-content del {
    text-decoration: line-through;
    color: #6b7280;
}

.rich-content strong,
.rich-content b { font-weight: 700; color: #111827; }

.rich-content em,
.rich-content i { font-style: italic; }

.rich-content ul,
.rich-content ol {
    margin: 0.5rem 0;
    padding-left: 1.25rem;
}

.rich-content ul { list-style-type: disc; }
.rich-content ol { list-style-type: decimal; }

.rich-content ul ul { list-style-type: circle; margin: 0.35rem 0; }
.rich-content ul ul ul { list-style-type: square; }
.rich-content ol ol { list-style-type: lower-alpha; margin: 0.35rem 0; }

.rich-content li {
    margin: 0.35rem 0;
    padding-left: 0.25rem;
    line-height: 1.6;
}

.rich-content li > p {
    margin: 0.25rem 0;
}

.rich-content a {
    color: #f97316;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rich-content a:hover { color: #ea580c; }

.rich-content blockquote {
    border-left: 4px solid #fed7aa;
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 1rem 0;
    color: #4b5563;
    font-style: italic;
    background: #fff7ed;
    border-radius: 0 0.5rem 0.5rem 0;
}

.rich-content table {
    width: 100%;
    min-width: 280px;
    margin: 0.75rem 0;
    font-size: 0.8125rem;
    border-collapse: collapse;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

.rich-content thead { background: #f9fafb; }

.rich-content th,
.rich-content td {
    border: 1px solid #e5e7eb;
    padding: 0.625rem 0.875rem;
    text-align: left;
    vertical-align: top;
}

.rich-content th {
    font-weight: 600;
    color: #111827;
    background: #f3f4f6;
}

.rich-content tbody tr:nth-child(even) { background: #fafafa; }
.rich-content tbody tr:hover { background: #fff7ed; }

.rich-content hr {
    margin: 1.5rem 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}
