/**
 * Pandoc formatkonverterare – isolerat och mobilanpassat gränssnitt.
 * Ändrad: 2026-08-15 – första WordPress-versionen.
 */
.dhpf-converter {
    --dhpf-ink: #17202a;
    --dhpf-muted: #66727d;
    --dhpf-line: #dce3e6;
    --dhpf-paper: #fff;
    --dhpf-soft: #f4f7f7;
    --dhpf-accent: #126e66;
    --dhpf-accent-dark: #0b514c;
    width: 100%;
    margin: 30px auto;
    overflow: hidden;
    color: var(--dhpf-ink);
    border: 1px solid var(--dhpf-line);
    border-radius: 14px;
    background: var(--dhpf-paper);
    box-shadow: 0 20px 55px rgba(26, 40, 48, 0.1);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

.dhpf-converter * { box-sizing: border-box; }
.dhpf-converter button, .dhpf-converter select, .dhpf-converter textarea { font: inherit; }
.dhpf-converter .screen-reader-text {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.dhpf-header {
    padding: 28px 30px 22px;
    border-bottom: 1px solid var(--dhpf-line);
    background: linear-gradient(135deg, #f8fbfa, #eef5f3);
}

.dhpf-header .dhpf-kicker {
    margin: 0 0 5px;
    color: var(--dhpf-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.dhpf-header h2 { margin: 0; color: var(--dhpf-ink); font-size: clamp(26px, 4vw, 38px); line-height: 1.1; letter-spacing: -0.035em; }
.dhpf-header > p:last-child { margin: 9px 0 0; color: var(--dhpf-muted); font-size: 14px; }
.dhpf-form { padding: 24px; }

.dhpf-format-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
    align-items: end;
    gap: 14px;
    max-width: 820px;
    margin: 0 auto 24px;
}

.dhpf-format-row label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--dhpf-muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dhpf-format-row select {
    width: 100%;
    min-height: 45px;
    padding: 8px 38px 8px 12px;
    color: var(--dhpf-ink);
    border: 1px solid #cbd5da;
    border-radius: 8px;
    background-color: white;
}

.dhpf-format-row select:focus { border-color: var(--dhpf-accent); outline: 3px solid rgba(18, 110, 102, 0.16); }
.dhpf-arrow { display: grid; place-items: center; min-height: 45px; color: var(--dhpf-accent); font-size: 24px; }

.dhpf-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 70px minmax(0, 1fr);
    align-items: center;
}

.dhpf-editor {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--dhpf-line);
    border-radius: 10px;
    background: var(--dhpf-soft);
}

.dhpf-editor-heading {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--dhpf-line);
    background: white;
}

.dhpf-editor-heading strong { font-size: 15px; }
.dhpf-editor-heading > span { color: var(--dhpf-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.dhpf-link-button { padding: 4px; color: var(--dhpf-muted); border: 0; background: transparent; cursor: pointer; font-size: 12px; }

.dhpf-editor textarea {
    width: 100%;
    min-height: 340px;
    display: block;
    resize: vertical;
    margin: 0;
    padding: 16px;
    color: #26323b;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: var(--dhpf-soft);
    box-shadow: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.dhpf-editor textarea:focus { box-shadow: inset 0 0 0 2px var(--dhpf-accent); }

.dhpf-file-row, .dhpf-output-row {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--dhpf-line);
    background: white;
}

.dhpf-file-button, .dhpf-output-row button {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    color: var(--dhpf-ink);
    border: 1px solid #cbd5da;
    border-radius: 7px;
    background: white;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.dhpf-file-button:hover, .dhpf-output-row button:hover:not(:disabled) { color: var(--dhpf-accent); border-color: var(--dhpf-accent); }
.dhpf-file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dhpf-file-row > span { min-width: 0; overflow: hidden; color: var(--dhpf-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dhpf-output-row button:disabled { opacity: 0.45; cursor: not-allowed; }

.dhpf-convert-button {
    width: 88px;
    min-height: 64px;
    position: relative;
    z-index: 2;
    justify-self: center;
    display: grid;
    place-content: center;
    gap: 2px;
    padding: 8px;
    color: white;
    border: 7px solid white;
    border-radius: 999px;
    background: var(--dhpf-accent);
    box-shadow: 0 10px 25px rgba(18, 110, 102, 0.24);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.dhpf-convert-button:hover:not(:disabled) { background: var(--dhpf-accent-dark); }
.dhpf-convert-button:disabled { opacity: 0.7; cursor: wait; }

.dhpf-notice {
    margin-top: 18px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 7px;
    font-size: 13px;
}

.dhpf-notice-error { color: #922f2f; border-color: #edc7c7; background: #fcecec; }
.dhpf-notice-success { color: #17623b; border-color: #c0dfca; background: #e9f6ed; }
.dhpf-notice-info { color: #315c78; border-color: #c8dae6; background: #edf6fb; }
.dhpf-footer { padding: 13px 24px; color: var(--dhpf-muted); border-top: 1px solid var(--dhpf-line); background: #fbfcfc; font-size: 11px; text-align: center; }
.dhpf-message { padding: 12px 14px; border-radius: 7px; }
.dhpf-message-info { color: #315c78; border: 1px solid #c8dae6; background: #edf6fb; }

@media (max-width: 850px) {
    .dhpf-editor-grid { grid-template-columns: 1fr; }
    .dhpf-convert-button { width: auto; min-height: 44px; display: flex; align-items: center; gap: 8px; margin: 14px auto; padding: 7px 18px; border-width: 4px; }
    .dhpf-convert-button > span:last-child { transform: rotate(90deg); }
    .dhpf-editor textarea { min-height: 280px; }
}

@media (max-width: 560px) {
    .dhpf-header { padding: 22px 18px 18px; }
    .dhpf-form { padding: 16px; }
    .dhpf-format-row { grid-template-columns: 1fr; gap: 9px; }
    .dhpf-arrow { min-height: 18px; transform: rotate(90deg); }
    .dhpf-editor textarea { min-height: 240px; }
    .dhpf-file-row, .dhpf-output-row { align-items: stretch; flex-direction: column; }
    .dhpf-file-button, .dhpf-output-row button { width: 100%; }
    .dhpf-file-row > span { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .dhpf-converter *, .dhpf-converter *::before, .dhpf-converter *::after { transition: none !important; }
}
