/**
 * Coach Carmen Ramírez — theme styles.
 *
 * Layout and content are built with Elementor; this file holds the design
 * tokens and everything Elementor cannot express on its own: the custom
 * header and footer, the 3D book covers, the hero composition, overrides for
 * Elementor/plugin defaults, and the contact form.
 *
 * Conventions
 * - Every class is prefixed `cr-`. Components use BEM (`cr-block__element`,
 *   `cr-block--modifier`).
 * - Elementor only prints the "CSS Classes" field (`_css_classes`) on widgets.
 *   Containers use a separate field that most sections here do not set, so
 *   a section is usually targeted through a widget it contains:
 *   `.e-con:has(> .cr-some-widget)`. See docs/theme.md.
 * - Breakpoints follow Elementor: tablet ≤ 1024px, mobile ≤ 767px. The header
 *   switches to the burger menu at ≤ 1200px because the English menu labels
 *   are longer.
 * - `!important` is used only where an Elementor rule with higher specificity
 *   would otherwise win; each case is commented.
 *
 * Sections
 *   1. Tokens and base
 *   2. Buttons
 *   3. Hero (home page)
 *   4. Cards
 *   5. Header
 *   6. Footer
 *   7. Call-to-action pair (detail pages)
 *   8. Text, links and accordion
 *   9. Responsive typography
 *  10. Promo badge and partner strip
 *  11. Newsletter form
 *  12. Book covers and book grid
 *  13. 3D book
 *  14. Feature images (about page, affiliate pages)
 *  15. Signatures
 *  16. Contact form
 */

/* ==========================================================================
   1. Tokens and base
   ========================================================================== */

:root {
  --cr-cream:       #FAF1E2;  /* section background */
  --cr-teal:        #1A555C;  /* buttons, links */
  --cr-teal-hover:  #2C6B73;
  --cr-sky:         #B5D5DB;  /* button offset shadow, badges */
  --cr-text:        #777777;  /* body copy */
  --cr-heading:     #2E2E2E;
  --cr-label:       #9C8F79;  /* italic serif labels */
  --cr-green:       #538914;  /* promo badge */
  --cr-navy:        #152937;  /* footer */
}

body {
  font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
  color: var(--cr-text);
}

/* Some Android browsers flash a system colour over tapped elements. */
a, button, .cr-header__burger, .cr-cta, .elementor-button {
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Questrial', 'Inter', Helvetica, sans-serif;
  font-weight: 400;
  color: var(--cr-heading);
}

/* Section pseudo-elements (Elementor background overlays) stay behind the
   content. */
.elementor > .e-con::before,
.elementor > .e-con::after { z-index: 0 !important; }
.elementor > .e-con > .e-con-inner,
.elementor > .e-con > .e-con { position: relative; z-index: 1; }

.cr-footer__inner, .cr-footer__copyright { position: relative; z-index: 1; }

/* ==========================================================================
   2. Buttons — dark teal with a light-blue offset block behind them
   ========================================================================== */

/* Elementor drops the button wrapper, so the offset is a box-shadow on the
   button itself. Two selectors because Elementor's frontend CSS sets
   `.elementor a { box-shadow: none }`, which beats a plain class. */
.elementor .elementor-button,
.elementor a.elementor-button {
  position: relative;
  border-radius: 0;
  box-shadow: 10px 10px 0 0 var(--cr-sky);
  transition: background-color .25s ease, box-shadow .2s ease;
}
.elementor .elementor-button:hover,
.elementor a.elementor-button:hover {
  background-color: var(--cr-teal-hover) !important;
  box-shadow: 6px 6px 0 0 var(--cr-sky);
}

/* ==========================================================================
   3. Hero (home page) — portrait, 3D book and CR emblem overlap
   ========================================================================== */

/* The book deliberately hangs over the bottom edge of the hero into the next
   section, so the section must not clip, and `z-index: 2` keeps it above the
   following section (both are `position: relative`). */
.elementor > .e-con:has(.cr-hero-portrait) {
  position: relative;
  overflow: visible;
  z-index: 2;
}

/* The right-hand hero column is the positioning context for book and emblem. */
.e-con:has(> .e-con-inner > .cr-hero-portrait),
.e-con:has(> .cr-hero-portrait) {
  position: relative;
  min-height: 436px;
}

/* The portrait sits flush on the bottom edge of the section. The cut-out PNG
   ends with a hard horizontal edge at the forearms; shifting the image down
   34px and clipping the same amount moves that edge onto the section border,
   where it reads as the image boundary. */
.cr-hero-portrait {
  margin-top: auto !important;
  margin-bottom: -56px !important;   /* cancels the column's padding */
  align-self: flex-end;
  transform: translateY(34px);
  clip-path: inset(0 0 34px 0);
}
.cr-hero-portrait img {
  width: auto; height: 410px;
  object-fit: contain; object-position: bottom;
  display: block;
}
@media (max-width: 1024px) {
  .cr-hero-portrait { margin-bottom: -56px !important; }
  .cr-hero-portrait img { height: 420px; }

  /* Stacked layout: cap the line length of the full-width text column. */
  .elementor > .e-con:has(.cr-hero-portrait) .elementor-widget-text-editor,
  .elementor > .e-con:has(.cr-hero-portrait) .elementor-widget-heading {
    max-width: 620px;
  }
  .cr-hero-portrait { align-self: center; }
}

/* `.cr-hero-book` only positions; the 3D rotation lives on the inner
   `.cr-book3d` (two transforms on nested elements do not add up). The book
   covers about 20% of the portrait width, which hides the portrait's hard
   bottom edge without competing with it. The emblem sits at a fixed ratio of
   the book width so the crown lands on the same spot of the cover. */
.cr-hero-book {
  position: absolute; left: 150px; bottom: -66px;
  width: 172px; z-index: 4;
}
.cr-hero-emblem {
  position: absolute; left: 238px; bottom: -74px;
  width: 69px; z-index: 5;
}
.cr-hero-emblem img { width: 69px; height: auto; }

@media (max-width: 1024px) {
  /* The stacked portrait is centred, so book and emblem are anchored to the
     centre as well; otherwise they drift away from it as the viewport grows.
     The extra 16px compensate for column padding below the portrait. */
  .cr-hero-book   { left: calc(50% - 203px); bottom: -61px; width: 123px; }
  .cr-hero-emblem { left: calc(50% - 140px); bottom: -69px; width: 53px; }
  .cr-hero-emblem img { width: 53px; }
}
@media (max-width: 767px) {
  /* The overlap is kept on phones too (measured at a 390px viewport, the
     values hold up to 767px). `!important` overrides the widths Elementor
     sets on the image widgets. */
  .cr-hero-book, .cr-hero-emblem { margin: 0; }
  .cr-hero-book {
    position: absolute; left: calc(50% - 161px); bottom: -58px;
    width: 109px !important; z-index: 2;
  }
  .cr-hero-emblem {
    position: absolute; left: calc(50% - 108px); bottom: -68px;
    width: 49px !important; z-index: 3;
  }
  .cr-hero-emblem img { width: 49px !important; height: auto; }

  /* No bottom padding, so the portrait ends exactly on the section edge. */
  .e-con:has(> .e-con-inner > .cr-hero-portrait),
  .e-con:has(> .cr-hero-portrait) { min-height: 0; padding-bottom: 0; }
  .cr-hero-portrait { margin-bottom: -46px !important; }
}

/* ==========================================================================
   4. Cards — services, affiliates
   ========================================================================== */

.e-con .e-con-inner > .e-con,
.e-con > .e-con {
  transition: box-shadow .25s ease;
}

/* Card image: full card width, no gap above. */
.cr-card-image { margin: 0 !important; }
.cr-card-image .elementor-widget-container { margin: 0; padding: 0; }
.cr-card-image img {
  display: block; width: 100%; height: 230px;
  object-fit: cover; margin: 0;
}

/* Card buttons line up across a row regardless of text length: the card
   becomes a flex column and the button is pushed to the bottom. */
.e-con.e-child:has(> .cr-card-btn) {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.cr-card-btn { margin-top: auto; }

/* ==========================================================================
   5. Header — rendered by template-parts/header.php
   ========================================================================== */

.cr-header {
  position: sticky; top: 0; z-index: 999;
  background: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.cr-header__inner {
  display: flex; align-items: center; gap: 30px;
  padding: 10px 40px;
}
.cr-header__logo { flex: 0 0 auto; line-height: 0; }
.cr-header__logo img { width: 190px; height: auto; display: block; }

.cr-header__nav { display: flex; align-items: center; gap: 24px; flex: 1 1 auto; }

.cr-menu {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0; padding: 0;
}
.cr-menu > li > a {
  display: block;
  font-family: 'Questrial', sans-serif;
  font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  color: #3A3A3A; text-decoration: none;
  padding: 10px 15px; white-space: nowrap;
  transition: color .2s ease;
}
.cr-menu > li > a:hover,
.cr-menu > li.current-menu-item > a { color: var(--cr-teal); }

.cr-languages { display: flex; align-items: center; gap: 14px; list-style: none; margin: 0; padding: 0; }
.cr-languages a { display: inline-flex; line-height: 0; }
.cr-languages img {
  width: 26px; height: 18px; object-fit: cover; display: block;
  border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12);
  opacity: .95; transition: opacity .2s ease, transform .2s ease;
}
.cr-languages a:hover img { opacity: 1; transform: translateY(-1px); }

.cr-header__social { display: flex; gap: 10px; margin-left: auto; }
.cr-header__social a {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #EFEFEF; color: #3A3A3A; font-size: 15px;
  text-decoration: none; transition: background .2s ease, color .2s ease;
}
.cr-header__social a:hover { background: var(--cr-teal); color: #fff; }

.cr-header__burger {
  display: none; background: none; border: 0; cursor: pointer;
  padding: 10px; margin-left: auto; order: 90;
  -webkit-tap-highlight-color: transparent;
}
/* Hello Elementor's reset.css colours every `button:hover/:focus` pink.
   Reset only the background; resetting `display` here would beat the mobile
   `display: block` below (the pseudo-class adds specificity). */
.cr-header__burger:hover,
.cr-header__burger:focus {
  background: none;
  background-color: transparent;
}
.cr-header__burger:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }
.cr-header__burger span { display: block; width: 26px; height: 2px; background: #2E2E2E; margin: 5px 0; transition: .2s; }

/* Burger bars turn into a cross when open. */
.cr-header__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.cr-header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.cr-header__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* The three media blocks below are order-dependent: the ≤1024px link padding
   must override the ≤1200px one. */
@media (max-width: 1200px) {
  .cr-header__inner { padding: 10px 20px; gap: 18px; }
  .cr-menu > li > a { font-size: 13px; padding: 10px 9px; }
  .cr-header__logo img { width: 150px; }
}
@media (max-width: 1024px) {
  .cr-header__nav { display: none; }
  .cr-header__nav.is-open { display: flex; }
  .cr-menu { flex-direction: column; align-items: stretch; }
  .cr-menu > li > a { padding: 13px 2px; }
}
@media (max-width: 1200px) {
  .cr-header__nav .cr-menu { display: none; }
  .cr-header__burger { display: block; }

  /* The whole nav (menu and language flags) opens as a dropdown panel. */
  .cr-header__nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    padding: 10px 20px 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    z-index: 998;
  }
  .cr-header__nav.is-open .cr-menu {
    display: flex;
    flex-direction: column;
  }
  .cr-header__nav.is-open .cr-languages {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #EEE;
  }
  .cr-header { position: relative; }
  .cr-header__inner { flex-wrap: nowrap; align-items: center; }

  /* Visual order independent of the markup: logo, nav, social, burger. */
  .cr-header__logo   { order: 10; }
  .cr-header__nav    { order: 20; }
  .cr-header__social { order: 80; }
  .cr-header__burger { order: 90; margin-left: auto; }

  .cr-header__nav.is-open .cr-menu,
  .cr-header__nav .cr-menu.is-open { display: flex; }
}

/* ==========================================================================
   6. Footer — rendered by template-parts/footer.php
   ========================================================================== */

.cr-footer {
  background: var(--cr-navy);
  color: #fff;
}
.cr-footer__inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; gap: 50px;
  padding: 80px 20px 40px;
}
.cr-footer__col { flex: 1 1 0; }
.cr-footer__col--center { text-align: center; }
.cr-footer__col--right { text-align: right; }

.cr-footer__title {
  font-family: 'Questrial', sans-serif;
  font-size: 26px; color: #fff; margin: 0 0 26px;
}
.cr-footer__label {
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600;
  color: #fff; margin: 0 0 4px;
}
.cr-footer__value {
  font-family: 'Inter', sans-serif; font-size: 15px;
  color: rgba(255,255,255,.82); margin: 0 0 22px;
}
.cr-footer__value a { color: rgba(255,255,255,.82); text-decoration: none; }
.cr-footer__value a:hover { color: #fff; }

/* A dedicated white-and-gold logo file; a CSS filter would bleach the gold. */
.cr-footer__logo { width: 270px; height: auto; }

.cr-footer__claim {
  font-family: 'Inter', sans-serif; font-size: 15px; line-height: 1.8;
  color: rgba(255,255,255,.82); margin: 20px auto 0; max-width: 420px;
}
.cr-footer__social { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.cr-footer__social a {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.55); color: #fff; font-size: 15px;
  text-decoration: none; transition: background .2s ease, color .2s ease;
}
.cr-footer__social a:hover { background: #fff; color: #0E3742; }

.cr-footer__menu { list-style: none; margin: 0; padding: 0; }
.cr-footer__menu li { margin-bottom: 12px; }
.cr-footer__menu a {
  font-family: 'Inter', sans-serif; font-size: 15px;
  color: rgba(255,255,255,.82); text-decoration: none; transition: color .2s ease;
}
.cr-footer__menu a:hover { color: #fff; }

.cr-footer__copyright { border-top: 1px solid rgba(255,255,255,.16); }
.cr-footer__copyright-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 22px 20px 26px;
  font-family: 'Inter', sans-serif; font-size: 13px; color: rgba(255,255,255,.6);
}
.cr-footer__copyright-inner a { color: rgba(255,255,255,.85); }

@media (max-width: 1024px) {
  .cr-footer__inner { flex-wrap: wrap; padding: 55px 20px 30px; gap: 36px; }
  .cr-footer__col { flex: 1 1 100%; text-align: center; }
  .cr-footer__col--right { text-align: center; }
  .cr-footer__copyright-inner { justify-content: center; text-align: center; }
}

/* ==========================================================================
   7. Call-to-action pair on detail pages ("Call now" / "Message us")
   Markup lives in an Elementor HTML widget; links use [cr_contact].
   ========================================================================== */

.cr-cta-pair { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.cr-cta {
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  background: var(--cr-teal); color: #fff;
  padding: 14px 26px; min-width: 190px;
  box-shadow: 10px 10px 0 0 var(--cr-sky);
  transition: background .25s ease;
  position: relative;   /* containing block for the stretched link */
  cursor: pointer;
}
.cr-cta:hover { background: var(--cr-teal-hover); }
.cr-cta__icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.cr-cta__text { display: flex; flex-direction: column; justify-content: center; }
.cr-cta__small { font-family: 'Inter', sans-serif; font-size: 12px; opacity: .8; }
.cr-cta__large { font-family: 'Inter', sans-serif; font-size: 17px; font-weight: 600; }
.cr-cta a { color: #fff; text-decoration: none; }

/* Stretched link: the link stays in the text flow (so the two text lines keep
   their layout) and its ::after covers the whole button. */
.cr-cta a.cr-contact-link { position: static; }
.cr-cta a.cr-contact-link::after { content: ""; position: absolute; inset: 0; }

/* ==========================================================================
   8. Text, links and accordion
   ========================================================================== */

a.cr-contact-link { cursor: pointer; text-decoration: none; }

/* ElementsKit accordion (about page). */
.elementskit-accordion .elementskit-card { border: 0; border-bottom: 1px solid #E5E0D6; }
.elementskit-accordion .elementskit-card-header a {
  font-family: 'Questrial', sans-serif; font-size: 22px; color: var(--cr-heading);
  padding: 20px 0;
}
.elementskit-accordion .elementskit-card-body {
  font-family: 'Inter', sans-serif; font-size: 16px; line-height: 1.8; color: var(--cr-text);
  padding: 0 0 22px;
}
.elementskit-accordion .elementskit-card-body li { margin-bottom: 14px; }
.elementskit-accordion .elementskit-card-body li:last-child { margin-bottom: 0; }

/* Links in running text. */
.elementor-widget-text-editor a,
.entry-content a,
a.cr-contact-link {
  color: var(--cr-teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 85, 92, .3);
  transition: border-color .2s ease;
}
.elementor-widget-text-editor a:hover,
.entry-content a:hover,
a.cr-contact-link:hover { border-bottom-color: var(--cr-teal); }

/* No underline in the dark footer or inside buttons. */
.cr-footer a.cr-contact-link,
.cr-cta a.cr-contact-link { border-bottom: 0; color: inherit; }

/* ==========================================================================
   9. Responsive typography
   Font sizes are set per widget in Elementor; these caps keep the large
   headings from overflowing on tablet and mobile.
   ========================================================================== */

@media (max-width: 1024px) {
  .elementor h1, .elementor .elementor-heading-title h1 { font-size: 44px !important; }
  .elementor h2, .elementor .elementor-heading-title h2 { font-size: 34px !important; }
  .elementor h3, .elementor .elementor-heading-title h3 { font-size: 24px !important; }
  .elementor .e-con.e-flex { --flex-wrap: wrap; }
  .elementor .e-con > .e-con { width: 100% !important; }
}

@media (max-width: 767px) {
  .elementor h1, .elementor .elementor-heading-title h1 { font-size: 34px !important; line-height: 1.2 !important; }
  .elementor h2, .elementor .elementor-heading-title h2 { font-size: 27px !important; }
  .elementor h3, .elementor .elementor-heading-title h3 { font-size: 21px !important; }
  .elementor .elementor-widget-text-editor { font-size: 15px !important; }
  .elementor-counter .elementor-counter-number-wrapper { font-size: 38px !important; }

  .elementor .e-con > .e-con { width: 100% !important; }
  .cr-cta-pair { flex-direction: column; }
  .cr-cta { width: 100%; box-shadow: 6px 6px 0 0 var(--cr-sky); }
  .elementor .elementor-button { box-shadow: 6px 6px 0 0 var(--cr-sky); }
  .cr-card-image img { height: 200px; }
}

/* ==========================================================================
   10. Promo badge (book collection page) and partner strip (home page)
   ========================================================================== */

.cr-promo-badge {
  position: absolute;
  top: 6%;
  right: 8%;
  z-index: 2;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--cr-green);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.cr-promo-badge__small {
  font-family: 'Noto Serif', Georgia, serif;
  font-style: italic;
  font-size: 14px;
  line-height: 1.3;
}
.cr-promo-badge__large {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 25px;
  line-height: 1.2;
  margin: 2px 0;
}
@media (max-width: 767px) {
  .cr-promo-badge { width: 110px; height: 110px; top: 4%; right: 4%; }
  .cr-promo-badge__small { font-size: 11px; }
  .cr-promo-badge__large { font-size: 19px; }
}

.elementor > .e-con:has(.cr-partner-logo) {
  position: relative;
  background: #FFFFFF;
}

/* ==========================================================================
   11. Newsletter form (The Newsletter Plugin)
   Field and button side by side, placeholder instead of a label, button
   with the same offset shadow as the Elementor buttons. The placeholder
   text itself is set in assets/js/site.js.
   ========================================================================== */

.tnp-field input[type=email] {
  width: 100%; box-sizing: border-box;
  padding: 18px 20px; border: 1px solid #E2D6C2; background: #fff;
  font-family: 'Inter', sans-serif; font-size: 15px; color: var(--cr-heading);
}
.tnp-field-checkbox label { font-size: 13px; color: var(--cr-text); }

.tnp-subscription { margin: 0; max-width: 100%; }
.tnp-subscription form { display: flex; gap: 16px; align-items: stretch; flex-wrap: nowrap; }
.tnp-subscription .tnp-field-email { flex: 1 1 auto; margin: 0; }
.tnp-subscription .tnp-field-email label { display: none; }
.tnp-subscription .tnp-field-button { flex: 0 0 auto; margin: 0; }
.tnp-subscription .tnp-field-checkbox { flex: 1 1 100%; margin-top: 6px; }

.tnp-subscription input.tnp-email {
  width: 100%; box-sizing: border-box; height: 62px;
  padding: 0 22px; border: 1px solid #E2D6C2; border-radius: 0;
  background: #fff; font-family: 'Inter', sans-serif; font-size: 15px;
  color: var(--cr-heading);
}
.tnp-subscription input.tnp-email::placeholder { color: #A8A08F; }

/* `!important` beats the colours the plugin prints inline. */
.tnp-subscription input.tnp-submit {
  height: 62px; padding: 0 34px; border: 0; border-radius: 0; cursor: pointer;
  background: #4A7078 !important; color: #fff !important;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase;
  box-shadow: 10px 10px 0 0 var(--cr-sky);
  transition: background .25s ease, box-shadow .2s ease;
}
.tnp-subscription input.tnp-submit:hover {
  background: var(--cr-teal) !important;
  box-shadow: 6px 6px 0 0 var(--cr-sky);
}

@media (max-width: 767px) {
  .tnp-subscription form { flex-direction: column; flex-wrap: wrap; }
  .tnp-subscription .tnp-field-button,
  .tnp-subscription input.tnp-submit { width: 100%; }
}

/* ==========================================================================
   12. Book covers and book grid
   ========================================================================== */

/* Home page grid: each cover sits alone in a white tile (see :only-child
   below) and fills it, centred. */
.cr-book-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;   /* fill the tile, not just the image's own size */
}
.cr-book-cover img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* The white tile. `:only-child` matters: on the book collection page cover,
   category, title and button share one card, which must not be forced into
   a square. */
.e-con:has(> .cr-book-cover:only-child) {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* At this nesting depth Elementor's `--width` does not resolve on tablet, so
   the tablet width of the grid column is set here. */
@media (max-width: 1024px) and (min-width: 768px) {
  .e-con:has(> .e-con > .cr-book-cover) {
    width: 46% !important;
  }
}

/* The grid is one wrapping row; tile width subtracts the flex gaps.
   `flex-basis` rather than `width`, because Elementor's container rules
   override `width`. Three per row on desktop, two below. The tile is an <a>
   because the whole tile links to the book. */
a.e-con:has(.cr-book-cover) {
  flex: 0 0 calc((100% - 52px) / 3);
  max-width: calc((100% - 52px) / 3);
}
@media (max-width: 1024px) {
  a.e-con:has(.cr-book-cover) {
    flex: 0 0 calc((100% - 26px) / 2);
    max-width: calc((100% - 26px) / 2);
  }
}
@media (max-width: 767px) {
  .e-con:has(> .cr-book-cover:only-child) {
    aspect-ratio: 4 / 5;
  }
  /* `!important`: Elementor's mobile container width rule wins otherwise. */
  a.e-con:has(.cr-book-cover) {
    flex: 0 0 calc((100% - 26px) / 2) !important;
    max-width: calc((100% - 26px) / 2) !important;
  }
}

/* Book collection page: uniform 2:3 format for covers of different source
   proportions. */
.cr-cover-uniform {
  aspect-ratio: 2 / 3 !important;
  height: auto !important;
  width: 100% !important;
  object-fit: cover !important;
  display: block;
  box-shadow: 0 5px 14px -6px rgba(30, 20, 10, .28);
}

/* Cover and title are links but should not look like text links. The spine
   shading is an overlay on the link: an inset box-shadow on <img> would be
   painted behind the image. */
.cr-catalog-cover-link { display: block; text-decoration: none; position: relative; }
.cr-catalog-cover-link img { margin: 0 auto; }
.cr-catalog-cover-link::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 7%;
  max-width: 18px;
  pointer-events: none;
  background: linear-gradient(to right,
    rgba(0, 0, 0, .30) 0%,
    rgba(0, 0, 0, .12) 40%,
    rgba(255, 255, 255, .12) 70%,
    rgba(0, 0, 0, 0) 100%);
  border-left: 1px solid rgba(0, 0, 0, .20);
}
.cr-catalog-title {
  display: block;
  font-family: 'Questrial', sans-serif;
  font-size: 20px;
  line-height: 1.3;
  text-align: center;
  color: var(--cr-heading, #2E2E2E);
  text-decoration: none;
  margin: 0 0 12px;
}
.cr-catalog-title:hover,
.cr-catalog-cover-link:hover img { opacity: .85; }

/* Button at the bottom of the card so a row lines up despite title length. */
.cr-catalog-btn { margin-top: auto; }

/* ==========================================================================
   13. 3D book with a visible spine
   Used in three sizes: hero (home), small (home book grid), promo (book
   collection page).

   The cover sits half a book-thickness in front of the centre plane; the
   spine is a second face in the same 3D context, rotated 90°, so its
   perspective always matches the tilt. Two details are load-bearing:
   - The spine rotates around its own centre and is offset by half the
     thickness (`left: calc(var(--depth) / -2)`). With
     `transform-origin: left center` it would fold out of the book.
   - The wrapper's aspect ratio matches the cover files (1116 × 1600); a
     different ratio would crop the cover through `object-fit`.
   ========================================================================== */

.cr-book3d {
  --depth: 34px;
  position: relative;
  aspect-ratio: 1116 / 1600;
  transform-style: preserve-3d;
}
.cr-book3d img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(calc(var(--depth) / 2));
  box-shadow: 0 18px 32px -14px rgba(30, 20, 10, .5);
}
.cr-book3d__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--depth) / -2);
  width: var(--depth);
  transform: rotateY(-90deg);
  background:
    linear-gradient(to right,
      #6f6355 0%, #8d8071 18%, #c9bdac 55%, #ece4d8 100%);
  border-radius: 2px 0 0 2px;
}

.cr-book3d--promo {
  --depth: 34px;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  transform: perspective(1600px) rotateY(24deg) rotate(-1.5deg);
}

/* Sized by width, not height: the square tile derives its height from its
   width, so a percentage height would be circular. */
.cr-book3d--small {
  --depth: 15px;
  width: 66%;
  transform: perspective(900px) rotateY(22deg) rotate(-1.5deg);
}

/* Width comes from the outer `.cr-hero-book`. */
.cr-book3d--hero {
  --depth: 20px;
  width: 100%;
  transform: perspective(1000px) rotateY(20deg) rotate(-3deg);
}

@media (max-width: 767px) {
  .cr-book3d--promo {
    --depth: 24px;
    max-width: 250px;
    transform: perspective(1200px) rotateY(20deg) rotate(-1.5deg);
  }
  .cr-book3d--small { --depth: 12px; }
  .cr-book3d--hero { --depth: 12px; }
}

/* Hover zoom. The scale is appended to each variant's own transform; a
   separate `scale` would replace the rotation. */
.cr-catalog-cover-link,
.cr-book3d {
  transition: transform .25s ease;
}
.cr-catalog-cover-link:hover {
  transform: scale(1.035);
}
.cr-book3d--promo:hover {
  transform: perspective(1600px) rotateY(24deg) rotate(-1.5deg) scale(1.035);
}
.cr-book3d--small:hover {
  transform: perspective(900px) rotateY(22deg) rotate(-1.5deg) scale(1.06);
}
.cr-book3d--hero:hover {
  transform: perspective(1000px) rotateY(20deg) rotate(-3deg) scale(1.05);
}

/* ==========================================================================
   14. Feature images — about page and affiliate detail pages
   ========================================================================== */

.cr-about-photo img { width: 100%; height: auto; display: block; }

/* Affiliate pages: the image column runs edge to edge and is cropped by the
   section. Elementor's default 10px container padding is removed for that. */
.e-con:has(> .e-con-inner > .e-con .cr-affiliate-image),
.e-con:has(> .e-con .cr-affiliate-image) { overflow: hidden; }
.e-con:has(.cr-affiliate-image) { padding-left: 0; padding-right: 0; }

.cr-affiliate-image img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
}
@media (max-width: 1024px) {
  .cr-affiliate-image img { min-height: 300px; }
}

/* Two stacked images in one column, together about as tall as one. */
.cr-affiliate-image--pair img {
  min-height: 0;
  height: 210px;
}
.cr-affiliate-image--pair + .cr-affiliate-image--pair img {
  height: 322px;
  object-position: 50% 80%;
}
@media (max-width: 1024px) {
  .cr-affiliate-image--pair img { min-height: 0; height: 200px; }
  .cr-affiliate-image--pair + .cr-affiliate-image--pair img { height: 300px; }
}

/* Small inset photo overlapping a large one. */
.cr-photo-inset {
  position: absolute;
  right: -20px;
  bottom: 60px;
  width: 150px;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.cr-photo-inset img {
  width: 100%;
  height: auto;
  display: block;
}
@media (max-width: 767px) {
  .cr-photo-inset { width: 110px; right: -10px; bottom: 40px; }
}

/* Framed variant on affiliate pages. It must stay inside the column: the
   image row clips (`overflow: hidden`) so the main image can run edge to
   edge. */
.cr-photo-inset--framed {
  right: 28px;
  bottom: -28px;
  width: 190px;
  border: 7px solid #fff;
  background: #fff;
}
/* The wrapper is only as tall as the main image; otherwise it grows with the
   text column and the inset drops far below the photo. */
.e-con:has(> .cr-photo-inset--framed) {
  flex-grow: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  --flex-grow: 0;
  align-self: flex-start !important;
}
@media (max-width: 1024px) {
  .cr-photo-inset--framed { width: 150px; right: 20px; bottom: 20px; border-width: 5px; }
}
@media (max-width: 767px) {
  .cr-photo-inset--framed { width: 115px; right: 16px; bottom: 16px; }
}

/* ==========================================================================
   15. Signatures
   ========================================================================== */

/* Carmen's signature (image). `max-width: 100%` keeps it from widening
   narrow columns. */
.cr-signature img { width: 100%; max-width: 560px; height: auto; }
.cr-signature { margin: 10px 0 34px !important; }
.cr-signature img,
.elementor-widget-image.cr-signature img {
  max-width: 100%;
  height: auto;
}

/* Set signature in a script face (affiliate overview page). */
.cr-signature-script {
  font-family: 'Ms Madi', cursive;
  font-size: 54px;
  line-height: 1.3;
  color: #2E2E2E;
  margin: 6px 0 10px;
}
@media (max-width: 767px) {
  .cr-signature-script { font-size: 40px; }
}

/* ==========================================================================
   16. Contact form [cr_contact_form] — inc/contact-form.php
   Placeholders instead of visible labels (labels remain for screen readers),
   full-width fields and a full-width button without the offset shadow.
   ========================================================================== */

.cr-contact-form__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}
.cr-contact-form .cr-contact-form__field {
  width: 100%;
  padding: 16px 20px;
  border: 1px solid #E2E2E2;
  border-radius: 0;
  background: #fff;
  font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--cr-heading);
  box-shadow: none;
  transition: border-color .2s ease;
}
.cr-contact-form .cr-contact-form__field::placeholder { color: #8A8A8A; opacity: 1; }
.cr-contact-form .cr-contact-form__field:focus {
  outline: none;
  border-color: var(--cr-teal);
}
.cr-contact-form .cr-contact-form__field--message { min-height: 150px; resize: vertical; }
.cr-contact-form .cr-contact-form__submit,
.cr-contact-form .cr-contact-form__submit:focus {
  width: 100%;
  margin-top: 4px;
  padding: 16px 20px;
  border: 0;
  border-radius: 0;
  background: var(--cr-teal);
  color: #fff;
  font-family: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .25s ease;
}
.cr-contact-form .cr-contact-form__submit:hover { background: var(--cr-teal-hover); color: #fff; }
.cr-contact-form .cr-contact-form__submit:focus-visible { outline: 2px solid var(--cr-sky); outline-offset: 2px; }
.cr-contact-form__privacy { margin: 0; font-size: 13px; color: var(--cr-text); }
.cr-contact-form__privacy a { color: var(--cr-teal); text-decoration: underline; }
/* Honeypot: invisible to people, a normal field to bots. */
.cr-contact-form__honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cr-contact-form__notice { margin: 0 0 20px; padding: 14px 20px; font-size: 15px; }
.cr-contact-form__notice--success { background: var(--cr-cream); color: var(--cr-heading); border-left: 3px solid var(--cr-teal); }
.cr-contact-form__notice--error { background: #FBEAEA; color: #8A1F1F; border-left: 3px solid #B33A3A; }
.cr-contact-form .screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}
