.home-news-layout{--news-ink:#153b4c;--news-blue:#175670;--news-line:#c4d8df;display:grid;grid-template-columns:minmax(0,1fr) minmax(16rem,.32fr);gap:clamp(.85rem,1.7vw,1.8rem);align-items:start}
.home-news-column,.events-rail{min-width:0}
/* The news and calendar share a column layout, but have independent typography. */
.home-news-layout {
  --story-ink: #153f47;
  --story-muted: #415d61;
  --story-link: #185966;
  --story-line: #d4e1df;
  --story-sans: "Segoe UI", Roboto, Arial, sans-serif;
}
.news-home-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  padding: .25rem 0 .45rem;
  scroll-margin-top: .6rem;
}
.home-news-layout .news-home-heading h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--story-ink);
  font: 650 clamp(1.35rem, 2vw, 1.65rem)/1.2 var(--story-sans);
  letter-spacing: -.035em;
}
.news-home-heading nav { display: flex; flex-wrap: wrap; gap: .1rem .9rem }
.home-news-layout .news-home-heading nav a {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  color: var(--story-link);
  font: 550 .875rem/1.3 var(--story-sans);
  text-decoration: underline;
  text-decoration-color: #acc7c7;
  text-underline-offset: .24em;
}
.home-news-layout .news-home-heading nav .calendar-jump { display: none }
.events-rail h2 {
  margin: 0;
  color: var(--news-ink);
  font: 650 1.22rem/1.15 system-ui,sans-serif;
  letter-spacing: -.025em;
}
.calendar-source,.cal-back {
  color: var(--news-blue);
  font: 550 .89rem/1.45 system-ui,sans-serif;
  text-decoration: underline;
  text-underline-offset: .17em;
}

/* Both homepages render the same article parts. Scope the new design to this feed,
   leaving the older archive, individual stories and their rating controls intact. */
:is(body.home #page, body.guide) .home-news-layout :is(#recent-content, .kuusalu-news-grid).content-loop {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: clamp(.5rem, .8vw, .75rem);

  & > .post {
    --story-pad: clamp(.65rem, .9vw, .9rem);
    --title-size: clamp(1.06rem, 1.3vw, 1.2rem);
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    align-items: start;
    align-content: start;
    gap: .38rem .65rem;
    margin: 0;
    padding: var(--story-pad);
    min-width: 0;
    border: 1px solid var(--story-line);
    border-radius: .55rem;
    background: var(--loo-news-bg, #fff);
    color: var(--story-ink);
    overflow: hidden;
  }
  & > .post:has(> .thumbnail-link) {
    grid-template-columns: minmax(0, 1fr) clamp(4.8rem, 7.8vw, 7.75rem);
  }
  & > .post > .thumbnail-link {
    grid-area: 1 / 2;
    display: block;
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    align-self: start;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border-radius: .55rem;
    background: #e9f2ef;
  }
  & > .post > .thumbnail-link :is(.thumbnail-wrap, img) {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
  }
  & .story-art-credit {
    position: absolute;
    inset: auto .25rem .25rem auto;
    padding: .14rem .3rem;
    border-radius: .25rem;
    background: #163337e6;
    color: white;
    font: 500 .75rem/1.15 var(--story-sans);
  }
  & > .post > .entry-header {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    gap: .22rem;
    margin: 0;
    padding: 0;
    min-width: 0;
    border: 0;
    background: transparent;
  }
  & > .post .entry-title, & > .post .entry-title a {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--story-ink);
    font: 650 var(--title-size)/1.22 var(--story-sans);
    letter-spacing: -.024em;
    text-transform: none;
    text-decoration: none;
    overflow: visible;
    overflow-wrap: anywhere;
  }
  & > .post .entry-title a { display: inline }
  & > .post :is(.entry-title,.entry-summary) a.company-link { text-decoration: underline; text-underline-offset: .15em }
  & > .post .entry-meta {
    display: flex;
    order: -1;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .12rem .35rem;
    margin: 0;
    color: var(--story-muted);
    font: 500 .8125rem/1.35 var(--story-sans);
  }
  & > .post .entry-category { display: inline; margin: 0; white-space: normal }
  & > .post .entry-category a {
    display: inline;
    padding: 0;
    background: transparent;
    color: #226450;
    font: 650 .8125rem/1.35 var(--story-sans);
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
  }
  & > .post > .entry-summary {
    grid-area: 2 / 1 / 3 / -1;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    align-self: start;
    overflow: hidden;
    max-height: none;
    margin: 0;
    padding: 0;
    color: var(--story-muted);
    font: 400 1rem/1.42 var(--story-sans);
  }
  & > .post > .read-more {
    grid-area: 3 / 1 / 4 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-self: end;
    justify-content: flex-start;
    gap: .1rem .85rem;
    margin: .1rem 0 0;
    padding: .35rem 0 0;
    border-top: 1px solid var(--story-line);
    font: 500 .875rem/1.35 var(--story-sans);
  }
  & .read-more > a, & .loo-action-row > :is(a, button) {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0;
    font: 500 .875rem/1.35 var(--story-sans);
    color: var(--story-link);
    text-decoration: underline;
    text-underline-offset: .2em;
    text-decoration-color: #a8c5c3;
  }
  & .read-more > a:first-child { font-weight: 650 }
  & > .post :focus-visible { outline: 2px solid #176778; outline-offset: 2px }
  & > .post > .thumbnail-link:focus-visible { outline-offset: -3px }

  & > .post:first-child {
    --story-pad: clamp(.8rem, 1.1vw, 1.05rem);
    --title-size: clamp(1.24rem, 1.85vw, 1.55rem);
    grid-column: 1 / -1;
    gap: .4rem 0;
    background: var(--loo-news-bg, #f8faf5);
  }
  & > .post:first-child:has(> .thumbnail-link) {
    grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
    padding: 0;
  }
  & > .post:first-child > .thumbnail-link {
    grid-area: 1 / 1 / 4 / 2;
    align-self: stretch;
    min-height: 14rem;
    aspect-ratio: auto;
    border-radius: 0;
  }
  & > .post:first-child .story-art-credit { inset: auto auto .6rem .6rem }
  & > .post:first-child:has(> .thumbnail-link) > :is(.entry-header, .entry-summary, .read-more) {
    grid-column: 2;
    margin-inline: var(--story-pad);
    padding-inline: 0;
  }
  & > .post:first-child:has(> .thumbnail-link) > .entry-header { padding-top: var(--story-pad) }
  & > .post:first-child:has(> .thumbnail-link) > .read-more { margin-bottom: .75rem }
  & > .post:first-child > .entry-summary { -webkit-line-clamp: 3 }
}
@media (max-width: 52.99rem) {
  .home-news-layout .news-home-heading nav .calendar-jump { display: inline-flex }
  :is(body.home #page, body.guide) .home-news-layout :is(#recent-content, .kuusalu-news-grid).content-loop {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 38rem) {
  :is(body.home #page, body.guide) .home-news-layout :is(#recent-content, .kuusalu-news-grid).content-loop {
    & > .post > .read-more > .loo-action-review { min-height: 2.75rem }
    & > .post:first-child:has(> .thumbnail-link) {
      display: flex;
      flex-direction: column;
      align-items: stretch;
    }
    & > .post:first-child > .thumbnail-link {
      order: -1;
      aspect-ratio: 2.3;
      min-height: 0;
    }
    & > .post:first-child:has(> .thumbnail-link) > .entry-header { padding-top: .15rem }
    & > .post:first-child:has(> .thumbnail-link) > .read-more { align-self: stretch }
  }
}

.events-rail{box-sizing:border-box;background:#fff;border:1px solid var(--news-line);border-top:3px solid #276b81;padding:.85rem clamp(.7rem,1vw,1.1rem) 1rem;color:var(--news-ink);font:400 .96rem/1.4 system-ui,sans-serif;scroll-margin-top:.75rem}
.events-rail h2{font-size:1.22rem}
.events-rail .cal-month-nav{display:grid;grid-template-columns:2.2rem 1fr 2.2rem;align-items:center;gap:.2rem;margin:.85rem 0 .4rem;text-align:center}
.cal-month-nav strong{text-transform:capitalize;font-weight:620;font-size:.99rem}
.events-rail button{font:inherit;color:inherit;border:0;background:transparent;cursor:pointer;padding:0}
.events-rail .cal-month-nav button{min-height:2.1rem;border:1px solid var(--news-line);border-radius:.35rem;font-size:1.35rem;line-height:1}
.cal-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px 2px;text-align:center}
.cal-weekday{font-size:.82rem;color:#45616d}
.events-rail .cal-today-jump{display:inline-flex;align-items:center;flex-wrap:wrap;gap:.45rem;margin:.55rem 0 0;padding:.35rem .55rem;min-height:2.4rem;background:#eef4f6;color:#143f54;border-radius:.4rem;font-size:.94rem}
.cal-today-jump strong{padding:.05rem .4rem;background:#143f54;color:#fff;border-radius:.25rem}
.events-rail .cal-day{display:grid;place-content:center;position:relative;min-height:2.35rem;border-radius:.35rem;padding:0 0 .28rem;font-size:.94rem;font-variant-numeric:tabular-nums}
.events-rail .cal-day.has-start{background:#d6ede7;color:#064e42;font-weight:750}
.events-rail .cal-day.has-start::after,.cal-key-start::before{content:"";width:.75rem;height:.25rem;border-radius:.2rem;background:currentColor}
.events-rail .cal-day.has-ongoing::after,.cal-key-ongoing::before{content:"";box-sizing:border-box;width:.38rem;height:.38rem;border:1.5px solid currentColor;border-radius:50%}
.events-rail .cal-day:is(.has-start,.has-ongoing)::after{position:absolute;bottom:.22rem;left:50%;transform:translateX(-50%)}
.events-rail .cal-day[aria-current=date]{background:#143f54;color:#fff;font-weight:800}
.events-rail .cal-day[aria-pressed=true]{box-shadow:inset 0 0 0 2px #246e82}
.events-rail .cal-day[aria-current=date][aria-pressed=true]{box-shadow:inset 0 0 0 2px #143f54,inset 0 0 0 3px #fff}
.events-rail .cal-day:hover,.events-rail .cal-month-nav button:hover{outline:1px solid #397585;outline-offset:-1px}
.cal-key{display:flex;flex-wrap:wrap;gap:.3rem .85rem;padding-top:.55rem;font-size:.86rem;color:#395761}
.cal-key span{display:inline-flex;align-items:center;gap:.35rem}
.cal-key-start::before{color:#096252}.cal-key-ongoing::before{color:#395761}
.events-rail :focus-visible{outline:2px solid #99530e;outline-offset:1px}
.cal-list-head{margin:.85rem 0 .4rem;border-top:1px solid var(--news-line);padding-top:.72rem;display:flex;flex-wrap:wrap;gap:.22rem .75rem;align-items:baseline;justify-content:space-between}
.cal-list-head h3{margin:0;font:650 .95rem/1.35 system-ui,sans-serif}
.events-rail .cal-back{font-size:.85rem;text-decoration:underline;color:var(--news-blue)}
.events-rail ul{padding:0;margin:0 0 .65rem;list-style:none}
.events-rail li{margin:0;padding:.4rem 0;border-bottom:1px solid #e1ebee}
.events-rail li a{color:#17475d;text-decoration:underline;text-underline-offset:.15em;font-weight:600;overflow-wrap:anywhere}
.events-rail li small{display:block;font-size:.83rem;line-height:1.35;color:#47626c}
.events-rail p{font-size:.88rem;margin:.5rem 0}.events-rail .cal-status{font-size:.8rem;color:#4a616a}
.guide .home-news-layout{margin:1.15rem 0 2.25rem}
@media(max-width:52.99rem){.home-news-layout{grid-template-columns:minmax(0,1fr)}.events-rail{width:100%;max-width:34rem}.news-home-heading nav{justify-content:flex-start}}
@media(max-width:38rem){.events-rail .cal-day{min-height:2.65rem}}

.home-news-sidebar{display:grid;gap:1rem;min-width:0}
@media(max-width:52.99rem){
  .home-news-layout[data-mobile-flow]>.home-news-sidebar{display:none}
  .home-news-layout .content-loop>.home-news-block{grid-column:1/-1;width:100%;max-width:none;min-width:0}
  /* Put the calendar between stories on first paint, including when scripts are unavailable. */
  .home-news-layout:not([data-mobile-flow]){grid-template-columns:minmax(0,1fr)}
  .home-news-layout:not([data-mobile-flow]) :is(.home-news-column,.home-news-sidebar,.kuusalu-news-grid),
  :is(body.home #page, body.guide) .home-news-layout:not([data-mobile-flow]) :is(#recent-content, .kuusalu-news-grid).content-loop{display:contents}
  .home-news-layout:not([data-mobile-flow]) .news-home-heading{order:-4;grid-column:1/-1}
  .home-news-layout:not([data-mobile-flow]) .post:nth-child(-n+2 of .post){order:-3}
  .home-news-layout:not([data-mobile-flow]) .home-news-sidebar>*{grid-column:1/-1;max-width:none}
  .home-news-layout:not([data-mobile-flow]) .home-news-sidebar>:first-child{order:-2}
  .home-news-layout:not([data-mobile-flow]) .post:nth-child(n+3 of .post):nth-child(-n+4 of .post){order:-1}
  .home-news-layout:not([data-mobile-flow]) .post:nth-child(n+5 of .post){order:1}
}
@media(max-width:38rem){
  .home-news-layout:not([data-mobile-flow]){grid-template-columns:minmax(0,1fr)}
}

/* Keep the masthead and navigation in proportion to the news feed. */
#masthead .site-title, #masthead .site-title a {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  letter-spacing: -.025em;
}
#loo-navigation .topic-panel a::before { content: none; }
@media (min-width: 40.01rem) {
  #masthead .site-start > .container, #masthead .site-branding { min-height: 3.8rem; }
  #masthead .site-branding { padding-block: .4rem; }
  #masthead .site-description { margin-top: .12rem; }
}
@media (min-width: 64rem) and (pointer: fine) {
  #loo-navigation .home-shortcuts a, #loo-language summary { min-height: 2rem; }
  #loo-navigation .topic-bar > details > summary { min-height: 2rem; font-size: .925rem; }
}
