/* NordPoint News - deliberately conventional newspaper styling.
   The whole point of the site is that nothing about it looks made up, so this
   sticks to the layout language readers already expect from a wire service:
   serif headlines, a red rule under the masthead, a lead story, a card grid. */

:root {
  --accent: #b3122b;
  --ink: #14161a;
  --ink-soft: #4a5058;
  --ink-faint: #7b828c;
  --rule: #dcdfe4;
  --rule-soft: #eceef1;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --max: 1180px;
  --control-h: 34px;
  --serif: "Georgia", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------- masthead */

.masthead {
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 40;
}

.bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px 10px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }

.brand-mark {
  width: 12px; height: 12px;
  background: var(--accent);
  display: inline-block;
  transform: rotate(45deg);
}

.brand-name {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.bar-right { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  background: none; border: 0;
  font-size: 20px; cursor: pointer; color: var(--ink);
}

.lang-select {
  font: inherit;
  font-size: 13px;
  height: var(--control-h);
  padding: 0 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink-soft);
  cursor: pointer;
}

.btn-login {
  height: var(--control-h);
  padding: 0 16px;
}

.btn-login, .btn-primary {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
}

.btn-login.is-in { border-color: var(--rule); color: var(--ink-soft); }
.btn-primary { background: var(--accent); color: #fff; width: 100%; padding: 10px; }

.sections {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 10px;
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sections::-webkit-scrollbar { display: none; }

.sections a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}
.sections a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* -------------------------------------------------------------------- feed */

.view { max-width: var(--max); width: 100%; margin: 0 auto; padding: 26px 20px 60px; flex: 1; }

.lead-story {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.lead-story .thumb { aspect-ratio: 16 / 10; }
.lead-story h2 { font-size: 34px; line-height: 1.15; margin: 10px 0 12px; }
.lead-story .card-lead { font-size: 17px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 26px;
}

.card { display: flex; flex-direction: column; }

.thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--bg-soft);
  display: block;
}

.thumb-empty {
  background: linear-gradient(135deg, var(--bg-soft) 0%, #e7eaee 100%);
}

.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 12px;
}

.card h2, .card h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 6px 0 8px;
}
.card h3 { font-size: 19px; line-height: 1.28; }

.card-lead {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 8px;
}

.stamp { font-size: 12px; color: var(--ink-faint); margin-top: auto; }

.card a { transition: color 0.12s; }
.card a:hover h2, .card a:hover h3 { color: var(--accent); }

.card .thumb { transition: opacity 0.15s; }
.card a:hover .thumb { opacity: 0.88; }

/* Keeps the date on a common baseline across a row of unequal-length headlines. */
.grid .card { min-height: 100%; }

/* ----------------------------------------------------------------- article */

/* ~68 characters per line: past that the eye loses its place returning to the
   start of the next line, which matters most in the long serif body text. */
.article { max-width: 42em; margin: 0 auto; }
.article .kicker { margin-top: 0; }
.article h1 {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 8px 0 16px;
}
.article .standfirst {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.article .byline {
  font-size: 13px;
  color: var(--ink-faint);
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.article figure { margin: 0 0 24px; }
.article figure img { width: 100%; display: block; }
.article figure figcaption {
  font-size: 13px;
  color: var(--ink-faint);
  padding-top: 8px;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 10px;
}
.article .body p {
  font-family: var(--serif);
  font-size: 18.5px;
  line-height: 1.65;
  margin: 0 0 20px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.back-link:hover { color: var(--accent); }

/* -------------------------------------------------------------- misc / ui */

.more-wrap { text-align: center; padding: 36px 0 0; }

.btn-more {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 34px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.btn-more:hover { border-color: var(--accent); color: var(--accent); }

.notice { color: var(--ink-faint); padding: 60px 0; text-align: center; }

.skeleton { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: 0.45 } }

/* ------------------------------------------------------------------ search */

/* Quiet by default - a filled pill with no border, so the masthead is not
   competing with itself. Focus is shown once, by the wrapper; the generic
   focus-visible outline is suppressed on the inner input, or the two rings
   stack into a double red halo. */
.search {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 10px;
  height: var(--control-h);
  background: var(--bg);
  transition: border-color 0.15s;
}
.search:hover { border-color: var(--ink-faint); }
.search:focus-within { border-color: var(--accent); }

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: text;
  flex: none;
}

.search-icon {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: var(--ink-faint);
  stroke-width: 1.9; stroke-linecap: round;
  transition: stroke 0.15s;
}
.search:focus-within .search-icon { stroke: var(--accent); }

.search input {
  border: 0;
  font: inherit;
  font-size: 13.5px;
  width: 128px;
  background: transparent;
  color: var(--ink);
  transition: width 0.18s ease;
}
.search input::placeholder { color: var(--ink-faint); }
/* The browser's own clear button on <input type="search"> is the only "x" here -
   a second, hand-rolled one sat right beside it and read as a glitch. */
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search input:focus { width: 190px; }
.search input:focus-visible { outline: none; }


.page-head { border-bottom: 1px solid var(--rule); margin-bottom: 26px; padding-bottom: 14px; }
.page-head h1 { font-family: var(--serif); font-size: 28px; margin: 0 0 4px; }
.page-head-note { color: var(--ink-faint); font-size: 14px; margin: 0; }

mark { background: #fff2a8; color: inherit; padding: 0 1px; }

/* ----------------------------------------------------------------- paywall */

/* The blur sits on #page, and #paywall is its sibling - nesting the dialog
   inside a blurred element would blur the dialog too, because filter creates a
   containing block for descendants. */
#page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#page.is-locked {
  filter: blur(6px) saturate(0.7);
  pointer-events: none;
  user-select: none;
}

body.no-scroll { overflow: hidden; }

#paywall { position: fixed; inset: 0; z-index: 100; }

#paywall-veil {
  position: absolute;
  inset: 0;
  background: rgba(16, 18, 22, 0.45);
}

#paywall-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--bg);
  border-top: 4px solid var(--accent);
  border-radius: 3px;
  padding: 30px 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

#paywall-dialog h2 {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.25;
  margin: 0 0 8px;
}
#paywall-dialog h2.pw-refuse { font-size: 18px; line-height: 1.5; font-family: var(--sans); }

.pw-sub { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 20px; }

.pw-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 14px 0 18px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}
.pw-amount { font-family: var(--serif); font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.pw-period { color: var(--ink-faint); font-size: 14px; }

.pw-or {
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
  margin: 20px 0 14px;
  position: relative;
}
.pw-or::before, .pw-or::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 14%;
  border-top: 1px solid var(--rule);
}
.pw-or::before { left: 0; }
.pw-or::after { right: 0; }

.pw-actions { display: flex; gap: 10px; margin-top: 22px; }
.pw-actions button { flex: 1; }

#paywall-dialog label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

#paywall-dialog input {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  margin-top: 5px;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}
#paywall-dialog input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.btn-secondary {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.form-error { color: var(--accent); font-size: 13px; margin: 0 0 12px; }

/* ------------------------------------------------------- focus & motion */

/* :focus-visible only, so a mouse click does not leave a ring behind but
   keyboard users can actually see where they are - there was no focus style at
   all before. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ----------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--rule); background: var(--bg-soft); margin-top: auto; }
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 20px;
  font-size: 13px;
  color: var(--ink-faint);
}
.footer-sep { margin: 0 8px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 820px) {
  .lead-story { grid-template-columns: 1fr; gap: 14px; }
  .lead-story h2 { font-size: 26px; }
  .article h1 { font-size: 30px; }
  .article .body p { font-size: 17px; }
  .brand-name { font-size: 24px; }
  .page-head h1 { font-size: 23px; }
}

@media (max-width: 640px) {
  /* One row, the way a phone masthead is actually built: wordmark on the left,
     compact controls on the right. */
  .bar {
    flex-wrap: nowrap;
    padding: 10px 14px 8px;
    gap: 8px;
  }
  .brand-name { font-size: 21px; }
  .bar-right { gap: 6px; flex-wrap: nowrap; }

  /* Collapsed to its icon until tapped. The :focus variant has to be restated
     here: the desktop `.search input:focus { width: 190px }` is more specific
     than a bare `.search input`, and a media query adds no specificity of its
     own - so without this the field would spring open inline on focus, which is
     exactly the half-open state that looked broken. */
  .search {
    width: var(--control-h);
    padding: 0;
    border-color: transparent;
    justify-content: center;
  }
  .search .search-toggle { width: var(--control-h); height: var(--control-h); cursor: pointer; }
  .search:not(.is-open) input,
  .search:not(.is-open) input:focus { width: 0; padding: 0; }
  .search:not(.is-open):focus-within { border-color: transparent; }

  /* Expanded, the search *replaces* the masthead contents rather than floating
     over them - an absolutely positioned box left the brand's diamond poking out
     beside it. */
  .bar.searching .brand,
  .bar.searching .lang-select,
  .bar.searching .btn-login { display: none; }
  .bar.searching .bar-right { flex: 1; margin-left: 0; }

  .search.is-open {
    width: 100%;
    padding: 0 10px;
    justify-content: flex-start;
    gap: 7px;
    border-color: var(--accent);
  }
  .search.is-open input,
  .search.is-open input:focus { width: 100%; }

  .lang-select { padding: 0 4px; font-size: 12px; }
  .btn-login { padding: 0 12px; font-size: 12px; }

  .sections { padding: 0 14px 10px; gap: 16px; }
  .view { padding: 20px 14px 48px; }
  .grid { grid-template-columns: 1fr; gap: 24px; }
  .lead-story { padding-bottom: 22px; margin-bottom: 22px; }
  #paywall-dialog { padding: 24px 20px 22px; }
  .pw-amount { font-size: 34px; }
  .pw-actions { flex-direction: column; }
}
}
}
