:root {
  --haapa-black: #050505;
  --haapa-red: #c92217;
  --haapa-red-dark: #aa1a10;
  --haapa-white: #ffffff;
  --haapa-paper: #f1f1f1;
  --haapa-line: #d9d9d9;
  --haapa-text: #171717;
  --haapa-muted: #696969;
  --haapa-soft: #fafafa;
  --haapa-content: 760px;
  --haapa-wrap: 1560px;
  --haapa-shadow: 0 10px 26px rgba(0,0,0,.24);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--haapa-white);
  color: var(--haapa-text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a {
  color: var(--haapa-red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
}
a:hover { color: var(--haapa-red-dark); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(201,34,23,.28);
  outline-offset: 3px;
}
strong { font-weight: 800; }
em { font-style: italic; }
mark, :target { background: #fff3b3; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .75em;
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 800;
}
h1 { font-size: clamp(2.5rem, 4vw, 4.6rem); }
h2 { font-size: clamp(2rem, 3vw, 3.3rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.9rem); }
h4 { font-size: 1.3rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1rem; }
p, ul, ol, blockquote, figure, table { margin: 0 0 1.35rem; }
ul, ol { padding-left: 1.3rem; }
li + li { margin-top: .48rem; }
blockquote {
  margin: 2rem 0;
  padding: 1.35rem 1.5rem;
  border-left: 5px solid var(--haapa-red);
  background: #fbfbfb;
  box-shadow: inset 0 0 0 1px #ededed;
  color: #333;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite { display: block; margin-top: .8rem; color: var(--haapa-muted); font-style: normal; font-size: .95rem; }
sub, sup { font-size: 75%; line-height: 0; position: relative; }
sub { bottom: -.25em; }
sup { top: -.5em; }

.container {
  width: min(100% - 40px, var(--haapa-wrap));
  margin-inline: auto;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  top: 10px;
  left: -9999px;
  z-index: 10000;
}
.skip-link:focus {
  left: 10px;
  background: #fff;
  color: #000;
  padding: .85rem 1rem;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--haapa-black);
  color: #fff;
  box-shadow: var(--haapa-shadow);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  gap: 2rem;
}
.site-branding {
  flex: 0 0 auto;
  min-width: 0;
}
.site-logo img {
  max-height: 54px;
  width: auto;
}
.site-title {
  margin: 0;
  font-size: clamp(1.4rem, 2vw, 2.05rem);
  line-height: 1;
  font-weight: 900;
}
.site-title a {
  color: #fff;
  text-decoration: none;
}
.primary-navigation {
  min-width: 0;
}
.primary-navigation ul,
.footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.primary-navigation ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(1rem, 2vw, 2.7rem);
}
.primary-navigation li { margin: 0; }
.primary-navigation a {
  color: #fff;
  text-decoration: none;
  font-size: clamp(1rem, 1.1vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -.01em;
}
.primary-navigation .current-menu-item > a,
.primary-navigation .current_page_item > a,
.primary-navigation .current-menu-ancestor > a,
.primary-navigation a:hover {
  color: #ff4c40;
}
.menu-toggle {
  display: none;
  align-items: center;
  gap: .85rem;
  padding: .5rem .7rem;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.menu-toggle span:not(.menu-toggle__label) {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px 0;
  background: currentColor;
}
.menu-toggle__label {
  font-weight: 700;
  font-size: .95rem;
}

.home-logo-band {
  background: #efefef;
  border-bottom: 1px solid #dfdfdf;
  padding: clamp(2rem, 4vw, 3.8rem) 0;
}
.logo-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(1.1rem, 2vw, 2rem);
  align-items: center;
}
.logo-strip__item {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-strip__image {
  max-height: 122px;
  width: auto;
  object-fit: contain;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(3.2rem, 8vw, 7rem) 0;
}
.hero-panel--blog {
  background: var(--haapa-red);
  color: #fff;
}
.hero-panel--tips {
  background: #fff;
  color: var(--haapa-text);
}
.hero-panel__inner {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
}
.hero-panel--tips .hero-panel__inner {
  grid-template-columns: minmax(420px, 1.05fr) minmax(340px, 1fr);
}
.hero-panel__content {
  min-width: 0;
}
.hero-panel__eyebrow {
  margin: 0 0 1.2rem;
  font-size: .92rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-panel__title {
  margin: 0 0 1.4rem;
  font-size: clamp(4.2rem, 8vw, 8.8rem);
  line-height: .88;
  font-weight: 900;
}
.hero-panel--tips .hero-panel__title {
  font-size: clamp(3.6rem, 7vw, 7.5rem);
}
.hero-panel__description {
  max-width: 34rem;
  font-size: clamp(1.05rem, 1.35vw, 1.28rem);
  line-height: 1.55;
  margin-bottom: 1.8rem;
}
.hero-panel__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: .9rem 1.5rem;
  border: 2px solid currentColor;
  text-decoration: none;
  font-weight: 800;
  color: inherit;
  transition: transform .18s ease, background-color .18s ease, color .18s ease;
}
.hero-panel__button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.12);
  color: inherit;
}
.hero-panel--tips .hero-panel__button:hover { background: rgba(0,0,0,.05); }
.hero-panel__media {
  min-width: 0;
}
.hero-panel__image,
.hero-panel__placeholder {
  width: 100%;
  aspect-ratio: 16 / 10.2;
  min-height: 420px;
  object-fit: cover;
}
.hero-panel__placeholder {
  background: linear-gradient(135deg, #e4e4e4 0%, #cfcfcf 100%);
}

.home-posts {
  padding: clamp(3rem, 6vw, 6rem) 0 clamp(4rem, 7vw, 7rem);
  background: #fff;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.2rem, 3.5vw, 4rem);
}
.section-search { flex: 0 0 auto; }
.search-form {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.search-field {
  min-width: 290px;
  min-height: 50px;
  padding: 0 .95rem;
  border: 1px solid #cbcbcb;
  border-radius: 0;
  background: #fff;
  font: inherit;
}
.search-submit,
.button,
button,
input[type="submit"] {
  min-height: 50px;
  padding: 0 1rem;
  border: 0;
  border-radius: 0;
  background: var(--haapa-black);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.search-submit:hover,
.button:hover,
button:hover,
input[type="submit"]:hover { background: var(--haapa-red); }

.post-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.7rem;
}
.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
}
.post-card__media-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card-image,
.card-image--placeholder {
  width: 100%;
  aspect-ratio: 1.2 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, #e8e8e8, #cfcfcf);
}
.post-card__content {
  padding-top: 1rem;
}
.category-pill {
  display: inline-block;
  margin-bottom: .7rem;
  color: var(--haapa-red);
  text-decoration: none;
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
}
.entry-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--haapa-muted);
  font-size: .95rem;
}
.entry-meta--card { margin-bottom: .8rem; }
.byline {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}
.author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}
.author-avatar--large {
  width: 84px;
  height: 84px;
}
.byline-text a {
  color: #454545;
  text-decoration: none;
  font-weight: 600;
}
.posted-on { color: var(--haapa-muted); }
.post-card__title {
  margin: 0 0 .7rem;
  font-size: 1.46rem;
  line-height: 1.14;
}
.post-card__title a {
  color: #111;
  text-decoration: none;
}
.post-card__title a:hover { color: var(--haapa-red); }
.post-card__readmore {
  color: var(--haapa-red);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 800;
}
.post-card__readmore:hover { color: var(--haapa-red-dark); }

.archive-shell,
.singular-shell,
.page-shell,
.search-shell {
  padding-top: 2rem;
  padding-bottom: 4.5rem;
}
.breadcrumbs {
  margin-bottom: 1.5rem;
  color: var(--haapa-muted);
  font-size: .92rem;
}
.breadcrumbs a {
  color: var(--haapa-muted);
  text-decoration: none;
}
.breadcrumbs .sep { margin: 0 .4rem; }
.archive-header { margin-bottom: 2rem; }
.archive-description { max-width: 56rem; color: #454545; }
.post-grid--archive { margin-bottom: 2.5rem; }

.entry-content-shell {
  max-width: 1160px;
  margin-inline: auto;
}
.entry-header {
  margin-bottom: 2rem;
}
.entry-title {
  max-width: 16ch;
  margin-bottom: 1rem;
  font-size: clamp(2.6rem, 4.4vw, 4.7rem);
}
.entry-meta--single {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 1.7rem;
}
.entry-media {
  margin-top: 1.6rem;
}
.entry-image {
  width: 100%;
  aspect-ratio: 16 / 8.2;
  object-fit: cover;
}
.entry-content {
  max-width: var(--haapa-content);
  margin-inline: auto;
  font-size: 1.08rem;
}
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  margin-top: 2rem;
}
.entry-content h2 {
  font-size: clamp(1.9rem, 2.6vw, 2.8rem);
}
.entry-content h3 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}
.entry-content a {
  color: var(--haapa-red);
  font-weight: 600;
}
.entry-content img {
  margin: 1.8rem auto;
}
.entry-content figure { margin: 2rem 0; }
.entry-content hr {
  height: 1px;
  border: 0;
  background: #e5e5e5;
  margin: 2rem 0;
}
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: #fff;
}
.entry-content th,
.entry-content td {
  padding: .85rem .9rem;
  border: 1px solid #e5e5e5;
  text-align: left;
  vertical-align: top;
}
.entry-content thead th {
  background: #f5f5f5;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}
.author-box {
  max-width: var(--haapa-content);
  margin: 3rem auto 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
}
.author-box__content h2 {
  font-size: 1.55rem;
  margin-bottom: .5rem;
}
.author-box__content p { color: #4b4b4b; }
.related-posts {
  max-width: var(--haapa-content);
  margin: 4rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
}
.related-posts h2 {
  font-size: clamp(1.7rem, 2.4vw, 2.5rem);
  margin-bottom: 1.2rem;
}
.related-posts__list {
  display: grid;
  gap: .9rem;
}
.related-post h3 {
  font-size: 1.12rem;
  margin: 0;
}
.related-post a {
  color: #161616;
  text-decoration: none;
}
.related-post a:hover { color: var(--haapa-red); }

.page-content,
.search-results,
.no-results { max-width: var(--haapa-content); }
.pagination,
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2rem;
}
.page-numbers,
.nav-links a,
.nav-links span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 .8rem;
  border: 1px solid #ddd;
  color: #111;
  text-decoration: none;
}
.page-numbers.current,
.nav-links .current { background: var(--haapa-black); color: #fff; border-color: var(--haapa-black); }

.site-footer {
  margin-top: 3rem;
  background: var(--haapa-black);
  color: #fff;
}
.site-footer__inner {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  padding: 2.3rem 0 2.8rem;
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.social-links a,
.footer-menu a {
  color: #fff;
  text-decoration: none;
}
.footer-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem 1.2rem;
}
.site-footer__branding p { margin: 0; }
.site-footer__tagline {
  color: #dddddd;
  margin-top: .35rem !important;
}

.wp-block-image,
.wp-block-gallery,
.alignwide,
.alignfull { max-width: 100%; }
.alignwide { width: min(100%, calc(var(--haapa-content) + 180px)); margin-left: auto; margin-right: auto; }
.alignfull { width: min(100vw, var(--haapa-wrap)); margin-left: auto; margin-right: auto; }

@media (max-width: 1400px) {
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .site-header__inner { min-height: 82px; }
  .menu-toggle { display: inline-flex; }
  .primary-navigation {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 1rem 20px 1.4rem;
    background: #101010;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul {
    display: grid;
    gap: .85rem;
    justify-content: stretch;
  }
  .primary-navigation a { display: block; padding: .15rem 0; }

  .logo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-panel__inner,
  .hero-panel--tips .hero-panel__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-panel__title { max-width: 8ch; }
  .hero-panel__description { max-width: 100%; }
  .section-heading { align-items: start; flex-direction: column; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-image { aspect-ratio: 16 / 10; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .container { width: min(100% - 24px, var(--haapa-wrap)); }
  .site-header__inner { min-height: 74px; gap: 1rem; }
  .site-logo img { max-height: 42px; }
  .site-title { font-size: 1.2rem; }
  .logo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
  }
  .logo-strip__item { min-height: 108px; }
  .logo-strip__image { max-height: 84px; }
  .hero-panel { padding: 2.2rem 0 2.8rem; }
  .hero-panel__title {
    font-size: clamp(3rem, 18vw, 5rem);
    max-width: none;
  }
  .hero-panel__image,
  .hero-panel__placeholder {
    min-height: 260px;
    aspect-ratio: 16 / 11;
  }
  .hero-panel__button { width: 100%; }
  .search-form { width: 100%; flex-direction: column; align-items: stretch; }
  .search-field,
  .search-submit { width: 100%; min-width: 0; }
  .post-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .post-card__title { font-size: 1.3rem; }
  .entry-title { font-size: clamp(2rem, 12vw, 3rem); }
  .entry-meta--single { gap: .8rem; }
  .entry-content { font-size: 1rem; }
  .author-box {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .site-footer__inner { justify-items: start; text-align: left; }
  .social-links,
  .footer-menu { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
