/**
 * Shared visual and interaction refinements for Hail Mary Media.
 * Template-specific layout remains in each template while this layer keeps
 * typography, touch targets, cards and long-form reading consistent.
 */

:root:root {
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --shadow-card: 0 8px 28px rgba(0, 0, 0, .08);
}

html body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

body.hmm-dialog-open {
  overflow: hidden;
}

body .ticker-tab:not(.active),
body .ticker-loser .ticker-name,
body .ticker-loser .ticker-score,
body .ticker-final,
body .ticker-loading,
body .ticker-nogames,
body .search-overlay-close,
body .f-tag,
body .f-nav a,
body .f-bottom a,
body .foot-links a,
body .foot-copy,
body .subscribe-note,
body .cat-strip-label,
body .page-hero-desc,
body .page-hero-count,
body .hero-404 p {
  color: #aaa;
}

body input,
body textarea,
body select {
  font-family: var(--font-body) !important;
}

body .search-form .search-input,
body .fi-body,
body .card-body,
body .result-body {
  min-width: 0;
}

body .hero h1,
body .page-hero h1,
body .post-title,
body .section-hd h2,
body .related-hd,
body .post-body h2,
body .post-body h3,
body .post-body h4,
body .t-hero,
body .t-mid,
body .t-sm,
body .card-title,
body .result-title,
body .yt-title,
body .vid-title,
body .fi-title,
body .related-title,
body .sb-ttl {
  font-family: var(--font-display);
  text-wrap: balance;
}

/* Keep the sticky navigation useful without pinning two full rows onscreen. */
body .scores-ticker {
  position: relative;
  top: auto;
}

body .ticker-score,
body .score-num,
body .score-lg,
body .team-record,
body .game-clock {
  font-variant-numeric: tabular-nums;
}

/* Long-form copy should feel like an article, not a full-width page builder. */
body.single-post .post-body,
body.single-post .post-tags,
body.single-post .share-row,
body.single-post .author-box {
  width: min(100%, 720px);
  margin-inline: auto;
}

/* Keep article photography sharp and complete. Never stretch a small upload or
   crop a larger one merely to manufacture a banner. */
body.single-post .article-feature {
  display: table;
  width: auto;
  max-width: min(100%, 1040px);
  margin: 0 auto 2rem;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  background: #0b0b0b;
  text-align: center;
}

body.single-post .article-feature__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(760px, 78vh);
  margin-inline: auto;
  object-fit: contain;
}

/* Filters and live-score controls are primary mobile navigation, not tiny tags. */
body .filter-chip,
body .cat-chip,
body .cat-pill,
body .fbtn,
body .ticker-tab,
body .pbp-tab,
body .back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

body.single-post .article-feature figcaption {
  padding: .65rem 1rem;
  background: #fff;
  color: #666;
  font-size: .78rem;
  line-height: 1.45;
  text-align: left;
}

body.single-post .article-breadcrumb {
  margin-bottom: 1rem;
  color: #aaa;
  font-family: var(--font-display);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1.45;
  text-transform: uppercase;
}

body.single-post .article-breadcrumb nav,
body.single-post .article-breadcrumb p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin: 0;
}

body.single-post .article-breadcrumb a {
  color: #ddd;
  text-decoration: none;
}

body.single-post .article-breadcrumb a:hover {
  color: #ffb612;
}

body .archive-breadcrumb {
  position: relative;
  z-index: 1;
  margin: 0 auto .9rem;
  color: #aaa;
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

body .archive-breadcrumb nav,
body .archive-breadcrumb p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  margin: 0;
}

body .archive-breadcrumb a {
  color: #ddd;
}

body .archive-breadcrumb a:hover {
  color: #ffb612;
}

body.single-post .post-body {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + .2vw, 1.15rem);
  line-height: 1.76;
  letter-spacing: -.006em;
  overflow-wrap: break-word;
}

body.single-post .post-body h2 {
  font-size: clamp(1.75rem, 1.45rem + 1vw, 2.25rem);
  line-height: 1.08;
  text-transform: none;
  letter-spacing: 0;
}

body.single-post .post-body h3 {
  font-size: clamp(1.35rem, 1.2rem + .55vw, 1.7rem);
  line-height: 1.15;
}

body.single-post .post-body figcaption {
  font-size: .8125rem;
  line-height: 1.45;
}

body.single-post .post-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

body.single-post .post-body iframe,
body.single-post .post-body video,
body.single-post .post-body embed,
body.single-post .post-body object {
  max-width: 100%;
}

body.single-post .post-body a {
  overflow-wrap: anywhere;
}

body.single-post .post-body > table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.single-post .post-body > * + * {
  margin-top: 1.5rem;
}

body.single-post .post-body p {
  margin: 0 0 1.25em !important;
}

body.single-post .post-body p + p {
  margin-top: 0 !important;
}

body.single-post .post-body br {
  display: inline;
  margin: 0;
  content: normal;
}

body.single-post .post-body .wp-block-table,
body.single-post .post-body pre {
  max-width: 100%;
  overflow-x: auto;
}

/* Accessible target sizes on mouse, keyboard and touch screens. */
body .nav-links a,
body .nav-dropdown a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

body .nav-dropdown a {
  width: 100%;
}

body .nav-search-btn,
body .dark-toggle,
body .ham,
body .hamburger,
body .search-overlay-close {
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

body .mobile-menu a,
body .mob a {
  display: flex;
  align-items: center;
  min-height: 48px;
}

body .nav-item:focus-within .nav-dropdown {
  display: block;
}

body .btn,
body .subscribe-btn,
body .search-btn,
body .search-overlay-btn,
body .page-btn,
body .fbtn {
  min-height: 44px;
}

/* Hierarchy comes from type, spacing and feedback rather than more decoration. */
body .bc,
body .blog-card,
body .result-card,
body .yt-card,
body .vid-card,
body .fi,
body .related-card {
  border-color: #d7d7d7;
}

body .bc:hover,
body .blog-card:hover,
body .result-card:hover,
body .yt-card:hover,
body .vid-card:hover,
body .fi:hover,
body .related-card:hover,
body .bc:focus-visible,
body .blog-card:focus-visible,
body .result-card:focus-visible,
body .yt-card:focus-visible,
body .vid-card:focus-visible,
body .fi:focus-visible,
body .related-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: #ffb612;
}

body .excerpt,
body .card-excerpt,
body .result-excerpt,
body .vid-desc,
body .fi-desc {
  font-family: var(--font-body);
  font-size: .875rem;
  line-height: 1.5;
}

body .meta,
body .card-meta,
body .result-meta,
body .yt-date,
body .vid-date,
body .fi-date,
body .related-date {
  font-family: var(--font-body);
  font-size: .78rem;
}

body .social-pill:hover {
  opacity: .82;
}

body .soc,
body .f-soc,
body .f-nav a,
body .foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

body .f-soc {
  justify-content: center;
}

/* Keep the black footer compact and readable. Footer navigation is secondary
   content, so it does not need the same oversized desktop target spacing as
   primary controls; the mobile rule below restores full touch-size targets. */
body .site-footer .f-grid,
body.home .home-footer-grid {
  align-items: start;
  gap: 1.25rem;
  width: min(100%, 1180px);
  padding: 2rem 1.5rem 1.25rem;
}

body .site-footer .f-tag,
body .site-footer .f-nav a,
body .site-footer .f-bottom,
body .site-footer .f-bottom a,
body.home footer .foot-links a:not([style*="var(--gold)"]),
body.home footer .foot-copy,
body.home footer .home-footer-grid > div:first-child p {
  color: #f2f2f2 !important;
}

body .site-footer .f-nav a:hover,
body .site-footer .f-nav a:focus-visible,
body .site-footer .f-bottom a:hover,
body .site-footer .f-bottom a:focus-visible,
body.home footer .foot-links a:hover,
body.home footer .foot-links a:focus-visible {
  color: var(--gold) !important;
}

body .site-footer .f-nav,
body.home footer .foot-links {
  gap: .1rem !important;
}

body .site-footer .f-nav a,
body.home footer .foot-links a {
  min-height: 32px;
}

body .site-footer .f-bottom,
body.home footer .foot-copy {
  padding-block: .85rem 1rem;
}

/* Keep the brand moment while bringing the stories into view sooner. */
body.home .hero {
  padding: 1.25rem 1.5rem 1.5rem;
}

body.home .hero-logo {
  height: 92px;
  width: 92px;
}

body.home .hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.3rem);
}

body.home .hero-sub {
  margin-bottom: .9rem;
}

/* The ROSTER promo and four-column footer previously relied on inline desktop
   grids. Named classes make both regions responsive at narrow mobile widths. */
body.home .roster-promo {
  padding: 2.75rem 1.5rem;
  border-top: 3px solid #ffb612;
  border-bottom: 3px solid #ffb612;
  background: linear-gradient(135deg, #0a0a0f 0%, #111 50%, #1a1200 100%);
}

body.home .roster-promo-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .8fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  width: min(100%, 1180px);
  margin-inline: auto;
}

body.home .roster-promo-copy,
body.home .roster-leagues {
  min-width: 0;
}

body.home .roster-eyebrow {
  margin: 0 0 .5rem;
  color: #ffb612;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .25em;
  text-transform: uppercase;
}

body.home .roster-title {
  margin: 0 0 .75rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: -.01em;
  line-height: .95;
  text-transform: uppercase;
}

body.home .roster-title span {
  color: #ffb612;
}

body.home .roster-description {
  max-width: 620px;
  margin: 0 0 1.25rem;
  color: #aaa;
  font-size: .98rem;
  line-height: 1.65;
}

body.home .roster-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

body.home .roster-leagues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

body.home .roster-league {
  min-width: 0;
  padding: 1.15rem .65rem;
  border: 1px solid #2a2a3d;
  border-radius: 8px;
  background: #13131c;
  text-align: center;
}

body.home .roster-league strong,
body.home .roster-league span {
  display: block;
  font-family: var(--font-display);
}

body.home .roster-league strong {
  color: #ffb612;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

body.home .roster-league span {
  margin-top: .3rem;
  color: #aaa;
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}

body.home .roster-league--nba strong { color: #f07830; }
body.home .roster-league--nfl strong { color: #6686f2; }
body.home .roster-league--nhl strong { color: #50b8e0; }

body.home .home-footer-grid {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
  gap: 2rem;
  width: min(100%, 1280px);
  margin-inline: auto;
  padding: 2.5rem 1.5rem 1.5rem;
}

body.home footer {
  padding: 0;
}

body.home .foot-copy {
  margin-inline: 1rem;
  width: auto;
  padding-bottom: 1.25rem;
}

/* WordPress's admin toolbar changes the sticky/fixed navigation offset. */
body.admin-bar .primary-nav,
body.admin-bar .site-nav {
  top: 32px;
}

@media (max-width: 860px) {
  body .top-bar {
    display: none;
  }

  body .primary-nav,
  body .site-nav {
    top: 0;
    min-height: 60px;
    height: 60px;
    padding-inline: .85rem;
  }

  body.admin-bar .primary-nav,
  body.admin-bar .site-nav {
    top: 32px;
  }

  body .nav-links {
    display: none !important;
  }

  body .ham,
  body .hamburger {
    display: flex !important;
  }

  body .top-socials {
    display: none;
  }

  body .mobile-menu,
  body .mob {
    position: fixed !important;
    inset: 60px 0 auto !important;
    top: 60px !important;
    max-height: calc(100vh - 60px);
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 9998;
  }

  body.admin-bar .mobile-menu,
  body.admin-bar .mob {
    top: 92px !important;
    max-height: calc(100vh - 92px);
    max-height: calc(100dvh - 92px);
  }

  body.home .cat-strip-inner {
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
  }

  body.home .roster-promo-inner {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  body.single-post .post-head-inner {
    padding: 1.75rem 1rem 1.5rem;
  }

  body.single-post .post-title {
    font-size: clamp(2rem, 10vw, 2.625rem);
    line-height: 1;
  }

  body.single-post .page-wrap {
    padding: 1rem 1rem 2.5rem;
  }

  body.single-post .article-feature {
    margin-bottom: 1.5rem;
    border-radius: 7px;
  }

  body.single-post .article-feature__image {
    max-height: 70vh;
  }

  body.single-post .post-body {
    font-size: 1.0625rem;
    line-height: 1.72;
  }

  body.single-post .share-row {
    align-items: stretch;
    padding: 1rem;
  }

  body.single-post .share-lbl {
    width: 100%;
  }

  body.single-post .sbtn {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding-inline: .85rem;
  }

  body.single-post .author-box {
    padding-inline: 1rem;
  }

  body.single-post .post-cta {
    padding-inline: 0;
  }

  body.single-post .post-cta .cta-block {
    padding: 1.5rem 1rem;
  }

  body.home .roster-promo {
    padding: 2.25rem 1rem;
  }

  body.home .roster-leagues {
    gap: .55rem;
  }

  body.home .roster-league {
    padding: 1rem .4rem;
  }

  body .site-footer .f-grid,
  body.home .home-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 1rem;
    padding: 1.75rem 1rem 1rem;
  }

  body .site-footer .f-grid > :first-child,
  body .site-footer .f-grid > :last-child,
  body.home .home-footer-grid > :first-child,
  body.home .home-footer-grid > :last-child {
    grid-column: 1 / -1;
  }

  body .site-footer .f-nav a,
  body.home footer .foot-links a {
    min-height: 44px;
  }

  body .search-overlay {
    padding-top: 5rem;
  }

  body .search-overlay-form {
    flex-direction: column;
  }

  body .search-overlay-btn {
    width: 100%;
  }
}

/* Game data can contain unusually long team, player, injury and play strings.
   Let text shrink and wrap instead of being clipped by the card shell. */
body.hmm-game-page .ticker-tab,
body.hmm-game-page .pbp-tab,
body.hmm-game-page .back-link {
  min-height: 44px;
}

body.hmm-game-page .back-link {
  padding-block: .5rem;
}

body.hmm-game-page .performer-item > :first-child,
body.hmm-game-page .injury-item > :first-child,
body.hmm-game-page .performer-stats,
body.hmm-game-page .pbp-text,
body.hmm-game-page .scoring-text,
body.hmm-game-page .stat-compare-center,
body.hmm-game-page .gameinfo-item,
body.hmm-game-page .weather-item {
  min-width: 0;
}

body.hmm-game-page .performer-name,
body.hmm-game-page .performer-pos,
body.hmm-game-page .performer-stats,
body.hmm-game-page .performer-team-name,
body.hmm-game-page .injury-name,
body.hmm-game-page .injury-pos,
body.hmm-game-page .pbp-text,
body.hmm-game-page .pbp-stoppage,
body.hmm-game-page .scoring-text,
body.hmm-game-page .gameinfo-item,
body.hmm-game-page .broadcast-badge,
body.hmm-game-page .weather-item {
  overflow-wrap: anywhere;
}

body.hmm-game-page .performer-stats {
  flex: 0 1 auto;
  white-space: normal;
}

body.hmm-game-page .injury-item {
  align-items: flex-start;
  gap: .75rem;
}

body.hmm-game-page .injury-status,
body.hmm-game-page .pbp-score,
body.hmm-game-page .scoring-score {
  flex: 0 0 auto;
}

body.hmm-game-page .winprob-bar {
  min-width: 0;
}

body.hmm-game-page .winprob-team {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  body.hmm-game-page .scoreboard {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  body.hmm-game-page .team-side,
  body.hmm-game-page .score-center {
    min-width: 0;
  }

  body.hmm-game-page .team-name-lg {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  body.hmm-game-page .injury-grid {
    grid-template-columns: 1fr;
  }

  body.hmm-game-page .winprob-bar-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(44px, 2fr) auto minmax(0, 1fr);
    gap: .35rem;
  }

  body.hmm-game-page .game-header,
  body.hmm-game-page .breakdown-section,
  body.hmm-game-page .performers-section,
  body.hmm-game-page .gameinfo-section,
  body.hmm-game-page .odds-section,
  body.hmm-game-page .winprob-section,
  body.hmm-game-page .teamstats-section,
  body.hmm-game-page .scoring-section,
  body.hmm-game-page .broadcasts-section,
  body.hmm-game-page .weather-section,
  body.hmm-game-page .injuries-section {
    padding-inline: 1rem;
  }
}

@media (max-width: 420px) {
  body.hmm-game-page .game-header {
    padding-inline: .75rem;
  }

  body.hmm-game-page .scoreboard {
    gap: .2rem;
  }

  body.hmm-game-page .team-side {
    gap: .3rem;
  }

  body.hmm-game-page .team-logo-lg {
    width: 36px;
    height: 36px;
  }

  body.hmm-game-page .team-name-lg {
    font-size: .85rem;
  }

  body.hmm-game-page .scores-display {
    gap: .25rem;
  }

  body.hmm-game-page .score-num {
    font-size: 2rem;
  }

  body.hmm-game-page .score-sep {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  body .search-form {
    flex-direction: column;
  }

  body .search-form .search-btn {
    width: 100%;
  }
}

@media screen and (max-width: 782px) {
  body.admin-bar .primary-nav,
  body.admin-bar .site-nav {
    top: 46px;
  }

  body.admin-bar .mobile-menu,
  body.admin-bar .mob {
    top: 106px !important;
    max-height: calc(100vh - 106px);
    max-height: calc(100dvh - 106px);
  }
}

@media (max-width: 420px) {
  body.home .roster-actions .btn {
    width: 100%;
    min-width: 0;
    padding-inline: .8rem;
    white-space: normal;
    text-align: center;
  }
}

/* Touch users do not have hover, so video affordances remain visible there. */
@media (hover: none), (pointer: coarse) {
  body .play-ov,
  body .vid-play,
  body .fi-play-ov {
    background: rgba(0, 0, 0, .12);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .bc:hover,
  body .blog-card:hover,
  body .result-card:hover,
  body .yt-card:hover,
  body .vid-card:hover,
  body .fi:hover,
  body .related-card:hover {
    transform: none;
  }
}
