/*
 * ZeroDataUpload site pages: the one base stylesheet of the guide, catalogue, converter listing, converter
 * FAQ/help, blog, legal/info and author pages (3 Oct 2026). It carries the homepage's design language so these
 * pages read as one site with index.html (home.css): Inter for text and Space Grotesk for headings, the same
 * page backgrounds and soft radial glow, opaque white (light) or near-black (dark) cards with a 1 px edge and
 * a soft shadow, black headlines, gradient pill buttons, pill chips. The page provides the side space (16 px
 * under 640 px, 80 px from 640 px, the global layout rule); there is no framed box around the content.
 *
 * Light is the default (data-theme="light" on <html>, set statically and kept by the head one-liner and
 * /libs/site.js); dark applies when the attribute is absent. Each family stylesheet (tools/tools.css,
 * converter/converter.css, blog/blog.css, content/content.css) is loaded after this
 * one and holds only that family's own components. The legacy variable names (--glass-bg, --text-primary,
 * --gradient-1 ...) are kept as aliases so older rules keep working.
 */

/* ----- 1. Tokens ----- */
:root {
    --brand: #8B5CF6;
    --brand-2: #EC4899;
    --brand-3: #3B82F6;
    --gradient-brand: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-brand-hover: linear-gradient(135deg, #7C3AED 0%, #DB2777 100%);
    --gradient-blue: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
    --success: #166534;
    --warning: #b45309;
    --danger: #b91c1c;
    --danger-strong: #b91c1c; /* fill under white text, both themes (the dark theme's --danger is a text colour) */

    --bg: #f8f9fa;
    --text: #0a0a14;
    --text-strong: #0a0a14;
    --text-2: #4b5563;
    --text-3: #5f6673; /* 4.5:1 or better on the light tinted panels (axe, 8 Oct 2026) */
    --link: #7c3aed;
    --link-hover: #6d28d9;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-border: rgba(0, 0, 0, 0.12);
    --surface-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.06);
    --surface-hover-shadow: 0 12px 24px rgba(139, 92, 246, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.1);
    --chip: rgba(255, 255, 255, 0.72);
    --chip-border: rgba(0, 0, 0, 0.1);
    --field: #ffffff;
    --field-border: rgba(0, 0, 0, 0.12);
    --placeholder: #9aa0a6;
    --code-bg: rgba(139, 92, 246, 0.1);
    --code-text: #6d28d9;
    --tint-brand: rgba(139, 92, 246, 0.08);
    --tint-brand-border: rgba(139, 92, 246, 0.3);
    --glow-alpha: 0.35;

    /* Aliases for the family stylesheets' older rules */
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --secondary: #EC4899;
    --dark: var(--bg);
    --light: var(--text);
    --glass-bg: var(--surface);
    --glass-border: var(--surface-border);
    --text-primary: var(--text);
    --text-secondary: var(--text-2);
    --gradient-1: var(--gradient-brand);
    --gradient-2: linear-gradient(135deg, #EC4899 0%, #F472B6 100%);
    --gradient-3: var(--gradient-brand);
    --neon-blue: #3B82F6;
}
:root:not([data-theme="light"]) {
    --bg: #0a0a0f;
    --text: #e5e7eb;
    --text-strong: #ffffff;
    --text-2: #9ca3af;
    --text-3: #8b93a1;
    --link: #a78bfa;
    --link-hover: #c4b5fd;
    --surface: rgba(20, 20, 32, 0.72);
    --surface-border: rgba(255, 255, 255, 0.15);
    --surface-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --surface-hover-shadow: 0 12px 24px rgba(139, 92, 246, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15);
    --chip: rgba(255, 255, 255, 0.04);
    --chip-border: rgba(255, 255, 255, 0.1);
    --field: rgba(255, 255, 255, 0.05);
    --field-border: rgba(255, 255, 255, 0.15);
    --placeholder: #6b7280;
    --code-bg: rgba(139, 92, 246, 0.15);
    --code-text: #c4b5fd;
    --tint-brand: rgba(139, 92, 246, 0.12);
    --tint-brand-border: rgba(139, 92, 246, 0.35);
    --glow-alpha: 1;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
}

/* ----- 2. Base ----- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 0;
    padding-top: 80px;
}
/* The homepage's fixed radial glow (home.css .main-gradient), dimmed in the light theme as there. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: var(--glow-alpha);
    background:
        radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(59, 130, 246, 0.2) 0%, transparent 50%);
}
img, svg, video { max-width: 100%; height: auto; }
button, input, select, textarea { font-family: inherit; }

/* ----- 3. Page container: the page provides the side space, nothing is framed ----- */
.container {
    --content-gutter: 16px;
    width: 100%;
    max-width: calc(900px + 2 * var(--content-gutter));
    margin: 24px auto 56px;
    padding: 8px var(--content-gutter) 0;
    background: none;
    border: 0;
    box-shadow: none;
}
@media (min-width: 640px) {
    .container { --content-gutter: 80px; margin-top: 32px; }
}
.container.tool-container, .container.blog-container { max-width: calc(1000px + 2 * var(--content-gutter)); }
.container.tools-index-container, .container.converter-index-container, .container.blog-index-container { max-width: 1600px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ----- 4. Type ----- */
h1, h2, h3, h4, h5, h6 { font-family: 'Space Grotesk', 'Inter', sans-serif; color: var(--text-strong); line-height: 1.2; }
h1 {
    font-size: clamp(2rem, 1.3rem + 3vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-align: center;
    margin-bottom: 0.75rem;
}
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; margin: 2.25rem 0 1rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }
h4 { font-size: 1rem; font-weight: 600; margin: 1.25rem 0 0.5rem; }
p { color: var(--text); margin-bottom: 1rem; line-height: 1.7; }
ul, ol { padding-left: 25px; margin-bottom: 1.5rem; }
li { color: var(--text); margin-bottom: 8px; line-height: 1.6; }
li strong, p strong { color: var(--text-strong); font-weight: 600; }
a { color: var(--link); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
/* Links inside running text are underlined, so they do not rely on colour alone */
.container p a, .container li a, .container td a, .container .form-note a, .container blockquote a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.page-subtitle, .tools-subtitle, .converter-subtitle, .blog-subtitle, .tool-tagline {
    text-align: center;
    color: var(--text-2);
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 42rem;
    margin: 0 auto 2rem;
}
.gradient-text {
    background: linear-gradient(90deg, #8B5CF6, #EC4899, #3B82F6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
    overflow-wrap: anywhere;
}
pre {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.5;
}
pre code { background: none; padding: 0; color: var(--text); }
blockquote {
    border-left: 4px solid var(--brand);
    padding: 15px 20px;
    margin: 1.5rem 0;
    background: var(--surface);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-2);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
.table-scroll table { margin: 0; }
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
}
th, td { border: 1px solid var(--surface-border); padding: 12px; text-align: left; color: var(--text); }
th { font-weight: 600; color: var(--text-strong); border-bottom: 2px solid var(--brand); }

/* ----- 5. Breadcrumbs (guides and posts) ----- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 1.75rem;
    font-size: 0.875rem;
    color: var(--text-3);
}
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--link); }
.breadcrumb [aria-current="page"] { color: var(--text-strong); font-weight: 500; }

/* ----- 6. Buttons and chips ----- */
.btn-primary, .btn-launch, .tool-launch-btn, .form-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--gradient-brand);
    color: #ffffff;
    border: 0;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 32px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover, .btn-launch:hover, .tool-launch-btn:hover, .form-submit-btn:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}
.btn-secondary, .btn-learn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text-strong);
    border: 1px solid var(--surface-border);
    border-radius: 9999px;
    font-weight: 600;
    font-size: 1rem;
    padding: 13px 28px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn-secondary:hover, .btn-learn:hover { border-color: var(--brand); color: var(--link); text-decoration: none; transform: translateY(-2px); }
.filter-btn {
    background: var(--chip);
    border: 1px solid var(--chip-border);
    color: var(--text-2);
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.filter-btn:hover { border-color: var(--brand); color: var(--link); }
.filter-btn.active { background: var(--gradient-brand); color: #ffffff; border-color: transparent; }
.category-filters, .blog-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 1.5rem 0 2rem; }
.pill-label {
    display: inline-block;
    background: var(--chip);
    border: 1px solid var(--chip-border);
    color: var(--link);
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* ----- 7. Cards (one surface for every family) ----- */
.card, .tool-card, .converter-card, .blog-card, .blog-card-featured, .feature-card, .faq-item, .related-tool-card,
.related-post-card, .toc, .callout, .article-meta, .author-bio, .tool-cta, .last-updated, .contact,
.privacy-highlight, .data-info, .rights-info, .checklist, .cookie-info, .privacy-note, .architecture-info,
.protection-info, .security-highlight, .contact-security, .service-info, .license-info, .legal-notice {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    box-shadow: var(--surface-shadow);
}
.card-hover, .tool-card, .converter-card, .blog-card, .blog-card-featured, .feature-card, .related-tool-card, .related-post-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card-hover:hover, .tool-card:hover, .converter-card:hover, .blog-card:hover, .blog-card-featured:hover,
.feature-card:hover, .related-tool-card:hover, .related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--surface-hover-shadow);
    text-decoration: none;
}
.callout { background: var(--tint-brand); border-color: var(--tint-brand-border); box-shadow: none; padding: 20px; margin: 1.5rem 0; }
.callout-title { font-weight: 700; color: var(--link); margin-bottom: 8px; }
.callout-privacy { background: rgba(22, 163, 74, 0.07); border-color: rgba(22, 163, 74, 0.3); }
.callout-privacy .callout-title { color: var(--success); }
.last-updated { text-align: center; margin-top: 3rem; padding: 20px; color: var(--text-2); box-shadow: none; }

/* ----- 8. Forms ----- */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; color: var(--text-strong); font-weight: 500; margin-bottom: 0.5rem; font-size: 0.95rem; }
.form-group input, .form-group textarea, .form-group select, .blog-search, .blog-sort, .search {
    width: 100%;
    padding: 12px 16px;
    background: var(--field);
    border: 1px solid var(--field-border);
    border-radius: 12px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input::placeholder, .form-group textarea::placeholder, .blog-search::placeholder, .search::placeholder { color: var(--placeholder); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus, .blog-search:focus, .blog-sort:focus, .search:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.form-group textarea { min-height: 150px; resize: vertical; }
.form-note { color: var(--text-2); font-size: 0.875rem; margin-top: 1rem; }

/* ----- 9. Theme toggle (as on the homepage) ----- */
.theme-toggle {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--chip);
    border: 1px solid var(--chip-border);
    color: var(--text-strong);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 40;
}
.theme-toggle:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2); }

/* ----- 10. Focus and responsive ----- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}
@media (max-width: 768px) {
    body { padding-top: 70px; }
    h2 { font-size: 1.3rem; }
    .theme-toggle { width: 45px; height: 45px; top: 75px; right: 15px; font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
    .card-hover, .tool-card, .converter-card, .blog-card, .blog-card-featured, .feature-card, .related-tool-card,
    .related-post-card, .btn-primary, .btn-launch, .tool-launch-btn, .form-submit-btn, .btn-secondary, .btn-learn, .theme-toggle { transition: none; }
}

/* Help and FAQ links under a tool's tagline (tools-app pages on the UltraCompress Pro template, 8 Oct 2026) */
.app-doclinks { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; }
.app-doclinks a, .container .app-doclinks a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    background: var(--surface);
    color: var(--text-strong);
    border: 1px solid var(--surface-border);
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.app-doclinks a:hover, .container .app-doclinks a:hover { border-color: var(--brand); color: var(--link); text-decoration: none; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .app-doclinks a { transition: none; } }

/* In-page messages that replace alert() boxes in the tools (zduToast() in each tool's script, 8 Oct 2026) */
.zdu-toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: calc(100vw - 32px); }
.zdu-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #0a0a14;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 4px solid #f87171;
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    min-width: 260px;
    max-width: 400px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
    animation: zduToastIn 0.3s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.zdu-toast.info { border-left-color: #38bdf8; }
.zdu-toast.warning { border-left-color: #fbbf24; }
.zdu-toast.success { border-left-color: #4ade80; }
.zdu-toast.leaving { opacity: 0; transform: translateX(40px); }
@keyframes zduToastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 639px) {
    .zdu-toast-container { left: 16px; right: 16px; bottom: 16px; }
    .zdu-toast { min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .zdu-toast { animation: none; transition: none; } }

/* No-JavaScript note under a tool's tagline (P-08, 8 Oct 2026) */
.app-noscript { margin: 1rem auto 0; max-width: 46rem; color: var(--text-2); font-size: 0.9375rem; }

/* Phones: secondary text at 16 px and tap targets of 44 px (AdSense audit H-04, 8 Oct 2026); larger screens unchanged */
@media (max-width: 639.98px) {
    .btn-primary, .btn-launch, .tool-launch-btn, .form-submit-btn, .btn-secondary, .btn-learn, .filter-btn { min-height: 44px; }
    .breadcrumb { font-size: 1rem; gap: 0 10px; }
    .breadcrumb a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
    .app-noscript, .form-note { font-size: 1rem; }
    .app-doclinks a { min-width: 44px; justify-content: center; }
    .back-bar a { display: inline-flex !important; align-items: center; min-height: 44px; } /* the link's own style is inline */
    .form-group input, .form-group select, .form-group textarea, select, input[type="search"], input[type="text"], input[type="email"] { min-height: 44px; }
}
