/*
Theme Name: Wittywords
Theme URI: https://wittywords.co.in/
Author: Wittywords
Description: Calm, simple block theme for Wittywords — kids' learning, play and healthy eating. Soft pastel colours, Fredoka headings, Figtree body text. WooCommerce ready.
Version: 1.0.4
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wittywords
*/

/* ---------- Base polish ---------- */
body { -webkit-font-smoothing: antialiased; }
img { border-radius: 20px; }
.wp-block-site-logo img, .custom-logo { border-radius: 0; }
a { text-underline-offset: 3px; }

/* ---------- Header ---------- */
.ww-header { border-bottom: 1px solid var(--wp--preset--color--line); background: #fff; position: sticky; top: 0; z-index: 50; }
.admin-bar .ww-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ww-header { top: 46px; } }
.ww-header .wp-block-site-title a { text-decoration: none; }
.ww-header .wp-block-navigation-item__content { font-weight: 700; padding: 10px 16px !important; border-radius: 999px; text-decoration: none; }
.ww-header .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--grey); }
.ww-header .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.ww-header .wp-block-navigation-item__content[aria-current="page"] { background: var(--wp--preset--color--ink); color: #fff; }
.ww-header .ww-cart .wp-block-navigation-item__content { background: var(--wp--preset--color--yellow); }
.wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 20px; }

/* ---------- Footer ---------- */
.ww-footer a { text-decoration: none; }
.ww-footer a:hover { text-decoration: underline; }
.ww-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ww-ig a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--wp--preset--color--ink); color: #fff !important; font-weight: 800; }

/* ---------- Make older page-builder content match ---------- */
.wp-block-kadence-advancedheading, .kb-adv-heading-wrap h1, .kb-adv-heading-wrap h2, .kb-adv-heading-wrap h3,
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
  font-family: var(--wp--preset--font-family--fredoka) !important;
  letter-spacing: normal !important; text-transform: none !important; color: var(--wp--preset--color--ink);
}
.wp-block-kadence-advancedbtn .kb-button, .kb-button {
  border-radius: 999px !important; font-family: var(--wp--preset--font-family--figtree) !important;
  font-weight: 800 !important; text-transform: none !important; letter-spacing: normal !important;
}
.wp-block-kadence-column, .kt-inside-inner-col { border-radius: 24px; }
.wp-block-image img, .kb-image img, .wp-block-cover { border-radius: 24px; }

/* ---------- WooCommerce ---------- */
.woocommerce .button, .woocommerce button.button, .woocommerce a.button, .wc-block-components-button,
.woocommerce #payment #place_order {
  border-radius: 999px !important; background: var(--wp--preset--color--ink) !important; color: #fff !important;
  font-weight: 800 !important; padding: 14px 26px !important; border: 0 !important;
}
.woocommerce .price, .woocommerce-Price-amount { color: var(--wp--preset--color--ink); font-weight: 800; }
.woocommerce span.onsale { background: var(--wp--preset--color--green); border-radius: 999px; }
.woocommerce-checkout #payment { background: var(--wp--preset--color--grey) !important; border-radius: 20px; }

/* ---------- Inner page kit (.wwp) ---------- */
.wwp { font-family: var(--wp--preset--font-family--figtree); color: var(--wp--preset--color--ink); font-size: 17px; line-height: 1.6; }
.wwp * { box-sizing: border-box; }
.wwp p { margin: 0; }
.wwp h1, .wwp h2, .wwp h3 { font-family: var(--wp--preset--font-family--fredoka); font-weight: 700; margin: 0; line-height: 1.1; color: var(--wp--preset--color--ink); }
.wwp-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wwp-hero { background: var(--wp--preset--color--sage); padding: 56px 0 48px; }
.wwp-hero.butter { background: var(--wp--preset--color--butter); }
.wwp-hero.sky { background: var(--wp--preset--color--sky); }
.wwp-hero.peach { background: var(--wp--preset--color--peach); }
.wwp-eyebrow { font-weight: 800; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--wp--preset--color--green); margin-bottom: 10px !important; }
.wwp h1 { font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.5px; }
.wwp-lead { font-size: 20px; color: var(--wp--preset--color--muted); max-width: 660px; margin-top: 14px !important; }
.wwp-sec { padding: 56px 0; }
.wwp-sec.alt { background: var(--wp--preset--color--grey); }
.wwp-sec + .wwp-sec:not(.alt) { padding-top: 0; }
.wwp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.wwp-head h2 { font-size: clamp(28px, 3.4vw, 38px); }
.wwp-head p { color: var(--wp--preset--color--muted); margin-top: 6px !important; }
.wwp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.wwp-grid.two { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.wwp-card { background: #fff; border: 2px solid var(--wp--preset--color--line); border-radius: 24px; overflow: hidden; display: flex; flex-direction: column; }
.wwp-thumb { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--wp--preset--color--grey); }
.wwp-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; display: block; }
.wwp-thumb.contain img { object-fit: contain; padding: 14px; }
.wwp-thumb .glyph { font-family: var(--wp--preset--font-family--fredoka); font-weight: 700; font-size: 48px; }
.wwp-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.wwp-tag { font-size: 13px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.wwp-tag.free { color: var(--wp--preset--color--green); }
.wwp-body h3 { font-size: 22px; }
.wwp-body p { font-size: 16px; color: var(--wp--preset--color--muted); }
.wwp-price { font-weight: 800; color: var(--wp--preset--color--ink) !important; }
.wwp-price s { font-weight: 500; color: var(--wp--preset--color--muted); }
.wwp-actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.wwp-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--wp--preset--color--ink); color: #fff !important; text-decoration: none !important; font-weight: 800; font-size: 16px; border: 2px solid var(--wp--preset--color--ink); }
.wwp-btn:hover { background: var(--wp--preset--color--green); border-color: var(--wp--preset--color--green); }
.wwp-btn.green { background: var(--wp--preset--color--green); border-color: var(--wp--preset--color--green); }
.wwp-btn.line { background: transparent; color: var(--wp--preset--color--ink) !important; }
.wwp-btn.line:hover { background: var(--wp--preset--color--grey); }
.wwp-btn.yellow { background: var(--wp--preset--color--yellow); border-color: var(--wp--preset--color--yellow); color: var(--wp--preset--color--ink) !important; }
.wwp-soon { display: inline-flex; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--wp--preset--color--grey); font-weight: 800; font-size: 13px; }
.wwp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 28px; }
.wwp-tile { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-radius: 20px; text-decoration: none !important; font-weight: 800; color: var(--wp--preset--color--ink) !important; }
.wwp-tile b { font-family: var(--wp--preset--font-family--fredoka); font-size: 24px; }
.wwp-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center; }
.wwp-split img { width: 100%; height: auto; border-radius: 24px; border: 2px solid var(--wp--preset--color--line); }
.wwp-checks { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.wwp-checks li { display: flex; gap: 10px; align-items: flex-start; }
.wwp-checks li:before { content: ""; flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--wp--preset--color--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F6F4A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 14px no-repeat; margin-top: 3px; }
.wwp-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.wwp-meta span { padding: 6px 12px; border-radius: 999px; background: var(--wp--preset--color--grey); font-weight: 700; font-size: 14px; }
.wwp-note { border-radius: 24px; background: var(--wp--preset--color--butter); padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.wwp-note h2 { font-size: 26px; }
.wwp-note p { color: var(--wp--preset--color--muted); margin-top: 4px !important; }
.wwp-calm { border-radius: 24px; background: var(--wp--preset--color--sage); padding: 24px 28px; }
.wwp-calm p { color: var(--wp--preset--color--muted); }
.wwp-faq details { border: 2px solid var(--wp--preset--color--line); border-radius: 18px; padding: 0 20px; background: #fff; }
.wwp-faq details + details { margin-top: 10px; }
.wwp-faq summary { cursor: pointer; font-weight: 800; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.wwp-faq summary::-webkit-details-marker { display: none; }
.wwp-faq summary:after { content: "+"; font-family: var(--wp--preset--font-family--fredoka); font-size: 24px; line-height: 1; }
.wwp-faq details[open] summary:after { content: "–"; }
.wwp-faq details p { padding: 0 0 18px; color: var(--wp--preset--color--muted); }
.wwp-founder { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; padding: 32px; border-radius: 28px; border: 2px solid var(--wp--preset--color--line); }
.wwp-photo { flex: 0 0 auto; width: 150px; height: 150px; border-radius: 50%; background: var(--wp--preset--color--butter); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--wp--preset--color--muted); font-size: 14px; text-align: center; overflow: hidden; }
.wwp-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }
@media (max-width: 781px) {
  .wwp-hero { padding: 32px 0 28px; }
  .wwp-lead { font-size: 18px; }
  .wwp-sec { padding: 36px 0; }
  .wwp-wrap { padding: 0 18px; }
  .wwp-split { grid-template-columns: 1fr; gap: 24px; }
  .wwp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wwp-grid, .wwp-grid.two { grid-template-columns: 1fr; }
  .wwp-btn { width: 100%; }
  .wwp-actions .wwp-btn { width: auto; flex: 1 1 auto; }
  .wwp-founder { padding: 22px; justify-content: center; text-align: center; }
}
/* page-wide template: no side gutters from the theme, sections handle their own */
.page-template-page-wide main > .wp-block-post-content > .wwp:first-child { margin-top: 0; }

/* ---------- Phone: app-style bottom tab bar ---------- */
.ww-tabbar { display: none; }
@media (max-width: 781px) {
  .ww-tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 99;
    background: #fff; border-top: 1px solid var(--wp--preset--color--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .ww-tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 52px; text-decoration: none; font-size: 12px; font-weight: 700;
    color: var(--wp--preset--color--ink);
  }
  .ww-tabbar a[aria-current="page"] { color: var(--wp--preset--color--green); }
  .ww-tabbar a[aria-current="page"] svg { background: var(--wp--preset--color--sage); border-radius: 999px; padding: 2px 10px; box-sizing: content-box; }
  body { padding-bottom: 76px; }
  /* the tab bar replaces the hamburger menu on phones */
  .ww-header .wp-block-navigation { display: none; }
  .ww-header { padding-top: 10px !important; padding-bottom: 10px !important; }
  .ww-header .wp-block-site-title { font-size: 21px !important; }
  .ww-header .wp-block-site-logo img { width: 34px !important; }
}

/* ---------- Gentle focus for keyboard users ---------- */
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid var(--wp--preset--color--yellow); outline-offset: 2px; }


/* No gap between header, page and footer */
.wp-site-blocks > * + * { margin-block-start: 0; }


/* Shop grid: tidy cards on every screen */
.wc-block-product-template.wc-block-product-template__responsive{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:20px;margin:24px 0 48px;padding:0;}
.wc-block-product-template .wc-block-product{width:auto!important;max-width:none!important;margin:0!important;background:#fff;border:1px solid var(--wp--preset--color--line);border-radius:22px;padding:12px 12px 18px;display:flex;flex-direction:column;align-items:center;text-align:center;}
.wc-block-product-template .wc-block-components-product-image{width:100%;margin:0 0 12px!important;}
.wc-block-product-template .wc-block-components-product-image img{width:100%!important;aspect-ratio:1/1;object-fit:cover;border-radius:14px;}
.wc-block-product-template .wp-block-post-title{font-size:16px!important;line-height:1.3;margin:0 0 6px!important;}
.wc-block-product-template .wc-block-components-product-price{margin-bottom:12px!important;}
.wc-block-product-template .wp-block-button,.wc-block-product-template .wc-block-components-product-button{margin-top:auto!important;width:100%;}
.wc-block-product-template .wc-block-components-product-button .wp-block-button__link,.wc-block-product-template .add_to_cart_button{width:100%;background:var(--wp--preset--color--green)!important;color:#fff!important;border-radius:999px;font-size:14px;padding:11px 12px;}
@media (max-width:781px){.wc-block-product-template.wc-block-product-template__responsive{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.wc-block-product-template .wc-block-product{padding:8px 8px 14px;border-radius:18px;}
.wc-block-product-template .wp-block-post-title{font-size:14px!important;}
.wc-block-product-template .add_to_cart_button,.wc-block-product-template .wp-block-button__link{font-size:13px;padding:10px 8px;}}
