/* Pickleball Coach Dave: typography and UX refinements */
@font-face {
  font-family: "Manrope PCD";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/wp-content/themes/twentytwentyfive/assets/fonts/manrope/Manrope-VariableFont_wght.woff2") format("woff2");
}

:root {
  --pcd-red: #c40d2d;
  --pcd-red-dark: #970a22;
  --pcd-ink: #20242c;
  --pcd-muted: #5c6470;
  --pcd-line: #e3e6ea;
  --pcd-soft: #f7f8fa;
  --pcd-yellow: #ffd700;
  --pcd-shadow: 0 12px 32px rgba(20, 25, 35, 0.09);
  --pcd-heading: "Platypi", Georgia, serif;
  --pcd-body: "Manrope PCD", "Segoe UI", Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--pcd-ink);
  font-family: var(--pcd-body);
  font-size: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body :where(p, li, dt, dd, blockquote, figcaption, label, input, textarea, select, button),
body .wp-block-site-tagline,
body .wp-block-latest-posts__post-date,
body .wp-block-latest-posts__post-excerpt {
  font-family: var(--pcd-body) !important;
  letter-spacing: 0;
}

body :where(p, li) {
  line-height: 1.68;
}

body :where(h1, h2, h3, h4, h5, h6),
body .wp-block-site-title {
  font-family: var(--pcd-heading);
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1.14;
  text-wrap: balance;
}

body main h1 {
  font-size: clamp(2.45rem, 4.6vw, 4rem);
}

body main h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
}

body main h3 {
  font-size: clamp(1.2rem, 1.5vw, 1.45rem);
}

body main p,
body main li {
  max-width: 72ch;
}

body a:where(:not(.wp-element-button):not(.mega-menu-link)) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

body a:where(:not(.wp-element-button):not(.mega-menu-link)):hover {
  color: var(--pcd-red-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

body :where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid var(--pcd-yellow) !important;
  outline-offset: 3px;
}

/* Header and primary navigation */
header.wp-block-template-part {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0);
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

header.wp-block-template-part > .wp-block-group {
  gap: clamp(1rem, 2.4vw, 2.5rem);
  padding-block: 0.65rem !important;
}

header.wp-block-template-part .custom-logo {
  width: 64px;
  height: 64px;
}

header.wp-block-template-part .wp-block-site-title {
  line-height: 1.05;
}

header.wp-block-template-part .wp-block-site-tagline {
  color: rgba(255, 255, 255, 0.78) !important;
  font-size: 0.78rem !important;
  line-height: 1.35;
  max-width: 34ch;
}

#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link,
#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item li.mega-menu-item > a.mega-menu-link {
  font-family: var(--pcd-body) !important;
  font-size: 0.925rem !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

#mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
  min-height: 44px;
  display: flex !important;
  align-items: center;
}

#mega-menu-wrap-primary #mega-menu-primary > #mega-menu-item-394 > a.mega-menu-link {
  background: var(--pcd-yellow) !important;
  border-radius: 999px !important;
  color: #111 !important;
  margin-inline: 0.35rem;
  padding-inline: 1rem !important;
}

#mega-menu-wrap-primary #mega-menu-primary > #mega-menu-item-395 > .mega-sub-menu {
  left: auto !important;
  right: 0 !important;
}

/* Homepage hero and media */
.home .entry-content > .wp-block-group:first-child {
  padding-top: clamp(2.5rem, 6vw, 5.5rem);
  padding-bottom: clamp(1.25rem, 2.5vw, 2.25rem);
}

.home .wp-block-post-title {
  margin-bottom: 0.45rem;
}

.home .wp-block-post-title + h2 {
  margin-top: clamp(1.25rem, 3vw, 2.25rem);
}

.home .entry-content > .wp-block-group:first-child p {
  color: var(--pcd-muted);
  font-size: clamp(1.05rem, 1rem + 0.45vw, 1.35rem) !important;
  line-height: 1.55;
  margin-inline: auto;
  text-wrap: pretty;
}

.home .wp-block-jetpack-slideshow {
  margin-block: clamp(1.5rem, 4vw, 3rem);
  max-width: 960px;
}

.home .wp-block-jetpack-slideshow_container {
  background: #eef0f3;
  border-radius: 18px;
  box-shadow: var(--pcd-shadow);
}

.home .wp-block-jetpack-slideshow_swiper-wrapper {
  aspect-ratio: 4 / 3;
  height: auto !important;
  max-height: min(70vh, 720px);
}

.home .wp-block-jetpack-slideshow_slide figure,
.home .wp-block-jetpack-slideshow_image {
  height: 100% !important;
  width: 100% !important;
}

.home .wp-block-jetpack-slideshow_image {
  object-fit: cover !important;
  object-position: center 28%;
}

.home .wp-block-jetpack-slideshow :where(.wp-block-jetpack-slideshow_button-next, .wp-block-jetpack-slideshow_button-prev, .wp-block-jetpack-slideshow_button-pause, .wp-block-jetpack-slideshow_button-play) {
  opacity: 0.82;
}

/* Service cards */
.home .pcd-home-cards {
  gap: clamp(1rem, 2.2vw, 1.75rem) !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  max-width: 1120px !important;
  margin-inline: auto !important;
}

.home .pcd-home-cards > .wp-block-group {
  border: 1px solid var(--pcd-line) !important;
  border-radius: 16px !important;
  box-shadow: var(--pcd-shadow) !important;
  min-height: 100%;
  padding: clamp(1.35rem, 2.5vw, 2rem) !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.home .pcd-home-cards > .wp-block-group:hover {
  border-color: rgba(196, 13, 45, 0.35) !important;
  box-shadow: 0 16px 38px rgba(20, 25, 35, 0.13) !important;
  transform: translateY(-3px);
}

.home .pcd-home-cards h3 {
  margin-bottom: 0.75rem !important;
}

.home .pcd-home-cards h3 a {
  color: var(--pcd-red);
  text-decoration: none;
}

.home .pcd-home-cards p {
  color: var(--pcd-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* Latest posts */
.home .wp-block-latest-posts.is-grid {
  gap: clamp(1rem, 2.2vw, 1.75rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home .wp-block-latest-posts.is-grid > li {
  background: #fff;
  border: 1px solid var(--pcd-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(20, 25, 35, 0.07);
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  padding: 0 1.25rem 1.35rem;
}

.home .wp-block-latest-posts__featured-image {
  margin: 0 -1.25rem 1rem;
}

.home .wp-block-latest-posts__featured-image a,
.home .wp-block-latest-posts__featured-image img {
  display: block;
  height: 190px;
  object-fit: cover;
  width: 100%;
}

.home .wp-block-latest-posts__post-title {
  color: var(--pcd-ink) !important;
  font-family: var(--pcd-heading);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration-color: rgba(196, 13, 45, 0.35);
}

.home .wp-block-latest-posts__post-date {
  color: var(--pcd-muted);
  margin-top: 0.65rem;
}

.home .wp-block-latest-posts__post-excerpt {
  color: var(--pcd-muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.home .wp-block-latest-posts__read-more {
  color: var(--pcd-red);
  font-weight: 700;
  white-space: nowrap;
}

/* Calls to action and controls */
body .wp-element-button,
body .wp-block-button__link {
  border-radius: 999px;
  font-family: var(--pcd-body);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: 48px;
  padding: 0.9rem 1.65rem;
  transition: box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

body .wp-element-button:hover,
body .wp-block-button__link:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.home .entry-content > .wp-block-group:last-child {
  padding-block: clamp(3rem, 7vw, 5.5rem) !important;
}

.home .entry-content > .wp-block-group:last-child > * {
  max-width: 760px;
}

/* Forms and long-form content */
body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]), textarea, select) {
  background: #fff;
  border: 1px solid #aeb4bd;
  border-radius: 10px;
  box-sizing: border-box;
  color: var(--pcd-ink);
  font-size: 1rem;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  width: 100%;
}

body textarea {
  min-height: 150px;
}

body :where(.entry-content, .wp-block-post-content) > :where(p, ul, ol) {
  text-wrap: pretty;
}

footer.wp-block-template-part .wp-block-site-tagline,
footer.wp-block-template-part p {
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (max-width: 960px) {
  header.wp-block-template-part > .wp-block-group {
    align-items: flex-start;
    flex-wrap: wrap !important;
  }

  #mega-menu-wrap-primary {
    flex-basis: 100%;
    width: 100%;
  }

  .home .pcd-home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1400px) and (min-width: 768px) {
  header.wp-block-template-part .wp-block-site-tagline {
    display: none;
  }

  header.wp-block-template-part .wp-block-site-title {
    font-size: 1.1rem !important;
    white-space: nowrap;
  }

  header.wp-block-template-part .custom-logo {
    height: 54px;
    width: 54px;
  }

  #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
    font-size: 0.86rem !important;
    padding-inline: 0.55rem !important;
  }
}

@media (max-width: 767px) {
  header.wp-block-template-part {
    position: relative;
  }

  header.wp-block-template-part > .wp-block-group {
    align-items: center;
    flex-wrap: nowrap !important;
    padding: 0.65rem 1rem !important;
  }

  header.wp-block-template-part .custom-logo {
    width: 52px;
    height: 52px;
  }

  header.wp-block-template-part .wp-block-site-title {
    font-size: 1rem !important;
  }

  header.wp-block-template-part .wp-block-site-tagline {
    display: none;
  }

  #mega-menu-wrap-primary {
    flex-basis: auto;
    width: auto;
  }

  #mega-menu-wrap-primary .mega-menu-toggle {
    min-height: 48px;
    min-width: 48px;
  }

  #mega-menu-wrap-primary #mega-menu-primary {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    padding: 0.5rem !important;
  }

  #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
    border-radius: 8px;
    font-size: 1rem !important;
    min-height: 48px;
    padding-inline: 0.9rem !important;
  }

  #mega-menu-wrap-primary #mega-menu-primary > #mega-menu-item-394 > a.mega-menu-link {
    margin: 0.35rem 0 !important;
  }

  .home .entry-content > .wp-block-group:first-child {
    padding-top: 2.25rem;
  }

  .home .wp-block-post-title {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }

  .home .wp-block-jetpack-slideshow_swiper-wrapper {
    aspect-ratio: 1 / 1;
  }

  .home .pcd-home-cards,
  .home .wp-block-latest-posts.is-grid {
    grid-template-columns: 1fr !important;
  }

  .home .pcd-home-cards > .wp-block-group {
    padding: 1.35rem !important;
  }

  .home .wp-block-latest-posts__featured-image img {
    height: 210px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
