/*
Theme Name: Children's Joy Child
Theme URI: https://childrensjoy.io
Author: Martins Girss
Author URI: https://childrensjoy.io
Description: Custom child theme for Children's Joy non-profit organization. Built on Astra, with minimalist design, soft floral accents, and rounded corners — for free coloring books, workbooks, and digital downloads. Funded by Google Ad Grants and donations.
Template: astra
Version: 0.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: childrensjoy-child
Tags: non-profit, charity, education, children, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments
*/

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
  /* Brand colors */
  --cj-cream: #FBF6F0;
  --cj-white: #FFFFFF;
  --cj-peach: #F4D7CC;
  --cj-peach-deep: #EFC8B5;
  --cj-sage: #A8C09A;
  --cj-sage-deep: #87A77A;
  --cj-mustard: #D4A574;
  --cj-mustard-deep: #B88A5B;
  --cj-text: #2D2A26;
  --cj-text-muted: #6B6560;
  --cj-border: #EFE7DC;

  /* Radius scale */
  --cj-radius-sm: 12px;
  --cj-radius-md: 18px;
  --cj-radius-lg: 28px;

  /* Shadows */
  --cj-shadow-soft: 0 4px 24px rgba(45, 42, 38, 0.06);
  --cj-shadow-card: 0 8px 32px rgba(45, 42, 38, 0.08);
}

/* =====================================================
   GLOBAL BASE
   ===================================================== */
html,
body,
.site,
.ast-container,
#page,
.site-content {
  background: var(--cj-cream) !important;
}
body {
  color: var(--cj-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.site-title,
.entry-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  line-height: 1.2;
  color: var(--cj-text);
}

/* =====================================================
   ROUNDED CORNERS — applied broadly per design spec
   ===================================================== */
.wp-block-button__link,
.ast-button,
button,
input[type="submit"],
.search-submit {
  border-radius: var(--cj-radius-sm) !important;
}

.wp-block-image img,
.wp-block-cover,
.wp-block-group.has-background,
.ast-separate-container .ast-article-post,
.ast-article-single,
article.post,
article.page {
  border-radius: var(--cj-radius-md);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  border-radius: var(--cj-radius-sm) !important;
}

/* =====================================================
   BUTTONS — warm CTA style
   ===================================================== */
.wp-block-button.is-style-cj-primary .wp-block-button__link,
.btn-cj-primary {
  background: var(--cj-text);
  color: var(--cj-white);
  padding: 14px 26px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.wp-block-button.is-style-cj-primary .wp-block-button__link:hover,
.btn-cj-primary:hover {
  background: var(--cj-mustard-deep);
  transform: translateY(-1px);
}

.wp-block-button.is-style-cj-donate .wp-block-button__link,
.btn-cj-donate {
  background: var(--cj-mustard);
  color: var(--cj-white);
  padding: 14px 26px;
  font-weight: 700;
  transition: all 0.2s ease;
}
.wp-block-button.is-style-cj-donate .wp-block-button__link:hover,
.btn-cj-donate:hover {
  background: var(--cj-mustard-deep);
  transform: translateY(-1px);
}

/* =====================================================
   CARDS / CONTENT BLOCKS
   ===================================================== */
.cj-card {
  background: var(--cj-white);
  border: 1px solid var(--cj-border);
  border-radius: var(--cj-radius-md);
  padding: 28px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.cj-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cj-shadow-soft);
}

/* =====================================================
   FLORAL ACCENT — small decorative SVG positions
   ===================================================== */
.cj-floral {
  position: absolute;
  pointer-events: none;
  opacity: 0.6;
  z-index: 0;
}

/* =====================================================
   ASTRA OVERRIDES
   ===================================================== */
.ast-primary-header-bar,
.site-header {
  background: rgba(251, 246, 240, 0.92) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cj-border);
}

/* Compact logo + site title so all 9 menu items fit in one row */
.site-header .site-branding .site-logo-img img,
.site-header .site-branding .custom-logo-link img,
.site-header .site-branding .ast-site-identity img,
.site-header img.custom-logo,
body .site-header .custom-logo {
  max-width: 60px !important;
  max-height: 60px !important;
  width: 60px !important;
  height: auto !important;
}
body .site-header .site-title,
body .site-header .site-title a {
  font-size: 1.25rem !important;
  font-family: 'Fraunces', Georgia, serif !important;
  letter-spacing: 0 !important;
  white-space: nowrap;
  line-height: 1.2 !important;
}
.site-description { display: none !important; }

/* Menu — tighter spacing so all items fit one row */
body .main-header-menu > .menu-item > .menu-link,
body .main-header-menu li a,
body .main-header-bar .main-header-menu li > a {
  padding-left: 10px !important;
  padding-right: 10px !important;
  font-size: 0.92rem !important;
  white-space: nowrap;
}

/* Wider container to give menu breathing room */
@media (min-width: 922px) {
  body .ast-container,
  body .site-header .ast-container {
    max-width: 1320px !important;
  }
}

.site-footer {
  background: var(--cj-cream);
  border-top: 1px solid var(--cj-border);
}

/* Eyebrow text utility (small uppercase labels above headings) */
.cj-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--cj-peach);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cj-mustard-deep);
}
.cj-eyebrow.is-style-sage {
  background: var(--cj-white);
  color: var(--cj-sage-deep);
  border: 1px solid var(--cj-border);
}

/* =====================================================
   GIVEWP FORM — brand styling overrides
   ===================================================== */

/* Reset GiveWP's default background colors */
body.give-form-template-legacy,
.give-form-templates,
.give-form-template-wrap {
  background: transparent !important;
}

/* Amount input + buttons */
.cj-donate-form-wrapper .give-donation-amount {
  border-radius: var(--cj-radius-sm) !important;
  border-color: var(--cj-border) !important;
}
.cj-donate-form-wrapper .give-donation-amount #give-amount {
  border-radius: var(--cj-radius-sm) !important;
}
.cj-donate-form-wrapper .give-donation-amount .give-currency-symbol {
  background: var(--cj-cream) !important;
  border-radius: var(--cj-radius-sm) 0 0 var(--cj-radius-sm) !important;
}

/* Donation level buttons */
.cj-donate-form-wrapper .give-donation-levels-wrap .give-btn {
  background: var(--cj-cream) !important;
  border: 1px solid var(--cj-border) !important;
  color: var(--cj-text) !important;
  border-radius: var(--cj-radius-sm) !important;
  padding: 12px 20px !important;
  font-weight: 600 !important;
  transition: all 0.2s ease !important;
  margin: 4px !important;
}
.cj-donate-form-wrapper .give-donation-levels-wrap .give-btn:hover,
.cj-donate-form-wrapper .give-donation-levels-wrap .give-btn.give-default-level,
.cj-donate-form-wrapper .give-donation-levels-wrap .give-btn-level-custom:hover {
  background: var(--cj-peach) !important;
  border-color: var(--cj-peach-deep) !important;
  color: var(--cj-mustard-deep) !important;
}

/* Main Donate Now button */
.cj-donate-form-wrapper #give-purchase-button,
.cj-donate-form-wrapper .give-submit,
.cj-donate-form-wrapper [id^="give-purchase-button"] {
  background: var(--cj-mustard) !important;
  color: var(--cj-white) !important;
  border: none !important;
  border-radius: var(--cj-radius-sm) !important;
  padding: 14px 32px !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  transition: all 0.2s ease !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
.cj-donate-form-wrapper #give-purchase-button:hover,
.cj-donate-form-wrapper .give-submit:hover {
  background: var(--cj-mustard-deep) !important;
  transform: translateY(-1px);
}

/* Form input fields */
.cj-donate-form-wrapper input[type="text"],
.cj-donate-form-wrapper input[type="email"],
.cj-donate-form-wrapper input[type="tel"],
.cj-donate-form-wrapper input[type="number"],
.cj-donate-form-wrapper select,
.cj-donate-form-wrapper textarea {
  border-radius: var(--cj-radius-sm) !important;
  border: 1px solid var(--cj-border) !important;
  padding: 10px 14px !important;
}
.cj-donate-form-wrapper input:focus,
.cj-donate-form-wrapper select:focus,
.cj-donate-form-wrapper textarea:focus {
  border-color: var(--cj-mustard) !important;
  outline: none !important;
}

/* Section labels */
.cj-donate-form-wrapper fieldset legend,
.cj-donate-form-wrapper h3.give-payment-mode-label,
.cj-donate-form-wrapper #give-personal-info-wrap legend {
  font-family: 'Fraunces', Georgia, serif !important;
  font-weight: 500 !important;
  color: var(--cj-text) !important;
}

/* Donation total */
.cj-donate-form-wrapper #give-final-total-wrap,
.cj-donate-form-wrapper .give-final-total-amount {
  background: var(--cj-cream) !important;
  border: 1px solid var(--cj-border) !important;
  border-radius: var(--cj-radius-sm) !important;
  padding: 8px 14px !important;
}

/* Payment method radio buttons spacing */
.cj-donate-form-wrapper #give-payment-mode-select ul {
  display: flex !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
}

/* Test mode notice — softer style */
.cj-donate-form-wrapper .give_notices,
.cj-donate-form-wrapper .give_error,
.cj-donate-form-wrapper .give_success {
  border-radius: var(--cj-radius-sm) !important;
}

/* Hide title from Donate page (the page title appears via Astra) */
body.page-id-2773 .ast-archive-title,
body.page-id-2773 .entry-title:first-of-type {
  display: none !important;
}

/* =====================================================
   COLORING BOOK CARD POLISH
   ===================================================== */
.cj-books .wp-block-button__link {
  font-size: 0.82rem !important;
  padding: 10px 18px !important;
  white-space: nowrap !important;
}
.cj-books .wp-block-column .wp-block-group .wp-block-heading {
  font-size: 1.05rem !important;
}

/* Books section — narrower max-width on desktop (cards ~25% smaller) */
@media (min-width: 922px) {
  .cj-books > .wp-block-columns {
    max-width: 690px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    column-gap: 20px !important;
  }
  .cj-books > .wp-block-columns > .wp-block-column .wp-block-group {
    border-radius: 14px !important;
  }
}

/* Image fills card to edges — already overflow:hidden on outer group, but ensure no margin */
.cj-books .wp-block-image,
.cj-books .wp-block-image figure {
  margin: 0 !important;
}
.cj-books .wp-block-image img {
  display: block !important;
  width: 100% !important;
}

/* =====================================================
   NARROWER HEADER CONTAINER
   ===================================================== */
@media (min-width: 922px) {
  body .site-header .ast-container,
  body .ast-primary-header-bar .ast-container,
  body .main-header-bar {
    max-width: 1100px !important;
  }
}

/* =====================================================
   MOBILE-ONLY HOME LAYOUT TWEAKS
   ===================================================== */
@media (max-width: 768px) {
  /* Hero — compact on mobile */
  .cj-hero {
    padding-top: 90px !important;
    padding-bottom: 16px !important;
  }
  .cj-hero h1 {
    font-size: 1.7rem !important;
    line-height: 1.2 !important;
  }

  /* Coloring Books — 2 columns on mobile (grid 2×2, 3rd book half-width) */
  .cj-books {
    padding-top: 16px !important;
    padding-bottom: 40px !important;
  }
  .cj-books .wp-block-columns {
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-top: 0 !important;
  }
  .cj-books .wp-block-columns > .wp-block-column {
    flex-basis: calc(50% - 6px) !important;
    flex-grow: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  /* Book card padding tighter on mobile */
  .cj-books .wp-block-column .wp-block-group {
    padding: 12px !important;
  }
  .cj-books .wp-block-column h3 {
    font-size: 0.95rem !important;
  }
  .cj-books .wp-block-column p {
    font-size: 0.82rem !important;
  }
  .cj-books .wp-block-column .wp-block-button__link {
    font-size: 0.82rem !important;
    padding: 8px 14px !important;
  }
}

/* =====================================================
   CONTACT FORM
   ===================================================== */

.cj-contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cj-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .cj-form-row { grid-template-columns: 1fr; }
}
.cj-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cj-form-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cj-text);
  letter-spacing: 0.02em;
}
.cj-form-field label span {
  color: var(--cj-mustard-deep);
}
.cj-form-field input[type="text"],
.cj-form-field input[type="email"],
.cj-form-field textarea {
  background: var(--cj-cream);
  border: 1px solid var(--cj-border);
  border-radius: var(--cj-radius-sm) !important;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--cj-text);
  transition: border-color 0.2s, background 0.2s;
}
.cj-form-field input:focus,
.cj-form-field textarea:focus {
  outline: none;
  border-color: var(--cj-mustard);
  background: var(--cj-white);
}
.cj-form-field textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}
.cj-form-submit {
  align-self: flex-start;
  background: var(--cj-mustard);
  color: var(--cj-white);
  border: none;
  border-radius: var(--cj-radius-sm);
  padding: 14px 32px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}
.cj-form-submit:hover {
  background: var(--cj-mustard-deep);
  transform: translateY(-1px);
}
.cj-form-honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.cj-form-notice {
  padding: 14px 18px;
  border-radius: var(--cj-radius-sm);
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.cj-form-notice--success {
  background: rgba(168, 192, 154, 0.15);
  border: 1px solid var(--cj-sage);
  color: var(--cj-sage-deep);
}
.cj-form-notice--error {
  background: rgba(184, 60, 60, 0.08);
  border: 1px solid rgba(184, 60, 60, 0.25);
  color: #B83C3C;
}
.cj-form-notice a {
  color: inherit;
  text-decoration: underline;
}
