/*
Theme Name: Subtitle Translator
Theme URI: https://engelskeundersaettelser.com
Description: Danish to English subtitle translator theme
Version: 1.0.0
Author: Custom
Text Domain: subtitle-translator
*/

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-logo-icon {
    width: 28px;
    height: 28px;
}

.site-logo span {
    color: var(--text-primary);
}

.site-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--primary-color);
}

/* Directory nav button */
.nav-directory-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px !important;
    margin-left: 30px;
    background: var(--primary-color);
    color: #fff !important;
    font-weight: 600;
    font-size: .88rem;
    border-radius: 6px;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}
.nav-directory-btn:hover {
    background: var(--primary-hover);
    color: #fff !important;
}

/* Hamburger toggle (CSS-only via checkbox hack) */
.nav-toggle-chk { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 110;
    -webkit-tap-highlight-color: rgba(0,0,0,.1);
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
    pointer-events: none;
}
.nav-toggle-chk:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-chk:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-toggle-chk:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .nav-toggle { display: flex !important; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 8px 24px rgba(0,0,0,.1);
        padding: 16px 20px;
        flex-direction: column;
        gap: 0;
        z-index: 200;
    }
    .nav-toggle-chk:checked ~ .site-nav,
    .site-nav.open { display: flex !important; }
    .site-nav a {
        margin-left: 0;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 1rem;
    }
    .site-nav a:last-child { border-bottom: none; }
    .site-header .container { position: relative; }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.hero h2 {
    font-size: 1.35rem;
    font-weight: 400;
    opacity: 0.85;
    margin-bottom: 20px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
.main-content {
    padding: 60px 0;
}

/* Upload Section */
.upload-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.upload-section h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--background);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.upload-zone svg {
    width: 64px;
    height: 64px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.upload-zone h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.upload-zone .supported {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--background);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* File Info */
.file-info {
    display: none;
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.file-info.show {
    display: block;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.file-meta h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.file-meta p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    padding: 8px;
}

/* Transcription Section */
.transcription-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.text-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .text-columns {
        grid-template-columns: 1fr;
    }
}

.text-column h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-column h3 .flag {
    font-size: 1.25rem;
}

.text-column textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.8;
    resize: vertical;
    transition: border-color 0.2s;
}

.text-column textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.text-column textarea:read-only {
    background: var(--background);
}

.char-count {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    text-align: right;
}

.char-count--limit {
    color: var(--error-color, #dc2626);
    font-weight: 600;
}

/* Timestamp Editor */
.timestamp-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.subtitle-entries {
    margin-top: 30px;
}

.subtitle-entry {
    display: grid;
    grid-template-columns: 120px 120px 1fr auto;
    gap: 15px;
    align-items: start;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .subtitle-entry {
        grid-template-columns: 1fr 1fr;
    }
}

.subtitle-entry label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}

.subtitle-entry input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
}

.subtitle-entry textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    min-height: 60px;
    resize: vertical;
}

.subtitle-entry input:focus,
.subtitle-entry textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.entry-actions {
    display: flex;
    gap: 8px;
    padding-top: 24px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: white;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--background);
}

.btn-icon.delete:hover {
    background: var(--error-color);
    color: white;
    border-color: var(--error-color);
}

.add-entry-btn {
    width: 100%;
    padding: 15px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.add-entry-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Download Section */
.download-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.download-buttons {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.download-card {
    flex: 1;
    min-width: 200px;
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.download-card:hover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.download-card svg {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.download-card h4 {
    margin-bottom: 5px;
}

.download-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Progress */
.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s;
    width: 0%;
}

/* Status Messages */
.status-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.status-message.show {
    display: block;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.status-message.info {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Footer */
.site-footer {
    background: #1e293b;
    border-top: 1px solid var(--border-color);
    padding: 40px 0 0;
    margin-top: 60px;
    color: #94a3b8;
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 2rem;
}
.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.75rem;
}
.footer-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.footer-nav-list a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color .2s;
}
.footer-nav-list a:hover {
    color: #fff;
}
.footer-social {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.footer-social a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color .2s;
}
.footer-social a:hover { color: #fff; }
.footer-social svg { flex-shrink: 0; }
.footer-bottom {
    border-top: 1px solid #334155;
    padding: 1.25rem 0;
    text-align: center;
}
.footer-bottom p {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}
@media (max-width: 768px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    .footer-nav-list,
    .footer-social {
        align-items: center;
    }
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hidden */
.hidden {
    display: none !important;
}

/* Media Player */
.media-player {
    margin-top: 20px;
    background: var(--background);
    border-radius: 12px;
    padding: 20px;
}

.media-player audio,
.media-player video {
    width: 100%;
    border-radius: 8px;
}

/* ================================================
   Static Pages (Cookies, Terms, About, Advertising, Contact)
   ================================================ */

.static-hero {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: #fff;
    padding: 60px 20px;
    text-align: center;
}
.static-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 10px;
}
.static-hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin: 0;
}
.static-content {
    padding: 40px 20px 60px;
    max-width: 900px;
    margin: 0 auto;
}
.static-content .container {
    max-width: 900px;
}

/* Content Blocks */
.content-block {
    margin-bottom: 32px;
}
.content-block h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}
.content-block p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 12px;
}
.content-block ul,
.content-block ol {
    margin: 8px 0 16px;
    padding-left: 24px;
    color: var(--text-secondary);
}
.content-block li {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 6px;
}
.content-block a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.content-block a:hover {
    text-decoration: underline;
}
.last-updated {
    font-size: 0.85rem !important;
    color: #94a3b8 !important;
    font-style: italic;
}

/* Cookie Preferences */
.cookie-preferences {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}
.cookie-category {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.cookie-category:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    gap: 16px;
}
.cookie-category-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.cookie-category-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}
.cookie-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.toggle-label {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}
.toggle-switch input:disabled + .toggle-slider {
    background: var(--primary-color);
    opacity: 0.6;
    cursor: not-allowed;
}
.cookie-details {
    padding: 0 24px 20px;
    border-top: 1px solid var(--background);
}
.cookie-details p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 12px 0 8px;
}
.cookie-details ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.cookie-details li {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.cookie-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

/* About Us Features */
.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}
.feature-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.feature-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.feature-card p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Advertising */
.ad-placements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.ad-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}
.ad-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.ad-card-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.ad-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.ad-card p {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.stat-item {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}
.stat-icon {
    margin-bottom: 8px;
}
.stat-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.stat-item p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* Contact Page */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 48px;
    align-items: start;
}
.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.contact-method {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.contact-method-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37,99,235,0.08);
    border-radius: 8px;
}
.contact-method h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.contact-method p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}
.contact-form-wrap {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}
.form-group .required {
    color: var(--error-color);
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--card-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}
.form-success {
    text-align: center;
    padding: 32px 16px;
}
.form-success svg {
    margin-bottom: 16px;
}
.form-success h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.form-success p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}
.form-errors {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.form-errors p {
    font-size: 0.88rem;
    color: var(--error-color);
    margin: 0 0 4px;
}
.form-errors p:last-child {
    margin-bottom: 0;
}

/* Static Pages Responsive */
@media (max-width: 768px) {
    .static-hero {
        padding: 40px 20px;
    }
    .static-hero h1 {
        font-size: 1.8rem;
    }
    .static-content {
        padding: 24px 16px 40px;
    }
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .cookie-actions {
        flex-direction: column;
    }
    .cookie-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .about-features {
        grid-template-columns: 1fr 1fr;
    }
    .ad-placements {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 480px) {
    .about-features {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .contact-form-wrap {
        padding: 20px;
    }
}

/* ================================================
   Homepage Mobile Optimization
   ================================================ */
@media (max-width: 768px) {
    /* Header: tighter, smaller logo */
    .site-header { padding: 12px 0; }
    .site-logo { font-size: 1.1rem; gap: 6px; }
    .site-logo-icon { width: 24px; height: 24px; }
    .container { padding: 0 16px; }

    /* Hero: smaller padding, font sizes */
    .hero { padding: 40px 16px 32px; }
    .hero h1 { font-size: 1.75rem; margin-bottom: 12px; line-height: 1.2; }
    .hero p { font-size: 1rem; line-height: 1.5; }

    /* Main content: less padding */
    .main-content { padding: 28px 0; }

    /* Section cards: tighter padding */
    .upload-section,
    .transcription-section,
    .timestamp-section,
    .download-section {
        padding: 20px 16px;
        border-radius: 12px;
        margin-bottom: 24px;
    }

    /* Section H2 */
    .upload-section h2,
    .transcription-section h2,
    .timestamp-section h2,
    .download-section h2 {
        font-size: 1.15rem;
        margin-bottom: 16px;
        gap: 8px;
    }
    .upload-section h2 svg,
    .transcription-section h2 svg,
    .timestamp-section h2 svg,
    .download-section h2 svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    /* Upload zone: smaller */
    .upload-zone { padding: 32px 16px; border-radius: 10px; }
    .upload-zone svg { width: 44px; height: 44px; margin-bottom: 12px; }
    .upload-zone h3 { font-size: 1rem; margin-bottom: 6px; }
    .upload-zone p { font-size: 0.9rem; margin-bottom: 12px; }
    .upload-zone .supported { font-size: 0.78rem; line-height: 1.4; display: block; }

    /* Buttons: full width on mobile, easier to tap */
    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    /* Translate section paragraph + button row */
    .transcription-section > p { font-size: 0.9rem; margin-bottom: 14px !important; }
    .transcription-section [style*="display: flex"] { gap: 10px !important; flex-direction: column; }

    /* Textareas: shorter on mobile */
    .text-column textarea { min-height: 180px; padding: 14px; font-size: 0.95rem; }
    .text-column h3 { font-size: 0.95rem; margin-bottom: 10px; }

    /* Subtitle entries: stack cleanly */
    .subtitle-entry {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
        padding: 14px;
    }
    .subtitle-entry > div:nth-child(3) { grid-column: 1 / -1; }
    .entry-actions {
        grid-column: 1 / -1;
        padding-top: 4px;
        justify-content: flex-end;
    }
    .subtitle-entry input[type="text"],
    .subtitle-entry textarea { font-size: 16px; } /* prevent iOS zoom */

    /* Download cards: stack */
    .download-buttons { gap: 12px; margin-top: 18px; flex-direction: column; }
    .download-card { padding: 20px 16px; min-width: 0; }
    .download-card svg { width: 36px; height: 36px; margin-bottom: 8px; }
    .download-card h4 { font-size: 1rem; }
    .download-card p { font-size: 0.85rem; }

    /* File info: cleaner */
    .file-info { padding: 14px; }
    .file-details { gap: 10px; }
    .file-icon { width: 40px; height: 40px; flex-shrink: 0; }
    .file-meta h4 { font-size: 0.9rem; word-break: break-all; }
    .file-meta p { font-size: 0.8rem; }

    /* Footer: less margin */
    .site-footer { padding: 28px 0 0; margin-top: 32px; }

    /* Add entry button */
    .add-entry-btn { padding: 12px; font-size: 0.95rem; }

    /* Status messages: tighter */
    .status-message { padding: 12px 14px; font-size: 0.9rem; }

    /* Inline section paragraph (textarea description) */
    .timestamp-section > p,
    .download-section > p,
    .upload-section > p { font-size: 0.88rem; }

    /* Prevent horizontal overflow */
    body { overflow-x: hidden; }
    img, svg, video { max-width: 100%; }
}

@media (max-width: 380px) {
    .site-logo { font-size: 0.95rem; }
    .site-logo-icon { width: 22px; height: 22px; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: 0.9rem; }
    .upload-section,
    .transcription-section,
    .timestamp-section,
    .download-section { padding: 16px 12px; }
}

/* ── Blog ───────────────────────────────────────────────────── */
--font-serif: 'DM Serif Display', Georgia, serif;

.section-label {
    display: inline-block;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--primary-color);
    background: #eff6fc;
    border-radius: 4px;
    padding: 5px 12px;
    margin-bottom: 14px;
}

.blog-hero {
    padding: 72px 0 56px;
    text-align: center;
    border-bottom: 1px solid #e8e6e1;
    background: #f8f7f4;
}

.blog-hero-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    color: #1b1b1f;
    margin: 0 0 12px;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.blog-hero-subtitle {
    font-size: 1.0625rem;
    color: #71717a;
    line-height: 1.7;
    max-width: 560px;
    margin: 0 auto;
}

.blog-section {
    padding: 64px 0 80px;
    background: #fff;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.blog-card {
    background: #fff;
    border: 1px solid #e8e6e1;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover {
    border-color: #d4d2cd;
    box-shadow: 0 4px 12px rgba(27,27,31,.08), 0 2px 4px rgba(27,27,31,.04);
    transform: translateY(-2px);
}

.blog-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f2f0eb;
}

.blog-card-image--placeholder {
    background: linear-gradient(135deg, #e0eef8 0%, #c0dcf0 100%);
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.06);
}

.blog-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15,42,74,.28) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.blog-card:hover .blog-card-image::after {
    opacity: 1;
}

.blog-card-body {
    padding: 20px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-cat {
    display: inline-block;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #2563a8;
    background: #eff6fc;
    padding: 3px 9px;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 10px;
}

.blog-cat:hover { background: #e0eef8; }

.blog-card-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.1875rem;
    font-weight: 400;
    line-height: 1.35;
    color: #1b1b1f;
    margin: 0 0 10px;
    flex: 1;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.blog-card-title a:hover { color: #1d4d85; }

.blog-card-excerpt {
    font-size: .875rem;
    line-height: 1.65;
    color: #71717a;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #e8e6e1;
    margin-top: auto;
}

.blog-date {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: .6875rem;
    color: #a1a1aa;
    letter-spacing: .02em;
}

.blog-read-more {
    font-size: .8125rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.blog-read-more:hover { color: #1d4ed8; }

.blog-pagination {
    margin-top: 56px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
    color: #3f3f46;
    border: 1px solid #e8e6e1;
    background: #fff;
    transition: all .2s ease;
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.blog-empty {
    text-align: center;
    color: #71717a;
    padding: 80px 0;
    font-size: 1.1rem;
}

@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .blog-grid { grid-template-columns: 1fr; gap: 16px; }
    .blog-hero { padding: 48px 0 40px; }
    .blog-section { padding: 40px 0 60px; }
}

/* ── Home: Seneste artikler ─────────────────────────────────── */
.home-articles {
    padding: 72px 0 80px;
    background: #f8f7f4;
    border-top: 1px solid #e8e6e1;
}

.home-articles-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.home-articles-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    color: #1b1b1f;
    margin: 0;
    letter-spacing: -.02em;
}

.home-articles-see-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .875rem;
    font-weight: 600;
    color: #2563a8;
    text-decoration: none;
    white-space: nowrap;
    transition: gap 0.2s ease, color 0.15s ease;
}

.home-articles-see-all:hover {
    color: #1d4d85;
    gap: 10px;
}

@media (max-width: 560px) {
    .home-articles { padding: 48px 0 56px; }
}

/* ── Single Article ─────────────────────────────────────────── */
.ba-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

.ba-breadcrumbs {
    padding: 88px 0 0;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: .6875rem;
    letter-spacing: .02em;
    color: #a1a1aa;
}

.ba-breadcrumbs a { color: #a1a1aa; text-decoration: none; transition: color .15s; }
.ba-breadcrumbs a:hover { color: #2563eb; }
.ba-sep { margin: 0 6px; color: #d4d4d8; }

.ba-header {
    padding: 28px 0 0;
    max-width: 780px;
    margin: 0 auto;
}

.ba-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.ba-header h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 400;
    line-height: 1.2;
    color: #1b1b1f;
    margin-bottom: 16px;
    letter-spacing: -.02em;
}

.ba-header-excerpt {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #71717a;
    margin-bottom: 24px;
}

.ba-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 0;
    border-top: 1px solid #e8e6e1;
    border-bottom: 1px solid #e8e6e1;
    flex-wrap: wrap;
}

.ba-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1d4d85, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1rem;
    flex-shrink: 0;
}

.ba-author-name {
    font-size: .875rem;
    font-weight: 600;
    color: #2e2e33;
}

.ba-author-meta {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: .6875rem;
    color: #a1a1aa;
    margin-top: 2px;
}

.ba-share-row {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.ba-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e8e6e1;
    border-radius: 6px;
    color: #a1a1aa;
    text-decoration: none;
    transition: all .15s;
}

.ba-share-btn:hover { color: #2563eb; border-color: #93c5fd; background: #eff6fc; }

.ba-featured-image {
    max-width: 960px;
    margin: 32px auto 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #f2f0eb;
}

.ba-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Article 2-col layout */
.ba-article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
    padding: 48px 0 64px;
    max-width: 1080px;
    margin: 0 auto;
}

.ba-body {
    min-width: 0;
}

.ba-body h2 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.625rem);
    font-weight: 400;
    color: #1b1b1f;
    margin: 48px 0 16px;
    padding-top: 24px;
    border-top: 1px solid #e8e6e1;
    letter-spacing: -.01em;
}

.ba-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.ba-body h3 {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    font-weight: 700;
    color: #2e2e33;
    margin: 32px 0 12px;
}

.ba-body p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #52525b;
    margin-bottom: 20px;
}

.ba-body ul, .ba-body ol {
    margin: 0 0 24px 24px;
    color: #52525b;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.ba-body li { margin-bottom: 8px; }

.ba-body strong { color: #1b1b1f; font-weight: 600; }

.ba-body a { color: #2563eb; text-decoration: none; }
.ba-body a:hover { text-decoration: underline; text-underline-offset: 2px; }

.ba-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9375rem;
    margin-bottom: 28px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e6e1;
}

.ba-body th {
    background: #f8f7f4;
    font-weight: 600;
    color: #1b1b1f;
    padding: 12px 16px;
    text-align: left;
    font-size: .8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #e8e6e1;
}

.ba-body td {
    padding: 12px 16px;
    color: #52525b;
    border-bottom: 1px solid #f2f0eb;
}

.ba-body tr:last-child td { border-bottom: none; }
.ba-body tr:nth-child(even) td { background: #fafafa; }

/* Sidebar */
.ba-sidebar { position: sticky; top: 100px; }

.ba-toc {
    background: #f8f7f4;
    border: 1px solid #e8e6e1;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.ba-toc-label {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #71717a;
    margin-bottom: 12px;
}

.ba-toc-nav { display: flex; flex-direction: column; gap: 4px; }

.ba-toc-link {
    font-size: .875rem;
    color: #52525b;
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 5px;
    line-height: 1.4;
    transition: all .15s;
}

.ba-toc-link:hover { background: #eff6fc; color: #2563eb; }

.ba-cta-box {
    background: linear-gradient(135deg, #1d4d85 0%, #2563eb 100%);
    border-radius: 10px;
    padding: 22px;
    color: #fff;
}

.ba-cta-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.125rem;
    margin-bottom: 8px;
    color: #fff;
}

.ba-cta-text {
    font-size: .875rem;
    line-height: 1.6;
    color: rgba(255,255,255,.8);
    margin-bottom: 16px;
}

.ba-cta-btn {
    display: inline-block;
    background: #fff;
    color: #1d4d85;
    font-weight: 700;
    font-size: .875rem;
    padding: 10px 18px;
    border-radius: 7px;
    text-decoration: none;
    transition: all .15s;
}

.ba-cta-btn:hover { background: #eff6fc; }

/* Related */
.ba-related {
    padding: 64px 0;
    background: #f8f7f4;
    border-top: 1px solid #e8e6e1;
}

.ba-related-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    color: #1b1b1f;
    margin-bottom: 32px;
}

.ba-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ba-related-card {
    background: #fff;
    border: 1px solid #e8e6e1;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: all .25s;
}

.ba-related-card:hover { border-color: #d4d2cd; box-shadow: 0 4px 12px rgba(27,27,31,.08); transform: translateY(-2px); }

.ba-related-card-image { aspect-ratio: 16/10; overflow: hidden; background: #f2f0eb; }
.ba-related-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.ba-related-card:hover .ba-related-card-image img { transform: scale(1.05); }

.ba-related-card-body { padding: 18px; }
.ba-related-card-body h3 { font-size: 1rem; line-height: 1.35; color: #1b1b1f; margin: 8px 0 8px; font-weight: 600; }
.ba-related-card:hover h3 { color: #2563eb; }

@media (max-width: 1024px) {
    .ba-article-layout { grid-template-columns: 1fr 260px; gap: 32px; }
}

@media (max-width: 768px) {
    .ba-article-layout { grid-template-columns: 1fr; gap: 0; }
    .ba-sidebar { display: none; }
    .ba-related-grid { grid-template-columns: 1fr; gap: 16px; }
    .ba-share-row { margin-left: 0; margin-top: 8px; }
    .ba-breadcrumbs { padding-top: 72px; }
}
