/*
Theme Name: Speakeasy
Author: Built by Conor
Version: 1.0
Requires at least: 6.5
Requires PHP: 7.4
Description: Full block (FSE) theme for Speakeasy Coaching.
Text Domain: speakeasy
Tags: full-site-editing, block-theme
*/

/* ========== Root tokens ========== */
:root {
  --speakeasy-brand: #0276b6;
  --speakeasy-accent: #ff7a00;
  --wp--preset--color--brand: #0276b6;
  --wp--preset--color--accent: #ff7a00;
  --wp--style--global--content-size: 1200px;
}

/* ========== Base ========== */
html:focus-within {
  scroll-behavior: smooth
}

body {
  color: #111;
}

body>.wp-site-blocks {
  padding-top: 0 !important
}

:root :where(.is-layout-flow)>header.wp-block-template-part {
  margin-block-start: 0 !important
}

:root :where(.is-layout-flow)>.wp-block-template-part:first-child {
  margin-block-start: 0 !important
}

.entry-content {
  margin-block-start: 0
}

:root :where(.is-layout-flow)>* {
  margin-block-start: 0 !important;
}

a {
  color: var(--wp--preset--color--brand);
}
a:hover {
  color: var(--wp--preset--color--accent);
}

/* ========== Header / Navigation ========== */
.speakeasy-header.is-style-sticky {
  position: sticky;
  top: 0;
  z-index: 50
}

.wp-block-navigation a {
  font-size: 16px;
  font-weight: 700;
  text-decoration: none
}

.wp-block-navigation a:hover {
  text-decoration: underline
}

.wp-block-site-logo img.custom-logo,
.wp-block-site-logo svg {
  display: block;
  height: auto;
  max-width: 100%
}

.wp-block-speakeasy-site-header .wp-block-buttons .wp-block-button__link:hover {
  color: #fff;
  transform: translateY(-2px);
}

/* ===== Speakeasy Brevo form (refined size fix) ===== */
.speakeasy-brevo-form {
  max-width: 720px; /* limits form to your content width */
  margin-inline: auto;
  text-align: center;
}

/* Field row */
.speakeasy-brevo-form .form-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: stretch;
  margin: 1.25rem auto 0;
  width: 100%;
  max-width: 720px;
  box-sizing: border-box;
}

/* Ensure inputs never overflow their parent */
.speakeasy-brevo-form .form-group > div {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
}

/* Inputs */
.speakeasy-brevo-form input[type="text"],
.speakeasy-brevo-form input[type="email"] {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  font-size: 16px;
  line-height: 1.3;
  box-sizing: border-box;
  outline: none;
  color: var(--wp--preset--color--body, #111);
  transition: box-shadow 0.15s ease;
}

/* Focus ring */
.speakeasy-brevo-form input:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--primary, #0276b6) 25%, transparent);
}

/* Placeholder */
.speakeasy-brevo-form ::placeholder {
  color: var(--wp--preset--color--muted, #6b7280);
}

/* Submit button */
.speakeasy-brevo-form .sib-default-btn,
.speakeasy-brevo-form input[type="submit"] {
  width: 100%;
  display: inline-block;
  padding: 0.9rem 1.25rem;
  margin-top: 1rem;
  border-radius: 9999px;
  border: 0;
  background: var(--wp--preset--color--accent, #ff7a00);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.speakeasy-brevo-form .sib-default-btn:hover {
  filter: brightness(0.95);
}

/* Mobile stack */
@media (max-width: 640px) {
  .speakeasy-brevo-form .form-group {
    flex-direction: column;
    gap: 8px;
  }
}

/* Submit button */
.speakeasy-brevo-form .sib-default-btn,
.speakeasy-brevo-form input[type="submit"] {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: .9rem 1.25rem;
  margin-top: .9rem;
  border: 0;
  border-radius: 9999px;
  background: var(--wp--preset--color--accent, #ff7a00);
  color: #fff;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .15s ease;
}
.speakeasy-brevo-form .sib-default-btn:hover,
.speakeasy-brevo-form input[type="submit"]:hover {
  filter: brightness(0.95);
}
.speakeasy-brevo-form .sib-default-btn:disabled,
.speakeasy-brevo-form input[type="submit"]:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Message styles (replace inline <style> block) */
form#sib_signup_form_1 p.sib-alert-message {
  padding: 8px 12px;
  margin: 12px 0;
  border: 1px solid var(--wp--preset--color--border, #e5e7eb);
  border-radius: 8px;
  box-sizing: border-box;
}
form#sib_signup_form_1 p.sib-alert-message-error {
  background: #f2dede; border-color: #ebccd1; color: #a94442;
}
form#sib_signup_form_1 p.sib-alert-message-success {
  background: #dff0d8; border-color: #d6e9c6; color: #3c763d;
}
form#sib_signup_form_1 p.sib-alert-message-warning {
  background: #fcf8e3; border-color: #faebcc; color: #8a6d3b;
}

/* Mobile: stack fields */
@media (max-width: 720px) {
  .speakeasy-brevo-form .form-group { flex-direction: column; gap: 10px; }
}

/* ========== Hero / Profile ========== */
.speakeasy-hero-profile {
  position: relative
}

.speakeasy-hero-title {
  color: #0276b6;
  text-transform: uppercase;
  margin: 0 0 .5rem;
  font-size: 4rem;
  font-style: normal;
  font-weight: 700;
  line-height: .85
}

.speakeasy-hero-intro {
  max-width: 60ch;
  opacity: .9;
  padding-top: 10px;
}

.speakeasy-portrait-col {
  display: grid;
  justify-items: end;
}

.speakeasy-portrait-wrap {
  position: relative;
  width: clamp(240px, 34vw, 460px);
  aspect-ratio: 1/1;
}

.speakeasy-portrait-wrap .wp-block-post-featured-image,
.speakeasy-portrait {
  width: 100%;
  height: 100%;
  border-radius: 10%;
  overflow: hidden;
  position: relative;
  display: block;
  border: 5px solid #ff7a00;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  z-index: 1
}

.speakeasy-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block
}

/* Orange blobs (0.5 opacity) */
.speakeasy-portrait-wrap::before,
.speakeasy-portrait-wrap::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  width: 70%;
  height: 70%;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .08))
}

.speakeasy-portrait-wrap::before {
  top: -10%;
  right: -20%;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'><g transform='translate(300,300)'><path d='M120 -154C158 -120 188 -79 199 -34C209 12 201 60 178 101C155 143 118 178 76 194C34 210 -12 207 -58 194C-104 181 -149 158 -175 121C-200 83 -207 31 -195 -15C-183 -60 -153 -98 -117 -132C-81 -166 -40 -196 2 -198C44 -200 88 -174 120 -154Z' fill='%23ff7a00' opacity='0.5'/></g></svg>");
}

.speakeasy-portrait-wrap::after {
  bottom: -15%;
  left: -35%;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'><g transform='translate(300,300)'><path d='M120 -154C158 -120 188 -79 199 -34C209 12 201 60 178 101C155 143 118 178 76 194C34 210 -12 207 -58 194C-104 181 -149 158 -175 121C-200 83 -207 31 -195 -15C-183 -60 -153 -98 -117 -132C-81 -166 -40 -196 2 -198C44 -200 88 -174 120 -154Z' fill='%23ff7a00' opacity='0.5'/></g></svg>");
}

@media (max-width:800px) {
  .speakeasy-portrait-wrap {
    margin-top: 1rem;
    width: 100%;
  }
  .speakeasy-portrait-wrap::before {
    display: none;
  }
  .speakeasy-hero-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
  }
  .speakeasy-hero-intro {
    text-align: center;
  }
}

/* ========== Woo: product variations & inline grids ========== */
.speakeasy-variations__row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 1rem
}

.speakeasy-variations__field {
  flex: 1
}

.speakeasy-variations__btn {
  display: block;
  width: 100%;
  margin-top: .5rem
}

.speakeasy-variations--single .variations {
  display: block
}

.speakeasy-variations--single .variations tr {
  display: block;
  margin: 0 0 1rem
}

.speakeasy-variations--single .variations td.label,
.speakeasy-variations--single .variations td.value {
  display: block;
  padding: 0;
  margin: 0 0 .25rem
}

.speakeasy-variations--single .addtocart-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 1rem
}

.speakeasy-variations--single .speakeasy-qty-input {
  width: 90px
}

.speakeasy-variations--single .speakeasy-variations__btn {
  flex: 1
}

/* Inline grid (Qty + Date etc.) */
.speakeasy-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 1rem
}

.speakeasy-inline label {
  display: block;
  font-weight: 600;
  margin-bottom: .25rem
}

.speakeasy-qty-input,
.speakeasy-inline select {
  width: 100%
}

/* Woo Blocks: hide “Start shopping” button */
.wp-block-woocommerce-mini-cart-shopping-button-block {
  display: none !important
}

/* ========== Woo: unified buttons ========== */
body.woocommerce a.button,
body.woocommerce button.button,
body.woocommerce input.button,
body.woocommerce input[type="submit"],
body.woocommerce-page a.button,
body.woocommerce-page button.button,
body.woocommerce-page input.button,
body.woocommerce-page input[type="submit"],
.wc-block-checkout .wc-block-components-button,
.wc-block-cart .wc-block-components-button,
.wc-block-mini-cart__drawer .wc-block-components-button,
.wp-block-woocommerce-cart .wc-block-components-button,
.wp-block-woocommerce-checkout .wc-block-components-button,
.wp-block-woocommerce-mini-cart .wc-block-components-button,
.wc-block-components-checkout-place-order-button {
  background: var(--wp--preset--color--primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 10px 18px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  align-items: center;
  justify-content: center
}

body.woocommerce a.button:hover,
body.woocommerce button.button:hover,
body.woocommerce input.button:hover,
body.woocommerce input[type="submit"]:hover,
.wc-block-checkout .wc-block-components-button:hover,
.wc-block-cart .wc-block-components-button:hover,
.wc-block-mini-cart__drawer .wc-block-components-button:hover,
.wc-block-components-checkout-place-order-button:hover {
  filter: brightness(.93)
}

body.woocommerce a.button:focus-visible,
body.woocommerce button.button:focus-visible,
body.woocommerce input.button:focus-visible,
body.woocommerce input[type="submit"]:focus-visible,
.wc-block-checkout .wc-block-components-button:focus-visible,
.wc-block-cart .wc-block-components-button:focus-visible,
.wc-block-mini-cart__drawer .wc-block-components-button:focus-visible,
.wc-block-components-checkout-place-order-button:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(2, 118, 182, .25), 0 0 0 1px rgba(2, 118, 182, .6) !important
}

/* Force outline-style buttons to be solid on Woo pages */
body.woocommerce .wp-block-button.is-style-outline .wp-block-button__link,
.wc-block-checkout .wp-block-button.is-style-outline .wp-block-button__link,
.wc-block-cart .wp-block-button.is-style-outline .wp-block-button__link {
  background: var(--wp--preset--color--primary) !important;
  color: #fff !important;
  border: none !important
}

/* ========== Woo: minicart presence & layering ========== */
body.woocommerce-cart .wp-block-woocommerce-mini-cart,
body.woocommerce-checkout .wp-block-woocommerce-mini-cart {
  display: block !important;
  visibility: visible !important
}

.wc-block-mini-cart__drawer {
  z-index: 9999
}

.wc-block-components-button.wc-block-components-drawer__close {
  background: transparent !important;
  color: #111 !important;
}

/* ========== Woo: loading spinner overlay ========== */
.wc-block-cart.is-loading::after,
.wc-block-checkout.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  border: 3px solid rgba(2, 118, 182, .25);
  border-top-color: var(--wp--preset--color--primary, #0276b6);
  animation: spin .6s linear infinite;
  z-index: 1000
}

.wc-block-cart,
.wc-block-checkout {
  position: relative
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ========== Woo: disable product-name links ========== */
.wc-block-components-product-name {
  pointer-events: none;
  cursor: default;
  text-decoration: none !important;
  color: inherit !important
}

.disabled {
  background-color: #888;
}

.wc-block-mini-cart__shopping-button {
  display: none !important;
}

.speakeasy-page-content, .speakeasy-hero-profile {
  padding: 0 20px;
}

.page-404 {
  padding: 15rem 0;
  text-align: center;
}

.woocommerce-Price-amount.amount {
  font-weight: bold;
}

.speakeasy-variation-price {
  display: none;
}