/* Eterum theme additions on top of the original eterum.se stylesheet (dist/main.css). */

:root {
  --eterum-ink: #403939;
  --eterum-coral: #ff847c;
  --eterum-coral-dark: #c8473f;
  --eterum-sand: #ebe8e5;
  --eterum-line: #d6d1cc;
  --eterum-cream: #fff0e5;
}

/* Accessibility helpers */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 12px 18px;
  background: var(--eterum-ink);
  color: #fff;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--eterum-ink);
  outline-offset: 2px;
}
.footer a:focus-visible {
  outline-color: #fff;
}

/* Mobile menu states (the old site toggled these with jQuery) */
.mobile-top-menu.in,
.mobile-top-menu.in .page-menu {
  display: block;
}
body.mobile-menu-open .top-menu .top-menu-button {
  display: none;
}
body.mobile-menu-open .top-menu .top-menu-close-button {
  display: block;
}
@media (min-width: 992px) {
  .mobile-top-menu.in {
    display: none;
  }
}

/* Footer */
.footer .footer-legal {
  margin-bottom: 80px;
}
.footer .footer-legal p {
  color: #bfbfbf;
  font-size: 14px;
  font-style: italic;
  line-height: 24px;
}
@media (min-width: 992px) {
  .footer .footer-section {
    flex: 1 1 33%;
  }
}

/* Article page: the article title is the h1, the section name is a label */
.section-label.with-border a {
  color: inherit;
  text-decoration: none;
}
.article-meta .category {
  margin-left: 12px;
  color: var(--eterum-coral-dark);
  font-weight: 600;
}
.news-item .date,
.article-meta .date {
  color: #6f6763;
}

/* Category filter on the listing */
.news-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: -20px 0 40px;
}
.news-categories a {
  padding: 6px 16px;
  border: 1px solid var(--eterum-line);
  border-radius: 24px;
  color: var(--eterum-ink);
  font-weight: 600;
  font-size: 15px;
  line-height: 24px;
  text-decoration: none;
}
.news-categories a:hover,
.news-categories a[aria-current="page"] {
  background: var(--eterum-ink);
  border-color: var(--eterum-ink);
  color: #fff;
}

/* Pagination */
.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 0;
}
.pagination .page-numbers {
  min-width: 44px;
  padding: 9px 14px;
  border: 1px solid var(--eterum-line);
  color: var(--eterum-ink);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.pagination .page-numbers.current,
.pagination a.page-numbers:hover {
  background: var(--eterum-ink);
  border-color: var(--eterum-ink);
  color: #fff;
}

/* Member call to action */
.member-cta {
  margin: 50px 0 0;
  padding: 30px;
  background: var(--eterum-cream);
  border-left: 6px solid var(--eterum-coral);
}
.member-cta__heading {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 36px;
  font-weight: 600;
}
.member-cta__text {
  margin: 0 0 20px;
}
.member-cta__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin: 0;
}
.member-cta__login {
  color: var(--eterum-ink);
  font-weight: 600;
  text-decoration: underline;
}
.member-cta--listing {
  margin-top: 0;
}
.member-cta--listing .member-cta__heading {
  font-size: 22px;
  line-height: 30px;
}
@media (max-width: 991px) {
  .member-cta--listing {
    margin-top: 40px;
  }
}

/* Search form */
.search-form {
  max-width: 560px;
  margin-bottom: 40px;
}
.search-form .form-control {
  height: 50px;
  font-size: 18px;
}
.search-form .btn {
  height: 50px;
}
.search-summary {
  color: #6f6763;
}

/* Block-written articles */
.page-content-text .wp-block-image img {
  max-width: 100%;
  height: auto;
}
.page-content-text table {
  max-width: 100%;
}
@media (max-width: 767px) {
  .page-content-text .table,
  .page-content-text table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Heading underline: the old site injected a .heading-border element with JavaScript */
.with-border::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: currentColor;
}
h1.with-border::after,
.section-label.with-border::after,
.footer .footer-section h2.with-border::after,
body.StartPage h2.with-border::after {
  height: 8px;
}

/* Article page: section label looks like the old page heading, the article title like the old h2 */
.section-label.with-border {
  margin: 0 0 50px;
  padding-bottom: 15px;
  color: #333;
  font-size: 36px;
  line-height: 50px;
  font-weight: 600;
  letter-spacing: 0.083em;
  text-transform: uppercase;
}
.section-label.with-border a:hover {
  color: var(--eterum-coral-dark);
}
h1.article-title {
  margin: 0 0 15px;
  font-size: 26px;
  line-height: 38px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
@media (min-width: 992px) {
  .section-label.with-border {
    padding-bottom: 25px;
    font-size: 62px;
    line-height: 86px;
  }
  h1.article-title {
    font-size: 32px;
    line-height: 48px;
  }
}

/* Listing titles keep the look of the old h3 */
.news-item h2 {
  margin: 25px 0 10px;
  font-size: 28px;
  line-height: 32px;
  font-weight: 600;
}
.news-item h2 a {
  color: var(--eterum-ink);
}

.article-meta .updated {
  margin-left: 12px;
  color: #6f6763;
}

/* Article sidebar: sticky contents list and member call to action, from 1200px (same idea as the Pensionera guides) */
.article-aside-col {
  display: none;
}
.page-content-text h2[id] {
  scroll-margin-top: 24px;
}
@media (min-width: 1200px) {
  .article-layout {
    display: flex;
  }
  .article-layout::before,
  .article-layout::after {
    display: none;
  }
  .article-aside-col {
    display: block;
  }
  .has-article-aside .page-content-text .wp-block-rank-math-toc-block {
    display: none;
  }
}
.article-aside {
  position: sticky;
  top: 30px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding-bottom: 8px;
}
.admin-bar .article-aside {
  top: 62px;
  max-height: calc(100vh - 92px);
}
.article-aside__label {
  margin: 0 0 8px;
  padding: 0 12px;
  color: #6f6763;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}
.article-aside__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.article-aside__nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--eterum-ink);
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
}
.article-aside__nav a:hover {
  background: #f6f3f1;
  color: var(--eterum-ink);
}
.article-aside__nav a[aria-current] {
  background: var(--eterum-sand);
  font-weight: 700;
}
.article-aside__cta {
  margin-top: 28px;
  padding: 20px;
  border-radius: 16px;
  background: var(--eterum-ink);
}
.article-aside__cta-heading {
  margin: 0 0 14px;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.article-aside__cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  border-radius: 999px;
  background: #fff;
  color: var(--eterum-ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.article-aside__cta-button:hover,
.article-aside__cta-button:focus {
  background: var(--eterum-coral);
  color: var(--eterum-ink);
}
.article-aside__cta-button:focus-visible {
  outline-color: #fff;
}
