/* ===========================================
   ПартнёрЪ — кастомные стили прототипа
   v0.5.0 — реверт палитры под index2.html
   palette: brand = slate-50..950, accent = amber-100..600
   =========================================== */

/* === База === */
* { scroll-behavior: smooth; }
html { scroll-padding-top: 80px; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* === Glassmorphism === */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}
.glass-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* === Градиенты === */
.gradient-text {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}
.gradient-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}
.mesh-gradient {
    background:
        radial-gradient(at 40% 20%, rgba(245, 158, 11, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(15, 23, 42, 0.3) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(245, 158, 11, 0.1) 0px, transparent 50%);
}

/* === Кнопки === */
.btn-primary {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.5);
}
.btn-primary:hover::before {
    left: 100%;
}
.btn-primary:active {
    transform: translateY(0);
}

/* === Навигация === */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: #f59e0b;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

/* === Карточки услуг === */
.service-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
}
.service-card .service-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    transition: background 0.3s ease;
}
.service-card:hover .service-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}
/* Иконка остаётся цветной на amber-фоне — высокий контраст, не «пропадает». */
/* (filter: brightness(0) invert(1) делал её белой — низкий контраст на amber) */

.testimonial-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s ease;
}
.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.08);
}

/* === Раскрывающиеся отзывы (макс. размер + «Читать полностью») === */
.line-clamp-3, .line-clamp-4, .line-clamp-6, .line-clamp-8 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 { -webkit-line-clamp: 3; }
.line-clamp-4 { -webkit-line-clamp: 4; }
.line-clamp-6 { -webkit-line-clamp: 6; }
.line-clamp-8 { -webkit-line-clamp: 8; }

.testimonial-toggle {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    line-height: inherit;
}
.testimonial-toggle:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Аватары отзывов (явный круг, не зависит от Tailwind CDN) === */
.testimonial-avatar {
    width: 3rem;
    height: 3rem;
    aspect-ratio: 1;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    line-height: 1;
}
@media (min-width: 640px) {
    .testimonial-avatar {
        width: 3rem;
        height: 3rem;
    }
}

/* === Пагинация (the_posts_pagination) === */
.pagination,
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}
.pagination .page-numbers,
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}
.pagination .page-numbers:hover,
.nav-links .page-numbers:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #d97706;
    transform: translateY(-1px);
}
.pagination .page-numbers.current,
.nav-links .page-numbers.current {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    cursor: default;
}
.pagination .page-numbers.dots,
.nav-links .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
    cursor: default;
}
.pagination .prev.page-numbers,
.pagination .next.page-numbers,
.nav-links .prev.page-numbers,
.nav-links .next.page-numbers {
    padding: 0 1.25rem;
}

.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.2);
}

/* === Формы === */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
    background: #ffffff;
}
.form-input:focus {
    border-color: #f59e0b;
    background: white;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
    outline: none;
}
.form-input::placeholder {
    color: #94a3b8;
}

/* === Scroll-reveal === */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* === Анимации === */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes float {
    0%, 100% { transform: translateY(0px) translateZ(0); }
    50% { transform: translateY(-10px) translateZ(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}
.float,
.floating-badge {
    animation: float 6s ease-in-out infinite;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}
.pulse-dot {
    animation: pulse 2s ease-in-out infinite;
}

/* === Hero === */
.hero-image-wrapper {
    position: relative;
}
.hero-image-wrapper::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    border-radius: 2rem;
    z-index: 0;
    opacity: 0.3;
}

/* === Мобильное меню === */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-menu.open {
    transform: translateX(0);
}

/* === Stat number (для секции статистики) === */
.stat-number {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* === Backdrop для мобильного меню === */
.menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.menu-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* === Утилиты === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* === Печать === */
@media print {
    nav, .btn-primary, form, footer { display: none !important; }
}
