/*
Theme Name: News Cutting Desk
Theme URI: https://example.com/news-cutting-desk
Author: News Cutting Desk
Description: A mobile-friendly newsroom workflow for employees to digitize newspaper cuttings and editors to verify them.
Version: 1.1.0
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: news-cutting-desk
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --ncd-ink: #17211c;
  --ncd-paper: #f6f2e7;
  --ncd-surface: #fffdf8;
  --ncd-primary: #0f6b4f;
  --ncd-primary-dark: #084d39;
  --ncd-accent: #d64a2f;
  --ncd-line: #d8d1c3;
  --ncd-muted: #637069;
  --ncd-success: #20734d;
  --ncd-danger: #a62f25;
  --ncd-shadow: 0 12px 36px rgba(23, 33, 28, .1);
  --ncd-radius: 8px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--ncd-ink);
  background: var(--ncd-paper);
  font-family: "Noto Sans Oriya", "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: var(--ncd-primary); }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.ncd-site-header { background: var(--ncd-ink); color: var(--ncd-surface); border-bottom: 4px solid var(--ncd-accent); }
.ncd-header-inner { max-width: 1120px; margin: 0 auto; min-height: 72px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ncd-brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-family: Georgia, serif; font-size: clamp(1.25rem, 3vw, 1.65rem); font-weight: 700; }
.ncd-brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 2px solid currentColor; font-family: inherit; font-size: 1.1rem; }
.ncd-header-actions { display: flex; align-items: center; gap: 12px; font-size: .9rem; }
.ncd-header-actions a { color: inherit; }
.ncd-user { color: #dce4df; }

.ncd-main { min-height: calc(100vh - 132px); }
.ncd-shell { width: min(100% - 32px, 1040px); margin: 0 auto; padding: 42px 0 64px; }
.ncd-shell--narrow { max-width: 760px; }
.ncd-kicker { margin: 0 0 6px; color: var(--ncd-accent); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ncd-title { margin: 0; max-width: 780px; font-family: Georgia, "Noto Serif Oriya", serif; font-size: clamp(2rem, 7vw, 4.75rem); line-height: 1.02; letter-spacing: 0; }
.ncd-lede { max-width: 700px; margin: 18px 0 0; color: var(--ncd-muted); font-size: 1.1rem; }
.ncd-section-head { margin-bottom: 28px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.ncd-section-head h1 { margin: 0; font-family: Georgia, "Noto Serif Oriya", serif; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; }
.ncd-section-head p { margin: 8px 0 0; color: var(--ncd-muted); }

.ncd-title-row, .ncd-heading-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ncd-section-head--task .ncd-kicker { margin-bottom: 6px; }
.ncd-section-head--task { margin-bottom: 24px; }
.ncd-section-head--task h1 { flex: 1 1 auto; min-width: 0; }
.ncd-section-head--verify { margin-bottom: 22px; }
.ncd-section-head--verify h1 { margin-top: 6px; }
.ncd-button--micro { min-height: 32px; padding: 5px 10px; border-radius: 4px; font-size: .72rem; line-height: 1; white-space: nowrap; }
.ncd-filter-panel { padding: 16px 18px; }
.ncd-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.ncd-filter .ncd-field { min-width: 0; }
.ncd-filter .ncd-field label { margin-bottom: 4px; font-size: .72rem; }
.ncd-filter .ncd-field input { min-height: 38px; height: 38px; padding: 6px 9px; font-size: .82rem; }
.ncd-button--filter { min-height: 38px; padding: 6px 12px; font-size: .78rem; white-space: nowrap; }

.ncd-role-grid { margin-top: 42px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ncd-role { padding: clamp(24px, 5vw, 40px); background: var(--ncd-surface); border: 1px solid var(--ncd-line); border-top: 6px solid var(--ncd-primary); border-radius: var(--ncd-radius); box-shadow: var(--ncd-shadow); }
.ncd-role--editor { border-top-color: var(--ncd-accent); }
.ncd-role-number { color: var(--ncd-muted); font-family: Georgia, serif; font-size: 1.1rem; }
.ncd-role h2 { margin: 10px 0 4px; font-family: Georgia, serif; font-size: 2rem; }
.ncd-role p { margin: 0 0 22px; color: var(--ncd-muted); }
.ncd-login-form p { margin: 0 0 14px; }
.ncd-login-form label, .ncd-field label { display: block; margin-bottom: 7px; font-weight: 700; }
.ncd-login-form input[type=text], .ncd-login-form input[type=password], .ncd-field input[type=text], .ncd-field input[type=date], .ncd-field input[type=file], .ncd-field textarea, .ncd-field select {
  width: 100%; min-height: 50px; padding: 11px 13px; color: var(--ncd-ink); background: var(--ncd-surface); border: 1px solid var(--ncd-line); border-radius: 5px;
}
.ncd-field textarea { min-height: 270px; resize: vertical; line-height: 1.75; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(15,107,79,.24); outline-offset: 2px; border-color: var(--ncd-primary); }
.ncd-remember { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.ncd-remember input { width: 18px; height: 18px; }

.ncd-button, .ncd-login-form input[type=submit] {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border: 1px solid transparent; border-radius: 5px; color: var(--ncd-surface); background: var(--ncd-primary); font-weight: 800; text-decoration: none; cursor: pointer; transition: background .18s ease, transform .18s ease;
}
.ncd-button:hover, .ncd-login-form input[type=submit]:hover { background: var(--ncd-primary-dark); transform: translateY(-1px); }
.ncd-button--secondary { color: var(--ncd-ink); background: transparent; border-color: var(--ncd-line); }
.ncd-button--secondary:hover { color: var(--ncd-surface); background: var(--ncd-ink); }
.ncd-button--danger { background: var(--ncd-accent); }
.ncd-button--danger:hover { background: #ad3622; }
.ncd-button--danger-outline { color: var(--ncd-danger); background: transparent; border-color: #e0b4ae; }
.ncd-button--danger-outline:hover { color: var(--ncd-surface); background: var(--ncd-danger); border-color: var(--ncd-danger); }
.ncd-button--icon { min-width: 46px; padding: 10px; font-size: 1.25rem; }
.ncd-button[disabled] { opacity: .6; cursor: wait; transform: none; }
.ncd-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.ncd-panel { padding: clamp(20px, 5vw, 36px); background: var(--ncd-surface); border: 1px solid var(--ncd-line); border-radius: var(--ncd-radius); box-shadow: var(--ncd-shadow); }
.ncd-form { display: grid; gap: 22px; }
.ncd-required { color: var(--ncd-danger); }
.ncd-help { display: block; margin-top: 7px; color: var(--ncd-muted); font-size: .85rem; }
.ncd-image-preview { display: none; margin-top: 14px; padding: 10px; background: var(--ncd-paper); border: 1px solid var(--ncd-line); }
.ncd-image-preview.is-visible { display: block; }
.ncd-image-preview img { display: block; max-height: 420px; margin: 0 auto; object-fit: contain; }
.ncd-notice { margin: 0 0 22px; padding: 14px 16px; border-left: 5px solid var(--ncd-success); background: #e7f4ec; }
.ncd-notice--error { border-color: var(--ncd-danger); background: #fae8e5; }

.ncd-filter { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: end; }
.ncd-results-meta { margin: 24px 0 12px; color: var(--ncd-muted); font-size: .9rem; }
.ncd-story-list { display: grid; gap: 12px; }
.ncd-story-card { display: block; padding: 20px; color: inherit; background: var(--ncd-surface); border: 1px solid var(--ncd-line); border-left: 5px solid var(--ncd-primary); border-radius: 5px; text-decoration: none; transition: border-color .18s ease, transform .18s ease; }
.ncd-story-card:hover { border-color: var(--ncd-primary); transform: translateX(3px); }
.ncd-story-card--task:hover { transform: none; }
.ncd-story-card--task { padding: 22px; }
.ncd-story-card h2 { margin: 0 0 7px; font-family: Georgia, "Noto Serif Oriya", serif; font-size: 1.3rem; line-height: 1.3; }
.ncd-story-card p { margin: 0; color: var(--ncd-muted); }
.ncd-task-history { margin-top: 42px; }
.ncd-section-head--compact { margin-bottom: 18px; }
.ncd-section-head--compact h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1; }
.ncd-section-head--compact p { margin-bottom: 0; }
.ncd-existing-image { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 10px; background: var(--ncd-paper); border: 1px solid var(--ncd-line); }
.ncd-existing-image img { width: 150px; height: 90px; object-fit: cover; }
.ncd-existing-image span { color: var(--ncd-muted); font-size: .85rem; font-weight: 700; }
.ncd-task-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ncd-line); }
.ncd-task-row form { margin: 0; }
.ncd-feedback { margin-top: 16px; padding: 13px 15px; border-left: 4px solid var(--ncd-accent); background: #faf0ec; }
.ncd-feedback strong { display: block; margin-bottom: 3px; }
.ncd-feedback p { margin: 0; color: var(--ncd-ink); white-space: pre-wrap; }
.ncd-lock-note { color: var(--ncd-muted); font-size: .85rem; font-weight: 700; }
.ncd-card-feedback { display: block; margin-top: 10px; color: var(--ncd-accent); font-weight: 700; }
.ncd-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 6px; }
.ncd-review-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 1.8rem; }
.ncd-help--wide { max-width: 760px; }
.ncd-article-title-ref { margin: 10px 0 12px; font-family: Georgia, "Noto Serif Oriya", serif; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.08; }
.ncd-article-body--reference { padding-bottom: 28px; }
.ncd-story-meta { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--ncd-muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; }
.ncd-status { display: inline-flex; padding: 2px 8px; border-radius: 999px; color: var(--ncd-primary-dark); background: #e1f1e8; }
.ncd-status--needs-correction { color: var(--ncd-danger); background: #fae8e5; }
.ncd-empty { padding: 32px; text-align: center; color: var(--ncd-muted); background: var(--ncd-surface); border: 1px dashed var(--ncd-line); }

.ncd-detail-nav { margin-bottom: 22px; }
.ncd-article { max-width: 820px; margin: 0 auto; }
.ncd-article h1 { margin: 8px 0 22px; font-family: Georgia, "Noto Serif Oriya", serif; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.08; }
.ncd-article-body { padding: 26px 0 40px; border-top: 1px solid var(--ncd-line); font-size: 1.08rem; white-space: pre-wrap; }
.ncd-cutting-heading { margin: 0 0 12px; font-family: Georgia, serif; font-size: 1.5rem; }
.ncd-viewer { position: relative; height: min(72vh, 760px); min-height: 420px; overflow: hidden; background: #111612; border: 1px solid #111612; border-radius: var(--ncd-radius); touch-action: none; user-select: none; }
.ncd-viewer img { position: absolute; top: 50%; left: 50%; max-width: none; transform-origin: center; cursor: grab; will-change: transform; }
.ncd-viewer.is-dragging img { cursor: grabbing; }
.ncd-viewer-controls { position: absolute; z-index: 2; right: 12px; bottom: 12px; display: flex; gap: 8px; }
.ncd-viewer-controls .ncd-button { color: #fffdf8; background: rgba(23,33,28,.92); border-color: rgba(255,255,255,.2); }
.ncd-detail-nav--split { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.ncd-image-page { max-width: 1180px; margin: 0 auto; }
.ncd-image-page-nav { margin-bottom: 14px; }
.ncd-full-image-stage { display: flex; justify-content: center; padding: 4px; background: var(--ncd-ink); border-radius: var(--ncd-radius); }
.ncd-full-image { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; }
.ncd-review { margin-top: 28px; }
.ncd-review-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }

.ncd-site-footer { min-height: 60px; display: grid; place-items: center; padding: 16px; color: #dce4df; background: var(--ncd-ink); font-size: .82rem; text-align: center; }

@media (max-width: 720px) {
  .ncd-header-inner { min-height: 64px; }
  .ncd-user { display: none; }
  .ncd-shell { width: min(100% - 24px, 1040px); padding-top: 28px; }
  .ncd-role-grid { grid-template-columns: 1fr; margin-top: 30px; }
  .ncd-role { padding: 24px; }
  .ncd-section-head { display: block; }
  .ncd-title-row, .ncd-heading-line { gap: 8px; }
  .ncd-section-head--task h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .ncd-filter-panel { padding: 12px 10px; }
  .ncd-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 5px; }
  .ncd-filter .ncd-button { width: auto; }
  .ncd-filter .ncd-field label { font-size: .66rem; }
  .ncd-filter .ncd-field input { min-height: 34px; height: 34px; padding: 4px 6px; font-size: .72rem; }
  .ncd-button--filter { min-height: 34px; padding: 4px 8px; font-size: .7rem; }
  .ncd-review-grid { grid-template-columns: 1fr; }
  .ncd-actions { display: grid; grid-template-columns: 1fr; }
  .ncd-actions .ncd-button { width: 100%; }
  .ncd-task-row { align-items: stretch; flex-direction: column; }
  .ncd-task-row .ncd-actions { width: 100%; }
  .ncd-existing-image { width: 100%; }
  .ncd-existing-image img { width: 120px; height: 72px; }
  .ncd-button--micro { flex: 0 0 auto; }
  .ncd-section-head--verify .ncd-heading-line { align-items: center; }
  .ncd-review-heading { display: block; }
  .ncd-review-heading .ncd-status { margin-top: 10px; }
  .ncd-viewer { min-height: 360px; height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
