/* ==========================================================================
   Talousmagasiini — domain stylesheet (tm-site.css)
   Forest green / warm ivory analysis magazine. Owns only .tm-* surfaces.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
.tm-site {
  --tm-ink: #163d32;
  --tm-paper: #f7f5ed;
  --tm-text: #263a32;
  --tm-muted: #56665b;
  --tm-line: #c8d0c4;
  --tm-accent: #235b44;
  --tm-white: #ffffff;
  --tm-ochre: #a5792c;
  --tm-wrap: 1180px;
  --tm-font-serif: Georgia, "Times New Roman", serif;
  --tm-font-sans: Arial, Helvetica, system-ui, sans-serif;
}

/* --- Reset / base (scoped) ---------------------------------------------- */
.tm-site {
  background: var(--tm-paper);
  color: var(--tm-text);
  font-family: var(--tm-font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.tm-site *,
.tm-site *::before,
.tm-site *::after {
  box-sizing: border-box;
  min-width: 0;
}

.tm-site img {
  max-width: 100%;
  height: auto;
  display: block;
}

.tm-site a {
  color: var(--tm-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.tm-site a:hover {
  color: var(--tm-ink);
}

.tm-site h1,
.tm-site h2,
.tm-site h3 {
  font-family: var(--tm-font-serif);
  color: var(--tm-ink);
  line-height: 1.15;
  overflow-wrap: break-word;
}

/* Keyboard skip link */
.tm-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--tm-ink);
  color: var(--tm-white);
  padding: 12px 20px;
  font-family: var(--tm-font-sans);
}

.tm-skip:focus {
  left: 8px;
  top: 8px;
}

.tm-site a:focus-visible,
.tm-site button:focus-visible,
.tm-site summary:focus-visible {
  outline: 3px solid var(--tm-accent);
  outline-offset: 2px;
}

/* --- Layout wrapper ------------------------------------------------------ */
.tm-wrap {
  width: 100%;
  max-width: var(--tm-wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / masthead --------------------------------------------------- */
.tm-header {
  background: var(--tm-paper);
  border-bottom: 1px solid var(--tm-line);
}

.tm-masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: var(--tm-wrap);
  margin: 0 auto;
  padding: 28px 24px 20px;
}

.tm-brand {
  font-family: var(--tm-font-serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--tm-ink);
  text-decoration: none;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.tm-brand:hover {
  color: var(--tm-accent);
}

.tm-service {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.tm-service a {
  font-size: 15px;
  color: var(--tm-muted);
  text-decoration: none;
  font-family: var(--tm-font-sans);
}

.tm-service a:hover {
  color: var(--tm-accent);
  text-decoration: underline;
}

/* --- Navigation (native details) ----------------------------------------- */
.tm-nav {
  border-top: 1px solid var(--tm-line);
  max-width: var(--tm-wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.tm-nav summary {
  display: none;
  cursor: pointer;
  align-items: center;
  min-height: 44px;
  font-family: var(--tm-font-sans);
  font-weight: 700;
  color: var(--tm-ink);
  list-style: none;
}

.tm-nav summary::-webkit-details-marker {
  display: none;
}

.tm-nav summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: 10px;
  border-right: 2px solid var(--tm-ink);
  border-bottom: 2px solid var(--tm-ink);
  transform: rotate(45deg) translateY(-2px);
}

.tm-nav[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.tm-navlinks {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tm-navlinks a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--tm-font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--tm-ink);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.tm-navlinks a:hover,
.tm-navlinks a:focus-visible {
  color: var(--tm-accent);
  border-bottom-color: var(--tm-ochre);
}

.tm-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.tm-search input[type="search"] {
  font-family: var(--tm-font-sans);
  font-size: 16px;
  padding: 8px 12px;
  border: 1px solid var(--tm-line);
  border-radius: 2px;
  background: var(--tm-white);
  color: var(--tm-text);
  min-height: 44px;
}

.tm-search button {
  font-family: var(--tm-font-sans);
  font-size: 15px;
  font-weight: 700;
  padding: 10px 18px;
  min-height: 44px;
  background: var(--tm-accent);
  color: var(--tm-white);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.tm-search button:hover {
  background: var(--tm-ink);
}

/* Desktop: nav always expanded */
@media (min-width: 760px) {
  .tm-nav summary {
    display: none !important;
  }
}

/* Mobile: native toggle */
@media (max-width: 759px) {
  .tm-nav {
    padding: 0 16px;
  }

  .tm-nav summary {
    display: flex;
  }

  .tm-nav[open] {
    padding-bottom: 8px;
  }

  .tm-navlinks {
    flex-direction: column;
    gap: 0;
    padding-top: 4px;
  }

  .tm-navlinks a {
    min-height: 48px;
    border-bottom: 1px solid var(--tm-line);
  }

  .tm-search {
    padding: 12px 0;
  }

  .tm-search input[type="search"] {
    flex: 1 1 auto;
  }
}

/* --- Home: intro ---------------------------------------------------------- */
.tm-intro {
  padding: 44px 0 8px;
}

.tm-kicker {
  font-family: var(--tm-font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tm-accent);
  margin: 0 0 10px;
}

.tm-intro h1 {
  font-size: clamp(34px, 5vw, 52px);
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}

.tm-intro p {
  font-size: 19px;
  color: var(--tm-muted);
  max-width: 60ch;
  margin: 0;
}

/* --- Home: lead grid ------------------------------------------------------ */
.tm-lead {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;
  padding: 28px 0 36px;
}

.tm-mainlead {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tm-mainlead img {
  width: 100%;
  border-radius: 3px;
}

.tm-mainlead h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  margin: 0;
}

.tm-mainlead h2 a {
  color: var(--tm-ink);
  text-decoration: none;
}

.tm-mainlead h2 a:hover {
  color: var(--tm-accent);
  text-decoration: underline;
}

.tm-secondary {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

/* --- Cards ---------------------------------------------------------------- */
.tm-card {
  background: var(--tm-white);
  border: 1px solid var(--tm-line);
  border-radius: 4px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.tm-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 44px;
  height: 3px;
  background: var(--tm-ochre);
  border-radius: 0 0 2px 0;
}

.tm-card time {
  font-size: 14px;
  font-weight: 700;
  color: var(--tm-muted);
  font-family: var(--tm-font-sans);
}

.tm-card h2,
.tm-card h3 {
  margin: 0;
  font-size: 22px;
}

.tm-card h2 a,
.tm-card h3 a {
  color: var(--tm-ink);
  text-decoration: none;
}

.tm-card h2 a:hover,
.tm-card h3 a:hover {
  color: var(--tm-accent);
  text-decoration: underline;
}

.tm-card .tm-excerpt {
  margin: 0;
  color: var(--tm-muted);
  font-size: 16px;
}

.tm-mainlead .tm-card,
.tm-secondary .tm-card {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--tm-line);
  border-radius: 0;
  padding: 18px 0 0;
}

/* --- Topics strips -------------------------------------------------------- */
.tm-topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 8px 0 36px;
}

.tm-topics .tm-card {
  border-top: 2px solid var(--tm-ink);
  border-radius: 0;
}

/* --- Latest grid ---------------------------------------------------------- */
.tm-latest {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 8px 0 48px;
}

/* --- Section headings ------------------------------------------------------ */
.tm-section-title {
  font-size: 24px;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tm-line);
}

/* --- Article --------------------------------------------------------------- */
.tm-article {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 40px;
}

.tm-article-head {
  max-width: 850px;
  margin: 0 auto 28px;
}

.tm-article-head h1 {
  font-size: clamp(30px, 4.5vw, 46px);
  margin: 8px 0 16px;
  letter-spacing: -0.5px;
}

.tm-meta {
  font-family: var(--tm-font-sans);
  font-size: 15px;
  color: var(--tm-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tm-line);
}

.tm-feature {
  width: 100%;
  border-radius: 3px;
  margin: 0 0 8px;
}

.tm-feature figcaption {
  font-size: 14px;
  color: var(--tm-muted);
  padding-top: 8px;
}

/* Article content */
.tm-content {
  max-width: 68ch;
  margin: 0 auto;
  font-size: 19px;
  line-height: 1.7;
}

.tm-content p {
  margin: 0 0 20px;
}

.tm-content h2 {
  font-size: 28px;
  margin: 36px 0 14px;
}

.tm-content h3 {
  font-size: 23px;
  margin: 28px 0 12px;
}

.tm-content ul,
.tm-content ol {
  margin: 0 0 20px;
  padding-left: 28px;
}

.tm-content blockquote {
  margin: 24px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--tm-ochre);
  color: var(--tm-ink);
  font-family: var(--tm-font-serif);
  font-size: 21px;
  line-height: 1.5;
}

.tm-content img {
  border-radius: 3px;
}

/* Legacy content fitting inside article */
.tm-content .n24-wrap,
.tm-content [class*="n24-"] {
  max-width: 100%;
}

.tm-content .n24-wrap img,
.tm-content img {
  max-width: 100%;
  height: auto;
}

.tm-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.tm-content .tm-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Related list */
.tm-related {
  max-width: 68ch;
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--tm-line);
}

.tm-related h2 {
  font-size: 24px;
  margin: 0 0 12px;
}

.tm-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tm-related li {
  padding: 12px 0;
  border-bottom: 1px solid var(--tm-line);
}

.tm-related a {
  font-family: var(--tm-font-serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--tm-ink);
  text-decoration: none;
}

.tm-related a:hover {
  color: var(--tm-accent);
  text-decoration: underline;
}

/* --- Static page ------------------------------------------------------------ */
.tm-page {
  max-width: 70ch;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

.tm-page h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 18px;
}

.tm-page p {
  font-size: 18px;
  margin: 0 0 18px;
}

/* --- Archive ----------------------------------------------------------------- */
.tm-archive {
  padding: 32px 0 48px;
}

.tm-archive .tm-card {
  min-height: 0;
}

/* --- Footer -------------------------------------------------------------------- */
.tm-footer {
  background: var(--tm-ink);
  color: var(--tm-paper);
  margin-top: 48px;
  padding: 44px 0 28px;
}

.tm-footer .tm-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 48px;
}

.tm-footer h2,
.tm-footer h3 {
  color: var(--tm-white);
  font-size: 17px;
  margin: 0 0 12px;
  font-family: var(--tm-font-sans);
}

.tm-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tm-footer a {
  color: var(--tm-paper);
  text-decoration: none;
  font-size: 15px;
}

.tm-footer a:hover {
  color: var(--tm-white);
  text-decoration: underline;
}

.tm-footer .tm-ownership {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid rgba(247, 245, 237, 0.25);
  font-size: 14px;
  color: rgba(247, 245, 237, 0.75);
}

/* --- Responsive: tablet ----------------------------------------------------------- */
@media (max-width: 1023px) {
  .tm-lead {
    grid-template-columns: minmax(0, 1fr);
  }

  .tm-secondary {
    grid-template-rows: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tm-topics,
  .tm-latest {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- Responsive: mobile ------------------------------------------------------------ */
@media (max-width: 759px) {
  .tm-masthead {
    padding: 20px 16px 14px;
 }

  .tm-brand {
    font-size: 27px;
  }

  .tm-intro {
    padding: 24px 0 4px;
  }

  .tm-secondary,
  .tm-topics,
  .tm-latest,
  .tm-archive {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .tm-article,
  .tm-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tm-footer .tm-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- Wide desktop refinement ------------------------------------------------------- */
@media (min-width: 1440px) {
.tm-site {
  margin: 0;
    font-size: 17.5px;
  }
}

/* --- Reduced motion ------------------------------------------------------------------ */
/* Integrated markup refinements: authored and reviewed by the release owner. */
.tm-brand span{display:block;font:13px/1.5 Arial,sans-serif;letter-spacing:.05em;margin-top:8px;color:var(--tm-muted)}
.tm-nav{padding:0}
.tm-navbody{display:flex;align-items:center;justify-content:space-between;gap:24px}
.tm-search{display:block;margin:0;max-width:310px}
.tm-search label{display:block;font-size:12px;color:var(--tm-muted)}
.tm-search>div{display:flex;gap:6px}.tm-search input[type=search]{width:100%;min-width:0}
.tm-secondary{display:flex;flex-direction:column;gap:16px}
.tm-secondary>.tm-card{flex:1}
.tm-mainlead .tm-card h2{font-size:clamp(28px,3vw,38px)}
.tm-card-image{display:block}.tm-card-image img{width:100%;aspect-ratio:3/2;object-fit:cover}
.tm-card p{font-size:16px;line-height:1.55;margin:6px 0 0}
.tm-mainlead .tm-card p{font-size:18px}.tm-mainlead .tm-card-image{margin-bottom:12px}
.tm-topics,.tm-latest{display:block}
.tm-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
.tm-topic-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 32px}
.tm-topic-grid>div{border-top:1px solid var(--tm-line);padding:16px 0 6px}.tm-topic-grid h3{margin:6px 0;font-size:22px;font-style:italic}
.tm-number{font:14px Arial,sans-serif;color:var(--tm-muted)}
.tm-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;flex-wrap:wrap;border-top:1px solid var(--tm-line);margin-top:16px}
.tm-method-note{border-block:1px solid var(--tm-line);padding:20px 0 28px;max-width:75ch;margin:0 auto 30px}
.tm-article{padding-inline:0}.tm-article>.tm-content{max-width:none}.tm-article .tm-content>p,.tm-article .tm-content>h2,.tm-article .tm-content>h3{max-width:68ch;margin-inline:auto}
.tm-feature img{width:100%;max-height:530px;object-fit:cover}.tm-meta{display:block}
.tm-site .tm-content .mm-article-v1{--mm-ink:#163d32;--mm-accent:#235b44;--mm-accent-strong:#163d32;--mm-soft:#f7f5ed;--mm-edit-ink:#163d32;--mm-edit-accent:#235b44;--mm-edit-wash:#f7f5ed;--mm-line:#c8d0c4;font-family:Arial,sans-serif}
.tm-site .mm-offer-item h3{font-family:Arial,sans-serif;line-height:1.3}
.tm-content .n24-wrap{padding-inline:0}.tm-content .n24-wrap p,.tm-content .n24-wrap li{font-size:18px;line-height:1.7}
.tm-site .tm-content .n24-table{display:table;table-layout:fixed;white-space:normal;width:100%}.tm-site .tm-content .n24-table th,.tm-site .tm-content .n24-table td{white-space:normal;overflow-wrap:anywhere;padding:12px}
.tm-page{padding-inline:0}.tm-page details{padding:14px;border:1px solid var(--tm-line);margin:24px 0}.tm-page summary{min-height:44px;cursor:pointer;font-weight:bold}
.tm-page li{margin-bottom:12px}.tm-breadcrumb{font-size:14px}.tm-report{margin:36px auto;max-width:68ch}
.tm-pagination{display:flex;gap:8px;flex-wrap:wrap;margin-top:32px}.tm-pagination a,.tm-pagination span{min-width:44px;min-height:44px;padding:8px 12px;border:1px solid var(--tm-line);display:inline-flex;justify-content:center;align-items:center}.tm-pagination .current{background:var(--tm-ink);color:white}
.tm-footer nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tm-footer nav a{display:flex;align-items:center;min-height:44px}.tm-footer-brand{font:700 30px Georgia,serif;margin:0}.tm-owner{font-size:14px}.tm-footer .tm-wrap>p{grid-column:1/-1}
.tm-site .tm-skip{color:#fff}.tm-footer :focus-visible{outline-color:#fff}.tm-site input:focus-visible{outline:3px solid var(--tm-accent);outline-offset:2px}
@media(min-width:760px) and (max-width:1023px){.tm-lead{grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:24px}.tm-navbody{align-items:flex-start}.tm-navlinks{gap:12px}.tm-search{max-width:250px}.tm-service{gap:12px}}
@media(max-width:759px){.tm-navbody{display:block}.tm-search{max-width:none}.tm-search label{font-size:14px}.tm-brand{font-size:30px}.tm-masthead{gap:14px}.tm-service{gap:16px}.tm-service a{font-size:14px;min-height:32px;display:flex;align-items:center}.tm-lead,.tm-topic-grid,.tm-card-grid{grid-template-columns:minmax(0,1fr)}.tm-secondary{display:flex}.tm-article{padding-inline:0}.tm-content{font-size:18px}.tm-footer nav{grid-template-columns:minmax(0,1fr)}.tm-intro h1{font-size:34px}.tm-card{padding:16px}.tm-mainlead .tm-card{padding-inline:0}.tm-content .n24-wrap{margin-inline:0;padding:0}}
@media(max-width:359px){.tm-brand{font-size:26px}.tm-service{gap:12px}.tm-service a{font-size:13px}.tm-intro h1{font-size:31px}.tm-navlinks a{width:100%}}
/* --- Personal blog: notebook hero, avatar, identity ---------------------------------- */
.tm-notebook-hero{display:flex;align-items:center;gap:40px;padding:48px 0 20px}
.tm-notebook-hero .tm-hero-copy{flex:1 1 auto;min-width:0}
.tm-notebook-hero h1{font-size:clamp(34px,5vw,54px);margin:0 0 14px;letter-spacing:-0.5px}
.tm-notebook-hero .tm-hero-copy>p:last-child{font-size:19px;color:var(--tm-muted);max-width:58ch;margin:0}
.tm-site .tm-hero-avatar{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:10px;text-decoration:none;color:var(--tm-muted);max-width:280px}
.tm-hero-avatar img{width:260px;height:260px;max-width:280px;flex-shrink:0;border-radius:50%;border:3px solid var(--tm-ink);background:var(--tm-paper);object-fit:cover}
.tm-hero-avatar span{font-family:var(--tm-font-sans);font-size:14px;font-weight:700;text-align:center}
.tm-site .tm-hero-avatar:hover{color:var(--tm-accent)}
.tm-site .tm-hero-avatar:hover img{border-color:var(--tm-accent)}

/* Latest notes: two columns on desktop */
.tm-latest .tm-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}

/* Compact author identity under article content */
.tm-blog-identity{display:flex;align-items:flex-start;gap:16px;max-width:68ch;margin:28px auto 0;padding-top:16px;border-top:1px solid var(--tm-line)}
.tm-blog-identity img{width:80px;height:80px;flex:0 0 auto;border-radius:50%;border:2px solid var(--tm-line);background:var(--tm-paper);object-fit:cover}
.tm-blog-identity-body{min-width:0}
.tm-blog-identity h2{font-size:20px;margin:0 0 6px}
.tm-blog-identity p{margin:0 0 8px;font-size:15px;line-height:1.55;color:var(--tm-muted)}
.tm-blog-identity a{font-size:15px}

@media (max-width:759px){
  .tm-notebook-hero{flex-direction:column;align-items:flex-start;gap:20px;padding:28px 0 8px}
  .tm-site .tm-hero-avatar{flex-direction:row;align-items:center;gap:12px;max-width:none}
  .tm-hero-avatar img{width:140px;height:140px;border-width:2px}
  .tm-latest .tm-card-grid{grid-template-columns:minmax(0,1fr)}
}
.tm-site .tm-about-avatar{margin:0 0 24px;max-width:240px}
.tm-site .tm-about-avatar img{border-radius:50%;width:240px;height:240px;object-fit:cover}

@media (prefers-reduced-motion: reduce) {
  .tm-site *,
  .tm-site *::before,
  .tm-site *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
