/**
 * pages.css — Page-Specific Styles
 *
 * Styles for blog content, marquee animations, and
 * other page-specific components.
 *
 * @package MyApostille
 * @version 2.0.0
 * @author Your Name
 * @license GPL-2.0+
 */

/* ============================================================
   MARQUEE / SCROLLING TEXT
   ============================================================ */

@keyframes marquee-ltr {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes marquee-rtl {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.marquee-ltr {
    animation: marquee-ltr 28s linear infinite;
    will-change: transform;
}

.marquee-rtl {
    animation: marquee-rtl 32s linear infinite;
    will-change: transform;
}

.marquee-row:hover .marquee-ltr,
.marquee-row:hover .marquee-rtl {
    animation-play-state: paused;
}

/* Marquee container */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee-container::before,
.marquee-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 1;
    pointer-events: none;
}

.marquee-container::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg, #f8fafc), transparent);
}

.marquee-container::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg, #f8fafc), transparent);
}

.dark .marquee-container::before {
    background: linear-gradient(to right, var(--color-bg-dark, #0f172a), transparent);
}

.dark .marquee-container::after {
    background: linear-gradient(to left, var(--color-bg-dark, #0f172a), transparent);
}

/* ============================================================
   PROSE / BLOG CONTENT
   ============================================================ */

.prose-content {
    max-width: 100%;
}

.prose-content h2 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 6rem;
    line-height: 1.2;
}

.dark .prose-content h2 {
    color: #f1f5f9;
}

.prose-content h2::before {
    content: '# ';
    color: var(--color-accent, #0f52ba);
    opacity: 0.5;
}

.prose-content h3 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 6rem;
    line-height: 1.3;
}

.dark .prose-content h3 {
    color: #f1f5f9;
}

.prose-content h4 {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 6rem;
}

.dark .prose-content h4 {
    color: #f1f5f9;
}

.prose-content p {
    color: #475569;
    margin-bottom: 1.25rem;
    line-height: 1.75;
    font-size: 0.9375rem;
}

.dark .prose-content p {
    color: #94a3b8;
}

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

.prose-content ul {
    list-style-type: disc;
}

.prose-content ol {
    list-style-type: decimal;
}

.prose-content li {
    margin-bottom: 0.5rem;
    color: #475569;
    line-height: 1.7;
}

.dark .prose-content li {
    color: #94a3b8;
}

.prose-content li::marker {
    color: var(--color-accent, #0f52ba);
}

.prose-content strong,
.prose-content b {
    font-weight: 700;
    color: #0f172a;
}

.dark .prose-content strong,
.dark .prose-content b {
    color: #f1f5f9;
}

.prose-content em,
.prose-content i {
    font-style: italic;
    color: #475569;
}

.dark .prose-content em,
.dark .prose-content i {
    color: #94a3b8;
}

.prose-content a {
    color: var(--color-accent, #0f52ba);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition-fast, 150ms ease);
}

.prose-content a:hover {
    color: var(--color-accent-dark, #0c4194);
}

.dark .prose-content a {
    color: #60a5fa;
}

.dark .prose-content a:hover {
    color: #93c5fd;
}

.prose-content blockquote {
    border-left: 4px solid var(--color-accent, #0f52ba);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-surface, #f8fafc);
    border-radius: 0 var(--radius-md, 12px) var(--radius-md, 12px) 0;
}

.dark .prose-content blockquote {
    background: var(--color-surface-dark, #1e293b);
}

.prose-content blockquote p {
    margin-bottom: 0;
    font-style: italic;
    color: #475569;
}

.dark .prose-content blockquote p {
    color: #94a3b8;
}

.prose-content blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-style: normal;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    font-size: 0.875rem;
}

.prose-content img {
    border-radius: var(--radius-lg, 16px);
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
}

.prose-content figure {
    margin: 1.5rem 0;
}

.prose-content figure figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted, #64748b);
    margin-top: 0.5rem;
}

.prose-content hr {
    border: 0;
    border-top: 2px solid var(--color-border, #e2e8f0);
    margin: 2rem 0;
}

.dark .prose-content hr {
    border-color: var(--color-border-dark, #334155);
}

.prose-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.prose-content table thead {
    background: var(--color-surface, #f1f5f9);
}

.dark .prose-content table thead {
    background: var(--color-surface-dark, #1e293b);
}

.prose-content table th,
.prose-content table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border, #e2e8f0);
    text-align: left;
}

.dark .prose-content table th,
.dark .prose-content table td {
    border-color: var(--color-border-dark, #334155);
}

.prose-content table th {
    font-weight: 700;
    color: #0f172a;
}

.dark .prose-content table th {
    color: #f1f5f9;
}

.prose-content code {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    background: var(--color-surface, #f1f5f9);
    border-radius: var(--radius-sm, 8px);
    color: var(--color-error, #ef4444);
}

.dark .prose-content code {
    background: var(--color-surface-dark, #1e293b);
}

.prose-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-lg, 16px);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
}

.prose-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
    .prose-content h2 {
        font-size: 1.25rem;
    }

    .prose-content h3 {
        font-size: 1.0625rem;
    }

    .prose-content p {
        font-size: 0.875rem;
    }

    .prose-content blockquote {
        padding: 0.75rem 1rem;
    }
}

/* ============================================================
   SITEMAP CUSTOM CUSTOMIZATIONS
   ============================================================ */

/* Fix white artifact: arbitrary Tailwind class negative left compile fallback */
.-left-\[24px\] {
    left: -24px !important;
}

/* Sitemap cards hover states & transitions */
.sitemap-card-item {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sitemap-card-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(15, 82, 186, 0.08);
}

/* Sitemap links slide-in micro interaction */
.sitemap-link-item {
    display: block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.sitemap-link-item:hover {
    transform: translateX(4px);
}

/* Smooth FAQ Accordion CSS Grid Transitions */
.faq-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 300ms cubic-bezier(0.4, 0, 0.2, 1), border-color 300ms ease;
}

.faq-content-wrapper.is-open {
    grid-template-rows: 1fr;
}

/* Hide scrollbar utility */
.scrollbar-none::-webkit-scrollbar {
    display: none;
}
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ============================================================
   EDITORIAL / BLOG PROSE RICH STYLING
   ============================================================ */

/* Reading Width & Typography Settings */
.prose-content {
    max-width: 48rem; /* ~768px (Optimal reading width for 65-75 chars/line) */
    margin-left: auto;
    margin-right: auto;
}

/* Heading hover direct anchor layout adjustments */
.prose-content h2,
.prose-content h3,
.prose-content h4 {
    position: relative;
    scroll-margin-top: 100px;
}

/* Heading Hover Anchor Link styling */
.heading-anchor {
    margin-left: 0.5rem;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Callout Boxes (Info, Warning, Success, Note) */
.callout-box {
    margin: 1.75rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg, 16px);
    border-left-width: 4px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.callout-info {
    background-color: rgba(59, 130, 246, 0.05);
    border-color: #3b82f6;
    color: #1e3a8a;
}
.dark .callout-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
}

.callout-warning {
    background-color: rgba(245, 158, 11, 0.05);
    border-color: #f59e0b;
    color: #78350f;
}
.dark .callout-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fde047;
}

.callout-success {
    background-color: rgba(16, 185, 129, 0.05);
    border-color: #10b981;
    color: #064e3b;
}
.dark .callout-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
}

.callout-note {
    background-color: rgba(100, 116, 139, 0.05);
    border-color: #64748b;
    color: #334155;
}
.dark .callout-note {
    background-color: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

/* Custom Checklist Bullets */
.prose-content ul.checklist {
    list-style-type: none !important;
    padding-left: 0.5rem !important;
}

.prose-content ul.checklist li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.prose-content ul.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f52ba' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}
.dark .prose-content ul.checklist li::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

/* Responsive Table Wrapper styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--color-border, #e2e8f0);
    margin: 1.75rem 0;
}
.dark .table-responsive {
    border-color: var(--color-border-dark, #334155);
}

.table-responsive table {
    margin: 0 !important;
}

/* Internal Links & External Link Indicators */
.prose-content a.internal-link {
    font-weight: 600;
    border-bottom: 2px solid rgba(15, 82, 186, 0.2);
    text-decoration: none !important;
}
.prose-content a.internal-link:hover {
    border-bottom-color: rgba(15, 82, 186, 0.8);
}

.prose-content a.external-link::after {
    content: '\2197'; /* Unicode diagonal arrow northwest ↗ */
    font-size: 0.75em;
    margin-left: 0.25rem;
    display: inline-block;
    transition: transform 150ms ease;
}
.prose-content a.external-link:hover::after {
    transform: translate(1px, -1px);
}

/* Sticky TOC active sidebar markers */
#toc-list-desktop a.font-extrabold {
    border-left-color: var(--color-accent, #0f52ba) !important;
}
.dark #toc-list-desktop a.font-extrabold {
    border-left-color: #60a5fa !important;
}

/* Scroll To Top Button styling */
.scroll-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background-color: var(--color-accent, #0f52ba);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 82, 186, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    z-index: 45;
}
.scroll-to-top-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.scroll-to-top-btn:hover {
    background-color: var(--color-accent-dark, #0c4194);
    transform: translateY(-2px);
}