/* ==========================================================================
   Alueposti Wire - editorial surfaces (cards, homepage modules, pages)
   Loaded after style.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shared story primitives
   -------------------------------------------------------------------------- */
.story { min-width: 0; display: flex; flex-direction: column; }
.story a { text-decoration: none; }

.story-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font: 700 11.5px/1.5 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.story-meta .meta-cat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}
.story-meta .meta-cat::before {
  content: "";
  width: 12px;
  height: 3px;
  background: var(--cat, var(--brand));
  flex: none;
}
.story-meta a.meta-cat:hover { color: var(--brand); text-decoration: underline; }
.story-meta time { color: var(--muted); letter-spacing: .02em; }

.story h1, .story h2, .story h3 { margin: 0 0 9px; }
.story h1 a, .story h2 a, .story h3 a { color: var(--ink); }
.story h1 a:hover, .story h2 a:hover, .story h3 a:hover { color: var(--brand); text-decoration: underline; text-decoration-thickness: 2px; }
.story h1 { font-size: clamp(31px, 4vw, 42px); line-height: 1.12; }
.story h2 { font-size: 21px; line-height: 1.24; }

.story .excerpt { margin: 0 0 12px; color: #333B33; font-size: 15.5px; line-height: 1.62; }

.story-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin-top: auto;
  padding-top: 10px;
  font: 600 12.5px/1.4 var(--sans);
  color: var(--muted);
}
.story-foot .read-more { color: var(--brand); text-decoration: none; border-bottom: 1px solid var(--signal); }
.story-foot .read-more:hover { color: var(--ink); }

.story-image {
  display: block;
  position: relative;
  background: var(--surface);
  border: var(--line-hair) solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.story-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-image .image-missing {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 140px;
  background: repeating-linear-gradient(135deg, var(--surface) 0 12px, #E7E7DD 12px 24px);
  color: #A6AEA2;
}
.story-image .image-missing svg { width: 44px; height: 36px; }

.ratio-16-10 { aspect-ratio: 16 / 10; }
.ratio-4-3 { aspect-ratio: 4 / 3; }

/* Lead card: image left on wide screens for the FAM-wire desk feel. */
.story--lead { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.story--lead .story-image { margin-bottom: 16px; }
.story--lead .excerpt { font-family: var(--serif); font-size: 18px; line-height: 1.62; max-width: 62ch; }

.story--wide { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.story--wide .story-image { margin-bottom: 0; }

.story--row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px 0;
  border-bottom: var(--line-hair) solid var(--line);
}
.module-stack .story--row:first-child { padding-top: 0; }
.story--row .story-image { margin-bottom: 0; }
.story--row h2 { font-size: 17px; line-height: 1.32; }
.story--row .story-foot { padding-top: 6px; }

.story--card { background: transparent; }
.story--text h2 { font-size: 22px; }

/* --------------------------------------------------------------------------
   Trust page navigation
   -------------------------------------------------------------------------- */
.trust-list { display: grid; gap: 0; margin: 26px 0; border-top: var(--line-hair) solid var(--line); max-width: var(--measure); }
.trust-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 10px 2px;
  border-bottom: var(--line-hair) solid var(--line);
  font: 700 16px/1.3 var(--display);
  color: var(--ink);
  text-decoration: none;
}
.trust-list a:hover { color: var(--brand); }
.trust-list span { font: 400 13px/1.4 var(--sans); color: var(--muted); }

.notice-block {
  border: var(--line-hair) solid var(--line);
  border-left: 4px solid var(--signal);
  background: var(--surface);
  padding: 18px 20px;
  margin: 22px 0;
  font-size: 15.5px;
  line-height: 1.65;
  max-width: var(--measure);
}
.notice-block p:last-child { margin-bottom: 0; }
.notice-block strong { font-family: var(--display); }

.page-facts { display: grid; gap: 12px; margin: 24px 0; padding: 20px 22px; background: var(--surface); border: var(--line-hair) solid var(--line); border-left: 4px solid var(--brand); max-width: var(--measure); }
.page-facts dt { font: 700 11.5px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.page-facts dd { margin: 2px 0 0; font-size: 15px; line-height: 1.6; }

.wire-block { margin: 40px 0; padding: 24px; background: var(--surface); border: var(--line-hair) solid var(--line); border-radius: var(--radius); }
.wire-block .wire-intro { max-width: 62ch; margin-bottom: 16px; }
.wire-block h2 { margin: 2px 0 8px; }
.wire-block .wire-list article { padding: 12px 0; border-top: var(--line-hair) solid var(--line); }
.wire-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 700 12px/1.5 var(--sans); color: var(--muted); margin-bottom: 4px; }
.wire-check { margin: 16px 0 0; font: 600 12.5px/1.5 var(--sans); color: var(--muted); }

@media (max-width: 720px) {
  .story--wide { grid-template-columns: minmax(0, 1fr); }
  .story--wide .story-image { margin-bottom: 14px; }
}

@media (max-width: 420px) {
  .story--row { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; }
}

/* --------------------------------------------------------------------------
   Reviewer byline and author profile
   -------------------------------------------------------------------------- */
.byline .byline-person--reviewer { color: var(--ink); }
.byline .byline-person--reviewer img { border-color: var(--brand); }

.author-profile {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin: 6px 0 30px;
  padding-bottom: 26px;
  border-bottom: 3px solid var(--ink);
}
.author-profile .standfirst { margin: 4px 0 10px; }
.author-beats { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.author-beats strong { font: 700 11.5px/1.5 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }

/* Toimitus cards: name links, anchors and role language */
.team-member h2 a.team-name { color: var(--ink); text-decoration: none; }
.team-member h2 a.team-name:hover { color: var(--brand); text-decoration: underline; text-decoration-thickness: 2px; }
.team-member:target { border-top-color: var(--brand); }

/* --------------------------------------------------------------------------
   Typography and spacing polish (green Aluearki palette unchanged)
   -------------------------------------------------------------------------- */
.story h1 { font-size: clamp(33px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -0.02em; }
.story h2 { letter-spacing: -0.012em; }
.story .story-meta { letter-spacing: .09em; }
.eyebrow { letter-spacing: .14em; }

.story--card .story-copy { padding: 2px 0 4px; }
.story--card { padding-bottom: 18px; border-bottom: var(--line-hair) solid var(--line); }
.module-ledger .story--card:last-child { padding-bottom: 0; border-bottom: 0; }
.story--wide .story-copy { padding-top: 2px; }
.story--lead .story-copy { padding-top: 4px; }
.story h1, .story h2 { margin: 0 0 10px; }
.story .excerpt { margin: 0 0 14px; }

.home-block { border-bottom: var(--line-hair) solid var(--line); padding-bottom: 34px; }
.home-block:last-of-type { border-bottom: 0; }

/* Consistent green focus ring (2px, 2px offset) */
:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Mobile menu: every target at least 44px tall */
@media (max-width: 900px) {
  .menu-panel .menu-topics a,
  .menu-panel .menu-links a,
  .menu-panel .menu-close,
  .menu-panel .search-row button,
  .menu-panel .search-row input[type="search"] { min-height: 44px; }
  .menu-panel .menu-links a { padding: 10px 2px; }
}

/* --------------------------------------------------------------------------
   Subtle motion, only when the reader has not asked for reduced motion.
   No tickers, no auto-scrolling, no fake counts.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .story { transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease); }
  .story--lead:hover,
  .story--card:hover,
  .story--wide:hover { transform: translateY(-2px); }
  .story--row:hover { transform: translateY(-1px); }

  @keyframes ap-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .home-block,
  .topic-nav-block,
  .editor-band { animation: ap-fade-in var(--t-slow) var(--ease) both; }

  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  .story,
  .home-block,
  .topic-nav-block,
  .editor-band { transition: none; animation: none; transform: none; }
}

/* --------------------------------------------------------------------------
   Print: black on white, no chrome, readable measure
   -------------------------------------------------------------------------- */
@media print {
  .ap-header,
  .ap-footer,
  .menu-panel,
  .reading-progress,
  .share-button,
  .share-status,
  .load-row,
  .topic-nav-block,
  .editor-band,
  .article-utility { display: none !important; }

  :root { --paper: #fff; --surface: #fff; --line: #000; --ink: #000; --muted: #000; --brand: #000; }
  html, body.ap-site { background: #fff; color: #000; }
  .shell { max-width: 720px; margin: 0 auto; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .article-heading h1 { max-width: none; }
  .reading-layout, .reading-rail { display: block; }
  .article-image img { max-width: 100%; }
  .story-image, .article-image { border: 0; }
  .byline { border-color: #000; }
}
