/*
 * =========================================
 * ФИНАЛЬНЫЙ CSS ФАЙЛ
 * Версия от 16.10.2025
 * Включает все стили и исправления
 * =========================================
 */

/* --- 1. Глобальные стили и Типографика --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    background-color: #f7f8fa;
    font-family: 'Inter', sans-serif;
    color: #4b5563;
}

h1, h2, h3, h4, h5, h6 {
    color: #111827;
    font-weight: 700;
}

/* --- 2. Основная структура и Карточки (Cards) --- */
.vpn-comparison-page {
    max-width: 1020px;
    margin: 40px auto;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* Общий стиль для всех информационных блоков */
.toc-wrapper,
.brief-summary,
.vpn-provider-block,
.comparison-table-block,
.text-section-block,
.faq-section-block,
.overall-rating-block {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 30px 40px;
    margin-bottom: 30px;
    border: 1px solid #eef2f7;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vpn-provider-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* --- 3. Шапка страницы (Hero Section) и Оглавление (TOC) --- */
.page-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    margin: 40px 0 20px 0;
    padding-bottom: 20px;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: #3b82f6;
}
.toc-wrapper {
    background: linear-gradient(40deg, #3b83f6, #bfd6fb);
	color: #fff;
    box-shadow: none;
}
.toc-wrapper h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}
.toc-wrapper ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc-wrapper ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    transition: color 0.2s ease;
}
.toc-wrapper ul li a:hover {
    color: #111827;
}

/* --- 4. Карточка VPN-провайдера --- */
.vpn-provider-block {
    position: relative;
    padding-top: 25px;
}
.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    border-bottom: 1px solid #eef2f7;
	padding-top: 24px;
    padding-bottom: 16px;
    margin-bottom: 16px;
	
}

.provider-rating {
  display: flex;          
  align-items: center;    
  gap: 8px;               
}

.star-rating > .top-rated-badge {
  order: 1;                 /* бейдж под ними */
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #facc15;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
	margin-top: 4px;
}
.star-rating .star {
	color: #FFD700;
}
.star-rating .star-empty {
  color: #FFD700;
  fill: none;
  stroke: #FFD700;
}

.provider-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
}
.provider-logo {
    flex-shrink: 0;
    max-width: 150px;
}
.provider-logo img {
    display: block;
    width: 120px;
    height: auto;
}
.provider-name {
    font-size: 1.8rem;
}
.best-for-badge {
    background-color: #e0e7ff;
    color: #3730a3;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}
.provider-specs {
    background-color: rgba(59, 130, 246, 0.05);
    border: 1px solid #eef2f7;
    padding: 8px 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 4px;
    margin-bottom: 16px;
}
.provider-description {
  float: left;             
  width: 45%;               
  margin-right: 20px;       
/*   background-color: #fff;   
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); */
} 

.rating-number {
	font-weight: 600;
    font-size: 22px;
    color: #efaf2c;
}
.spec-label {
    color: #6b7280;
    font-size: 0.85rem;
}
.spec-value {
    color: #111827;
    font-weight: 500;
}
.provider-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}
.pros-section, .cons-section {
    background-color: transparent;
    border: 1px solid #eef2f7;
    padding: 12px 20px;
    border-radius: 8px;
}
.pros-section h4, .cons-section h4 {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}
.pros-list, .cons-list {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}
.pros-list li, .cons-list li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 8px;
}
.pros-list li::before, .cons-list li::before {
    position: absolute;
    left: 0;
    top: 2px;
    font-family: sans-serif;
    font-weight: bold;
}
.pros-list li::before {
    content: '✓';
    color: #22c55e;
}
.cons-list li::before {
    content: '✗';
    color: #ef4444;
}

/* --- 5. Кнопки (Buttons) --- */
.provider-buttons {
    width: 100%;
    clear: both;
    padding-top: 10px;
    display: flex;
    gap: 15px;
}
.summary-button-wrapper {
    margin-top: 30px;
    text-align: center;
}
.btn {
    display: inline-block;
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 600;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.3s ease;
}
.btn-primary {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}
.btn-secondary {
    background: #ffffff;
    color: #3b82f6;
    border-color: #dbeafe;
}
.btn-secondary:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

/* --- 6. Прочие блоки (Хлебные крошки, Автор, Рейтинг) --- */
.breadcrumbs { margin-bottom: 20px; font-size: 0.9rem; color: #6b7280; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; flex-wrap: wrap; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin: 0 10px; color: #d1d5db; }
.breadcrumbs a { color: #4b5563; text-decoration: none; transition: color 0.2s ease; }
.breadcrumbs a:hover { color: #3b82f6; }
.breadcrumbs span { color: #111827; font-weight: 500; }

.overall-rating-block { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.author-block { margin-top: 0; padding-top: 0; border-top: none; text-align: right; font-size: 0.95rem; }
.author-trigger { position: relative; display: inline-block; cursor: pointer; }
.author-trigger strong { color: #3b82f6; font-weight: 600; }
.author-tooltip { display: none; position: absolute; bottom: 125%; right: 0; width: 280px; background-color: #111827; color: #fff; padding: 15px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); font-size: 0.9rem; line-height: 1.6; text-align: left; z-index: 10; }
.author-trigger:hover .author-tooltip { display: block; }
.author-tooltip::after { content: ''; position: absolute; top: 100%; right: 20px; border-width: 5px; border-style: solid; border-color: #111827 transparent transparent transparent; }

/* --- 7. Секция FAQ --- */
.faq-section-block { margin-top: 50px; padding-top: 30px; border-top: 1px solid #e5e7eb; }
.faq-section-block > h2,
.comparison-table-block h2,
.text-section-block h2 { text-align: center; font-size: 2rem; margin-bottom: 30px; }
.faq-plain .faq-item-plain { margin-bottom: 25px; }
.faq-plain .faq-question-plain { font-size: 1.3rem; font-weight: 600; color: #333; margin-bottom: 10px; line-height: 1.5; }
.faq-plain .faq-answer-plain { color: #555; line-height: 1.8; padding-left: 20px; border-left: 3px solid #e5e7eb; }
.faq-plain .faq-answer-plain p:first-of-type { margin-top: 0; }
.faq-plain .faq-answer-plain p:last-of-type { margin-bottom: 0; }

/* --- 8. Адаптивность --- */
@media (max-width: 768px) {
    .vpn-comparison-page { margin: 20px auto; padding: 0 10px; }
    .toc-wrapper ul,
    .provider-pros-cons { grid-template-columns: 1fr; columns: 1; }
    .page-title { font-size: 2.5rem; }
    .provider-header { flex-direction: column; }
    .provider-details { order: 2; align-items: center; text-align: center; }
    .provider-logo { order: 1; margin-bottom: 20px; }
    .provider-rating { border-top: none; padding-top: 0; margin-top: 0; justify-content: center; }
}

/* --- 9. Исправления (Overrides) --- */

/* Отмена грида темы для всех кастомных разделов */
.single-vpn_china .cs-main-content,
.single-unblock .cs-main-content,
.single-vpn_for .cs-main-content,
.single-vpn_by_device .cs-main-content,
.single-vpn_comparison .cs-main-content {
    display: block;
}

@media (min-width: 768px) {
    .toc-wrapper ul {
        columns: 2;
        gap: 40px;
    }
}
@media (max-width: 768px) {
  .provider-description {
    float: none;             /* убираем float */
    width: 100%;             /* блок занимает всю ширину */
    margin-right: 0;         /* убираем отступ */
  }
}

/* --- 10. Значки рейтинга (Медали и Корона) --- */

.rank-badge {
    position: absolute;
    top: -15px;
    left: 20px;
    width: 40px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 8px;
    padding-bottom: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 10;
    /* Стиль по умолчанию для 4, 5 и т.д. */
    background: #ffffff;
    color: #333;
    border: 1px solid #eef2f7;
}

/* Переопределяем стили для медалей */
.rank-badge.rank-1 { background: linear-gradient(145deg, #ffd700, #f0c400); color: #4a3300; border: none; }
.rank-badge.rank-2 { background: linear-gradient(145deg, #e0e0e0, #c7c7c7); color: #444; border: none; }
.rank-badge.rank-3 { background: linear-gradient(145deg, #cd7f32, #b86e29); color: #fff; border: none; }

/* Гарантированно рисуем корону через background-image */
.rank-badge.rank-1 .crown-icon {
    display: block !important;
    position: absolute;
    top: -12px;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffd700"><path d="M19.167 6.578C19.468 7.933 18.52 9 17.133 9H6.867C5.48 9 4.532 7.933 4.833 6.578L6.43 2.182C6.58 1.487 7.215 1 7.94 1H16.06c.725 0 1.36.487 1.51 1.182l1.597 4.396zM22 12c0-1.105-.895-2-2-2H4c-1.105 0-2 .895-2 2v8c0 1.105.895 2 2 2h16c1.105 0 2-.895 2-2v-8z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
    content: '' !important;
    font-family: initial !important;
}

/* Заставляем цифру отображаться как ТЕКСТ, а не иконка */
.rank-badge .rank-number {
    font-family: 'Inter', Arial, sans-serif !important;
    font-weight: 700 !important;
}
.page-template-template-best-collection-php .cs-main-content {
    display: block !important; /* Отключаем display: grid */
}

/* 2. Гарантируем правильный фон и цвета для Оглавления (TOC) на страницах */
.page-template-template-best-collection-php .toc-wrapper {
    background: linear-gradient(40deg, #3b83f6, #bfd6fb) !important;
	color: #fff !important;
}
.page-template-template-best-collection-php .toc-wrapper h3 {
    color: #fff !important;
}
.page-template-template-best-collection-php .toc-wrapper ul li a {
    color: #ffffff !important;
}
.page-template-template-best-collection-php .toc-wrapper ul li a:hover {
    color: #111827 !important;
}

/* 3. Убедимся, что основной контейнер центрирован и имеет правильную ширину */
.page-template-template-best-collection-php .vpn-comparison-page {
    max-width: 1020px; /* Убедитесь, что это та же ширина, что и для single */
    margin-left: auto;
    margin-right: auto;
}