/* ==========================================================================
   PetsYarn — WordPress & Elementor layer
   Additions on top of styles.css (the original static design).
   ========================================================================== */

[hidden] { display: none !important; }

/* ---------- Elementor: PetsYarn sections are full-bleed ---------- */
.e-con:where(:has(> .elementor-widget[data-widget_type^="py_"])),
.e-con > .e-con-inner:where(:has(> .elementor-widget[data-widget_type^="py_"])) {
  --padding-top: 0px; --padding-bottom: 0px; --padding-left: 0px; --padding-right: 0px;
  --padding-block-start: 0px; --padding-block-end: 0px; --padding-inline-start: 0px; --padding-inline-end: 0px;
  --gap: 0px; --row-gap: 0px; --column-gap: 0px;
  --content-width: 100%; --container-max-width: 100%;
  max-width: none;
}
.elementor-section:where(:has(.elementor-widget[data-widget_type^="py_"])) > .elementor-container { max-width: none; }
.elementor-column:where(:has(> .elementor-widget-wrap > .elementor-widget[data-widget_type^="py_"])) > .elementor-widget-wrap { padding: 0; }
.elementor-widget[data-widget_type^="py_"] { width: 100%; margin-block-end: 0; }
.elementor-widget[data-widget_type^="py_"] .py-s { font-family: var(--font); }

/* Theme styles are loaded after Elementor's, these restore the few properties its image reset removes. */
.elementor .about__media img, .elementor .article-hero img, .elementor .prose figure img,
.elementor .feature-card img, .elementor .result__extra img, .elementor .byline__author img,
.elementor .author-box img, .elementor .inline-promo img { border-radius: var(--radius); }
.elementor .feature-card img, .elementor .result__extra img { border-radius: 8px; }
.elementor .byline__author img, .elementor .author-box img { border-radius: 50%; }
.elementor :is(.hero__main, .product__media, .post-feature__media, .post__media, .card__media, .gallery__main, .gallery__thumbs, .guide-cover, .wide-media, .result__media, .way__media, .bundle__media, .upsell__media) img { height: 100%; }

.elementor-editor-active .js .reveal, .elementor-editor-preview .js .reveal { opacity: 1; transform: none; }

/* ---------- header & admin bar ---------- */
.header--static { position: relative; }
.admin-bar .header { top: 32px; }
.logo--image img { display: block; width: auto; max-height: 44px; }
.footer .logo--image img { max-height: 52px; }
@media (max-width: 900px) {
  .admin-bar .nav { top: calc(72px + 32px); }
}
@media (max-width: 782px) {
  .admin-bar .header { top: 46px; }
  .admin-bar .nav { top: calc(72px + 46px); }
}
@media (max-width: 600px) {
  .admin-bar .header { top: 0; }
  .admin-bar .nav { top: 72px; }
}

/* ---------- layout helpers ---------- */
.section--flush-top { padding-top: 0; }
.section--pdp { padding-top: clamp(28px, 4vw, 48px); }
.section--contact { padding-top: clamp(40px, 6vw, 72px); }
.section--panels { padding-block: 24px var(--section); }
.bundle--standalone { margin-top: 0; }
.center--buttons { gap: 12px; flex-wrap: wrap; }
.py-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px !important; }
.py-empty { padding: 48px 0; text-align: center; }
.py-caption { margin: 10px 0 0; font-size: 13px; color: var(--text-3); }
.py-search-group + .py-search-group { margin-top: 64px; }
.py-404 { padding-bottom: var(--section); }
.py-404 .signup { margin-top: 28px; }
a.tab { display: inline-flex; align-items: center; }
.way--dark .kicker { color: var(--accent-bright); }
.checklist--plain { border: 0; padding-top: 8px; margin-top: 24px; }
.guide-band__inner--no-cover { grid-template-columns: 1fr auto; }
.form__error { margin: 12px 0 0; padding: 14px 16px; border-radius: 10px; background: #FDECEA; color: #9B2C1F; font-size: 15px; }
.fine a { text-decoration: underline; }

/* grids that adapt to the number of items on wide screens */
@media (min-width: 901px) {
  .trust__grid { grid-template-columns: repeat(var(--cols, 3), 1fr); }
  .values { grid-template-columns: repeat(var(--cols, 3), 1fr); }
  .about--flip { grid-template-columns: 1.1fr 1fr; }
  .about--flip .about__media { order: 2; }
}
@media (min-width: 641px) {
  .about__stats { grid-template-columns: repeat(var(--cols, 3), 1fr); }
}

/* two-column numbered steps (About page) */
.steps--two { grid-template-columns: 1fr 1fr; margin-top: 32px; }
.steps--two li:nth-child(odd) { padding-left: 0; border-left: 0; }
@media (max-width: 640px) {
  .steps--two { grid-template-columns: 1fr; }
  .steps--two li { padding-left: 0; border-left: 0; }
}

/* articles without enough headings for "On this page" */
@media (min-width: 901px) {
  .article-layout--no-toc { grid-template-columns: minmax(0, 760px); justify-content: center; }
}

/* ---------- pattern pieces (materials, rounds…) ---------- */
.py-piece { max-width: var(--wrap); margin: 32px auto; padding-inline: var(--gutter); }
.py-piece > * + * { margin-top: 1.2em; }
.py-piece > h2 { margin: 0 0 .7em; font-size: 28px; font-weight: 500; line-height: 1.2; letter-spacing: -.035em; }
.py-piece > h2 + * { margin-top: 0; }
.prose .py-piece { max-width: none; margin: 0; padding: 0; }
.prose .py-piece > h2 { margin-top: 2.2em; }
.prose > .elementor { margin-top: 0; }
.prose .elementor-widget + .elementor-widget,
.prose .e-con + .e-con,
.prose .elementor-section + .elementor-section { margin-top: 1.2em; }
.prose .py-piece.prose p { margin: 0; }
.prose .py-piece .upsell { margin: 1.6em 0; }

/* ---------- WordPress content ---------- */
.prose img { border-radius: var(--radius); }
.prose .alignleft { float: left; margin: .4em 1.6em 1em 0; }
.prose .alignright { float: right; margin: .4em 0 1em 1.6em; }
.prose .aligncenter { margin-inline: auto; }
.prose .wp-caption-text, .prose .wp-element-caption { margin-top: 10px; font-size: 13px; color: var(--text-3); }
.prose .wp-block-image img { height: auto; }
.prose .wp-block-button__link { display: inline-flex; align-items: center; height: 48px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose table:not(.table) { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose table:not(.table) td, .prose table:not(.table) th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sticky, .bypostauthor, .gallery-caption { outline: 0; }

/* pagination from paginate_links() */
.pagination .dots { border: 0; }
.pagination .prev, .pagination .next { font-size: 16px; }

/* ---------- comments ---------- */
.comments-area { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--line); font-size: 16px; }
.comments-title, .comment-reply-title { font-size: 22px; font-weight: 500; letter-spacing: -.025em; }
.comment-list { list-style: none; padding: 0 !important; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.comment-author img { width: 36px; height: 36px; border-radius: 50%; }
.comment-metadata { font-size: 13px; color: var(--text-3); }
.comment-metadata a, .comment-reply-link { color: var(--text-3) !important; text-decoration: none !important; }
.comment-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea {
  width: 100%; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
}
.comment-form .submit { height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 500; cursor: pointer; }
.comment-form .submit:hover { background: var(--accent-hover); }

/* ---------- Dropdown Navigation Menu ---------- */
.nav__item { position: relative; display: inline-flex; align-items: center; }
.nav__item--has-children > a { display: inline-flex; align-items: center; gap: 4px; }
.nav__dropdown {
  position: absolute; top: calc(100% + 14px); left: -14px; min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(43,38,35,.15), 0 2px 6px rgba(43,38,35,.04);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  pointer-events: none; z-index: 100; display: flex; flex-direction: column; gap: 2px;
}
.nav__dropdown::before {
  content: ""; position: absolute; top: -16px; left: 0; right: 0; height: 16px;
}
.nav__item--has-children:hover .nav__dropdown,
.nav__item--has-children:focus-within .nav__dropdown {
  opacity: 1; visibility: visible; transform: none; pointer-events: auto;
}
.nav__dropdown-link {
  display: block !important; padding: 8px 14px !important; border-radius: 8px !important;
  font-size: 14px !important; font-weight: 500 !important; color: var(--text-2) !important;
  text-decoration: none !important; white-space: nowrap !important;
  transition: background .15s, color .15s !important;
}
.nav__dropdown-link:hover, .nav__dropdown-link[aria-current="page"] {
  background: var(--tint) !important; color: var(--accent) !important;
}
.nav__dropdown-link::after { display: none !important; }
.nav .nav__cta-btn { display: none !important; }

@media (max-width: 900px) {
  .nav__item--has-children { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
  .nav__item--has-children > a { width: 100%; border-bottom: 1px solid var(--line); }
  .nav__dropdown {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; padding: 4px 0 8px 16px; background: transparent;
    width: 100%; margin-top: 0; pointer-events: auto; display: flex; flex-direction: column; gap: 0;
  }
  .nav__dropdown::before { display: none; }
  .nav__dropdown-link {
    display: block !important; padding: 10px 0 !important; font-size: 16px !important;
    border-radius: 0 !important; border-bottom: 1px solid var(--line) !important;
  }
  .nav__dropdown-link:last-child { border-bottom: none !important; }
  .header__tools .header__cta-btn { display: none !important; }
  .nav .nav__cta-btn {
    display: block !important; width: 100%; margin-top: 20px; padding: 12px 20px; text-align: center;
  }
}

/* ---------- Category Grid (3-column responsive) ---------- */
.category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 900px) {
  .category-grid { grid-template-columns: 1fr; gap: 20px; }
}
.category-card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius);
  overflow: hidden; background: var(--tint); border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.category-card:hover {
  transform: translateY(-4px); box-shadow: 0 16px 32px -12px rgba(43,38,35,.15);
}
.category-card__media {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #eae2d8;
}
.category-card__media img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease);
}
.category-card:hover .category-card__media img {
  transform: scale(1.05);
}
.category-card__copy {
  display: flex; flex-direction: column; flex: 1; padding: 24px;
}
.category-card__copy h3 {
  margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.03em; line-height: 1.2;
}
.category-card__copy p {
  margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2);
}
.category-card__copy .link {
  margin-top: 18px; align-self: flex-start;
}

/* ---------- Ad Slot Placeholders (CLS-protected) ---------- */
.ad-slot:empty {
  display: none !important;
}
.ad-slot {
  display: block; width: 100%;
  margin: 32px 0;
  position: relative; overflow: hidden; contain: layout;
}
.my-8 { margin-block: 32px; }

/* ---------- Single Pattern Callout & PDF Download Cards ---------- */
.pdf-callout {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 20px; padding: 24px 28px; margin: 28px 0 36px;
  border-radius: var(--radius); background: linear-gradient(135deg, #FCF6F0 0%, #F5E8DC 100%);
  border: 1px solid var(--line-strong); box-shadow: 0 4px 16px -4px rgba(43,38,35,.06);
}
.pdf-callout--bottom {
  margin-top: 48px; margin-bottom: 24px;
}
.pdf-callout__copy { flex: 1 1 340px; }
.pdf-callout__badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); margin-bottom: 6px;
}
.pdf-callout h3 {
  margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.025em; color: var(--text);
}
.pdf-callout p {
  margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-2);
}
.pdf-callout__actions {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.pdf-callout__price {
  font-size: 20px; font-weight: 600; color: var(--text);
}

/* ---------- Pattern Bottom Conversion Section ---------- */
.pattern-bottom-meta {
  margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line);
}
.pattern-sizing-link {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 500;
  font-size: 15px; color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px;
}
.pattern-sizing-link:hover { color: var(--accent-hover); }

/* ---------- Generic Modal Layer (Starter Guide & Checkout) ---------- */
.py-modal {
  position: fixed; inset: 0; z-index: 1000; display: grid;
  place-items: center; padding: 20px;
}
.py-modal[hidden] { display: none !important; }
.py-modal__backdrop {
  position: fixed; inset: 0; background: rgba(43,38,35,.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.py-modal__dialog {
  position: relative; z-index: 1; width: min(520px, 100%);
  background: #fff; border-radius: var(--radius); padding: 36px 32px;
  box-shadow: 0 24px 48px -12px rgba(43,38,35,.3);
  animation: py-modal-enter .25s var(--ease);
}
@keyframes py-modal-enter {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.py-modal__close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px;
  display: grid; place-items: center; border-radius: 50%;
  font-size: 24px; line-height: 1; color: var(--text-3); cursor: pointer;
  transition: background .15s, color .15s;
}
.py-modal__close:hover { background: var(--tint); color: var(--text); }
.signup--modal { margin-top: 20px; width: 100%; max-width: none; }
.checkout-modal-details {
  margin: 16px 0 24px; padding: 14px 18px; border-radius: 8px;
  background: var(--tint); font-size: 14px;
}
.checkout-modal-details div {
  display: flex; justify-content: space-between; padding-block: 4px;
}
.checkout-modal-details div:last-child {
  border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 600;
}

