/* Taksiuutiset: oma ilme. Viininpunainen kansi, koralli päivämäärälaatat, uutispaperin lämmin pohja.
   Fontit: Bricolage Grotesque (otsikot) ja Schibsted Grotesk (teksti), SIL OFL 1.1, itse hostattu. */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque-latin-wdth.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-style: normal; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-wght.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }

:root {
  --paperi: #F4EEE8;
  --paperi-2: #EBE2DA;
  --muste: #1F1216;
  --teksti: #2B1D21;
  --himmea: #66504F;
  --viiva: #D6C8BF;
  --viini: #6B0F2A;
  --viini-tumma: #490919;
  --koralli: #FF6B57;
  --koralli-vaalea: #FFE2DC;
  --viini-teksti: #FFE9E4;
  --oikein: #17693A;
  --vaarin: #A3201A;
  --sade: 6px;
  --leveys: 70rem;
  --otsikko: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --teksti-fontti: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ulos: cubic-bezier(0.23, 1, 0.32, 1);
  color-scheme: light;
  scrollbar-color: var(--viini) var(--paperi-2);
}
html { scroll-padding-top: 8px; }
body { background: var(--paperi); color: var(--teksti); font: 400 1.125rem/1.65 var(--teksti-fontti); font-variant-numeric: lining-nums; }
::selection { background: var(--koralli); color: var(--muste); }
input, textarea { caret-color: var(--viini); }
h1, h2, h3 { font-family: var(--otsikko); color: var(--muste); line-height: 1.1; text-wrap: balance; }
a { color: var(--viini); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--viini); outline-offset: 2px; }

.hyppaa { position: absolute; left: -999px; top: 0; background: #fff; color: var(--muste); padding: 12px 16px; z-index: 10; }
.hyppaa:focus { left: 8px; top: 8px; }

/* Kansi */
.paa { background: var(--viini); }
.paa-sisus { display: flex; flex-direction: column; gap: 6px; padding-top: 22px; padding-bottom: 18px; }
.nimi { font-family: var(--otsikko); font-weight: 400; font-stretch: 75%; font-size: clamp(2.75rem, 14vw, 5rem); line-height: 0.95; letter-spacing: -0.025em; color: var(--koralli); text-decoration: none; }
.nimi b { font-weight: 800; font-stretch: 85%; color: #fff; }
.nimi:hover { text-decoration: none; }
.slogan { color: var(--viini-teksti); font-size: 1rem; }

.osastot { background: var(--viini-tumma); }
.osastot ul { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.14); max-width: var(--leveys); }
.osastot li { background: var(--viini-tumma); }
.osastot a { display: flex; align-items: center; min-height: 52px; padding: 8px 16px; font-weight: 600; font-size: 0.9375rem; line-height: 1.2; text-decoration: none; color: var(--viini-teksti); }
@media (hover: hover) and (pointer: fine) { .osastot a:hover { background: var(--koralli); color: var(--muste); } }
.osastot a:active { background: var(--koralli); color: var(--muste); }
.osastot a:focus-visible { outline-color: #fff; outline-offset: -3px; }

main.sisalto { padding-top: 2rem; padding-bottom: 1rem; }
h1 { font-size: clamp(1.9rem, 8vw, 2.75rem); font-weight: 800; font-stretch: 85%; margin: 0 0 1rem; letter-spacing: -0.015em; }
h2 { font-size: 1.5rem; font-weight: 700; font-stretch: 90%; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.375rem; font-weight: 700; font-stretch: 90%; margin: 0 0 0.25rem; }

.esittely p { font-size: 1.1875rem; margin: 0; max-width: 38rem; }
.meta { color: var(--himmea); font-size: 0.9375rem; margin: 0 0 0.75rem; }
.meta time { display: inline-block; background: var(--koralli); color: var(--muste); font-weight: 700; padding: 1px 8px; border-radius: 3px; }
.tyhja { color: var(--himmea); }

/* Etusivun jutut: päivämäärälaatta ja otsikko */
.lista { list-style: none; padding: 0; margin: 0; }
.lista li { padding: 14px 0; border-bottom: 1px solid var(--viiva); }
.lista time { display: inline-block; background: var(--koralli); color: var(--muste); font-size: 0.875rem; font-weight: 700; padding: 1px 8px; border-radius: 3px; margin-bottom: 6px; }
.lista a { display: block; font-family: var(--otsikko); font-weight: 700; font-stretch: 90%; font-size: 1.3125rem; line-height: 1.18; color: var(--muste); text-decoration: none; }
.lista li:first-child a { font-size: 1.75rem; font-weight: 800; font-stretch: 85%; line-height: 1.1; }
@media (hover: hover) and (pointer: fine) { .lista a:hover { color: var(--viini); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.16em; } }
/* Juttukortti listassa: ensimmäinen leveänä, muut pikkukuvana otsikon vasemmalla */
.lista li { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
.lista li:first-child { grid-template-columns: 1fr; gap: 12px; }
.lista .lista-kuva img { display: block; width: 100%; height: auto; border-radius: 4px; background: var(--viini); }
@media (min-width: 48rem) { .lista li { grid-template-columns: 176px 1fr; gap: 20px; } .lista li:first-child { grid-template-columns: 1fr; } .lista li:first-child .lista-kuva { max-width: 40rem; } }

/* Osastot: viininpunainen välilehti, sen alla ruled-juttulista */
.osasto { margin-top: 2.5rem; }
.osasto h2 { background: var(--viini); color: #fff; margin: 0 0 4px; padding: 10px 16px; font-size: 1.25rem; border-radius: var(--sade) var(--sade) 0 0; }
.kortti { padding: 18px 0 20px; border-bottom: 1px solid var(--viiva); }
.kortti p { margin: 0.25rem 0 0; }
.kortti .meta { margin: 0.25rem 0 0.5rem; }
.kortti h3 a { color: var(--muste); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .kortti h3 a:hover { color: var(--viini); text-decoration: underline; text-decoration-thickness: 2px; } }
.osasto .tyhja { padding: 14px 0; margin: 0; border-bottom: 1px solid var(--viiva); }

/* Juttu */
.juttu > * { max-width: 40rem; }
.osasto-merkki { margin: 0 0 1rem; font-size: 0.875rem; font-weight: 700; }
.osasto-merkki a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; background: var(--viini); color: #fff; text-decoration: none; border-radius: 3px; }
.juttu > .meta { margin-bottom: 1.25rem; }
.tiiv { font-size: 1.3125rem; line-height: 1.5; font-weight: 500; color: var(--muste); margin: 0 0 1.75rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--muste); }
.juttu h2 { color: var(--viini); margin-top: 2.5rem; }
.juttu ul { padding-left: 1.25rem; }
.juttu li { margin-bottom: 0.6rem; }
.juttu li::marker { color: var(--viini); }

.taulu { width: 100%; border-collapse: collapse; background: #fff; margin: 1rem 0; font-size: 0.9375rem; table-layout: fixed; }
.taulu caption { text-align: left; font-weight: 700; padding-bottom: 6px; color: var(--muste); }
.taulu th, .taulu td { border: 1px solid var(--viiva); padding: 8px; text-align: left; vertical-align: top; }
.taulu thead th { background: var(--viini); color: #fff; font-size: 0.8125rem; overflow-wrap: anywhere; hyphens: auto; border-color: var(--viini); }
.taulu tbody th { background: var(--koralli-vaalea); color: var(--muste); }
.taulu th:first-child, .taulu td:first-child { width: 54%; overflow-wrap: anywhere; }
.taulu td:nth-child(n+2), .taulu thead th:nth-child(n+2) { text-align: right; }
.aluelista { list-style: none; padding: 0 !important; background: #fff; border: 1px solid var(--viiva); border-radius: var(--sade); }
.aluelista li { padding: 10px 12px; margin: 0 !important; border-bottom: 1px solid var(--viiva); font-size: 0.9375rem; overflow-wrap: anywhere; max-width: none; }
.aluelista li:last-child { border-bottom: 0; }

.lisaa { margin: 1.5rem 0 0; }
.lisaa a { display: inline-block; padding: 12px 0; font-weight: 600; }
.lahteet { margin-top: 2.5rem; }
.lahteet a { overflow-wrap: anywhere; }
.lahteet li { padding: 4px 0; }
.huom { color: var(--himmea); font-size: 0.9375rem; }

/* Tilauskortti: kannen väri toistuu */
.tilaus { background: var(--viini); color: var(--viini-teksti); border-radius: var(--sade); padding: 22px 18px 24px; margin: 2.5rem 0 1rem; }
.tilaus h2 { color: #fff; margin: 0 0 0.5rem; }
.tilaus p { margin: 0 0 1rem; }
.tilaus a { color: #fff; }
.tilaus a:focus-visible, .tilaus button:focus-visible, .tilaus input:focus-visible { outline-color: #fff; }
.tilauslomake label[for="sposti"] { display: block; font-weight: 600; margin-bottom: 6px; color: #fff; }
.tilauslomake input[type="email"] { width: 100%; min-height: 52px; padding: 10px 12px; font-size: 16px; border: 2px solid transparent; border-radius: var(--sade); background: #fff; color: var(--muste); }
.tilauslomake input[type="email"]::placeholder { color: #6E5A5C; opacity: 1; }
.mehu { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.suostumus { display: flex; gap: 12px; align-items: flex-start; margin: 1rem 0 0.5rem; }
.suostumus input { flex: none; width: 24px; height: 24px; margin: 3px 0 0; accent-color: var(--koralli); }
.suostumus label { font-size: 1rem; }
.tietosuoja-linkki { margin: 0 0 1rem !important; }
.tietosuoja-linkki a { display: inline-block; padding: 12px 0; }
.tilauslomake button { width: 100%; min-height: 52px; padding: 12px 20px; font-size: 16px; font-weight: 800; border: 0; border-radius: var(--sade); background: var(--koralli); color: var(--muste); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .tilauslomake button:hover { background: #FF8272; } }
.tilauslomake button:active { transform: scale(0.98); }
.lomake-viesti { margin: 0.75rem 0 0 !important; font-weight: 600; }
.lomake-viesti.virhe { color: #FFD3CB; }
.lomake-viesti.ok { color: #CDF5D8; }

.alatunniste { border-top: 1px solid var(--viiva); margin-top: 4rem; padding: 2rem 0; color: var(--himmea); font-size: 0.9375rem; }
.alatunniste p { margin: 0 0 0.25rem; }
.alatunniste a { display: inline-block; padding: 8px 0; }

@media (min-width: 640px) {
  .osastot ul { display: flex; background: none; margin-left: -20px; }
  .osastot li { background: none; }
  .osastot a { padding: 8px 20px; white-space: nowrap; }
  .tilauslomake button { width: auto; }
  .sisalto { padding-left: 24px; padding-right: 24px; }
  .slogan { font-size: 1.0625rem; }
}

/* Etusivu leveällä näytöllä: lukukolumni ja tilaus vierekkäin */
@media (min-width: 64rem) {
  main.sisalto:not(.juttu) { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; column-gap: 56px; align-items: start; }
  main.sisalto:not(.juttu) > .esittely, main.sisalto:not(.juttu) > .uusimmat { grid-column: 1; }
  main.sisalto:not(.juttu) > .tilaus { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; position: sticky; top: 16px; }
  main.sisalto:not(.juttu) > .osasto { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; align-items: start; }
  main.sisalto:not(.juttu) > .osasto h2 { grid-column: 1 / -1; }
  .osasto .tyhja { grid-column: 1 / -1; }
  .uusimmat > h2 { margin-top: 2rem; }
}

/* Liike: yksi hetki, etusivun juttulistan sisääntulo. Sisältö näkyy ilman animaatiotakin. */
@media (prefers-reduced-motion: no-preference) {
  .osastot a, .lista a, .kortti h3 a { transition: background-color 160ms var(--ulos), color 160ms var(--ulos); }
  .tilauslomake button { transition: transform 140ms var(--ulos), background-color 160ms var(--ulos); }
  .lista li { animation: nousu 420ms var(--ulos) both; }
  .lista li:nth-child(2) { animation-delay: 50ms; }
  .lista li:nth-child(3) { animation-delay: 100ms; }
  .lista li:nth-child(4) { animation-delay: 150ms; }
  .lista li:nth-child(5) { animation-delay: 200ms; }
  @keyframes nousu { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* Tilauskortti piilossa ennen tallennusta: etusivu yhteen sarakkeeseen. */
[hidden] { display: none !important; }
@media (min-width: 900px) { main.sisalto:not(.juttu):has(> .tilaus[hidden]) { grid-template-columns: minmax(0, 1fr); } }

/* Juttukuva: koodilla tehty kortti, 1200x675 */
.juttukuva { margin: 0 0 1.5rem; max-width: 40rem; }
.juttukuva img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--viini); }
.juttukuva figcaption { margin-top: 6px; font-size: 0.8125rem; color: var(--himmea); }
