/*
Theme Name: MySums
Theme URI: https://mysums.co.uk/
Author: MySums
Description: MySums WordPress theme with the original UK calculator interface.
Version: 1.1.2
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: mysums
*/

.mysums-calculator-mount:empty { min-height: 280px; }
.mysums-rating-star { border: 0; background: transparent; color: #164c35; font-size: 1.75rem; cursor: pointer; padding: .15rem; }
.mysums-rating-star:hover, .mysums-rating-star:focus-visible { transform: scale(1.13); }
.mysums-consent { position: fixed; z-index: 100; bottom: 1rem; left: 1rem; right: 1rem; max-width: 34rem; padding: 1.25rem; border: 1px solid #dce5dd; border-radius: 1rem; background: white; box-shadow: 0 12px 40px #12291d33; }
.mysums-consent[hidden] { display: none; }
.mysums-consent button { margin: .75rem .5rem 0 0; border: 1px solid #164c35; border-radius: .5rem; padding: .5rem .9rem; font-weight: 700; }
.mysums-consent .accept { background: #164c35; color: white; }
.mysums-consent .reject { color: #164c35; background: white; }

/* Long guides: with many headings the sidebar TOC was taller than the hero and left a blank gap.
   Above 8 items, stack the TOC under the hero as a full-width, multi-column card. */
@media (min-width: 821px) {
  .blog-post-hero-layout:has(.blog-post-toc li:nth-child(9)) { grid-template-columns: minmax(0, 1fr); }
  .blog-post-hero-layout:has(.blog-post-toc li:nth-child(9)) .blog-post-toc ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem 1.75rem; }
  .blog-post-hero-layout:has(.blog-post-toc li:nth-child(9)) .blog-post-toc li:last-child { border-left: 1px solid #e2e8e3; padding-bottom: .7rem; }
}

/* Mobile: a 16-item TOC pushed the article ~650px down the page. Keep it compact and scrollable. */
@media (max-width: 820px) {
  .blog-post-hero-layout:has(.blog-post-toc li:nth-child(9)) .blog-post-toc ol { max-height: 13rem; overflow-y: auto; overscroll-behavior: contain; padding-right: .25rem; }
  .mysums-consent { left: .5rem; right: .5rem; bottom: .5rem; padding: .9rem 1rem; font-size: .85rem; line-height: 1.4; }
  .mysums-consent button { margin-top: .5rem; padding: .45rem .8rem; }
}

/* Archive and search pagination. index.php used to print every matching post in
   full, so there was nothing to paginate and no style for it. */
.mysums-archive-pagination { margin-top: 2rem; }
.mysums-archive-pagination .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.mysums-archive-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; min-height: 2.5rem; padding: 0 .65rem; border: 1px solid #dce5dd; border-radius: .75rem; background: #fff; font-size: .875rem; font-weight: 700; color: #164c35; text-decoration: none; }
.mysums-archive-pagination .page-numbers:hover { border-color: #164c35; }
.mysums-archive-pagination .page-numbers.current { background: #164c35; border-color: #164c35; color: #fff; }
.mysums-archive-pagination .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* WCAG 2.2 AA, 2.5.8 Target Size (Minimum): the footer column links and the
   cookie-settings button are grid items sized by the 20px line box of text-sm,
   under the 24px minimum. Vertical centring keeps the existing rhythm. */
footer .grid > a,
footer .grid > button { display: flex; align-items: center; min-height: 24px; }

/* The two standalone arrow links sit outside body copy, so the inline exception
   to 2.5.8 does not cover them either. The isolated form checkbox is left at its
   designed 20px: it passes under the spacing exception, and resizing the input
   would move the custom tick drawn over it. */
.next-step-nudge-link { display: inline-flex; align-items: center; min-height: 24px; }
a[class~="inline-flex"][class*="sm:hidden"] { min-height: 24px; align-items: center; }
