/*
Theme Name: BetterFit DK
Theme URI: https://betterfit.dk/
Author: TWS Crew
Description: A fast, responsive Danish fitness magazine theme with editable Customizer options, modern posts, contact message storage, and a custom product CTA block.
Version: 1.0.2
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: betterfit
*/

:root {
  --bf-bg: #ffffff;
  --bf-surface: #f5f7fb;
  --bf-surface-strong: #eef3f7;
  --bf-text: #101214;
  --bf-muted: #5d6874;
  --bf-border: #e2e7ee;
  --bf-accent: #ffd641;
  --bf-accent-2: #29c783;
  --bf-accent-3: #1967d2;
  --bf-radius-sm: 14px;
  --bf-radius: 22px;
  --bf-radius-lg: 32px;
  --bf-shadow: 0 16px 42px rgba(16, 18, 20, .08);
  --bf-shadow-soft: 0 10px 24px rgba(16, 18, 20, .06);
  --bf-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bf-serif: Georgia, "Times New Roman", serif;
  --bf-content: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bf-bg);
  color: var(--bf-text);
  font-family: var(--bf-font);
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: .09em; text-underline-offset: .18em; }
a:hover { color: #000; }
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto;
  clip-path: none;
  height: auto;
  left: 16px;
  top: 16px;
  width: auto;
  z-index: 100000;
  padding: 10px 14px;
  background: var(--bf-text);
  color: #fff;
  border-radius: 999px;
}
.bf-container { width: min(var(--bf-content), calc(100% - 44px)); margin-inline: auto; }
.bf-site-header {
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--bf-border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
}
.bf-header-inner {
  min-height: 112px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}
.bf-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.bf-custom-logo img, .custom-logo { display: block; width: auto; max-width: 230px; max-height: 58px; }
.bf-word-logo {
  display: inline-flex;
  align-items: center;
  gap: .08em;
  color: var(--bf-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(2.05rem, 3.2vw, 3.45rem);
  font-weight: 950;
  line-height: .92;
  letter-spacing: -.075em;
  white-space: nowrap;
}
.bf-word-logo__main { color: currentColor; }
.bf-word-logo__mark {
  display: inline-block;
  background: var(--bf-accent);
  color: #101214;
  padding: .05em .13em .08em;
  border-radius: .06em;
  transform: rotate(-2deg);
  letter-spacing: -.08em;
}
.bf-word-logo--footer { color: #fff; }
.bf-primary-nav { justify-self: center; }
.bf-menu { list-style: none; display: flex; gap: clamp(18px, 2.4vw, 34px); align-items: center; margin: 0; padding: 0; }
.bf-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
}
.bf-menu a:hover { color: var(--bf-accent-3); }
.bf-header-actions { display: flex; align-items: center; gap: 14px; }
.bf-search-link { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; text-decoration: none; }
.bf-search-link:hover { background: var(--bf-surface); color: var(--bf-accent-3); }
.bf-menu-toggle { display: none; width: 46px; height: 46px; border: 0; border-radius: 999px; background: var(--bf-text); color: #fff; cursor: pointer; }
.bf-menu-toggle span { display: block; width: 18px; height: 2px; margin: 4px auto; background: currentColor; border-radius: 4px; transition: transform .2s ease, opacity .2s ease; }
.bf-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.bf-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bf-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.bf-main { min-height: 68vh; }
.bf-home { padding: 34px 0 70px; }
.bf-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, .85fr);
  gap: 42px;
  align-items: start;
}
.bf-featured-card { display: block; text-decoration: none; color: inherit; }
.bf-featured-media { overflow: hidden; border-radius: var(--bf-radius-lg); background: var(--bf-surface); box-shadow: var(--bf-shadow); aspect-ratio: 1.42 / 1; }
.bf-featured-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.bf-featured-card:hover .bf-featured-media img { transform: scale(1.025); }
.bf-kicker { display: inline-flex; gap: 8px; align-items: center; margin: 22px 0 10px; font-size: 14px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; color: var(--bf-accent-3); text-decoration: none; }
.bf-kicker::before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: linear-gradient(135deg, var(--bf-accent), var(--bf-accent-2)); }
.bf-featured-title { margin: 0 0 12px; font-size: clamp(2.35rem, 4.2vw, 5.4rem); line-height: .95; letter-spacing: -.06em; }
.bf-featured-excerpt { margin: 0; max-width: 740px; font-size: clamp(1.05rem, 1.25vw, 1.24rem); color: var(--bf-muted); }
.bf-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 18px; color: var(--bf-muted); font-size: 15px; }
.bf-meta a { font-weight: 800; color: var(--bf-text); }
.bf-side-list { background: #f0f6fc; border-radius: var(--bf-radius-lg); padding: 28px; }
.bf-side-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.bf-side-item a { display: grid; grid-template-columns: 136px 1fr; gap: 18px; text-decoration: none; align-items: center; }
.bf-side-thumb { border-radius: 14px; overflow: hidden; aspect-ratio: 1.45 / 1; background: #dfe8f2; }
.bf-side-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bf-side-title { margin: 0; font-family: var(--bf-serif); font-size: clamp(1.08rem, 1.3vw, 1.45rem); line-height: 1.05; }
.bf-side-meta { color: var(--bf-muted); font-size: 14px; margin-top: 6px; }
.bf-home-content { margin-top: 62px; }

.bf-page-hero, .bf-archive-hero, .bf-search-hero {
  padding: clamp(40px, 7vw, 92px) 0 clamp(26px, 5vw, 56px);
}
.bf-page-title, .bf-archive-title, .bf-search-title {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 6.3rem);
  line-height: .92;
  letter-spacing: -.065em;
}
.bf-page-intro, .bf-archive-description { max-width: 780px; margin: 20px 0 0; color: var(--bf-muted); font-size: 1.15rem; }
.bf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding-bottom: 72px; }
.bf-card { border: 1px solid var(--bf-border); border-radius: var(--bf-radius); overflow: hidden; background: #fff; box-shadow: var(--bf-shadow-soft); display: flex; flex-direction: column; min-height: 100%; }
.bf-card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; min-height: 100%; }
.bf-card-media { aspect-ratio: 1.34 / 1; background: var(--bf-surface); overflow: hidden; }
.bf-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .32s ease; }
.bf-card:hover .bf-card-media img { transform: scale(1.03); }
.bf-card-body { padding: 22px; }
.bf-card-title { margin: 4px 0 10px; font-size: clamp(1.28rem, 1.8vw, 1.75rem); line-height: 1.08; letter-spacing: -.025em; }
.bf-card-excerpt { margin: 0; color: var(--bf-muted); font-size: 1rem; }
.bf-pagination { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 4px 0 72px; }
.bf-pagination .page-numbers { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--bf-border); text-decoration: none; font-weight: 800; }
.bf-pagination .current, .bf-pagination a:hover { background: var(--bf-text); color: #fff; border-color: var(--bf-text); }

.bf-article { padding-bottom: 78px; }
.bf-article-header { padding: clamp(42px, 6.5vw, 86px) 0 clamp(22px, 3.2vw, 42px); }
.bf-article-title { margin: 0 0 16px; font-size: clamp(3rem, 7.7vw, 7.1rem); line-height: .9; letter-spacing: -.075em; max-width: 1050px; }
.bf-subtitle { display: block; max-width: 760px; margin: 0 0 22px; font-family: var(--bf-serif); font-size: clamp(1.24rem, 2vw, 1.65rem); line-height: 1.3; color: #20252b; }
.bf-review-line { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 16px; color: #27313a; }
.bf-review-line svg { color: #2d8a59; flex: 0 0 auto; }
.bf-article-layout { display: grid; grid-template-columns: 280px minmax(0, 820px) minmax(230px, 1fr); gap: 42px; align-items: start; }
.bf-toc { position: sticky; top: 144px; background: #f0f0f0; border-radius: 0; padding: 22px; font-family: var(--bf-serif); }
.bf-toc[hidden] { display: none; }
.bf-toc-title { display: block; font-family: var(--bf-font); font-weight: 850; font-size: 1rem; margin-bottom: 12px; }
.bf-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bf-toc a { text-decoration: none; font-weight: 700; line-height: 1.2; }
.bf-article-main { min-width: 0; }
.bf-article-image { border-radius: var(--bf-radius); overflow: hidden; margin: 0 0 34px; box-shadow: var(--bf-shadow-soft); }
.bf-article-image img { display: block; width: 100%; }
.bf-entry { font-size: clamp(1.07rem, 1.24vw, 1.2rem); }
.bf-entry > *:first-child { margin-top: 0; }
.bf-entry h2, .bf-entry h3, .bf-entry h4 { line-height: 1.06; letter-spacing: -.045em; margin: 1.75em 0 .7em; }
.bf-entry h2 { font-size: clamp(2.1rem, 4vw, 3.35rem); }
.bf-entry h3 { font-size: clamp(1.65rem, 3vw, 2.35rem); }
.bf-entry h4 { font-size: clamp(1.32rem, 2vw, 1.7rem); }
.bf-entry p { margin: 0 0 1.18em; }
.bf-entry a { color: #0f5cc5; font-weight: 750; text-decoration-thickness: .09em; text-underline-offset: .19em; }
.bf-entry strong, .bf-entry b { font-weight: 850; color: #050607; }
.bf-entry em, .bf-entry i { color: #26323d; }
.bf-entry ul, .bf-entry ol { padding-left: 1.35em; margin: 0 0 1.25em; }
.bf-entry li { margin: .42em 0; padding-left: .18em; }
.bf-entry ul li::marker { color: var(--bf-accent-2); }
.bf-entry ol li::marker { color: var(--bf-accent-3); font-weight: 900; }
.bf-entry blockquote {
  position: relative;
  margin: 2em 0;
  padding: 26px 28px 26px 76px;
  background: linear-gradient(135deg, rgba(255,214,65,.28), rgba(41,199,131,.16));
  border: 1px solid rgba(16,18,20,.08);
  border-radius: var(--bf-radius);
  font-family: var(--bf-serif);
  font-size: 1.2em;
  line-height: 1.45;
}
.bf-entry blockquote::before {
  content: "🏃";
  position: absolute;
  left: 24px;
  top: 23px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--bf-shadow-soft);
  font-size: 19px;
}
.bf-entry blockquote p:last-child { margin-bottom: 0; }
.bf-entry table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .96em; }
.bf-entry th, .bf-entry td { border: 1px solid var(--bf-border); padding: 13px 15px; vertical-align: top; }
.bf-entry th { background: var(--bf-surface); text-align: left; }
.bf-entry figure { margin: 2em 0; }
.bf-entry figcaption { color: var(--bf-muted); font-size: .92rem; margin-top: 8px; }
.bf-entry .wp-block-separator { border: 0; height: 1px; background: var(--bf-border); margin: 2.2em 0; }
.bf-article-aside { min-width: 0; }
.bf-aside-card { position: sticky; top: 144px; border-radius: var(--bf-radius); overflow: hidden; background: var(--bf-surface); border: 1px solid var(--bf-border); }
.bf-aside-card a { display: block; text-decoration: none; }
.bf-aside-card img { width: 100%; display: block; aspect-ratio: 1.1 / 1; object-fit: cover; }
.bf-aside-card span { display: block; padding: 16px; font-family: var(--bf-serif); font-weight: 700; line-height: 1.14; }
.bf-related { margin-top: 58px; padding-top: 44px; border-top: 1px solid var(--bf-border); }
.bf-related h2 { margin: 0 0 20px; font-size: clamp(1.9rem, 3.8vw, 3rem); line-height: 1; letter-spacing: -.05em; }
.bf-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

.bf-page-content { padding-bottom: 76px; }
.bf-contact-shell { display: grid; grid-template-columns: minmax(0, .95fr) minmax(320px, 560px); gap: 44px; align-items: start; padding-bottom: 76px; }
.bf-contact-card { background: var(--bf-surface); border: 1px solid var(--bf-border); border-radius: var(--bf-radius-lg); padding: clamp(24px, 4vw, 42px); box-shadow: var(--bf-shadow-soft); }
.bf-form { display: grid; gap: 16px; }
.bf-form label { display: grid; gap: 8px; font-weight: 850; }
.bf-form input, .bf-form textarea, .bf-search-form input {
  width: 100%;
  border: 1px solid var(--bf-border);
  border-radius: 16px;
  background: #fff;
  color: var(--bf-text);
  font: inherit;
  padding: 14px 16px;
}
.bf-form textarea { min-height: 170px; resize: vertical; }
.bf-button, .wp-block-button__link, .bf-form button, .bf-search-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  background: linear-gradient(135deg, var(--bf-text), #2a3340);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(16,18,20,.16);
}
.bf-button:hover, .wp-block-button__link:hover, .bf-form button:hover, .bf-search-form button:hover { transform: translateY(-1px); color: #fff; }
.bf-alert { border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; background: rgba(41,199,131,.13); border: 1px solid rgba(41,199,131,.28); font-weight: 800; }
.bf-search-form { display: flex; gap: 12px; max-width: 760px; margin: 22px 0 0; }

.bf-product-cta, .wp-block-betterfit-product-cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, .9fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: center;
  margin: 2em 0;
  padding: clamp(24px, 4vw, 42px);
  border-radius: var(--bf-radius-lg);
  background: linear-gradient(135deg, rgba(255,214,65,.88), rgba(41,199,131,.72));
  box-shadow: var(--bf-shadow);
  color: var(--bf-text);
}
.bf-product-cta::before, .wp-block-betterfit-product-cta::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 260px;
  height: 260px;
  background: rgba(255,255,255,.22);
  border-radius: 999px;
  pointer-events: none;
}
.bf-product-content, .bf-product-media { position: relative; z-index: 1; }
.bf-product-title { margin: 0 0 10px; font-size: clamp(1.65rem, 3.4vw, 3.2rem); line-height: 1; letter-spacing: -.05em; }
.bf-product-text { margin: 0 0 20px; max-width: 620px; color: rgba(16,18,20,.78); }
.bf-product-media { border-radius: 24px; overflow: hidden; background: rgba(255,255,255,.5); min-height: 220px; display: grid; place-items: center; }
.bf-product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bf-product-button { background: #fff; color: var(--bf-text); box-shadow: 0 12px 28px rgba(16,18,20,.12); }
.bf-product-button:hover { color: var(--bf-text); }

.bf-site-footer { background: #0e1116; color: #fff; margin-top: 30px; }
.bf-footer-inner { padding: clamp(42px, 6vw, 74px) 0 30px; }
.bf-footer-top { display: grid; grid-template-columns: minmax(0, 1.35fr) 1fr 1fr minmax(200px, .7fr); gap: 36px; }
.bf-footer-brand p { max-width: 430px; color: rgba(255,255,255,.68); margin: 18px 0 0; }
.bf-footer-title { font-weight: 900; margin: 0 0 14px; letter-spacing: .04em; text-transform: uppercase; font-size: 14px; }
.bf-footer-menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bf-footer-menu a { color: rgba(255,255,255,.76); text-decoration: none; }
.bf-footer-menu a:hover { color: #fff; }
.bf-socials { display: flex; flex-wrap: wrap; gap: 10px; }
.bf-socials a { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; background: rgba(255,255,255,.1); color: #fff; text-decoration: none; font-weight: 900; }
.bf-socials a:hover { background: var(--bf-accent); color: #0e1116; }
.bf-footer-bottom { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.13); color: rgba(255,255,255,.64); font-size: 14px; }

.bf-404 { padding: clamp(58px, 10vw, 120px) 0; text-align: center; }
.bf-404-icon { width: 118px; height: 118px; display: inline-grid; place-items: center; border-radius: 34px; background: linear-gradient(135deg, var(--bf-accent), var(--bf-accent-2)); margin-bottom: 24px; font-size: 54px; box-shadow: var(--bf-shadow); }
.bf-404 h1 { margin: 0; font-size: clamp(3rem, 8vw, 7rem); line-height: .92; letter-spacing: -.07em; }
.bf-404 p { max-width: 640px; margin: 18px auto 28px; color: var(--bf-muted); font-size: 1.15rem; }

@media (max-width: 1080px) {
  .bf-header-inner { min-height: 92px; }
  .bf-primary-nav {
    position: fixed;
    inset: 92px 0 auto 0;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid var(--bf-border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    padding: 18px 22px 28px;
    box-shadow: var(--bf-shadow-soft);
  }
  .bf-primary-nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .bf-menu { display: grid; gap: 4px; }
  .bf-menu a { font-size: 16px; min-height: 48px; }
  .bf-menu-toggle { display: inline-block; }
  .bf-header-inner { grid-template-columns: auto 1fr auto; }
  .bf-home-grid { grid-template-columns: 1fr; }
  .bf-side-list ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bf-side-item a { grid-template-columns: 104px 1fr; }
  .bf-article-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .bf-toc, .bf-aside-card { position: static; }
  .bf-toc { order: -1; }
  .bf-article-aside { display: none; }
  .bf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bf-footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 18px; line-height: 1.62; }
  .bf-container { width: min(100% - 30px, var(--bf-content)); }
  .bf-header-inner { min-height: 78px; gap: 12px; }
  .bf-primary-nav { inset: 78px 0 auto 0; }
  .bf-custom-logo img, .custom-logo { max-width: 168px; max-height: 48px; }
  .bf-word-logo { font-size: 2.15rem; }
  .bf-search-link { display: none; }
  .bf-home { padding-top: 22px; }
  .bf-featured-media { border-radius: 24px; aspect-ratio: 1.12 / 1; }
  .bf-side-list { padding: 18px; border-radius: 24px; }
  .bf-side-list ul { grid-template-columns: 1fr; gap: 18px; }
  .bf-side-item a { grid-template-columns: 108px 1fr; gap: 14px; }
  .bf-side-title { font-size: 1.15rem; }
  .bf-grid, .bf-related-grid { grid-template-columns: 1fr; gap: 20px; }
  .bf-card-body { padding: 20px; }
  .bf-article-title, .bf-page-title, .bf-archive-title, .bf-search-title { letter-spacing: -.055em; }
  .bf-article-header { padding-top: 38px; }
  .bf-entry { font-size: 1.08rem; }
  .bf-entry table { display: block; overflow-x: auto; white-space: nowrap; border: 0; -webkit-overflow-scrolling: touch; }
  .bf-entry th, .bf-entry td { min-width: 150px; white-space: normal; }
  .bf-entry blockquote { padding: 22px 20px 22px 64px; }
  .bf-entry blockquote::before { left: 18px; top: 21px; }
  .bf-product-cta, .wp-block-betterfit-product-cta { grid-template-columns: 1fr; padding: 22px; border-radius: 26px; }
  .bf-product-media { min-height: 190px; order: -1; }
  .bf-contact-shell { grid-template-columns: 1fr; gap: 26px; }
  .bf-search-form { flex-direction: column; }
  .bf-footer-top { grid-template-columns: 1fr; gap: 30px; }
  .bf-footer-bottom { flex-direction: column; align-items: flex-start; }
}

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