/* ==========================================================================
   Treningsvitenskap — foundation stylesheet
   Tokens and shared shell for the redesigned pages.
   Every value here comes from the design handoff. Page-specific components
   (gym cards, price rows, equipment cards, galleries) live further down as
   they are built.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Brand */
  --tv-red:              #CF2029;
  --tv-red-hover:        #A8161F;
  --tv-link-hover:       #96141C;
  --tv-red-tint:         #FDF4F4;
  --tv-red-tint-border:  #F0C9CC;

  /* Text */
  --tv-ink:              #14161A;
  --tv-text:             #4A5058;
  --tv-muted:            #5C6269;
  --tv-label:            #6B7076;
  --tv-faint:            #8F959C;
  --tv-nav:              #40464D;

  /* Lines and surfaces */
  --tv-border:           #E4E7EA;
  --tv-border-light:     #EEF0F2;
  --tv-input-border:     #D3D7DB;
  --tv-surface:          #FFFFFF;
  --tv-surface-alt:      #FAFBFB;
  --tv-placeholder:      #E4E7EA;

  /* Open/closed badge */
  --tv-open-bg:          #F0F7F1;
  --tv-open-border:      #CFE3D3;
  --tv-open-text:        #1F6B34;
  --tv-open-dot:         #2E9E4F;
  /* Closed reads red against the open state's green. The handoff suggested
     neutral; red is the client's call and the clearer signal of the two. */
  --tv-closed-bg:        #FDF4F4;
  --tv-closed-border:    #F0C9CC;
  --tv-closed-text:      #A8161F;
  --tv-closed-dot:       #CF2029;

  /* Type families */
  --tv-display: 'Saira Condensed', 'Arial Narrow', system-ui, sans-serif;
  --tv-body:    'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Type scale */
  --tv-h1:        clamp(34px, 4.6vw, 58px);
  --tv-h2:        clamp(24px, 2.6vw, 32px);
  --tv-h2-cta:    clamp(28px, 3.4vw, 44px);
  --tv-lead:      17.5px;

  /* Layout */
  --tv-maxw:      1180px;
  --tv-gutter:    24px;
  --tv-section:   56px;
  --tv-section-first: 40px;

  /* Long-form reading. Four values introduced by the blog handoff, each
     derived from the originals: 1180px runs to ~130 characters at 17px,
     roughly twice a readable measure, so prose gets its own column. */
  --tv-prose:      680px;
  --tv-prose-size: 17px;
  --tv-prose-lh:   1.7;
  --tv-prose-ink:  #2C3238;
  --tv-list-thumb: 128px;

  /* Radii */
  --tv-r-card:    5px;
  --tv-r-photo:   4px;
  --tv-r-btn:     3px;
  --tv-r-badge:   2px;
  --tv-r-pill:    99px;

  /* Motion */
  --tv-transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

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

/*
 * No overflow-x: hidden here on purpose. It hides a too-wide layout rather than
 * fixing it, and breaks position: sticky on some Android builds. If the page
 * scrolls sideways, find the element.
 */
.tv-page {
  background: var(--tv-surface);
  color: var(--tv-ink);
  font-family: var(--tv-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.tv-page p { margin: 0; text-wrap: pretty; }
.tv-page img { max-width: 100%; display: block; }

/*
 * Flex and grid children default to min-width: auto, which refuses to shrink
 * below their content — one long unbreakable string then widens the whole
 * document. Email addresses and street names are the usual offenders here.
 */
.tv-grid > *,
.tv-cta-copy,
.tv-card-head > div,
.tv-post-text,
.tv-price-name,
.tv-price-figure,
.tv-price-desc,
.tv-price-action { min-width: 0; }

.tv-footer p,
.tv-card-addr,
.tv-facts dd { overflow-wrap: anywhere; }

.tv-page a {
  color: var(--tv-red);
  text-decoration: none;
  transition: var(--tv-transition);
}
.tv-page a:hover { color: var(--tv-link-hover); }

.tv-page :focus-visible {
  outline: 2px solid var(--tv-red);
  outline-offset: 2px;
  border-radius: var(--tv-r-badge);
}

/* Visible only to screen readers until focused */
.tv-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--tv-ink);
  color: #fff;
  padding: 10px 16px;
  font-family: var(--tv-display);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}
.tv-skip:focus { left: 0; color: #fff; }

.tv-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */

.tv-wrap {
  max-width: var(--tv-maxw);
  margin: 0 auto;
  padding-left: var(--tv-gutter);
  padding-right: var(--tv-gutter);
}

/* Full-bleed bands keep their own inner wrap */
.tv-bleed { width: 100%; }

.tv-section { padding-top: var(--tv-section); }
.tv-section--first { padding-top: var(--tv-section-first); }

/* Responsive without media queries, as specified in the handoff */
.tv-grid { display: grid; gap: 20px; }
.tv-grid--cards     { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.tv-grid--three     { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tv-grid--two       { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 36px; }
.tv-grid--split     { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; }
.tv-grid--clusters  { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.tv-grid--footer    { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 32px; }

/* --------------------------------------------------------------------------
   4. Typography
   -------------------------------------------------------------------------- */

.tv-h1 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: var(--tv-h1);
  font-weight: 700;
  line-height: 1;
  max-width: 20ch;
  text-wrap: balance;
  color: var(--tv-ink);
  margin: 0;
}

/* Section heading with the red rule */
.tv-h2 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: var(--tv-h2);
  font-weight: 700;
  line-height: 1.1;
  color: var(--tv-ink);
  margin: 0;
  padding-bottom: 9px;
  border-bottom: 3px solid var(--tv-red);
  display: inline-block;
}

.tv-lead {
  font-size: var(--tv-lead);
  line-height: 1.55;
  color: var(--tv-text);
  max-width: 62ch;
}

.tv-eyebrow {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--tv-red);
}

.tv-badge-loc {
  display: inline-block;
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .13em;
  color: var(--tv-red);
}

.tv-caption { font-size: 13.5px; color: var(--tv-label); }
.tv-small   { font-size: 15.5px; color: var(--tv-label); }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.tv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.2;
  padding: 10px 18px;
  border-radius: var(--tv-r-btn);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--tv-transition);
  white-space: nowrap;
}

/*
 * Every button states its own text colour, at a specificity that beats the
 * global link rule. `.tv-page a` is (0,1,1) and a bare `.tv-btn--red` is only
 * (0,1,0), so without the `.tv-page` prefix the link colour wins and a red
 * label lands on a red background — invisible. :visited is included because a
 * visitor returning from ibooking would otherwise get the visited colour.
 */
.tv-page .tv-btn--red,
.tv-page .tv-btn--red:visited { background: var(--tv-red); color: #fff; }
.tv-page .tv-btn--red:hover,
.tv-page .tv-btn--red:focus { background: var(--tv-red-hover); color: #fff; }

.tv-page .tv-btn--outline,
.tv-page .tv-btn--outline:visited { background: transparent; color: var(--tv-ink); border-color: var(--tv-ink); }
.tv-page .tv-btn--outline:hover,
.tv-page .tv-btn--outline:focus { background: var(--tv-ink); color: #fff; }

/* "Vis bilder" */
.tv-page .tv-btn--tint,
.tv-page .tv-btn--tint:visited {
  background: var(--tv-red-tint);
  border-color: var(--tv-red-tint-border);
  color: var(--tv-red);
  padding: 9px 15px;
}
.tv-page .tv-btn--tint:hover,
.tv-page .tv-btn--tint:focus { background: var(--tv-red); border-color: var(--tv-red); color: #fff; }

/* On the red CTA band */
.tv-page .tv-btn--white,
.tv-page .tv-btn--white:visited { background: #fff; color: var(--tv-ink); }
.tv-page .tv-btn--white:hover,
.tv-page .tv-btn--white:focus { background: var(--tv-ink); color: #fff; }

.tv-page .tv-btn--ghost,
.tv-page .tv-btn--ghost:visited {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.55);
}
.tv-page .tv-btn--ghost:hover,
.tv-page .tv-btn--ghost:focus { background: rgba(255,255,255,.14); color: #fff; }

/* --------------------------------------------------------------------------
   6. Open / closed pill
   -------------------------------------------------------------------------- */

.tv-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--tv-r-pill);
  padding: 5px 13px 5px 11px;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--tv-open-bg);
  border: 1px solid var(--tv-open-border);
  color: var(--tv-open-text);
}
.tv-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tv-open-dot);
  flex: none;
}
.tv-pill--closed {
  background: var(--tv-closed-bg);
  border-color: var(--tv-closed-border);
  color: var(--tv-closed-text);
}
.tv-pill--closed::before { background: var(--tv-closed-dot); }

/* --------------------------------------------------------------------------
   7. Photos
   Fixed aspect ratio + placeholder ground, so a slow or missing image
   leaves a grey block instead of collapsing the layout.
   -------------------------------------------------------------------------- */

.tv-photo {
  background: var(--tv-placeholder);
  border-radius: var(--tv-r-photo);
  overflow: hidden;
  display: block;
}
.tv-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tv-photo--32   { aspect-ratio: 3 / 2; }
.tv-photo--1610 { aspect-ratio: 16 / 10; }
.tv-photo--1    { aspect-ratio: 1 / 1; }

/* --------------------------------------------------------------------------
   8. Top utility bar
   -------------------------------------------------------------------------- */

.tv-topbar {
  background: var(--tv-red);
  color: #fff;
  font-size: 13px;
  padding: 9px var(--tv-gutter);
}
.tv-topbar-inner {
  max-width: var(--tv-maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
}
.tv-topbar-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  font-family: var(--tv-display);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 14px;
  font-weight: 500;
}
.tv-topbar-dim { color: rgba(255,255,255,.78); }
.tv-topbar-side { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.tv-topbar a { color: #fff; }
.tv-topbar a:hover { color: rgba(255,255,255,.78); }

.tv-lang {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.38);
  color: #fff;
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  padding: 4px 9px;
  border-radius: var(--tv-r-badge);
  cursor: pointer;
  transition: var(--tv-transition);
}
.tv-lang:hover { background: rgba(255,255,255,.28); color: #fff; }

/* --------------------------------------------------------------------------
   9. Header
   -------------------------------------------------------------------------- */

.tv-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--tv-surface);
  border-bottom: 1px solid var(--tv-border);
  padding: 14px var(--tv-gutter);
}
.tv-header-inner {
  max-width: var(--tv-maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.tv-logo { display: block; flex: none; }
.tv-logo img { height: 28px; width: auto; }

.tv-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}
.tv-nav a { color: var(--tv-nav); }
.tv-nav a:hover { color: var(--tv-red); }

/* Current section or page. The same red rule as section headings, at 2px. */
.tv-nav a.is-active {
  color: var(--tv-red);
  font-weight: 600;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--tv-red);
}

.tv-nav-toggle { display: none; }

/* --------------------------------------------------------------------------
   9b. Year divider — blog index
   The section-heading treatment one size down, so the archive reads as a
   series of labelled groups rather than one long undated list.
   -------------------------------------------------------------------------- */

.tv-year {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding-bottom: 7px;
  border-bottom: 3px solid var(--tv-red);
}
.tv-year-label {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--tv-ink);
  font-variant-numeric: tabular-nums;
}
.tv-year-count { font-size: 13.5px; color: var(--tv-faint); }

/* --------------------------------------------------------------------------
   9c. Prose column — post bodies and legal text
   -------------------------------------------------------------------------- */

.tv-prose {
  max-width: var(--tv-prose);
  font-size: var(--tv-prose-size);
  line-height: var(--tv-prose-lh);
  color: var(--tv-prose-ink);
}
.tv-prose p { margin: 0 0 22px; }
.tv-prose > :last-child { margin-bottom: 0; }
.tv-prose h2 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--tv-ink);
  margin: 36px 0 14px;
}
.tv-prose h3 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--tv-ink);
  margin: 28px 0 10px;
}
.tv-prose ul,
.tv-prose ol {
  margin: 0 0 22px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tv-prose blockquote {
  margin: 32px 0;
  padding-left: 20px;
  border-left: 3px solid var(--tv-red);
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--tv-ink);
}
.tv-prose a { text-decoration: none; }
.tv-prose a:hover { text-decoration: underline; }
.tv-prose img { border-radius: var(--tv-r-photo); margin: 28px 0; }
.tv-prose figcaption { font-size: 14px; color: var(--tv-faint); margin-top: 8px; }

/*
 * Post content is 2018 editor output and carries fixed-width embeds — 32 of
 * the 41 posts hold a YouTube iframe hardcoded to 1020px, which is nearly
 * three times a phone viewport. Nothing in the body may exceed the column.
 */
.tv-prose iframe,
.tv-prose embed,
.tv-prose object,
.tv-prose video { max-width: 100%; }

.tv-prose iframe[src*="youtube"],
.tv-prose iframe[src*="youtu.be"],
.tv-prose iframe[src*="vimeo"],
.tv-prose iframe[src*="facebook"] {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--tv-r-photo);
}

.tv-prose table { display: block; max-width: 100%; overflow-x: auto; }
.tv-prose pre { max-width: 100%; overflow-x: auto; }

/* Classic captions carry an inline pixel width, so this has to outrank it */
.tv-prose figure,
.tv-prose .wp-caption {
  max-width: 100% !important;
  width: auto !important;
}

/*
 * Self-hosted video. MediaElement's stylesheet is dequeued along with the rest
 * of the parent theme's assets, which leaves its wrapper sized from inline
 * styles — measured at 18,030px on three posts. The native <video> element
 * plays perfectly well on its own; it just needs to stay inside the column.
 */
.tv-prose .wp-video,
.tv-prose .wp-video-shortcode,
.tv-prose .mejs-container,
.tv-prose .mejs-layers,
.tv-prose .mejs-overlay,
.tv-prose .mejs-poster {
  max-width: 100% !important;
  width: 100% !important;
}
.tv-prose .mejs-container,
.tv-prose .mejs-poster { height: auto !important; }
.tv-prose video {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: var(--tv-r-photo);
}
.tv-prose .wp-caption-text { font-size: 14px; color: var(--tv-faint); margin-top: 8px; }

/* Legal pages carry more headings, closer together, so the step is smaller */
.tv-prose--legal h2 { font-size: 24px; margin: 34px 0 12px; }

/* --------------------------------------------------------------------------
   10. CTA band
   -------------------------------------------------------------------------- */

.tv-cta {
  background: var(--tv-red);
  color: #fff;
  padding: 52px var(--tv-gutter);
  margin-top: 64px;
}
.tv-cta-inner {
  max-width: var(--tv-maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 36px;
  align-items: center;
  justify-content: space-between;
}
.tv-cta-copy { flex: 1 1 380px; display: flex; flex-direction: column; gap: 10px; }
.tv-cta h2 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: var(--tv-h2-cta);
  font-weight: 700;
  line-height: 1.02;
  margin: 0;
  color: #fff;
  text-wrap: balance;
}
.tv-cta p { color: rgba(255,255,255,.9); max-width: 52ch; }
.tv-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */

.tv-footer {
  background: var(--tv-ink);
  color: var(--tv-faint);
  padding: 48px var(--tv-gutter) 32px;
}
.tv-footer-inner { max-width: var(--tv-maxw); margin: 0 auto; }
.tv-footer h2 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .14em;
  color: #fff;
  margin: 0 0 12px;
}
.tv-footer p { font-size: 14.5px; }
.tv-footer-tagline { margin-top: 14px; }
.tv-footer a { color: var(--tv-faint); }
.tv-footer a:hover { color: #fff; }
.tv-footer-logo img { height: 24px; width: auto; filter: brightness(0) invert(1); }

.tv-footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   12. Intro block
   -------------------------------------------------------------------------- */

.tv-intro-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 20px;
}
.tv-intro-note { font-size: 14.5px; color: var(--tv-label); }

/* --------------------------------------------------------------------------
   13. Gym cards
   -------------------------------------------------------------------------- */

.tv-card {
  border: 1px solid var(--tv-border);
  border-top: 3px solid var(--tv-red);
  border-radius: var(--tv-r-card);
  display: flex;
  flex-direction: column;
  background: var(--tv-surface);
}

.tv-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--tv-border);
}
.tv-card-thumb {
  flex: none;
  width: 78px;
  height: 60px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--tv-placeholder);
}
.tv-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tv-card-name {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--tv-ink);
}
.tv-card-addr { font-size: 14px; color: var(--tv-label); }

/* Two-column fact table, shared by the cards and the gym pages */
.tv-facts { display: grid; grid-template-columns: auto 1fr; }
.tv-facts dt,
.tv-facts dd {
  margin: 0;
  padding: 13px 20px;
  font-size: 14.5px;
  border-bottom: 1px solid var(--tv-border-light);
}
.tv-facts dt { color: var(--tv-label); }
.tv-facts dd {
  font-weight: 600;
  color: var(--tv-ink);
  border-left: 1px solid var(--tv-border-light);
}
.tv-facts dd span { font-weight: 400; color: var(--tv-label); }
.tv-facts dt:last-of-type,
.tv-facts dd:last-of-type { border-bottom: 0; }

/*
 * Cards in a row stretch to match the tallest. Without this the surplus height
 * collected between the last fact row and the footer, leaving a gap under the
 * final value and stopping the column rule short of the row's bottom edge.
 * Letting the rows share the extra space closes both.
 */
.tv-card > .tv-facts { flex: 1 1 auto; align-content: stretch; }

.tv-card-foot {
  margin-top: auto;
  border-top: 1px solid var(--tv-border);
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
}
.tv-card-foot a:not(.tv-btn) { font-size: 14.5px; }

/* Join is the only button in the card; everything else is a quiet link */
.tv-card-cta { width: 100%; }
.tv-card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 14.5px;
}

/* --------------------------------------------------------------------------
   14. Price table
   -------------------------------------------------------------------------- */

.tv-prices {
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  overflow: hidden;
  background: var(--tv-surface);
}

/* Wrapping flex, not a grid. A fixed four-column grid clips the button on
   narrow screens - the one layout the handoff flags as broken in an earlier
   version. */
.tv-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  border-top: 1px solid var(--tv-border-light);
}
.tv-price-row:first-child { border-top: 0; }

.tv-price-name   { flex: 1 1 180px; padding: 18px 20px 6px; }
.tv-price-figure { flex: 0 1 130px; padding: 0 20px 6px; }
.tv-price-desc   { flex: 2 1 240px; padding: 0 20px 6px; font-size: 14.5px; color: var(--tv-text); }
.tv-price-action { flex: 0 1 160px; padding: 8px 20px 18px; }
.tv-price-action .tv-btn { width: 100%; }

.tv-price-row.is-featured {
  background: var(--tv-red-tint);
  border-left: 3px solid var(--tv-red);
}

.tv-price-label {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 700;
  color: var(--tv-ink);
}
.tv-price-tag {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--tv-red);
}
.tv-price-amount {
  font-family: var(--tv-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--tv-ink);
}
.tv-price-row.is-featured .tv-price-amount { color: var(--tv-red); }
.tv-price-note { font-size: 13px; color: var(--tv-label); }

/* --------------------------------------------------------------------------
   15. Training-program panel
   -------------------------------------------------------------------------- */

.tv-program {
  background: var(--tv-surface-alt);
  border-top: 1px solid var(--tv-border-light);
  padding: 24px 20px 26px;
}
.tv-program[hidden] { display: none; }
.tv-program-inner { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.tv-program h3 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 19px;
  font-weight: 700;
  color: var(--tv-ink);
  margin: 0;
}
.tv-program p { font-size: 15px; color: var(--tv-text); }

.tv-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.tv-field { display: flex; flex-direction: column; gap: 6px; }
.tv-field > span,
.tv-field > label {
  font-family: var(--tv-body);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--tv-label);
}
.tv-field input,
.tv-field textarea,
.tv-field select {
  border: 1px solid var(--tv-input-border);
  border-radius: var(--tv-r-btn);
  padding: 11px 13px;
  font-family: var(--tv-body);
  font-size: 15px;
  background: #fff;
  color: var(--tv-ink);
  width: 100%;
}
.tv-field textarea { resize: vertical; }
.tv-hint { font-size: 13px; color: var(--tv-faint); }
.tv-submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }

/* The hint drops to its own line rather than being squeezed off the panel edge */
.tv-submit-row .tv-hint { flex: 1 1 100%; }

@media (min-width: 561px) {
  .tv-submit-row .tv-hint { flex: 1 1 auto; }
}

/* --------------------------------------------------------------------------
   16. Equipment cards
   -------------------------------------------------------------------------- */

.tv-equip {
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  padding: 20px 22px 22px;
  background: var(--tv-surface);
}
.tv-equip h3 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 19px;
  font-weight: 700;
  color: var(--tv-red);
  margin: 0 0 12px;
}
.tv-equip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14.5px;
  color: var(--tv-text);
}

/* --------------------------------------------------------------------------
   17. News rows
   -------------------------------------------------------------------------- */

.tv-news { display: flex; flex-direction: column; }
.tv-news-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 13px 2px;
  border-top: 1px solid var(--tv-border);
  color: inherit;
}
.tv-news-row:last-child { border-bottom: 1px solid var(--tv-border); }
.tv-news-row:hover { background: var(--tv-red-tint); color: inherit; }
.tv-news-date {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--tv-red);
  min-width: 80px;
}
.tv-news-title { font-size: 16px; font-weight: 500; color: var(--tv-ink); }

/* --------------------------------------------------------------------------
   18. Om Espen
   -------------------------------------------------------------------------- */

.tv-espen {
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  background: var(--tv-surface);
}
.tv-espen-photo { background: var(--tv-placeholder); min-height: 300px; }
.tv-espen-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 300px; }
.tv-espen-body {
  padding: 32px 32px 34px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}
.tv-espen-body h2 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: var(--tv-h2);
  font-weight: 700;
  line-height: 1.06;
  max-width: 22ch;
  color: var(--tv-ink);
  margin: 0;
  border: 0;
  padding: 0;
  display: block;
}
.tv-quote {
  border-left: 3px solid var(--tv-red);
  padding-left: 16px;
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 20px;
  font-weight: 700;
  color: var(--tv-ink);
}
.tv-espen-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; }

/* --------------------------------------------------------------------------
   19. Photo clusters
   -------------------------------------------------------------------------- */

.tv-cluster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 12px;
}
.tv-cluster-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tv-cluster-grid > .tv-wide { grid-column: 1 / -1; }

/* Gym page: one large photo beside a stacked pair.
   `span 2` would force a second track into existence when only one column
   fits, pushing the grid past the viewport. `1 / -1` spans whatever exists. */
.tv-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px; }
.tv-hero-grid > .tv-wide { grid-column: 1 / -1; }
.tv-hero-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 6px; }
.tv-hero-stack .tv-photo { min-height: 150px; }
.tv-photo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; }

/* --------------------------------------------------------------------------
   20. Cross-link card
   -------------------------------------------------------------------------- */

.tv-crosslink {
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  padding: 24px 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  background: var(--tv-surface);
}
.tv-crosslink-title {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 19px;
  font-weight: 700;
  color: var(--tv-ink);
}
.tv-crosslink-note { font-size: 14.5px; color: var(--tv-label); }

/* --------------------------------------------------------------------------
   21. Blog index
   The front-page news row, scaled up: same date column, same hover, with the
   featured image and an excerpt added.
   -------------------------------------------------------------------------- */

.tv-post-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
  padding: 20px 4px;
  border-top: 1px solid var(--tv-border);
  color: inherit;
}
.tv-post-row:hover { background: var(--tv-red-tint); color: inherit; }
.tv-post-row.is-last { border-bottom: 1px solid var(--tv-border); }

.tv-post-date {
  flex: 0 0 80px;
  padding-top: 3px;
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--tv-red);
}
.tv-post-thumb {
  flex: 0 0 var(--tv-list-thumb);
  aspect-ratio: 4 / 3;
  border-radius: var(--tv-r-photo);
  overflow: hidden;
  background: var(--tv-placeholder);
}
.tv-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tv-post-text { flex: 1 1 320px; }
.tv-post-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--tv-ink);
  margin-bottom: 5px;
  text-wrap: pretty;
}
.tv-post-excerpt { font-size: 14.5px; line-height: 1.55; color: var(--tv-muted); }

/* --------------------------------------------------------------------------
   22. Pagination
   -------------------------------------------------------------------------- */

.tv-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 28px;
}
.tv-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tv-pages a,
.tv-pages span {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  border-radius: var(--tv-r-btn);
  font-variant-numeric: tabular-nums;
  transition: var(--tv-transition);
}
.tv-pages a {
  border: 1px solid var(--tv-input-border);
  color: var(--tv-ink);
  padding: 8px 14px;
}
.tv-pages a:hover { background: var(--tv-ink); border-color: var(--tv-ink); color: #fff; }
.tv-pages .current {
  background: var(--tv-ink);
  color: #fff;
  border: 1px solid var(--tv-ink);
  padding: 9px 15px;
}
.tv-pages .dots { color: var(--tv-faint); padding: 8px 4px; }
.tv-total { font-size: 13.5px; color: var(--tv-faint); margin-left: auto; }

.tv-empty {
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  padding: 26px;
  text-align: center;
  font-size: 17px;
  color: var(--tv-text);
}

/* --------------------------------------------------------------------------
   23. Single post
   -------------------------------------------------------------------------- */

.tv-post-header {
  max-width: var(--tv-prose);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--tv-border);
}
.tv-post-h1 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.02;
  color: var(--tv-ink);
  text-wrap: balance;
  margin: 10px 0 12px;
}
.tv-byline { font-size: 14.5px; color: var(--tv-label); }

.tv-post-figure {
  max-width: var(--tv-prose);
  aspect-ratio: 16 / 9;
  border-radius: var(--tv-r-photo);
  overflow: hidden;
  background: var(--tv-placeholder);
  margin: 26px 0 30px;
}
.tv-post-figure img { width: 100%; height: 100%; object-fit: cover; }

.tv-postnav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: var(--tv-prose);
  margin-top: 40px;
}
.tv-postnav a {
  flex: 1 1 240px;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  padding: 16px 18px;
  color: inherit;
  transition: var(--tv-transition);
}
.tv-postnav a:hover { background: var(--tv-red-tint); color: inherit; }
.tv-postnav .tv-prev { text-align: left; }
.tv-postnav .tv-next { text-align: right; }
.tv-postnav-label {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--tv-faint);
  margin-bottom: 4px;
}
.tv-postnav-title { font-size: 16px; font-weight: 500; color: var(--tv-ink); }

/* --------------------------------------------------------------------------
   24. Inner pages
   The H1 takes the section rule, promoted one level — it is what makes these
   pages read as part of the same site.
   -------------------------------------------------------------------------- */

.tv-page-header { margin-bottom: 30px; }
.tv-page-header .tv-h1 {
  padding-bottom: 12px;
  border-bottom: 3px solid var(--tv-red);
  display: inline-block;
  max-width: none;
}
.tv-page-lead {
  font-size: var(--tv-lead);
  color: var(--tv-text);
  max-width: 56ch;
  margin-top: 18px;
}

.tv-panel {
  background: var(--tv-surface-alt);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  padding: 26px 26px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tv-panel h2 {
  font-family: var(--tv-display);
  text-transform: uppercase;
  font-size: 19px;
  font-weight: 700;
  color: var(--tv-ink);
  margin: 0;
  border: 0;
  padding: 0;
  display: block;
}

.tv-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  align-items: start;
}
.tv-contact-cards { display: flex; flex-direction: column; gap: 20px; }

/* Contact details card — phone and email are links but read as values */
.tv-facts--contact dd a { color: var(--tv-ink); }
.tv-facts--contact dd a:hover { color: var(--tv-red); }

/* Location cards here are the front page's cards with the fact table removed */
.tv-card--mini .tv-card-head { border-bottom: 0; }

.tv-embed {
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-r-card);
  overflow: hidden;
  background: var(--tv-surface-alt);
  min-height: 820px;
}
.tv-embed iframe { width: 100%; min-height: 820px; border: 0; display: block; }
.tv-embed-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.tv-embed-open { font-size: 14.5px; font-weight: 600; }

/* --------------------------------------------------------------------------
   25. Mobile navigation
   Six items plus a logo and a button do not fit a phone. Below 720px the nav
   collapses behind a toggle; above it, nothing changes.
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  /*
   * Below 720px the bar holds the logo and MENY, nothing else. Six nav items
   * plus a join button do not fit at 360px; both move into the panel.
   *
   * Every item that spans the row uses flex-basis 100% on a WRAPPING container.
   * An earlier version set flex-wrap: nowrap here, which made those same
   * children add a full extra row-width each and pushed the whole document
   * past the viewport — the cause of the sideways scroll.
   */
  .tv-nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: 1px solid var(--tv-ink);
    border-radius: var(--tv-r-btn);
    padding: 10px 18px;
    min-height: 44px;
    font-family: var(--tv-display);
    text-transform: uppercase;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--tv-ink);
    cursor: pointer;
    transition: var(--tv-transition);
  }
  .tv-nav-toggle:hover,
  .tv-nav-toggle[aria-expanded="true"] { background: var(--tv-ink); color: #fff; }
  .tv-nav-toggle-bars {
    display: inline-block;
    width: 16px;
    height: 2px;
    background: currentColor;
    position: relative;
  }
  .tv-nav-toggle-bars::before,
  .tv-nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    background: currentColor;
  }
  .tv-nav-toggle-bars::before { top: -5px; }
  .tv-nav-toggle-bars::after { top: 5px; }

  .tv-header-inner { flex-wrap: wrap; gap: 0 12px; }

  /* Full-width panel below the bar, breaking out of the header's gutter */
  .tv-nav {
    display: none;
    order: 3;
    /* Basis has to include the header's gutter, or the negative margins pull
       the panel left without widening it and the rows stop short on the right */
    flex: 0 0 calc(100% + (2 * var(--tv-gutter)));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 14px calc(-1 * var(--tv-gutter)) -14px;
    background: var(--tv-surface);
  }
  .tv-nav.is-open { display: flex; }
  .tv-nav a {
    padding: 16px var(--tv-gutter);
    border-top: 1px solid var(--tv-border);
    font-size: 17px;
    font-weight: 500;
    color: var(--tv-ink);
    text-align: left;
  }
  .tv-nav a.is-active { color: var(--tv-red); border-bottom: 0; }

  /* The join button becomes the last item in the panel */
  .tv-header-inner > .tv-btn { display: none; }
  .tv-nav.is-open ~ .tv-btn {
    display: flex;
    order: 4;
    flex: 0 0 100%;
    margin: 16px 0 8px;
  }
}

@media (min-width: 721px) {
  .tv-nav { display: flex !important; }
}

/* Gym card actions stack rather than leaving an uneven two-then-one row */
@media (max-width: 560px) {
  .tv-card-foot .tv-btn { flex: 0 0 100%; }
}

/* --------------------------------------------------------------------------
   26. Contact Form 7
   CF7 supplies the machinery; the design supplies the look. These rules bring
   its wrappers, error tips and response messages into the token system.
   -------------------------------------------------------------------------- */

.tv-page .wpcf7 { margin: 0; }
.tv-page .wpcf7-form { display: flex; flex-direction: column; gap: 16px; }

/* CF7 wraps every field in a span; it must not break the label's column */
.tv-page .wpcf7-form-control-wrap { display: block; }

.tv-page .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tv-red);
}

.tv-page .wpcf7-not-valid {
  border-color: var(--tv-red);
}

.tv-page .wpcf7-response-output {
  margin: 0;
  padding: 13px 16px;
  border: 1px solid var(--tv-border);
  border-left: 3px solid var(--tv-label);
  border-radius: var(--tv-r-btn);
  font-size: 15px;
  color: var(--tv-text);
  background: #fff;
}

.tv-page .wpcf7 form.sent .wpcf7-response-output {
  background: var(--tv-open-bg);
  border-color: var(--tv-open-border);
  border-left-color: var(--tv-open-text);
  color: var(--tv-open-text);
}

.tv-page .wpcf7 form.invalid .wpcf7-response-output,
.tv-page .wpcf7 form.unaccepted .wpcf7-response-output,
.tv-page .wpcf7 form.failed .wpcf7-response-output,
.tv-page .wpcf7 form.spam .wpcf7-response-output {
  background: var(--tv-red-tint);
  border-color: var(--tv-red-tint-border);
  border-left-color: var(--tv-red);
  color: var(--tv-red-hover);
}

.tv-page .wpcf7-spinner { margin: 0 0 0 10px; }

/* CF7's submit is a plain input; the button tokens have to reach it */
.tv-page input.tv-btn { -webkit-appearance: none; appearance: none; }
