/* ==========================================================================
   TrustHost.ir — Terms & Rules Page Modern Documentation Stylesheet
   Direction: RTL | Scoped: .th-terms-page
   ========================================================================== */

.page-id-680 #content > .page-header,
.post-680 #content > .page-header,
.page-id-680 .entry-header,
.post-680 .entry-header {
    display: none !important;
}

.th-terms-page {
    --th-primary: #0066cc;
    --th-primary-dark: #01274d;
    --th-primary-light: #0284c7;
    --th-accent: #0ea5e9;
    --th-accent-subtle: #f0f7ff;
    --th-text-main: #1e293b;
    --th-text-muted: #64748b;
    --th-text-heading: #0f172a;
    --th-bg-white: #ffffff;
    --th-bg-slate: #f8fafc;
    --th-border: #e2e8f0;
    --th-border-hover: #cbd5e1;
    --th-radius-sm: 8px;
    --th-radius-md: 14px;
    --th-radius-lg: 20px;
    --th-radius-xl: 28px;
    --th-shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --th-shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06);
    --th-shadow-lg: 0 16px 36px -6px rgba(1, 39, 77, 0.12);
    --th-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

    direction: rtl !important;
    text-align: right !important;
    font-family: Vazirmatn, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Tahoma, sans-serif;
    color: var(--th-text-main);
    line-height: 2;
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 16px 60px;
    box-sizing: border-box;
}

.th-terms-page *,
.th-terms-page *::before,
.th-terms-page *::after {
    box-sizing: border-box;
}

/* 1. Header / Hero */
.th-terms-hero {
    position: relative;
    background: radial-gradient(circle at 80% 20%, #033c75 0%, #01274d 60%, #001730 100%);
    color: #ffffff;
    border-radius: var(--th-radius-xl);
    padding: 56px 36px 44px;
    margin-bottom: 32px;
    box-shadow: var(--th-shadow-lg);
    overflow: hidden;
    text-align: center;
}

.th-terms-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.6;
    pointer-events: none;
}

.th-terms-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.th-terms-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #bae6fd;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.th-terms-badge-dot {
    width: 8px;
    height: 8px;
    background-color: #38bdf8;
    border-radius: 50%;
    box-shadow: 0 0 10px #38bdf8;
}

.th-terms-hero h1 {
    color: #ffffff !important;
    font-size: clamp(1.85rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.th-terms-hero-lead {
    font-size: clamp(1.02rem, 1.5vw, 1.15rem);
    color: #e2e8f0;
    line-height: 1.95;
    margin: 0 auto 20px;
    max-width: 820px;
    text-align: justify;
    text-align-last: center;
}

.th-terms-meta-bar {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--th-radius-md);
    padding: 8px 20px;
    font-size: 0.88rem;
    color: #cbd5e1;
    flex-wrap: wrap;
    justify-content: center;
}

.th-terms-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.th-terms-meta-item strong {
    color: #ffffff;
}

/* 2. Preamble Notice Card */
.th-terms-preamble {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid #bfdbfe;
    border-right: 6px solid var(--th-primary);
    border-radius: var(--th-radius-lg);
    padding: 28px 30px;
    margin-bottom: 36px;
    box-shadow: var(--th-shadow-sm);
}

.th-terms-preamble-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.th-terms-preamble-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #dbeafe;
    color: var(--th-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.th-terms-preamble h2 {
    color: var(--th-text-heading);
    font-size: 1.22rem;
    font-weight: 800;
    margin: 0;
}

.th-terms-preamble p {
    font-size: 1.02rem;
    color: #334155;
    line-height: 2;
    margin: 0;
    text-align: justify;
}

/* 3. Main 2-Column Documentation Layout */
.th-terms-layout {
    display: grid !important;
    grid-template-columns: 300px 1fr !important;
    gap: 36px;
    align-items: start;
}

/* Sticky Sidebar Table of Contents */
.th-terms-sidebar {
    position: sticky;
    top: 24px;
    background: var(--th-bg-white);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 24px 20px;
    box-shadow: var(--th-shadow-sm);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.th-terms-toc-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--th-text-heading);
    font-size: 1.08rem;
    font-weight: 800;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--th-border);
}

.th-terms-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.th-terms-toc-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--th-radius-sm);
    color: #475569;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    transition: var(--th-transition);
}

.th-terms-toc-link:hover {
    background: #f1f5f9;
    color: var(--th-primary);
    transform: translateX(-3px);
}

.th-terms-toc-link.active {
    background: var(--th-accent-subtle);
    color: var(--th-primary);
    font-weight: 700;
    border-right: 3px solid var(--th-primary);
}

.th-terms-toc-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.th-terms-toc-link.active .th-terms-toc-num {
    background: #dbeafe;
    color: var(--th-primary);
}

/* Document Reading Surface */
.th-terms-content {
    background: var(--th-bg-white);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 44px 40px;
    box-shadow: var(--th-shadow-sm);
    min-width: 0;
}

.th-terms-section {
    margin-bottom: 48px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--th-border);
    scroll-margin-top: 30px;
}

.th-terms-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.th-terms-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--th-text-heading);
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 20px;
    line-height: 1.4;
}

.th-terms-section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--th-primary);
    border-radius: 4px;
    flex-shrink: 0;
}

.th-terms-content p {
    font-size: 1.04rem;
    color: #334155;
    line-height: 2.05;
    margin: 0 0 16px;
    text-align: justify;
}

.th-terms-content p strong {
    color: var(--th-text-heading);
}

.th-terms-content ul,
.th-terms-content ol {
    padding-right: 24px;
    margin: 0 0 20px;
    line-height: 2.05;
}

.th-terms-content li {
    font-size: 1.02rem;
    color: #334155;
    margin-bottom: 10px;
    text-align: justify;
}

.th-terms-content li strong {
    color: var(--th-text-heading);
}

/* Callout Boxes (Warnings, High CPU, Staff protection, Refund) */
.th-terms-callout-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-right: 5px solid #ef4444;
    border-radius: var(--th-radius-md);
    padding: 22px 24px;
    margin: 24px 0;
}

.th-terms-callout-danger h3,
.th-terms-callout-danger h4 {
    color: #991b1b;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 10px;
}

.th-terms-callout-danger p {
    color: #7f1d1d;
    margin: 0;
}

.th-terms-callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-right: 5px solid #f59e0b;
    border-radius: var(--th-radius-md);
    padding: 24px 26px;
    margin: 24px 0;
}

.th-terms-callout-warning h3,
.th-terms-callout-warning h4 {
    color: #92400e;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 12px;
}

.th-terms-callout-warning p {
    color: #78350f;
    margin: 0 0 14px;
}

.th-terms-callout-steps {
    background: #ffffff;
    border: 1px solid #fed7aa;
    border-radius: var(--th-radius-sm);
    padding: 16px 20px;
    margin-top: 14px;
}

.th-terms-callout-steps p {
    font-size: 0.96rem;
    line-height: 1.9;
    margin: 0 0 10px;
}

.th-terms-callout-steps p:last-child {
    margin: 0;
}

.th-terms-callout-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-right: 5px solid #22c55e;
    border-radius: var(--th-radius-md);
    padding: 22px 24px;
    margin: 24px 0;
}

.th-terms-callout-info h3,
.th-terms-callout-info h4 {
    color: #166534;
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 10px;
}

.th-terms-callout-info ul {
    margin: 0;
    padding-right: 20px;
}

.th-terms-callout-info li {
    color: #14532d;
    margin-bottom: 6px;
}

/* SLA Table Container & Styles */
.th-terms-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 24px 0;
    border-radius: var(--th-radius-md);
    border: 1px solid var(--th-border);
    box-shadow: var(--th-shadow-sm);
}

.th-terms-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.96rem;
    background: #ffffff;
}

.th-terms-table thead tr {
    background: var(--th-primary-dark);
    color: #ffffff;
}

.th-terms-table th {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.98rem;
    border: 1px solid #1e3a5f;
}

.th-terms-table td {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.th-terms-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.th-terms-table tbody tr:hover {
    background: #f1f5f9;
}

.th-terms-table-note {
    font-size: 0.93rem;
    color: var(--th-text-muted);
    background: #f8fafc;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-sm);
    padding: 14px 18px;
    margin-top: 14px;
    line-height: 1.85;
}

/* Footer Seal */
.th-terms-seal {
    background: #f8fafc;
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    padding: 28px 24px;
    text-align: center;
    margin-top: 40px;
}

.th-terms-seal p.brand {
    font-weight: 800;
    color: var(--th-primary-dark);
    font-size: 1.08rem;
    margin: 0 0 6px;
}

.th-terms-seal p.copyright {
    color: var(--th-text-muted);
    font-size: 0.92rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .th-terms-layout {
        grid-template-columns: 1fr !important;
    }
    .th-terms-sidebar {
        position: static;
        max-height: none;
        margin-bottom: 24px;
    }
    .th-terms-toc-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 768px) {
    .th-terms-page {
        padding: 6px 12px 40px;
    }
    .th-terms-hero {
        padding: 40px 20px 32px;
        border-radius: var(--th-radius-lg);
    }
    .th-terms-hero-lead {
        text-align: right;
        text-align-last: right;
    }
    .th-terms-content {
        padding: 28px 20px;
    }
    .th-terms-toc-list {
        grid-template-columns: 1fr;
    }
    .th-terms-section-title {
        font-size: 1.25rem;
    }
    .th-terms-table th,
    .th-terms-table td {
        padding: 10px 8px;
        font-size: 0.88rem;
    }
}

/* Print Stylesheet */
@media print {
    .th-terms-hero {
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        padding: 20px 0 !important;
        border-bottom: 2px solid #000000;
    }
    .th-terms-hero h1 {
        color: #000000 !important;
    }
    .th-terms-hero-lead {
        color: #333333 !important;
    }
    .th-terms-sidebar {
        display: none !important;
    }
    .th-terms-layout {
        display: block !important;
    }
    .th-terms-content {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    .th-terms-section {
        page-break-inside: avoid;
    }
}
