/*
Theme Name: Chalk & Wonder
Author: WordPress Telex
Description: A playful, storybook-inspired kindergarten theme with hand-drawn aesthetics, warm crayon colors, and wobbly borders. Built for childcare centers that want to feel inviting, creative, and fun.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: chalk-and-wonder
Tags: block-theme, full-site-editing, education, kindergarten
*/

/* Wobbly border utility */
.wobbly-border {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

/* Equal cards layout */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}
.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: center;
}

/* Texture overlay on body */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0.025;
  pointer-events: none;
  background-image: radial-gradient(#000 1px, transparent 1px);
  background-size: 1.25rem 1.25rem;
}

/* Header overlay — sits on top of hero */
.site-header-overlay {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-top: -10px !important;
  margin-bottom: -5rem !important;
  background: transparent !important;
}
.site-header-overlay > .wp-block-group {
  transform: rotate(-0.5deg);
}

/* Mobile navigation — full-screen overlay fix */
.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  background-color: #FDFAF4 !important;
  padding: 2rem !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  clip-path: none !important;
  border-radius: 0 !important;
  transform: none !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1.5rem !important;
  flex-grow: 1;
  padding-top: 4rem;
}

.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  font-family: 'Boogaloo', cursive;
  font-size: 1.75rem;
  color: #2D3436;
  text-decoration: none;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
}

.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
  color: #FF6B6B;
}

/* Close button — force visible in mobile overlay */
.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close,
.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open > .wp-block-navigation__responsive-container-close {
  position: absolute !important;
  top: 1.5rem !important;
  right: 1.5rem !important;
  z-index: 9999999 !important;
  color: #FF6B6B !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 3rem !important;
  height: 3rem !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 0.15rem solid #FF6B6B !important;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px !important;
  cursor: pointer !important;
  padding: 0 !important;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close:hover,
.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open > .wp-block-navigation__responsive-container-close:hover {
  background-color: #FFEBEE !important;
  transform: rotate(-3deg);
}

.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close svg {
  width: 1.5rem !important;
  height: 1.5rem !important;
  fill: #FF6B6B !important;
  display: block !important;
}

/* Ensure the hamburger button is visible and styled */
.site-header-overlay .wp-block-navigation__responsive-container-open {
  color: #2D3436;
}

/* Prevent header overflow clipping on mobile — but constrain width */
.site-header-overlay {
  overflow: visible !important;
  max-width: 100vw !important;
  box-sizing: border-box !important;
}
.site-header-overlay > .wp-block-group {
  overflow: visible !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Constrain the nav block itself when menu is open */
.site-header-overlay .wp-block-navigation.is-responsive {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Reset wobbly transform on the header bar when mobile menu is open to prevent overflow */
.site-header-overlay .wp-block-navigation__responsive-container.is-menu-open ~ * ,
.site-header-overlay:has(.wp-block-navigation__responsive-container.is-menu-open) > .wp-block-group {
  transform: none !important;
}

/* Hero headline tilt */
.hero-headline-wrapper {
  border-radius: 2.5rem;
  transform: rotate(1deg);
}
.hero-headline-wrapper h1 {
  transform: rotate(-2deg);
}

/* Wobbly card styles */
.wobbly-card {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.wobbly-card:hover {
  transform: translateY(-0.25rem) rotate(-0.5deg);
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.1);
}

/* Routine timeline */
.routine-item {
  position: relative;
  padding-left: 2rem;
}
.routine-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #FF6B6B;
  box-shadow: 0 0.125rem 0 #e05e5e;
}
.routine-item::after {
  content: '';
  position: absolute;
  left: 0.4375rem;
  top: 1.75rem;
  width: 0.1875rem;
  height: calc(100% - 1rem);
  background: #FFD93D;
}
.routine-item:last-child::after {
  display: none;
}

/* Gallery grid */
.gallery-grid .wp-block-columns {
  gap: 1rem !important;
}
.gallery-grid .wp-block-image img {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: transform 0.3s ease;
}
.gallery-grid .wp-block-image img:hover {
  transform: rotate(1deg) scale(1.02);
}

/* Testimonial card */
.testimonial-card {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-size: 4rem;
  font-family: 'Boogaloo', cursive;
  color: #FF6B6B;
  opacity: 0.3;
  line-height: 1;
}

/* FAQ accordion styles */
.faq-item details {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  background: #FFFFFF;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  border: 0.125rem solid #FFD93D;
  transition: box-shadow 0.3s ease;
}
.faq-item details[open] {
  box-shadow: 0 0.25rem 0.75rem rgba(255, 217, 61, 0.2);
}
.faq-item details summary {
  font-family: 'Boogaloo', cursive;
  font-size: 1.25rem;
  color: #2D3436;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item details summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 600;
  color: #FF6B6B;
  transition: transform 0.3s ease;
}
.faq-item details[open] summary::after {
  content: '-';
  transform: rotate(180deg);
}
.faq-item details summary::-webkit-details-marker {
  display: none;
}

/* Scroll bounce animation for hero arrow */
@keyframes chalkBounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-0.625rem); }
  60% { transform: translateY(-0.3125rem); }
}
.scroll-bounce {
  animation: chalkBounce 2s infinite;
}

/* Fade-in on scroll */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in-section {
  animation: fadeInUp 0.8s ease-out both;
}

/* Button wobble hover */
.wp-block-button.wobble-btn .wp-block-button__link {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.wp-block-button.wobble-btn .wp-block-button__link:hover {
  transform: translateY(-0.125rem) rotate(-1deg);
}

/* CTA section wave top */
.cta-section {
  position: relative;
}

/* Ensure footer has no top margin */
.wp-site-blocks > footer {
  margin-block-start: 0;
}

/* Remove any gap above the hero cover */
.wp-site-blocks {
  padding-top: 0 !important;
}
.wp-site-blocks > .wp-block-template-part:first-child {
  margin-block-start: -10px !important;
}

/* Star rating */
.star-rating {
  color: #FFD93D;
  font-size: 1.25rem;
  letter-spacing: 0.125rem;
}

/* Footer social icons — wobbly art-style */
.footer-social-icons .wp-social-link {
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 2.75rem;
  height: 2.75rem;
}
.footer-social-icons .wp-social-link:hover {
  transform: translateY(-0.15rem) rotate(-2deg);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}
.footer-social-icons .wp-social-link-facebook {
  background-color: #FF6B6B;
}
.footer-social-icons .wp-social-link-instagram {
  background-color: #A8E6F0;
}
.footer-social-icons .wp-social-link-instagram svg {
  color: #2D3436;
}
.footer-social-icons .wp-social-link-youtube {
  background-color: #FFD93D;
}
.footer-social-icons .wp-social-link-youtube svg {
  color: #2D3436;
}
.footer-social-icons .wp-social-link-tiktok {
  background-color: #6BCB77;
}