/*
Theme Name: Northpage
Theme URI: https://camscanneronline.local
Author: Northpage
Description: Page layout, navigation, and SEO for an in-browser document scanner. The scanning tool is provided by the Document Scanner plugin.
Version: 0.2.4
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
Text Domain: northpage
*/

:root {
  color-scheme: light;
  --np-bg: #fafaf7;
  --np-surface: #ffffff;
  --np-well: #f0f1eb;
  --np-ink: #171914;
  --np-muted: #4e524a;
  --np-line: #e3e3db;
  --np-accent: #e4ff97;
  --np-accent-press: #d4f56a;
  --np-danger: #8d2f2f;
  --np-danger-bg: #f8eceb;
  --np-warning: #8a4b08;
  --np-warning-bg: #fff4e5;
  --np-success: #146c43;
  --np-success-bg: #e7f6ee;
  --np-info: #1d4e89;
  --np-info-bg: #e8f1fb;
  --np-header-height: 56px;
  --np-content: 720px;
  --np-font-system: "Segoe UI", system-ui, sans-serif;
  --np-font-latin: Inter, var(--np-font-system);
  --np-font-cyrillic: Inter, var(--np-font-system);
  --np-font-sc: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --np-font-jp: "Segoe UI", "Yu Gothic", "Hiragino Sans", sans-serif;
  --np-font-kr: "Segoe UI", "Malgun Gothic", sans-serif;
  --np-font-ar: "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --np-font: var(--np-font-latin);
  --np-h1: clamp(2rem, 4vw, 2.75rem);
  --np-h2: 1.5rem;
  --np-h3: 1.25rem;
  font-family: var(--np-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--np-ink);
  background: var(--np-bg);
}

html[lang|="zh"] {
  --np-font: var(--np-font-sc);
}

html[lang|="ja"] {
  --np-font: var(--np-font-jp);
}

html[lang|="ko"] {
  --np-font: var(--np-font-kr);
}

html[lang|="ar"] {
  --np-font: var(--np-font-ar);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--np-bg);
  color: var(--np-ink);
}

.np-entry img,
.np-seo img {
  max-width: 100%;
  height: auto;
}

button,
input,
label {
  font: inherit;
}

button {
  touch-action: manipulation;
}

a {
  color: var(--np-ink);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--np-ink);
  outline-offset: 3px;
}

.np-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10;
  background: #ffffff;
  color: var(--np-ink);
  padding: 8px 12px;
  border-radius: 8px;
}

.np-skip:focus {
  top: 12px;
}

.np-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--np-bg);
  color: var(--np-ink);
  border-bottom: 1px solid var(--np-line);
}

body.admin-bar .np-header {
  top: 32px;
}

.np-header-inner,
.np-footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.np-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--np-header-height);
  flex-wrap: nowrap;
  padding: 0;
}

.np-brand {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 8px;
  color: var(--np-ink);
  font-weight: 600;
  text-decoration: none;
  min-width: 0;
}

.np-brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.np-brand .custom-logo {
  display: block;
  width: auto;
  height: 36px;
  max-width: 240px;
  object-fit: contain;
}

.np-nav {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 4px 16px;
  margin-left: auto;
}

.np-nav a {
  color: var(--np-ink);
  text-decoration: none;
  font-weight: 500;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.np-nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

.np-lang {
  display: flex;
  flex: 0 0 auto;
  margin-left: 8px;
}

.np-lang-select {
  appearance: none;
  background-color: var(--np-surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--np-ink) 50%), linear-gradient(135deg, var(--np-ink) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  border: 1px solid var(--np-line);
  border-radius: 8px;
  color: var(--np-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-height: 40px;
  padding: 0 28px 0 12px;
}

.np-main {
  min-height: calc(100dvh - var(--np-header-height) - 88px);
}

.np-entry {
  width: min(var(--np-content), calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 64px;
}

.np-entry h1,
.np-seo h1 {
  margin: 0 0 16px;
  font-size: var(--np-h1);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.np-entry h2 {
  margin: 28px 0 8px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.np-entry a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.np-entry p,
.np-entry li {
  max-width: 42rem;
}

.np-privacy {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 130px 0 0;
  text-align: center;
}

.np-privacy h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.np-privacy-lead {
  max-width: 36rem;
  margin: 12px auto 0;
  color: var(--np-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.np-privacy-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.np-privacy-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 6px;
  align-items: start;
  min-width: 0;
  padding: 0 32px;
  background: transparent;
  border: 0;
}

.np-privacy-list li:first-child {
  padding-left: 0;
}

.np-privacy-list li:last-child {
  padding-right: 0;
}

.np-privacy-list li + li {
  border-left: 1px solid var(--np-line);
}

.np-privacy-list:has(> :nth-child(4)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0;
  row-gap: 28px;
}

.np-privacy-list:has(> :nth-child(4)) li {
  padding: 0 32px;
}

.np-privacy-list:has(> :nth-child(4)) li:nth-child(odd) {
  padding-left: 0;
}

.np-privacy-list:has(> :nth-child(4)) li:nth-child(even) {
  padding-right: 0;
}

.np-privacy-list:has(> :nth-child(4)) li:nth-child(3),
.np-privacy-list:has(> :nth-child(4)) li:nth-child(4) {
  border-left: 0;
}

.np-privacy-list:has(> :nth-child(4)) li:nth-child(even) {
  border-left: 1px solid var(--np-line);
}

.np-privacy-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  margin: 0;
  color: var(--np-muted);
}

.np-privacy-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.np-privacy-list h3 {
  grid-column: 2;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

.np-privacy-list p {
  grid-column: 2;
  margin: 0;
  color: var(--np-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.np-privacy-note {
  margin: 28px 0 0;
  color: var(--np-muted);
  font-size: 0.75rem;
}

.np-seo {
  width: min(var(--np-content), calc(100% - 32px));
  margin: 66px auto 64px;
  padding: 70px 0 16px;
  border-top: 1px solid var(--np-line);
}

@media (max-width: 720px) {
  .np-privacy-list,
  .np-privacy-list:has(> :nth-child(4)) {
    grid-template-columns: 1fr;
    margin-top: 28px;
  }

  .np-privacy-list li,
  .np-privacy-list:has(> :nth-child(4)) li {
    padding: 0;
  }

  .np-privacy-list li + li,
  .np-privacy-list:has(> :nth-child(4)) li:nth-child(even) {
    margin-top: 24px;
    padding-top: 24px;
    border-left: 0;
    border-top: 1px solid var(--np-line);
  }
}

.np-seo p {
  margin: 1em 0;
}

.np-seo h2,
.np-seo h3 {
  margin: 1.75em 0 0.6em;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.np-seo h2,
.np-entry h2 {
  font-size: var(--np-h2);
  font-weight: 600;
}

.np-seo h2:first-child {
  margin-top: 0;
}

.np-seo h3,
.np-entry h3 {
  font-size: var(--np-h3);
  font-weight: 600;
}

.np-seo p,
.np-seo li {
  max-width: 40rem;
}

.np-seo ol,
.np-seo ul {
  margin: 0.4em 0 0;
  padding-left: 1.25em;
}

[dir="rtl"] {
  font-family: Tahoma, "Segoe UI", "Noto Naskh Arabic", sans-serif;
}

[dir="rtl"] .np-skip {
  left: auto;
  right: 12px;
}

[dir="rtl"] .np-nav {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .np-lang {
  margin-left: 0;
  margin-right: 8px;
}

[dir="rtl"] .np-privacy-list,
[dir="rtl"] .np-entry,
[dir="rtl"] .np-seo {
  text-align: right;
}

[dir="rtl"] .np-privacy-list li:first-child {
  padding-left: 32px;
  padding-right: 0;
}

[dir="rtl"] .np-privacy-list li:last-child {
  padding-left: 0;
  padding-right: 32px;
}

[dir="rtl"] .np-privacy-list li + li {
  border-left: 0;
  border-right: 1px solid var(--np-line);
}

[dir="rtl"] .np-seo ol,
[dir="rtl"] .np-seo ul {
  padding-left: 0;
  padding-right: 1.25em;
}

@media (max-width: 720px) {
  [dir="rtl"] .np-privacy-list li:first-child,
  [dir="rtl"] .np-privacy-list li:last-child {
    padding-right: 0;
    padding-left: 0;
  }

  [dir="rtl"] .np-privacy-list li + li {
    border-right: 0;
  }
}

.np-footer {
  border-top: 1px solid var(--np-line);
  background: var(--np-surface);
}

.np-footer-inner {
  padding: 28px 0 32px;
  color: var(--np-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.np-footer-about {
  width: min(40rem, 100%);
  margin: 0 auto;
}

.np-footer-title {
  margin: 0 0 8px;
  color: var(--np-ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.np-footer .np-footer-intro {
  margin: 0 auto 16px;
  line-height: 1.55;
}

.np-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 0;
}

.np-footer-nav a {
  color: var(--np-muted);
  font-weight: 500;
  text-decoration: none;
}

.np-footer-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.np-footer p {
  margin: 0;
}

.np-footer .np-footer-note {
  margin-top: 16px;
}

@media (max-width: 782px) {
  body.admin-bar .np-header {
    top: 46px;
  }
}

@media (max-width: 640px) {
  .np-header-inner {
    gap: 12px;
  }

  .np-nav {
    gap: 4px 12px;
  }

  .np-footer-nav {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
}

.np-archive {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.np-archive h1 {
  margin: 0;
  font-size: var(--np-h1);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.np-archive-intro {
  max-width: 42rem;
  margin-top: 12px;
  color: var(--np-muted);
}

.np-archive-intro > :first-child {
  margin-top: 0;
}

.np-archive-intro > :last-child {
  margin-bottom: 0;
}

.np-archive-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.np-guide {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--np-surface);
  border: 1px solid var(--np-line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow 180ms ease;
}

.np-guide:hover,
.np-guide:focus-within {
  box-shadow: 0 8px 20px rgba(23, 25, 20, 0.08);
}

.np-guide-media {
  display: block;
  background: var(--np-well);
}

.np-guide-media img {
  display: block;
  width: 100%;
  height: auto;
}

.np-guide-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  padding: 16px 18px 18px;
}

.np-guide h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.np-guide h2 a {
  color: inherit;
  text-decoration: none;
}

.np-guide p {
  margin: 0;
  color: var(--np-muted);
}

.np-guide-more {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 8px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.np-archive .navigation.pagination {
  margin-top: 32px;
}

.np-archive .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.np-archive .page-numbers {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--np-line);
  border-radius: 8px;
  background: var(--np-surface);
  color: var(--np-ink);
  text-decoration: none;
}

.np-archive .page-numbers.current {
  background: var(--np-accent);
  border-color: var(--np-accent);
}

.np-archive-empty {
  margin: 24px 0 0;
  color: var(--np-muted);
}

[dir="rtl"] .np-archive,
[dir="rtl"] .np-guide {
  text-align: right;
}

[dir="rtl"] .np-guide-more {
  align-self: flex-end;
}

@media (max-width: 1100px) {
  .np-archive-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .np-archive {
    padding-top: 32px;
  }

  .np-archive-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .np-guide {
    transition: none;
  }
}
