.hero .news--container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  height: auto !important;
}

.news--item {
  height: auto;
}

.news--item .headline {
  position: relative;
}

@media screen and (min-width: 960px) {
  figure.align_center {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    position: relative;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }
}

figure.align_center img {
  max-width: 100% !important;
  margin: auto !important;
}

.widget-image__title {
  margin-top: 1em;
  text-align: center;
  font-size: 1.25rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sharingButtons {
  max-width: 400px;
  margin: 2rem 0;
  padding: 1rem;
  background: rgba(0, 0, 0, .03);
  border: solid 1px rgba(0, 0, 0, .05);
  border-radius: .5em;
}

.sharingButtons:first-child {
  margin-top: 0;
}

.sharingButtons:last-child {
  margin-bottom: 0;
}

.sharingButtons__title {
  font-size: 1em;
  margin-bottom: .5em;
}

.sharingButtons__list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  list-style: none !important;
  margin: -.5rem !important;
  padding: 0 !important;
}

.sharingButtons__item {
  padding: .5rem;
}

.sharingButtons__link {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  width: 1.5em;
  height: 1.5em;
  font-size: 1.4em;
  color: #fff !important;
  border-radius: .3em;
  transition: all 200ms ease;
}

.sharingButtons__link:hover,
.sharingButtons__link:focus {
  transform: scale(1.15);
}

.sharingButtons__link--facebook {
  background: #3578E5;
}

.sharingButtons__link--twitter {
  background: rgb(29,161,242);
}

.sharingButtons__link--linkedin {
  background: rgb(10, 102, 194);
}

.sharingButtons__link .instagram-share-btn {
  margin: 0;
}

.safemailButton {
  line-height: 42px !important;
  color: #FFFFFF !important;
  background: #1696C7;
  padding: 0 1em !important;
  float: right;
  font-weight: bold;
  margin-top: 4px;
  margin-right: 8px;
  font-size: 13.4px;
  text-transform: uppercase;
}

.safemailButton:hover,
.safemailButton:focus {
  color: #FFFFFF;
  border-bottom: 0;
}

.logo--block {
  width: 45%;
}

@media screen and (max-width: 1240px) {
  .logo--block {
    width: auto;
  }
  .login--bar {
    float: right;
  }
}

@media screen and (max-width: 850px) {
  .logo--block {
    width: 100%;
  }
  .login--bar {
    float: left;
    width: 100%;
  }

  .safemailButton {
    margin-right: 4px;
  }
}

/* Carousel image new changes (stay full width) */
.hero--content .slide img {
  width: 100%;
}

.hero--content .slide .hero--image .slick-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.hero .hero--content .hero--image h2 {
  font-size: 2rem;
}

@media screen and (max-width: 1360px) {
  .hero .hero--content .hero--image h2 {
    font-size: 2rem;
  }
}

.carousel-title {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 0;
}

.slick-box {
  padding: 10px;
}

@media screen and (min-width: 1360px) {
  .slick-box {
    bottom: 10px;
  }
}

@media screen and (max-width: 943px) {
  .hero--content .slide .hero--image,
  .hero--content .slide .hero--image .slick-box {
    position: relative;
  }
}

/* Frontpage storytelling highlights */
.home-tpl .home-highlights-container,
.home-tpl .storytelling-container {
  margin: 3rem 0;
  overflow: initial;
}

.home-tpl main .home-highlights-container__h2,
.home-tpl main .storytelling-container__h2 {
  font-size: 2rem;
  text-align: center;
  padding-bottom: 1.5rem;
}

.home-tpl main .storytelling-container__more-link {
  margin-top: 1.5rem;
  text-align: center;
}

.home-tpl main .home-highlights-container__list,
.home-tpl main .storytelling-container__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -1rem -0.08rem;
}

.home-tpl main .home-highlights-container__list-item,
.home-tpl main .storytelling-container__list-item {
  display: flex;
  flex-direction: column;
  width: 33.333%;
  padding: 1rem .08rem;
}

.home-tpl main .home-highlights-container__list-item a:hover,
.home-tpl main .storytelling-container__list-item a:hover {
  border: none;
}

.home-tpl main .home-highlights-container__list-item a:hover img,
.home-tpl main .storytelling-container__list-item a:hover img {
  opacity: .8;
  transition: .25s ease-in;
}

.home-tpl main .home-highlights-container__list-item h3,
.home-tpl main .storytelling-container__list-item h3 {
  font-size: 1.25rem;
  padding: 1rem;
}

.home-tpl main .home-highlights-container__list-item a:hover h3,
.home-tpl main .storytelling-container__list-item a:hover h3 {
  color: #1696C7;
}

.home-tpl main .storytelling-container__list-item .date {
  color: #000;
  margin-bottom: 0;
  margin-top: .5rem;
}

.home-tpl .home-highlights-container__list-item--video,
.home-tpl .home-highlights-container__list-item--image,
.home-tpl .storytelling-container__list-item--image {
  height: 300px;
}

.home-tpl .home-highlights-container__list-item--video iframe {
  height: 100%;
  width: 100%;
}

.home-tpl main .home-highlights-container__list-item img,
.home-tpl main .storytelling-container__list-item img {
  margin: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

@media screen and (max-width: 1024px) {
  .home-tpl main .home-highlights-container__list,
  .home-tpl main .storytelling-container__list {
    justify-content: flex-start;
  }

  .home-tpl main .home-highlights-container__list-item,
  .home-tpl main .storytelling-container__list-item {
    width: 50%;
  }
}

@media screen and (max-width: 800px) {
  .home-tpl main .home-highlights-container__list-item,
  .home-tpl main .storytelling-container__list-item {
    width: 100%;
  }
}

@media screen and (max-width: 680px) {
  .home-tpl main .home-highlights-container__h2,
  .home-tpl main .storytelling-container__h2 {
    padding-bottom: 1rem;
  }

  .home-tpl main .home-highlights-container__list,
  .home-tpl main .storytelling-container__list {
    margin: 0;
  }
}
/* --- Mattinet extranet strip-down: header/footer centering ------------- */

/* Login screens (front page + /login/): center the logo and hide the empty
   login--bar. Both templates redirect an already-logged-in visitor to the
   extranet before rendering, so login--bar's sign-out branch never has
   content to show here -- leaving it in place just left blank space beside
   an off-center logo. */
.home-tpl .login--bar,
.login-tpl .login--bar {
  display: none;
}

.home-tpl .logo--block,
.login-tpl .logo--block {
  float: none;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.home-tpl .logo--block img,
.login-tpl .logo--block img {
  float: none;
  display: inline-block;
  margin: 0;
}

/* Footer: used to be one of three floated columns (partner logos,
   footer--content, a social-share list); the other two were removed with the
   public site, so its old width/float left the remaining content hugging the
   left edge instead of sitting centered in the page. */
footer .footer--content {
  float: none;
  width: 100%;
  margin: 0 auto;
}

/* --- Font: force Arial over Helvetica Neue on body -------------------- */

/* main.css's own body{font-family:...} was fixed directly (it's our file),
   but bootstrap.css also sets a bare body{font-family:"Helvetica Neue",...}
   -- and its AIOM-combined output loads AFTER main.css (confirmed via the
   rendered <link> order), so at equal specificity it was winning the
   cascade and overriding main.css's stack. Restating it here, in the file
   that loads last on every page, settles the tie for good. */
body {
  font-family: "Lato", Arial, "Helvetica", "Roboto", sans-serif;
}

/* --- Section-nav sidebar (tpl/nav.inc): visual hierarchy + cleanup ----- */

/* Markup for reference (MarkupSimpleNavigation, tpl/nav.inc):
     <ul class="nav nav-vertical sidebar">
       <li class="level-1 p_1236"><a href="...">Extranet</a></li>
       <li class="level-1 parent has_children"><a href="...">Matti</a>
         <ul>
           <li class="level-2 has_children"><a href="...">...</a></li>
           <li class="level-2 active has_children"><a class="active">...</a>
             <ul><li class="level-3">...</li></ul>
           </li>
         </ul>
       </li>
     </ul>
   level-N marks depth, has_children/parent/active mark state; p_1236 is the
   root page (show_root, list_field_class in tpl/nav.inc), always first and
   never has_children/parent since MarkupSimpleNavigation never recurses or
   marks state on the root it prepends. Old styling (.sidebar ul{margin-left:
   .5em} / li{padding:0 0 .5em 0}) gave every depth the same look, so the
   tree read as a flat list with no sense of nesting.
*/

.sidebar {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  padding: 1rem;
}

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

.sidebar li {
  padding: 0;
}

.sidebar li > a {
  display: block;
  padding: .6em .9em;
  color: #282828;
  text-decoration: none;
  border-left: 3px solid transparent;
  /* main.css has a global a:hover{border-bottom:solid 1px ...} meant for
     inline body-copy links (an underline-via-border hover effect). It still
     applies here too -- CSS resolves per property, not per rule, so a more
     specific selector that never sets border-bottom doesn't cancel it.
     On these stacked block-level items that border shifted each link by 1px
     on hover, which right at the boundary between two items un-hovers the
     first and hovers the next, causing rapid flicker. Set on every state so
     nothing on this element ever grows a hover border. */
  border-bottom: 0;
  transition: background .15s, border-color .15s, color .15s;
}

.sidebar li > a:hover,
.sidebar li > a:focus,
.sidebar li > a:active {
  background: #f2f8fb;
  color: #114B5F;
  border-bottom: 0;
}

/* Level 1: section heading -- bold, brand-colored, sits above its children
   rather than looking like just another link in the same list. Indented
   (unlike the root/p_1236 link above it) so it reads as nested under the
   Extranet link rather than a plain sibling at the same level; the indent
   is on the <li> itself so the whole subtree -- this link plus its nested
   <ul> of level-2/3 children -- shifts right together. */
.sidebar li.level-1:not(.p_1236) {
  margin-left: 1.5em;
}

.sidebar li.level-1 > a {
  font-weight: 700;
  font-size: .9em;
  color: #114B5F;
  padding: .9em .9em .6em;
}

.sidebar li.level-1 > ul {
  padding-bottom: .5em;
}

/* Root of the tree (page 1236, the extranet's own front page -- prepended
   by show_root in tpl/nav.inc so it's reachable from the sidebar too). It's
   a level-1 sibling of Matti etc., but a plain link back to the section's
   own home reads oddly styled exactly like a Matti-style section heading,
   so give it a lighter, larger treatment instead. No border-bottom here:
   it's a real border next to siblings that have none, which is exactly the
   1px height mismatch the comment above .sidebar li > a already warns
   about -- hovering near that boundary made the item flicker/twitch. */
.sidebar li.p_1236 > a {
  font-weight: 400;
  font-size: 1.15em;
  color: #5a6b72;
  padding: .8em .9em .5em;
}

/* Level 2+: indent per depth and add a left guide line so nesting is
   visible at a glance instead of every level looking identical. */
.sidebar li.level-2 > a {
  padding-left: 1em;
}

.sidebar li.level-3 > a {
  padding-left: 1em;
  font-size: .95em;
}

.sidebar li.level-2 > ul,
.sidebar li.level-3 > ul {
  margin-left: 1.5em;
  border-left: 1px solid #e3e3e3;
}

/* main.css marks the active item with a disc bullet (.sidebar ul li.active{
   list-style:disc}), on top of its own color change -- redundant now that
   the active page already gets a background + border-left highlight below.
   Same selector as that rule so this wins on source order at equal
   specificity, rather than needing !important. */
.sidebar ul li.active {
  list-style: none;
}

/* Current page: clear brand-colored highlight, not just a text color change. */
.sidebar li > a.active,
.sidebar li.active > a {
  background: #eaf6fb;
  border-left-color: #1696C7;
  border-bottom: 0;
  color: #114B5F;
  font-weight: 700;
}

/* Ancestor of the current page: a light indicator that this branch is
   "open", without competing with the active page's own highlight. */
.sidebar li.parent > a {
  border-left-color: #c7e4ef;
}

/* Mobile: collapse the sidebar behind the "Nayta alasivut" toggle. Written
   to stand alone rather than depend on the older rules scattered through
   main.css for this same interaction, some of which were already broken by
   a stray empty ruleset left over from a previous minification. JS side is
   unchanged -- it only ever toggles .active on .shortcuts--btn. */
.shortcuts--btn {
  display: none;
}

@media screen and (max-width: 959px) {

  /* Selectors qualified with the a element (a.shortcuts--btn = 0,1,1 / with
     .active = 0,2,1) so they outrank main.css's own .shortcuts--btn.active
     and .sidebar .shortcuts--btn.active (both 0,2,0) without !important.
     Every state declares background, color, arrow color AND a 1px border of
     the same width, because main.css sets each of those somewhere and any
     property left undeclared here keeps ITS value:
       - .shortcuts--btn{color:white}          -> invisible text on white
       - .shortcuts--btn span{color:white}      -> invisible arrow. Its
         .sidebar .shortcuts--btn span{color:#333} override never matched:
         the button is a SIBLING before ul.sidebar, not inside it.
       - .shortcuts--btn.active{background:#114B5F} -> dark blue on dark blue
         text once expanded, so the label vanished
       - .shortcuts--btn:hover{border-bottom:0} -> dropped the bottom border
         on hover, shifting the button 1px and causing the twitch */
  a.shortcuts--btn {
    display: block;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    padding: .75em 1em;
    color: #114B5F;
    text-decoration: none;
    font-weight: 700;
    text-transform: none;
    line-height: 1.2;
  }

  a.shortcuts--btn:hover,
  a.shortcuts--btn:focus {
    background: #f2f8fb;
    color: #114B5F;
    border: 1px solid #e3e3e3;
  }

  a.shortcuts--btn.active,
  a.shortcuts--btn.active:hover,
  a.shortcuts--btn.active:focus {
    background: #1696C7;
    color: #fff;
    border: 1px solid #1696C7;
  }

  /* main.css absolutely positions this span (right:1em;top:1em), which
     ignores float and drifts against our padding -- put it back in flow. */
  a.shortcuts--btn .icon-arrow-1-down {
    position: static;
    float: right;
    color: #114B5F;
    transition: transform .2s;
  }

  a.shortcuts--btn.active .icon-arrow-1-down {
    color: #fff;
    transform: rotate(180deg);
  }

  .sidebar {
    display: none;
    margin-top: .5em;
  }

  .shortcuts--btn.active + .sidebar {
    display: block;
  }
}

/* --- Table cell padding ------------------------------------------------ */

/* main.css already intends this -- it has its own th{padding:.75em} /
   td{padding:.75em} for tables written into body content (extranet law-
   reference tables use plain <table><th><td>, no classes). But bootstrap.css
   has both its own reset (td,th{padding:0}) and .table component rules whose
   selector lists also match bare th/td -- e.g. "th, .table > tbody > tr > th
   { padding: 8px; ... }" matches every plain <th> too, not just .table ones.
   Its AIOM output loads after main.css, so at equal specificity (both are
   bare element selectors) it wins and zeroes the padding main.css intended.
   Scoping to "table td"/"table th" gives this a higher specificity than any
   of those bare-element selectors, so it wins regardless of load order. */
table td,
table th {
  padding: 0.75em;
  vertical-align: middle;
}

/* --- Hero section ------------------------------------------------------- */

/* tpl/basic*.inc only outputs the <section class="hero"> markup at all when
   heroImage() resolves an image (the page's own basic_page_hero/crop_image,
   or falling back to the extranet root's) -- pages with neither render no
   hero section, rather than an empty banner. Sizing below only applies to
   the with-image case; width/max-width/margin restated explicitly rather
   than relying on the generic section{} rule elsewhere.

   The image itself is a real <img> (tpl/basic*.inc), not a background --
   gives it genuine alt text (the Pageimage's own ->description) rather than
   a CSS string, and native lazy-loading. .hero's own background is just a
   placeholder shown while that image loads. */
.hero {
  height: 240px;
  width: 100%;
  max-width: 86.250em;
  margin: 0 auto;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #114B5F, #1696C7);
}

.hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

@media screen and (max-width: 680px) {
  .hero {
    height: 160px;
    border-radius: 0;
  }
}

/* --- Header: logo size + sign-out button -------------------------------- */

/* Sign-out styled as an actual button.
   Selector must carry the full .language--select ul li a chain plus the new
   class: the legacy .language--select ul li a{color:#333;padding:1em;
   line-height:42px} is 1 class + 3 elements, so a bare .logout--btn (1 class,
   0 elements) TIES on class count and then loses on element count -- which is
   what left the label black and gave the button its tall shape (padding:1em
   on top of line-height:42px). Qualified below it wins outright. */
.language--select ul li a.logout--btn {
  display: inline-block;
  background: #1696C7;
  color: #fff;
  border: 1px solid #1696C7;
  border-radius: 3px;
  padding: .45em 1.1em;
  font-weight: 700;
  font-size: .875em;
  line-height: 1.4;
  text-decoration: none;
  transition: background .2s, border-color .2s;
}

/* Legacy .language--select ul li:hover a (2 class-ish + 3 elements) sets
   color:#fff on hover, so the chain needs the class to outrank it here too. */
.language--select ul li a.logout--btn:hover,
.language--select ul li a.logout--btn:focus,
.language--select ul li:hover a.logout--btn {
  background: #114B5F;
  border-color: #114B5F;
  color: #fff;
}

/* li:hover otherwise paints the whole row #1696c7 behind the button. */
.language--select ul li:hover {
  background: transparent;
}

@media screen and (max-width: 680px) {
  /* Smaller logo: main.css takes it 80px -> 60px at 1240px and no further.
     width/object-fit are essential, not decoration -- a later main.css rule
     sets .logo--block img{width:400px;max-width:100%;height:auto}, so
     constraining height alone left that explicit 400px width in place and
     stretched the logo out of proportion. */
  .logo--block img {
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
  }

  /* Center the sign-out button: .language--select and its ul are both
     float:right in main.css, which otherwise pins it to the right edge. */
  .login--bar,
  .language--select,
  .language--select ul {
    float: none;
    width: 100%;
    text-align: center;
  }

  .language--select ul li {
    float: none;
    display: inline-block;
  }

  /* bootstrap.css's .row{margin:0 -15px} pairs with ITS column padding, but
     the columns here are Foundation's (.columns), and .right-side carries
     its own padding on top -- so on narrow screens the negative margins
     pushed content past the viewport and produced a horizontal scrollbar.
     Harmless to drop: every column is full-width at this breakpoint. */
  .row {
    margin-left: 0;
    margin-right: 0;
  }
}
