/* EA7KLX articles (articulos.ea7klx.es). Same tokens and fonts as the EA7KLX
   home page. */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/barlow-semi-condensed-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Barlow Semi Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/barlow-semi-condensed-latin-600-normal.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  --paper: #eef1f5;
  --sheet: #ffffff;
  --ink: #16202e;
  --muted: #566273;
  --rule: #c5cdd8;
  --cota: #0a3fa8;
  --mark: #c4281c;
  --area: #fbe9d8;
  --terminal: #101a28;
  --terminal-ink: #dbe4f0;

  --serif: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Barlow Semi Condensed', 'DIN Alternate', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'DejaVu Sans Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0c1829;
    --sheet: #12233a;
    --ink: #e7edf5;
    --muted: #9fb0c6;
    --rule: #34496a;
    --cota: #9dbdff;
    --mark: #ff8f7f;
    --area: #2b3443;
    --terminal: #08111e;
    --terminal-ink: #dbe4f0;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

a {
  color: var(--cota);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

:focus-visible {
  outline: 2px solid var(--cota);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--sans);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--sheet);
  border-bottom: 1px solid var(--rule);
  padding: 3.5rem 0 2.5rem;
}

.masthead-kind {
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--muted);
}

.masthead-lead {
  margin: 1.75rem 0 0;
  max-width: 40rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.masthead-nav {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.125rem;
}

/* ---------- Sections ---------- */

.band {
  padding: 4rem 0;
  border-bottom: 1px solid var(--rule);
}

.band h2 {
  margin: 0 0 1rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  text-wrap: balance;
}

.band p {
  margin: 0 0 1rem;
  max-width: 38rem;
}

.section-lead {
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.band .actions {
  max-width: none;
}

.button {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border: 1.5px solid var(--cota);
  border-radius: 4px;
  background: var(--cota);
  color: var(--sheet);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.0625rem;
  text-decoration: none;
}

.button:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.button.is-quiet {
  background: transparent;
  color: var(--cota);
}

.button.is-quiet:hover {
  background: var(--cota);
  border-color: var(--cota);
  color: var(--sheet);
}

.page-footer {
  background: var(--sheet);
}

.page-footer p {
  margin: 0;
  font-family: var(--sans);
  color: var(--muted);
}


.page-footer .wrap {
  margin: 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.masthead-kind a {
  color: inherit;
}

.page-title {
  margin: 0.4rem 0 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(3.5rem, 11vw, 7.5rem);
  line-height: 0.9;
  color: var(--cota);
}

/* Site sections, at the foot of every masthead (same as ea7klx.es). */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.375rem;
}

.site-nav a {
  margin-top: -1px;
  padding-top: 0.85rem;
  border-top: 3px solid transparent;
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  border-top-color: var(--cota);
  color: var(--cota);
}

/* ---------- Articles ---------- */

/* Article titles are sentences, not names: smaller than a site title. */
.page-title.article-title {
  max-width: 30ch;
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  line-height: 1;
  text-wrap: balance;
}

.article-meta {
  margin: 1rem 0 0;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--muted);
}

.prose h3 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1.15;
}

.prose ul {
  max-width: 38rem;
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.band p.note {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Spec tables scroll on their own on a phone, never the page. */
.table-scroll {
  margin: 1.5rem 0;
  overflow-x: auto;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.specs {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.specs caption {
  padding: 0.75rem 1rem 0.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
}

.specs th,
.specs td {
  padding: 0.55rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.specs thead th {
  font-weight: 600;
  color: var(--cota);
}

.specs tbody th {
  font-weight: 500;
  color: var(--muted);
}

.specs tbody tr:last-child th,
.specs tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- Article list ---------- */

.article-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-list li + li {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.article-list h3 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.15;
}

.article-list h3 a {
  text-decoration: none;
}

.article-list h3 a:hover {
  text-decoration: underline;
}

.band .article-list .article-meta {
  margin: 0 0 0.75rem;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 48rem) {
  body {
    font-size: 1.0625rem;
  }

  .wrap {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .masthead {
    padding: 2.25rem 0 1.75rem;
  }

  .masthead-lead {
    font-size: 1.125rem;
  }

  .band {
    padding: 2.75rem 0;
  }

  .specs th,
  .specs td {
    padding: 0.5rem 0.75rem;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Link to the same page in the other language, after the breadcrumb. */
.masthead-kind .lang-switch {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--rule);
  color: var(--cota);
}

/* Model names such as FTM-510DE must not break at the hyphen. */
.nowrap {
  white-space: nowrap;
}

/* ---------- Figures ---------- */

.photo,
.shot {
  margin: 1.5rem 0 0;
}

.photo img,
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: var(--terminal);
}

.photo figcaption,
.shot figcaption {
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.75rem;
  margin-top: 1.5rem;
}

.gallery .shot {
  margin: 0;
}

/* A lead photo opens its section, above the heading. */
.photo {
  margin: 0 0 2.5rem;
}

.shot a {
  display: block;
}

kbd,
.band code {
  font-family: var(--mono);
  font-size: 0.85em;
}

kbd {
  display: inline-block;
  padding: 0.05em 0.4em;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--sheet);
  line-height: 1.35;
}

@media (max-width: 48rem) {
  .gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Click to zoom ----------
   Every image is a button that opens a popover copy of itself: the browser
   brings it to the top layer, shades the page behind (::backdrop) and closes
   it on Esc. No JavaScript, so the CSP keeps script-src 'none'. The copy is a
   full-screen close button: a click anywhere puts the image back. */

.zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: zoom-in;
}

.zoom:focus-visible {
  outline: 2px solid var(--cota);
  outline-offset: 3px;
}

.lightbox {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
}

.lightbox::backdrop {
  background: rgb(4 9 18 / 0.82);
  opacity: 0;
  transition: opacity 0.2s, overlay 0.2s allow-discrete, display 0.2s allow-discrete;
}

.lightbox:popover-open,
.lightbox:popover-open::backdrop {
  opacity: 1;
}

@starting-style {
  .lightbox:popover-open,
  .lightbox:popover-open::backdrop {
    opacity: 0;
  }
}

.lightbox .lightbox-close {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-out;
}

/* Photos fill the screen, letterboxed by object-fit, so small ones grow too. */
.lightbox .lightbox-close > img {
  display: block;
  width: 96vw;
  height: 94vh;
  height: 94dvh;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  object-fit: contain;
  transform: scale(1);
  transition: transform 0.2s;
}

@starting-style {
  .lightbox:popover-open .lightbox-close > img {
    transform: scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox::backdrop,
  .lightbox .lightbox-close > img {
    transition: none;
  }
}
