/*
Theme Name: LHTS Refined Foundation
Theme URI: https://learnhowtosource.com/
Author: Learn How to Source AB / Soulful Creations
Author URI: https://learnhowtosource.com/
Description: A responsive, accessible WordPress theme for the Learn How to Source procurement knowledge base. Built around the Refined Foundation brand system, The Procurement Framework, role-based navigation and guided professional development.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lhts-refined-foundation
Tags: blog, education, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, wide-blocks, accessibility-ready
*/

:root {
  --lhts-navy: #17324d;
  --lhts-navy-dark: #10283e;
  --lhts-steel: #738fa8;
  --lhts-teal: #246b6b;
  --lhts-teal-dark: #195656;
  --lhts-ochre: #d88a2b;
  --lhts-sky: #e8f0f5;
  --lhts-paper: #f7f4ee;
  --lhts-ink: #1f2933;
  --lhts-muted: #52616b;
  --lhts-line: #d4dee5;
  --lhts-white: #ffffff;
  --lhts-font-sans: "Source Sans 3", Aptos, Arial, sans-serif;
  --lhts-font-serif: "Source Serif 4", Georgia, serif;
  --lhts-reading: 46rem;
  --lhts-wide: 72rem;
  --lhts-radius-sm: 0.25rem;
  --lhts-radius-md: 0.5rem;
  --lhts-shadow: 0 0.5rem 2rem rgb(23 50 77 / 0.08);
  --lhts-header-height: 5.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--lhts-ink);
  background: var(--lhts-white);
  font-family: var(--lhts-font-sans);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 2rem 0;
}

a {
  color: var(--lhts-teal);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--lhts-navy);
}

:focus-visible {
  outline: 3px solid var(--lhts-ochre);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.75em;
  color: var(--lhts-navy);
  line-height: 1.15;
  text-wrap: balance;
}

h1,
h2,
.lhts-editorial-title {
  font-family: var(--lhts-font-serif);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.25rem);
}

h2 {
  font-size: clamp(2rem, 3.5vw, 3rem);
}

h3 {
  font-size: clamp(1.45rem, 2.3vw, 2rem);
}

h4 {
  font-size: 1.35rem;
}

p {
  margin: 0 0 1.35em;
}

blockquote {
  margin: 2rem 0;
  border-left: 0.35rem solid var(--lhts-ochre);
  background: var(--lhts-paper);
  padding: 1.4rem 1.6rem;
  color: var(--lhts-navy);
  font-family: var(--lhts-font-serif);
  font-size: 1.3rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 1rem;
}

th,
td {
  border-bottom: 1px solid var(--lhts-line);
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--lhts-navy);
  background: var(--lhts-sky);
  font-weight: 700;
}

button,
input,
textarea,
select {
  font: inherit;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--lhts-steel);
  border-radius: var(--lhts-radius-sm);
  background: var(--lhts-white);
  padding: 0.72rem 0.85rem;
  color: var(--lhts-ink);
}

button,
input[type="submit"] {
  border: 0;
  border-radius: var(--lhts-radius-sm);
  background: var(--lhts-navy);
  padding: 0.7rem 1rem;
  color: var(--lhts-white);
  font-weight: 700;
  cursor: pointer;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  white-space: nowrap;
}

.screen-reader-text:focus {
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100000;
  width: auto;
  height: auto;
  clip: auto;
  clip-path: none;
  background: var(--lhts-white);
  padding: 0.75rem 1rem;
  color: var(--lhts-navy);
}

.lhts-container {
  width: min(calc(100% - 2rem), var(--lhts-wide));
  margin-inline: auto;
}

.lhts-reading-width {
  max-width: var(--lhts-reading);
}

.site-main {
  min-height: 55vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgb(212 222 229 / 0.8);
  background: rgb(255 255 255 / 0.96);
  backdrop-filter: blur(12px);
}

.admin-bar .site-header {
  top: 32px;
}

.site-header__inner {
  display: grid;
  min-height: var(--lhts-header-height);
  grid-template-columns: minmax(15rem, 1fr) auto auto;
  align-items: center;
  gap: 1.5rem;
}

.site-branding img {
  display: block;
  width: min(25rem, 100%);
  max-height: 4.2rem;
  object-fit: contain;
  object-position: left center;
}

.custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.primary-menu,
.footer-menu {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-menu a {
  color: var(--lhts-ink);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
  color: var(--lhts-teal);
}

.primary-menu .sub-menu {
  position: absolute;
  min-width: 14rem;
  margin: 0;
  border: 1px solid var(--lhts-line);
  border-radius: var(--lhts-radius-sm);
  background: var(--lhts-white);
  box-shadow: var(--lhts-shadow);
  padding: 0.75rem;
  list-style: none;
  opacity: 0;
  transform: translateY(0.5rem);
  visibility: hidden;
  transition: 160ms ease;
}

.primary-menu li {
  position: relative;
}

.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
  opacity: 1;
  transform: none;
  visibility: visible;
}

.primary-menu .sub-menu a {
  display: block;
  padding: 0.5rem 0.65rem;
}

.menu-toggle {
  display: none;
}

.lhts-button,
.wp-block-button__link {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid transparent;
  border-radius: var(--lhts-radius-sm);
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.lhts-button:hover,
.wp-block-button__link:hover {
  transform: translateY(-1px);
}

.lhts-button--primary,
.wp-block-button__link {
  color: var(--lhts-white);
  background: var(--lhts-navy);
}

.lhts-button--primary:hover {
  color: var(--lhts-white);
  background: var(--lhts-navy-dark);
}

.lhts-button--secondary {
  border-color: var(--lhts-teal);
  color: var(--lhts-teal);
  background: transparent;
}

.lhts-button--secondary:hover {
  color: var(--lhts-white);
  background: var(--lhts-teal);
}

.lhts-button--action {
  color: var(--lhts-ink);
  background: var(--lhts-ochre);
}

.lhts-header-cta {
  white-space: nowrap;
}

.lhts-hero {
  position: relative;
  overflow: hidden;
  background: var(--lhts-paper);
  padding: clamp(4.5rem, 9vw, 7.5rem) 0;
}

.lhts-hero::after {
  position: absolute;
  top: -12rem;
  right: -15rem;
  width: 38rem;
  height: 38rem;
  border-radius: 50%;
  background: rgb(36 107 107 / 0.09);
  content: "";
}

.lhts-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
}

.lhts-kicker {
  margin-bottom: 1rem;
  color: var(--lhts-ochre);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lhts-hero__title {
  max-width: 13ch;
}

.lhts-hero__lead {
  max-width: 43rem;
  color: var(--lhts-muted);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.lhts-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.lhts-path-card {
  border: 1px solid var(--lhts-line);
  border-radius: var(--lhts-radius-md);
  background: var(--lhts-white);
  box-shadow: var(--lhts-shadow);
  padding: clamp(1.5rem, 4vw, 2.3rem);
}

.lhts-path-card__meta,
.lhts-card__meta,
.entry-meta,
.archive-label {
  color: var(--lhts-teal);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lhts-path-card h2 {
  font-size: 2rem;
}

.lhts-progress {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--lhts-sky);
}

.lhts-progress span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: var(--lhts-teal);
}

.lhts-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.lhts-section--sky {
  background: var(--lhts-sky);
}

.lhts-section--paper {
  background: var(--lhts-paper);
}

.lhts-section--navy {
  color: var(--lhts-white);
  background: var(--lhts-navy);
}

.lhts-section--navy h2,
.lhts-section--navy h3,
.lhts-section--navy a:not(.lhts-button) {
  color: var(--lhts-white);
}

.lhts-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.lhts-section-heading > div {
  max-width: 48rem;
}

.lhts-section-heading p {
  color: var(--lhts-muted);
}

.lhts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.lhts-card,
.post-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid var(--lhts-line);
  border-radius: var(--lhts-radius-md);
  background: var(--lhts-white);
  box-shadow: 0 0.25rem 1rem rgb(23 50 77 / 0.04);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.lhts-card:hover,
.post-card:hover {
  box-shadow: var(--lhts-shadow);
  transform: translateY(-2px);
}

.lhts-card {
  padding: 1.6rem;
}

.lhts-card h3 {
  margin-top: 0.65rem;
}

.lhts-card p,
.post-card__excerpt {
  color: var(--lhts-muted);
}

.lhts-card__link,
.post-card__link {
  margin-top: auto;
  font-weight: 700;
}

.post-card__image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--lhts-radius-md) var(--lhts-radius-md) 0 0;
  background: var(--lhts-sky);
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 250ms ease;
}

.post-card:hover .post-card__image img {
  transform: scale(1.025);
}

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.45rem;
}

.post-card__title {
  margin-top: 0.65rem;
  font-family: var(--lhts-font-serif);
  font-size: 1.55rem;
}

.post-card__title a {
  color: var(--lhts-navy);
  text-decoration: none;
}

.post-card__placeholder {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--lhts-steel);
}

.post-card__placeholder img {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
}

.archive-hero,
.page-hero {
  border-bottom: 1px solid var(--lhts-line);
  background: var(--lhts-paper);
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.archive-hero__content,
.page-hero__content {
  max-width: 52rem;
}

.archive-description,
.page-hero__lead {
  color: var(--lhts-muted);
  font-size: 1.2rem;
}

.content-area {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--lhts-reading)) minmax(13rem, 1fr);
  align-items: start;
  gap: clamp(2rem, 7vw, 6rem);
}

.entry-header {
  margin-bottom: 2rem;
}

.entry-title {
  margin-top: 0.7rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.entry-meta a {
  color: inherit;
}

.entry-featured-image {
  margin: 0 0 2.5rem;
  overflow: hidden;
  border-radius: var(--lhts-radius-md);
}

.entry-content > * {
  max-width: var(--lhts-reading);
}

.entry-content > .alignwide {
  width: min(100vw - 2rem, var(--lhts-wide));
  max-width: var(--lhts-wide);
  margin-left: min(0px, calc((var(--lhts-reading) - var(--lhts-wide)) / 2));
}

.entry-content > .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.3em;
}

.entry-content li {
  margin-bottom: 0.4rem;
}

.entry-content .wp-block-image img {
  border-radius: var(--lhts-radius-sm);
}

.entry-sidebar {
  position: sticky;
  top: calc(var(--lhts-header-height) + 2rem);
  border-top: 0.3rem solid var(--lhts-ochre);
  background: var(--lhts-paper);
  padding: 1.5rem;
}

.entry-sidebar h2 {
  font-size: 1.45rem;
}

.entry-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--lhts-line);
  padding-top: 1.5rem;
}

.tag-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-links a {
  border-radius: 999px;
  background: var(--lhts-sky);
  padding: 0.3rem 0.7rem;
  font-size: 0.88rem;
  text-decoration: none;
}

.post-navigation {
  margin-top: 3rem;
  border-top: 1px solid var(--lhts-line);
  padding-top: 2rem;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.nav-previous,
.nav-next {
  max-width: 45%;
}

.pagination {
  margin-top: 3rem;
}

.pagination .nav-links {
  justify-content: center;
}

.page-numbers {
  display: inline-grid;
  min-width: 2.6rem;
  min-height: 2.6rem;
  place-items: center;
  border: 1px solid var(--lhts-line);
  border-radius: var(--lhts-radius-sm);
  padding: 0.25rem 0.65rem;
  text-decoration: none;
}

.page-numbers.current {
  border-color: var(--lhts-navy);
  color: var(--lhts-white);
  background: var(--lhts-navy);
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form label {
  flex: 1;
}

.comments-area {
  max-width: var(--lhts-reading);
  margin-top: 4rem;
  border-top: 1px solid var(--lhts-line);
  padding-top: 2rem;
}

.comment-list {
  padding: 0;
  list-style: none;
}

.comment-body {
  margin-bottom: 1rem;
  border: 1px solid var(--lhts-line);
  border-radius: var(--lhts-radius-sm);
  padding: 1rem;
}

.site-footer {
  color: var(--lhts-white);
  background: var(--lhts-navy);
  padding: 4rem 0 2rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(16rem, 1.2fr) 1fr 1fr;
  gap: 3rem;
}

.site-footer__logo {
  width: min(24rem, 100%);
}

.site-footer h2,
.site-footer h3,
.site-footer a {
  color: var(--lhts-white);
}

.site-footer p {
  color: var(--lhts-sky);
}

.site-footer .footer-menu {
  align-items: flex-start;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  border-top: 1px solid rgb(232 240 245 / 0.2);
  padding-top: 1.5rem;
  color: var(--lhts-sky);
  font-size: 0.9rem;
}

.not-found {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

@media (max-width: 62rem) {
  .site-header__inner {
    grid-template-columns: minmax(12rem, 1fr) auto;
  }

  .menu-toggle {
    display: inline-flex;
    min-width: 2.8rem;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
  }

  .site-navigation {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    border-top: 1px solid var(--lhts-line);
    background: var(--lhts-white);
    box-shadow: var(--lhts-shadow);
    padding: 1rem;
  }

  .site-navigation.is-open {
    display: block;
  }

  .primary-menu {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
  }

  .primary-menu a {
    display: block;
    padding: 0.75rem;
  }

  .primary-menu .sub-menu {
    position: static;
    display: block;
    margin-left: 1rem;
    border: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
    visibility: visible;
  }

  .lhts-header-cta {
    display: none;
  }

  .lhts-hero__grid,
  .entry-layout,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .entry-sidebar {
    position: static;
  }

  .lhts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 48rem) {
  .admin-bar .site-header {
    top: 46px;
  }

  body {
    font-size: 1.0625rem;
  }

  .lhts-container {
    width: min(calc(100% - 1.25rem), var(--lhts-wide));
  }

  .site-branding img {
    width: min(18rem, 100%);
  }

  .lhts-grid {
    grid-template-columns: 1fr;
  }

  .lhts-actions,
  .lhts-section-heading,
  .site-footer__bottom,
  .nav-links {
    align-items: stretch;
    flex-direction: column;
  }

  .lhts-actions .lhts-button {
    width: 100%;
  }

  .nav-previous,
  .nav-next {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .entry-sidebar,
  .post-navigation,
  .comments-area {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
