/*
Theme Name: Crafters Club JO
Theme URI: https://craftersclub.jo
Author: Crafters Club JO
Description: The Crafters Club JO website theme. Cream, clay and cobalt, running-stitch details, bilingual-ready (English + Arabic, right-to-left). Works with WooCommerce for the shop, workshops and cash-on-delivery checkout.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.9
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: crafters-club
Tags: block-patterns, full-site-editing, e-commerce, rtl-language-support
*/

/* ---------- base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
:where(h1, h2, h3) { text-wrap: balance; }
:focus-visible { outline: 3px solid var(--wp--preset--color--cobalt); outline-offset: 3px; }
.has-caveat-font-family { font-weight: 700; line-height: 1.1; }
[dir="rtl"] .has-caveat-font-family, .rtl .has-caveat-font-family { font-family: var(--wp--preset--font-family--baloo); font-weight: 700; }

/* ---------- header ---------- */
.ccjo-header { position: sticky; top: 0; z-index: 50; border-bottom: 3px dashed rgba(74, 79, 217, .35); }
.admin-bar .ccjo-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ccjo-header { top: 46px; } }
.ccjo-header .wp-block-site-logo img { height: auto; }
.ccjo-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--cream); }
.ccjo-header .wp-block-navigation-item__content { padding: .35em .8em; border-radius: 999px; text-decoration: none; }
.ccjo-header .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--linen); }
.ccjo-header .wc-block-mini-cart__button { border: 2px solid var(--wp--preset--color--ink); border-radius: 999px; padding: .35em .8em; }
.ccjo-header .wc-block-mini-cart__badge { background: var(--wp--preset--color--clay); color: var(--wp--preset--color--cream); }

/* ---------- block styles ---------- */
.is-style-ccjo-card { border: 2px solid var(--wp--preset--color--ink); border-radius: 22px; overflow: hidden; }
.is-style-ccjo-stitched { border: 2px dashed currentColor; border-radius: 22px; }
.wp-block-separator.is-style-ccjo-stitch { border: 0; border-top: 3px dashed currentColor; opacity: .55; background: none; height: 0; }
.wp-block-image.is-style-ccjo-arch img { border-radius: 999px 999px 28px 28px; border: 4px solid var(--wp--preset--color--ink); aspect-ratio: 4 / 5; object-fit: cover; }
.wp-block-image.is-style-ccjo-framed img { border-radius: 22px; border: 2px solid var(--wp--preset--color--ink); }
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--wp--preset--color--ink); box-shadow: inset 0 0 0 2px currentColor; border: 0; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--linen); }

/* pattern fabrics */
.is-style-ccjo-confetti { background-image: url(assets/images/pat-confetti.svg); background-size: 260px 260px; }
.is-style-ccjo-cobalt-party { background-image: url(assets/images/pat-cobalt-party.svg); background-size: 260px 260px; }
.is-style-ccjo-clay-picnic { background-image: url(assets/images/pat-clay-picnic.svg); background-size: 260px 260px; }
.is-style-ccjo-lavender-loops { background-image: url(assets/images/pat-lavender-loops.svg); background-size: 260px 260px; }
.is-style-ccjo-big-loops { background-image: url(assets/images/pat-big-loops.svg); background-size: 360px 360px; }
.is-style-ccjo-stitch-lines { background-image: url(assets/images/pat-stitch-lines.svg); background-size: 260px 260px; }
.ccjo-swatch { min-height: 64px; border-top: 3px solid var(--wp--preset--color--ink); border-bottom: 3px solid var(--wp--preset--color--ink); }

/* ---------- hero ---------- */
.ccjo-hero-art { position: relative; max-width: 460px; margin-inline: auto; }
.ccjo-hero-art .wp-block-image { margin: 0; }
.ccjo-badge { position: absolute; width: 150px; height: 150px; inset-inline-start: -30px; bottom: 40px; animation: ccjo-spin 22s linear infinite; pointer-events: none; }
@keyframes ccjo-spin { to { transform: rotate(360deg); } }
.ccjo-float { position: absolute; width: 74px; height: 74px; top: -18px; inset-inline-end: -6px; transform: rotate(12deg); pointer-events: none; }
@media (max-width: 781px) { .ccjo-badge { width: 112px; height: 112px; inset-inline-start: -4px; } .ccjo-float { inset-inline-end: 0; } }
.ccjo-hero { overflow: hidden; }

/* marquee */
.ccjo-marquee { overflow: hidden; white-space: nowrap; }
.ccjo-marquee__track { display: inline-flex; gap: 2rem; animation: ccjo-mq 38s linear infinite; font-family: var(--wp--preset--font-family--baloo); font-weight: 700; font-size: 1.35rem; }
.ccjo-marquee__track span::after { content: "✳"; color: var(--wp--preset--color--lavender); margin-inline-start: 2rem; font-size: 1rem; }
@keyframes ccjo-mq { to { transform: translateX(-50%); } }
.rtl .ccjo-marquee__track { animation-name: ccjo-mq-rtl; }
@keyframes ccjo-mq-rtl { to { transform: translateX(50%); } }

/* ---------- products (WooCommerce) ---------- */
.wc-block-components-product-image img, .wp-block-woocommerce-product-image img, .wc-block-grid__product-image img { border-radius: 18px; border: 2px solid var(--wp--preset--color--ink); aspect-ratio: 4 / 5; object-fit: cover; background: var(--wp--preset--color--linen); }
.wp-block-woocommerce-product-template .wp-block-post-title a, .wc-block-grid__product-title { text-decoration: none; }
.wp-block-woocommerce-product-button .wp-block-button__link, .wc-block-components-product-button__button {
	background: var(--wp--preset--color--cream) !important; color: var(--wp--preset--color--ink) !important;
	border: 2px solid var(--wp--preset--color--ink) !important; border-radius: 999px !important;
	font-family: var(--wp--preset--font-family--baloo); font-weight: 700; padding: .5em 1.1em !important;
}
.wp-block-woocommerce-product-button .wp-block-button__link:hover, .wc-block-components-product-button__button:hover { background: var(--wp--preset--color--clay) !important; color: var(--wp--preset--color--cream) !important; border-color: var(--wp--preset--color--clay) !important; }
.wc-block-components-product-sale-badge, .onsale { background: var(--wp--preset--color--clay) !important; color: var(--wp--preset--color--cream) !important; border: 0 !important; border-radius: 999px !important; }
.wc-block-components-button:not(.is-link), .wc-block-cart__submit-button, .wc-block-components-checkout-place-order-button, .single_add_to_cart_button, .woocommerce .button.alt {
	background: var(--wp--preset--color--clay) !important; color: var(--wp--preset--color--cream) !important; border-radius: 999px !important; font-family: var(--wp--preset--font-family--baloo); font-weight: 700; border: 0 !important;
}
.wc-block-components-button:not(.is-link):hover { background: var(--wp--preset--color--clay-deep) !important; }
.wc-block-components-text-input input, .wc-block-components-textarea, .wc-blocks-components-select__select, .wc-block-components-combobox .components-combobox-control__input {
	border: 2px solid var(--wp--preset--color--ink) !important; border-radius: 12px !important; background: var(--wp--preset--color--paper) !important;
}
.wc-block-components-radio-control__option, .wc-block-components-radio-control-accordion-option { border-radius: 14px; }
.wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option { background: var(--wp--preset--color--linen); }
.woocommerce-order-received .woocommerce-thankyou-order-received, .wc-block-order-confirmation-status { font-family: var(--wp--preset--font-family--baloo); }

/* workshop + tutorial cards */
.ccjo-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.ccjo-meta p, .ccjo-tag { border: 1.5px solid var(--wp--preset--color--line); background: var(--wp--preset--color--paper); border-radius: 999px; padding: .15em .75em; font-size: .85rem; margin: 0; color: var(--wp--preset--color--ink-soft); }
.ccjo-meta p:empty { display: none; }
.wp-block-post-template.ccjo-cards > li, .ccjo-cards .wp-block-post { border: 2px solid var(--wp--preset--color--ink); border-radius: 22px; overflow: hidden; background: var(--wp--preset--color--paper); }
.ccjo-cards .wp-block-post-featured-image { margin: 0; }
.ccjo-cards .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 2px solid var(--wp--preset--color--ink); }
.ccjo-cards .wp-block-post-title a { text-decoration: none; }
.ccjo-steps { counter-reset: ccjo-step; }
.ccjo-step { counter-increment: ccjo-step; }
.ccjo-step::before { content: counter(ccjo-step); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--wp--preset--color--cream); color: var(--wp--preset--color--cobalt); font-family: var(--wp--preset--font-family--baloo); font-weight: 800; font-size: 1.5rem; margin-bottom: .75rem; }
.rtl .ccjo-step::before { content: counter(ccjo-step, arabic-indic); }

/* podcast player */
.ccjo-episode-number { font-family: var(--wp--preset--font-family--baloo); font-weight: 800; }
.wp-block-audio audio { width: 100%; }

/* footer */
.ccjo-footer a { color: inherit; }
.ccjo-footer .wp-block-social-links .wp-social-link { background: var(--wp--preset--color--cream) !important; color: var(--wp--preset--color--ink) !important; }
.ccjo-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.ccjo-chips li { background: var(--wp--preset--color--cream); color: var(--wp--preset--color--ink); border-radius: 999px; padding: .45em 1.1em; font-family: var(--wp--preset--font-family--baloo); font-weight: 700; }
.ccjo-how .ccjo-step p { opacity: .9; }

/* full-width sections sit flush against each other */
.ccjo-flush > * { margin-block-start: 0 !important; margin-block-end: 0 !important; }
.wp-site-blocks > footer.wp-block-template-part, .wp-site-blocks > footer { margin-block-start: 0 !important; }
.wp-site-blocks > main, .wp-site-blocks > .wp-block-group:has(> .ccjo-flush) { margin-block-start: 0; }

/* product cards: align text and button to the start */
.wp-block-woocommerce-product-template .wc-block-components-product-price,
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-price { text-align: start; }
.wp-block-woocommerce-product-template .wp-block-woocommerce-product-button,
.wp-block-woocommerce-product-template .wc-block-components-product-button { align-items: flex-start; justify-content: flex-start; text-align: start; }
@media (max-width: 600px) { .wp-block-woocommerce-product-template.wp-block-woocommerce-product-template { grid-template-columns: 1fr !important; } }
.wp-block-woocommerce-product-template .wp-block-post-title.has-text-align-center, .wp-block-woocommerce-product-template .has-text-align-center { text-align: start; }
