/*
 * Blog layer for kiekkomaila.fi/blog/ (Revon Hockey)
 *
 * Loaded after /styles.css, the homepage stylesheet, so the blog shares its
 * header, footer, colours, buttons, dialogs and the cookie banner. Only what
 * the homepage has no equivalent for lives here: the black band at the top,
 * post cards, page links and the article page.
 *
 * The homepage styles every <nav> (and hides them all below 900px, its
 * header's own breakpoint), so the blog's breadcrumb, page links and contents
 * list set their own display.
 */

:root {
  --blog-olive: #777d00;  /* the homepage's yellow, darkened to read on white */
  --blog-card-line: #dfdfd7;
  --blog-measure: 700px;  /* about 75 characters a line */
}

html { scroll-padding-top: 24px; }

.blog-container {
  width: min(1180px, calc(100% - 2 * clamp(20px, 5vw, 76px)));
  margin-inline: auto;
}

/* The header sits over the hero photo on the homepage; here it leads the black band. */
.edward-blog .site-header { position: relative; background: var(--navy); }
.edward-blog .site-header nav a.is-active { opacity: 1; color: var(--blue); }

.edward-blog a:focus-visible,
.edward-blog button:focus-visible,
.edward-blog summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.blog-section a:focus-visible,
.article-layout a:not(.button):focus-visible,
.article-layout summary:focus-visible {
  outline-color: var(--ink);
}

/* --- Black band at the top of every blog page ------------------------------- */

.blog-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 8vw, 110px) 0 clamp(56px, 7vw, 96px);
  background: var(--navy);
  color: white;
}
/* The brand mark's slanted bar, faint, on the right. */
.blog-hero::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  right: 7%;
  width: min(24vw, 340px);
  background: #f4ff0010;
  clip-path: polygon(26% 0, 100% 0, 74% 100%, 0 100%);
  pointer-events: none;
}
.blog-hero > * { position: relative; }
.blog-hero h1 {
  max-width: 920px;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  overflow-wrap: break-word;
}
.blog-hero h1 span { display: block; color: var(--blue); }
.blog-hero .lead {
  max-width: 640px;
  margin: 26px 0 0;
  color: #e7e7df;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.7;
}

.blog-search { margin-top: 34px; max-width: 520px; }
.blog-search label {
  display: block;
  margin-bottom: 9px;
  color: #b8b8ae;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.blog-search input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #ffffff4d;
  border-radius: 0;
  background: #111;
  color: white;
  font-size: 1rem;
}
.blog-search input::placeholder { color: #8a8a82; }
.blog-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.blog-status { min-height: 1.4em; margin: 10px 0 0; color: #b8b8ae; font-size: 0.85rem; }

/* --- Post cards ---------------------------------------------------------------- */

.blog-section { padding: clamp(56px, 7vw, 100px) 0; }
.blog-section-title {
  margin: 0 0 32px;
  font-size: clamp(1.9rem, 3.4vw, 3.2rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: white;
  border: 1px solid var(--blog-card-line);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.post-card:hover { transform: translateY(-5px); border-color: #a7ae00; box-shadow: 0 18px 45px #05050518; }
.post-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: #ecece5; }
.post-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A post without a cover image gets the brand mark, so the grid stays even. */
.post-card-media.is-empty { display: grid; place-items: center; background: var(--navy); }
.post-card-media.is-empty .brand-mark { width: 56px; height: 66px; font-size: 2.3rem; }
.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px 26px 26px;
}
.post-date {
  color: #85857c;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.post-card h3 {
  margin: 12px 0 10px;
  font-size: 1.3rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}
/* One link per card, on the title, stretched over the whole card. */
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card h3 a:focus-visible { outline: none; }
.post-card:focus-within { outline: 3px solid var(--ink); outline-offset: 4px; }
.post-card p { margin: 0 0 20px; color: #686860; font-size: 0.95rem; line-height: 1.6; }
.post-card .read-more {
  margin-top: auto;
  color: var(--blog-olive);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The newest post, wide and black, at the top of /blog/. */
.post-card.is-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  margin-bottom: 18px;
  background: var(--navy);
  color: white;
  border-color: var(--navy);
  border-top: 5px solid var(--blue);
}
.post-card.is-featured.no-media { grid-template-columns: minmax(0, 1fr); }
.post-card.is-featured:hover { border-color: var(--navy); border-top-color: var(--blue); box-shadow: 0 22px 50px #05050540; }
.post-card.is-featured:focus-within { outline-color: var(--blue); }
.post-card.is-featured .post-card-media { aspect-ratio: auto; min-height: 340px; }
.post-card.is-featured .post-card-body { justify-content: center; padding: clamp(28px, 4vw, 52px); }
.post-card.is-featured .post-date { color: var(--blue); }
.post-card.is-featured h3 { font-size: clamp(1.7rem, 3vw, 2.6rem); line-height: 1; letter-spacing: -0.04em; }
.post-card.is-featured p { color: #d1d1c7; font-size: 1.02rem; }
.post-card.is-featured .read-more { color: var(--blue); }

.blog-empty {
  margin: 0;
  padding: 32px;
  border: 1px dashed #bdbdb4;
  background: white;
  color: var(--muted);
}

/* Page links under the grid. */
.edward-blog .pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  font-size: 0.8rem;
  font-weight: 900;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.edward-blog .pagination a { border: 1px solid #bdbdb4; background: white; color: var(--ink); opacity: 1; }
.edward-blog .pagination a:hover { border-color: var(--ink); }
.pagination [aria-current] { border: 1px solid var(--blue); background: var(--blue); color: #050505; }
.pagination .is-disabled { border: 1px solid #e2e2da; color: #b2b2a8; }
.pagination .page-gap { min-width: 0; padding: 0 4px; color: var(--muted); }

/* --- Article page ---------------------------------------------------------------- */

.article-hero { padding: clamp(36px, 5vw, 64px) 0 clamp(110px, 13vw, 170px); }
.article-hero.no-cover { padding-bottom: clamp(56px, 7vw, 96px); }
.article-hero h1 {
  max-width: 1000px;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
}
.article-hero .lead { margin-top: 22px; max-width: 760px; }

.edward-blog .breadcrumb { display: block; margin: 0 0 28px; font-size: 0.8rem; font-weight: 700; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px 10px; margin: 0; padding: 0; list-style: none; }
.breadcrumb li { min-width: 0; color: #8f8f86; }
.breadcrumb li + li::before { content: "/"; margin-right: 10px; color: #55554f; }
.edward-blog .breadcrumb a {
  color: #e7e7df;
  opacity: 1;
  text-decoration: underline;
  text-decoration-color: #ffffff40;
  text-underline-offset: 4px;
}
.edward-blog .breadcrumb a:hover { color: var(--blue); }
.breadcrumb li[aria-current] { max-width: 48ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 28px;
  color: #b8b8ae;
  font-size: 0.88rem;
}
.article-meta .post-date { padding: 7px 11px; background: var(--blue); color: #050505; font-size: 0.72rem; }

.article-cover {
  position: relative; /* drawn over the black band, which is positioned */
  margin-top: calc(-1 * clamp(80px, 10vw, 130px));
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 620px;
  width: 100%;
  background: #111;
  border-bottom: 5px solid var(--blue);
  box-shadow: 0 28px 70px #05050538;
}
.article-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--blog-measure)) 300px;
  justify-content: space-between;
  align-items: start;
  gap: 56px;
  padding: clamp(44px, 5vw, 64px) 0 clamp(64px, 7vw, 96px);
}

.article-body { color: #22221f; font-size: 1.1rem; line-height: 1.75; overflow-wrap: break-word; }
.article-body > :first-child { margin-top: 0; }
/* The opening paragraph, a touch larger, leads into the article. */
.article-body > p:first-of-type { color: var(--ink); font-size: 1.22rem; line-height: 1.65; }
.article-hero h1,
.article-body h2,
.article-body h3,
.post-card h3 { text-wrap: balance; }
.article-body h2 {
  margin: 2.2em 0 0.6em;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.6vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
/* A short yellow bar over each section heading, as on the homepage cards. */
.article-body h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 5px;
  margin-bottom: 16px;
  background: var(--blue);
}
.article-body h3 { margin: 1.8em 0 0.5em; color: var(--ink); font-size: 1.25rem; line-height: 1.3; }
.article-body p { margin: 0 0 1.15em; }
.article-body a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #a7ae00;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.article-body a:hover { background: var(--blue); text-decoration-color: var(--ink); }
.article-body strong { color: var(--ink); }
.article-body ul,
.article-body ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.article-body li { margin: 0.45em 0; padding-left: 0.2em; }
.article-body ul li::marker { color: #8b9200; }
.article-body ol li::marker { color: var(--blog-olive); font-weight: 900; }
.article-body blockquote {
  margin: 1.8em 0;
  padding: 20px 24px;
  border-left: 5px solid var(--blue);
  background: white;
  color: var(--ink);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 1.8em 0; }
.article-body .table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--blog-card-line); background: white; }
.article-body table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 0.95rem; line-height: 1.5; }
.article-body th,
.article-body td { padding: 12px 14px; border-bottom: 1px solid #e6e6de; text-align: left; vertical-align: top; }
.article-body th { background: var(--navy); color: white; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; }
.article-body tr:last-child td { border-bottom: 0; }
.article-body pre { overflow: auto; padding: 16px; background: #111; color: #f1f1ea; font-size: 0.9rem; }
.article-body code { padding: 0.1em 0.35em; background: #ecece5; font-size: 0.92em; }
.article-body pre code { padding: 0; background: none; }
.article-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line); }

/* The sidebar: contents list and contact card, kept in view while reading. */
.article-side { position: sticky; top: 24px; display: grid; gap: 18px; }

.edward-blog .toc {
  display: block;
  padding: 22px 24px 18px;
  border: 1px solid var(--blog-card-line);
  border-top: 5px solid var(--blue);
  background: white;
}
.toc-title {
  margin: 0 0 12px;
  color: var(--blog-olive);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.toc ol {
  /* A long list scrolls inside the box, so the contact card below stays in view. */
  max-height: max(160px, calc(100vh - 560px));
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid #e6e6de;
  scrollbar-width: thin;
}
.edward-blog .toc a {
  display: block;
  margin-left: -2px;
  padding: 7px 0 7px 14px;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 1;
}
.edward-blog .toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { border-left-color: var(--ink); color: var(--ink); font-weight: 800; }

/* On smaller screens the contents list opens from a box at the top of the article. */
.article-body .toc-inline {
  display: none;
  margin: 0 0 28px;
  border: 1px solid var(--blog-card-line);
  border-left: 5px solid var(--blue);
  background: white;
}
.article-body .toc-inline summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.article-body .toc-inline summary::-webkit-details-marker { display: none; }
.article-body .toc-inline summary::after { content: "+"; font-size: 1.4rem; line-height: 1; }
.article-body .toc-inline[open] summary::after { content: "–"; }
.article-body .toc-inline ol { margin: 0; padding: 0 18px 14px 38px; font-size: 0.98rem; line-height: 1.5; }
.article-body .toc-inline a { text-decoration: none; }

.article-aside {
  padding: 28px 26px;
  border-top: 5px solid var(--blue);
  background: var(--navy);
  color: white;
}
.article-aside .eyebrow { margin: 0 0 12px; font-size: 0.7rem; }
.article-aside h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.article-aside p { margin: 0 0 22px; color: #c8c8be; font-size: 0.95rem; line-height: 1.6; }
.article-aside .button { width: 100%; }
.article-aside .aside-contact {
  display: block;
  margin-top: 12px;
  color: #e7e7df;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  overflow-wrap: anywhere;
}
.article-aside .aside-contact:hover { color: var(--blue); }

.related-posts { border-top: 1px solid var(--line); }

/* --- Call to action band (the homepage's team banner) -------------------------- */

.edward-blog .blog-cta {
  width: min(1180px, calc(100% - 2 * clamp(20px, 5vw, 76px)));
  margin: 0 auto clamp(56px, 7vw, 100px);
}

/* --- Smaller screens ----------------------------------------------------------- */

@media (max-width: 1100px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .article-side { position: static; max-width: var(--blog-measure); }
  .edward-blog .article-side .toc { display: none; }
  .article-body .toc-inline { display: block; }
}

@media (max-width: 760px) {
  .blog-hero::before { display: none; }
  .post-grid { grid-template-columns: minmax(0, 1fr); }
  .post-card.is-featured { grid-template-columns: minmax(0, 1fr); }
  .post-card.is-featured .post-card-media { aspect-ratio: 16 / 9; min-height: 0; }
  .post-card.is-featured .post-card-body { padding: 24px 22px 26px; }
  .post-card-body { padding: 22px 22px 24px; }
  /* Long Finnish compounds in big uppercase type would overflow a phone screen. */
  .blog-hero h1,
  .post-card h3,
  .article-body h2,
  .blog-cta h2 { hyphens: auto; }
  .breadcrumb li[aria-current] { display: none; } /* the title follows right below */
  .article-body { font-size: 1.05rem; }
  .article-body > p:first-of-type { font-size: 1.12rem; }
  .pagination .page-step { flex-basis: 100%; order: 1; } /* Uudemmat / Vanhemmat under the numbers */
  .pagination .page-step.is-disabled { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card { transition: none; }
  .post-card:hover { transform: none; }
}

@media print {
  .site-header, footer, .article-side, .blog-cta, .related-posts, .breadcrumb, .cookie-banner { display: none !important; }
  .blog-hero { padding: 0 0 16px; background: none; color: black; }
  .blog-hero::before { display: none; }
  .article-cover { margin-top: 0; box-shadow: none; }
  .article-layout { display: block; padding: 0; }
}
