/* =========================================================
   C4K theme.css (drop-in)
   - theme.json contentSize is the single source of truth
   - gutters live on .wp-site-blocks (NOT body)
   - alignfull breaks out correctly
   - header/footer/content/hero all share the same edges
   ========================================================= */

/* ---------------------------------------------------------
   Global vars + smooth anchors
   --------------------------------------------------------- */
:root {
  /* single source of truth for page background */
  --c4k-page-bg: #d08f5f;

  --c4k-sticky-header-offset: 90px;

  /* One gutter var used everywhere */
  --c4k-site-gutter: clamp(16px, 3vw, 32px);

  /* Canonical container widths from theme.json */
  --c4k-container-max: var(--wp--style--global--content-size);
  --c4k-wide-max: var(--wp--style--global--wide-size);

  /* prose */
  --c4k-prose-max: 62ch;
  --c4k-prose-h2: clamp(1.9rem, 2.2vw + 1.1rem, 2.7rem);
  --c4k-prose-body: clamp(1.08rem, 0.45vw + 1rem, 1.32rem);

  /* frame */
  --c4k-frame-border: rgba(0, 0, 0, 0.16);
  --c4k-frame-bg: rgba(255, 255, 255, 0.22);
  --c4k-frame-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

html {
  scroll-behavior: smooth;
}

/* Prevent tiny horizontal scrollbars from rounding when we do full-bleed math */
html,
body {
  overflow-x: clip;
}

/* ---------------------------------------------------------
   Page base
   IMPORTANT: remove side padding from body so full-bleed works
   --------------------------------------------------------- */
body {
  background-color: var(--c4k-page-bg);

  /* Safety net in case global styles add padding */
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.wp-site-blocks {
  background-color: var(--c4k-page-bg);

  /* Global gutters live here (not on body) */
  padding-left: var(--c4k-site-gutter);
  padding-right: var(--c4k-site-gutter);
  box-sizing: border-box;
}

/* =========================================================
   Full-bleed inside padded .wp-site-blocks
   (alignfull blocks touch the viewport edges)
   ========================================================= */
.wp-site-blocks .alignfull {
  margin-left: calc(-1 * var(--c4k-site-gutter));
  margin-right: calc(-1 * var(--c4k-site-gutter));
  width: calc(100% + (2 * var(--c4k-site-gutter)));
  box-sizing: border-box;
}

/* =========================================================
   Constrain NORMAL content to theme.json contentSize
   (this aligns hero + playlists with header/footer)
   ========================================================= */
:where(.wp-site-blocks > main),
:where(.wp-block-post-content),
:where(main .is-layout-constrained) {
  max-width: var(--c4k-container-max);
  margin-inline: auto;
  padding-inline: 0; /* gutter already on .wp-site-blocks */
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   Smooth anchors offset for sticky header
   --------------------------------------------------------- */
.c4k-home [id] {
  scroll-margin-top: var(--c4k-sticky-header-offset);
}

/* ---------------------------------------------------------
   Small theme-level tweaks
   --------------------------------------------------------- */
.wp-site-title a {
  text-decoration: none;
}
.wp-site-title a:hover {
  text-decoration: underline;
}

/* =========================================================
   Header + Footer: background can be full-bleed (alignfull)
   BUT inner content aligns to content edges
   ========================================================= */

/* Header wrapper uses site gutter so it visually matches content */
.c4k-header {
  padding-inline: var(--c4k-site-gutter);
  box-sizing: border-box;
}

/* Header inner row: constrain to content width */
.c4k-header > .wp-block-group {
  max-width: var(--c4k-container-max);
  margin-inline: auto;
  padding-inline: 0 !important;
  box-sizing: border-box;
}

/* Footer wrapper: full-bleed background (NO horizontal padding) */
.c4k-footer {
  padding-inline: 0 !important;
  box-sizing: border-box;
}

/* Footer inner: matches header/content edges */
.c4k-footer > .c4k-footer__inner {
  width: 100%;
  max-width: var(--c4k-container-max);
  margin-inline: auto;
  padding-inline: var(--c4k-site-gutter) !important;
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   Sticky header + subtle separation
   --------------------------------------------------------- */
.c4k-header {
  padding-block: 0.5rem;
}

/* Outer template-part header wrapper */
header.wp-block-template-part.c4k-header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 1000;
  background: var(--c4k-page-bg);
  display: block;
}

/* Keep general header inners transparent */
.c4k-header .wp-block-group,
.c4k-header .wp-block-group__inner-container,
.c4k-header .wp-block-navigation {
  background: transparent !important;
}

/* Mobile menu panel must NOT be transparent */
.c4k-header .wp-block-navigation__responsive-container,
.c4k-header .wp-block-navigation__responsive-container-content {
  background: var(--c4k-page-bg) !important;
}

/* Ensure open menu sits above sticky separator */
.c4k-header .wp-block-navigation__responsive-container.is-menu-open {
  z-index: 2000;
}

/* =========================================
   Mobile nav overlay centering (state-based)
   Works regardless of WP breakpoint
   ========================================= */

.c4k-header
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation__container {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: 100%;
  text-align: center !important;
}

.c4k-header
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item {
  width: 100%;
  text-align: center !important;
  margin: 0 !important;
}

.c4k-header
  .wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content {
  display: inline-block;
  margin: 0 auto !important;
  text-align: center !important;
}

.c4k-header .wp-block-site-logo {
  line-height: 0;
}

.c4k-header .wp-block-site-logo a {
  display: inline-flex;
  align-items: center;
}

.c4k-header .wp-block-site-logo img {
  height: 84px !important;
  width: auto !important;
  max-width: none !important;
}

@media (max-width: 767px) {
  .c4k-header .wp-block-site-logo img {
    height: 44px !important;
  }
}

/* Header separator (full viewport width) */
header.wp-block-template-part.c4k-header::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100vw;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

/* ---------------------------------------------------------
   Header Navigation – Hover underline bar
   --------------------------------------------------------- */
.c4k-header .wp-block-navigation-item__content {
  position: relative;
  text-decoration: none;
}

.c4k-header .wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 3px;
  background-color: #7dd0f8;

  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.c4k-header .wp-block-navigation-item__content:hover::after {
  transform: scaleX(1);
}

.c4k-header
  .wp-block-navigation-item.current-menu-item
  > .wp-block-navigation-item__content::after,
.c4k-header
  .wp-block-navigation-item.current_page_item
  > .wp-block-navigation-item__content::after {
  transform: scaleX(1);
}

/* ---------------------------------------------------------
   Landing page container
   IMPORTANT: hero image should be constrained to content width
   --------------------------------------------------------- */
.c4k-home {
  max-width: none;
  margin-inline: 0;
  padding-inline: 0;
  padding-top: 0;
  margin-top: 0;
}

/* You can keep .c4k-inner as a semantic wrapper, but it should not add extra gutter */
.c4k-home .c4k-inner {
  max-width: var(--c4k-container-max);
  margin-inline: auto;
  padding-inline: 0; /* gutter already on .wp-site-blocks */
  box-sizing: border-box;
}

/* Sections */
.c4k-home .c4k-section {
  margin: 0;
  padding-block: 1.5rem;
  padding-inline: 0;
  text-align: center;
}

/* .c4k-home .c4k-section + .c4k-section {
  margin-block-start: 2rem;
} */

.c4k-home .c4k-section .wp-block-buttons {
  justify-content: center;
}

.c4k-home .c4k-section :is(p, h1, h2, h3) {
  max-width: 65ch;
  margin-inline: auto;
}

/* Hero (CONSTRAINED) */
.c4k-home .c4k-hero {
  padding-top: 0;
  padding-bottom: 0;
  text-align: center;
}

/* Make sure featured image obeys the constrained container */
.c4k-home .c4k-hero .wp-block-post-featured-image,
.c4k-home .c4k-hero .wp-block-post-featured-image img {
  width: 100%;
  max-width: 100%;
  display: block;
}

/* =========================================================
   C4K Prose (opt-in): nicer typography for section intros
   ========================================================= */
.c4k-home .c4k-prose .c4k-inner > .wp-block-heading {
  font-size: var(--c4k-prose-h2);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 auto 1rem;
  max-width: var(--c4k-prose-max);
}

.c4k-home .c4k-prose .c4k-inner > p {
  font-size: var(--c4k-prose-body);
  line-height: 1.65;
  max-width: var(--c4k-prose-max);
  margin: 0.85rem auto 0;
  font-style: normal;
  opacity: 0.92;
}

.c4k-home .c4k-prose .c4k-inner > .wp-block-heading + p {
  margin-top: 0;
  font-style: normal;
  font-weight: 500;
  opacity: 1;
}

.c4k-home .c4k-prose .wp-block-buttons {
  margin-top: 1.5rem;
}

.c4k-home .c4k-prose .wp-block-button__link {
  font-style: normal;
  font-size: 1rem;
}

/* Start Listening: only style intro */
.c4k-home #start-listening.c4k-prose .c4k-inner > p {
  font-style: normal;
  font-size: inherit;
  line-height: inherit;
  opacity: inherit;
  max-width: 65ch;
  margin: 0.85rem auto 0;
}

.c4k-home #start-listening.c4k-prose .c4k-inner > .wp-block-heading + p {
  font-size: var(--c4k-prose-body);
  line-height: 1.65;
  max-width: var(--c4k-prose-max);
  margin-top: 0;
  font-style: normal;
  font-weight: 500;
  opacity: 1;
}

/* Frame container */
.c4k-frame {
  text-align: center;
  padding: clamp(1.2rem, 2.4vw, 2rem);
  margin-inline: auto;

  background: var(--c4k-frame-bg);
  box-shadow: var(--c4k-frame-shadow);

  border: 1px solid var(--c4k-frame-border);
  border-radius: 10px;

  max-width: min(var(--c4k-container-max), 70ch);
  position: relative;
}

#why-c4k .c4k-frame {
  background-color: #cbe8f7;
}

#join-us .c4k-frame {
  background-color: #7dd0f8;
}

.c4k-frame--accent {
  border-color: rgba(0, 0, 0, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
}

.c4k-home #why-c4k.c4k-section,
.c4k-home #join-us.c4k-section {
  padding-block: 2.75rem;
}

.c4k-frame > .wp-block-heading {
  margin-top: 0;
}

.c4k-frame > p:last-child {
  margin-bottom: 0;
}

/* Buttons */
.wp-block-button__link {
  border-radius: 999px;
}

/* =========================================================
   Playlists
   ========================================================= */
.c4k-home .c4k-playlists {
  text-align: center;
}

.c4k-home .c4k-playlists .c4k-playlist-grid,
.c4k-home .c4k-playlists .c4k-playlist-card {
  text-align: left;
}

/* Icon-like buttons */
.c4k-playlist-buttons .wp-block-button {
  margin: 0;
}

.c4k-playlist-buttons .wp-block-button__link {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  font-size: 0;
  text-decoration: none !important;
}

.c4k-playlist-buttons .wp-block-button__link img {
  width: 50px;
  height: 50px;
  display: block;
  object-fit: contain;
}

.c4k-playlist-buttons .wp-block-button__link:hover {
  opacity: 0.75;
}

.c4k-playlist-buttons .wp-block-button__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Spotify clipping box */
.c4k-playlist-buttons .c4k-spotify .wp-block-button__link {
  width: 50px;
  height: 50px;
  overflow: hidden;
  padding: 0;
}

.c4k-playlist-buttons .c4k-spotify img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  transform: scale(1.9);
  transform-origin: center;
}

.c4k-playlist-buttons .c4k-youtube img {
  transform: scale(1.75);
  transform-origin: center;
}

/* Tighten playlist title + description spacing */
.c4k-playlist-card h3,
.c4k-playlist-card .wp-block-heading {
  margin: 0 0 0.25rem 0;
  line-height: 1.15;
}

.c4k-playlist-card p {
  margin: 0;
  line-height: 1.35;
}

.c4k-playlist-card > p {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: left;
  max-width: 22ch;
  margin-inline: auto;
  color: inherit;
  opacity: 0.85;
}

.c4k-playlist-card > p:last-child {
  margin-bottom: 0;
}

.c4k-playlist-card {
  display: flex;
  flex-direction: column;
}

.c4k-playlist-card > p {
  margin-top: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.c4k-playlist-card img {
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* =========================================================
   Footer
   ========================================================= */
.c4k-footer {
  background-color: #4a3426;
  color: #f5f1eb;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-block: 2.5rem;
}

.c4k-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.c4k-footer a:hover {
  opacity: 0.9;
}

.c4k-footer .c4k-footer__inner {
  display: grid !important;
  row-gap: 1.25rem;
}

.c4k-footer .c4k-footer__inner > * {
  margin: 0;
  align-self: center;
}

.c4k-footer .c4k-footer__inner p {
  margin: 0;
  line-height: 1.2;
}

.c4k-footer .wp-block-social-links {
  margin: 0;
  padding: 0;
  line-height: 1;
  gap: 0.6rem;
}

.c4k-footer .wp-block-social-link a {
  color: currentColor;
}

.c4k-footer .wp-block-social-link svg,
.c4k-footer .wp-block-social-link img {
  width: 22px;
  height: 22px;
  display: block;
}

/* Footer social icons: override WP inline icon color */
.c4k-footer .wp-block-social-links.has-icon-color .wp-block-social-link,
.c4k-footer .wp-block-social-links.has-icon-color .wp-block-social-link a {
  color: #f5f1eb !important;
}

/* Ensure SVG uses that color */
.c4k-footer .wp-block-social-link svg,
.c4k-footer .wp-block-social-link svg * {
  fill: currentColor !important;
  stroke: currentColor !important;
}

/* ---------------------------------------------------------
   Footer – center content on mobile
   --------------------------------------------------------- */
@media (max-width: 767px) {
  .c4k-footer .c4k-footer__inner {
    text-align: center;
  }

  .c4k-footer .c4k-footer__social {
    justify-content: center !important;
  }

  .c4k-footer .wp-block-social-links {
    justify-content: center !important;
  }

  .c4k-footer .c4k-footer__contact,
  .c4k-footer .c4k-footer__copyright {
    text-align: center;
  }
}

@media (min-width: 768px) {
  .c4k-footer {
    padding-block: 1.25rem;
  }

  .c4k-footer .c4k-footer__inner {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    row-gap: 0;
  }

  .c4k-footer .c4k-footer__social {
    justify-self: start;
  }

  .c4k-footer .c4k-footer__contact {
    justify-self: center;
    text-align: center;
  }

  .c4k-footer .c4k-footer__copyright {
    justify-self: end;
    text-align: right;
  }
}

/* =========================================================
   Footer centering fix: full-bleed wrapper, gutter on inner
   ========================================================= */

/* Let the alignfull footer be truly full-bleed */
/* alignfull footer: ensure wrapper has no horizontal padding */
.wp-block-group.alignfull.c4k-footer {
  padding-inline: 0 !important;
}

/* alignfull footer: inner gets the gutter */
.wp-block-group.alignfull.c4k-footer > .c4k-footer__inner {
  padding-inline: var(--c4k-site-gutter) !important;
}

/* Mobile: center everything */
@media (max-width: 767px) {
  .wp-block-group.alignfull.c4k-footer > .c4k-footer__inner {
    justify-items: center; /* centers each grid item */
    text-align: center;
  }

  .wp-block-group.alignfull.c4k-footer .wp-block-social-links {
    justify-content: center !important;
  }
}

/* Desktop: your 3-column layout */
@media (min-width: 768px) {
  .wp-block-group.alignfull.c4k-footer > .c4k-footer__inner {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    row-gap: 0;
    justify-items: stretch;
  }

  .wp-block-group.alignfull.c4k-footer .c4k-footer__social {
    justify-self: start;
  }
  .wp-block-group.alignfull.c4k-footer .c4k-footer__contact {
    justify-self: center;
    text-align: center;
  }
  .wp-block-group.alignfull.c4k-footer .c4k-footer__copyright {
    justify-self: end;
    text-align: right;
  }
}

/* =========================================================
   Footer: override WP generated flex layout on the inner row
   Footer layout override (no hashed classes)
   ========================================================= */

/* Force the footer inner to NOT be WP flex */
footer .c4k-footer__inner.is-layout-flex,
footer .c4k-footer__inner.wp-block-group {
  display: grid !important; /* kill flex */
  justify-content: initial !important;
  align-items: initial !important;
}

/* Mobile: center items */
@media (max-width: 767px) {
  footer .c4k-footer__inner {
    justify-items: center; /* center each grid item */
    row-gap: 1.25rem;
    text-align: center;
  }

  /* Center the social links list itself */
  footer .c4k-footer .wp-block-social-links {
    justify-content: center !important;
  }

  /* If WP sets a fixed width somewhere, ensure it can shrink */
  footer .c4k-footer__inner > * {
    width: auto;
    max-width: 100%;
  }
}
/* =========================================================
   Mailchimp
   ========================================================= */
#mc_embed_signup {
  background: transparent;
  font-family: inherit;
  width: 100%;
}

.c4k-newsletter {
  max-width: 600px;
  margin-inline: auto;
}

#mc_embed_signup .mc-field-group {
  clear: left;
  width: 100%;
  padding-bottom: 12px;
}

#mc_embed_signup .mc-field-group label {
  display: block;
  margin-bottom: 4px;
}

#mc_embed_signup input[type="text"],
#mc_embed_signup input[type="email"] {
  width: 100%;
  box-sizing: border-box;
}

/* =========================================================
   Mailchimp: success + error messages
   ========================================================= */

/* Success message (not green) */
.c4k-newsletter #mc_embed_signup #mce-success-response {
  color: inherit; /* or pick a specific color */
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-weight: 600;
  display: block; /* keep it visible when Mailchimp sets inline display:block */
}

/* If Mailchimp’s stylesheet is still winning, use this stronger version: */
.c4k-newsletter #mc_embed_signup #mce-success-response {
  color: #1d1d1d !important; /* choose your success color */
}

/* Error message styling to match */
.c4k-newsletter #mc_embed_signup #mce-error-response {
  color: #1d1d1d;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
  font-weight: 600;
}

/* Optional: keep spacing consistent even when hidden */
.c4k-newsletter #mc_embed_signup #mce-responses {
  margin-top: 0.5rem;
}

.c4k-merriweather {
  font-family: var(--wp--preset--font-family--merriweather), serif;
}

/* =========================================================
   Playlists: responsive stacking
   ========================================================= */
.c4k-home .c4k-playlist-buttons {
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 767px) {
  .c4k-home .c4k-playlist-buttons {
    margin-top: 1rem;
    margin-bottom: 1.25rem;
  }
}

.c4k-home .c4k-playlist-grid {
  display: grid;
  gap: 1.25rem;
}

@media (max-width: 767px) {
  .c4k-home .c4k-playlist-grid {
    grid-template-columns: 1fr !important;
  }

  .c4k-home .c4k-playlist-card > p {
    max-width: none;
    margin-inline: 0;
  }

  .c4k-home .c4k-playlist-grid {
    justify-items: stretch;
  }

  .c4k-home .c4k-playlist-card {
    width: 100%;
  }

  .c4k-home .c4k-playlist-card .wp-block-image,
  .c4k-home .c4k-playlist-card .wp-block-image img {
    display: block;
    width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .c4k-home .c4k-playlist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .c4k-home .c4k-playlist-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
