/* Maintheme 0.4.0 presentation primitives. Logical properties keep RTL safe. */

:where(.wp-site-blocks) > :first-child { margin-block-start: 0; }
:where(.wp-site-blocks) > :last-child { margin-block-end: 0; }

.maintheme-main {
  min-height: 45vh;
  padding-block: clamp(1.75rem, 4vw, 4rem);
}

.maintheme-main--flush { padding-block: 0; }

.maintheme-announcement {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--small);
  padding-block: var(--wp--preset--spacing--20);
  text-align: center;
}
.maintheme-announcement p { margin: 0; }
.maintheme-announcement a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }

.maintheme-site-header {
  background: var(--wp--preset--color--base);
  background: color-mix(in srgb, var(--wp--preset--color--base) 94%, transparent);
  border-block-end: 1px solid var(--wp--preset--color--border);
  position: relative;
  z-index: var(--wp--custom--z-index--header);
}

.maintheme-header-inner { row-gap: var(--wp--preset--spacing--30); width: 100%; }
.maintheme-header-brand { flex: 0 1 auto; order: 1; }
.maintheme-header-inner > .maintheme-product-search { flex: 1 1 22rem; margin-inline: auto; max-width: 34rem; min-width: 14rem; order: 2; }
.maintheme-header-actions { flex: 0 0 auto; order: 3; }
.maintheme-primary-navigation { flex-basis: 100%; justify-content: center; order: 4; }
.maintheme-site-header .wp-block-search { min-width: 0; }
.maintheme-site-header .wp-block-search__inside-wrapper { border-color: var(--wp--preset--color--border); min-height: var(--wp--custom--control--height); }
.maintheme-site-header .wp-block-search__inside-wrapper,
.maintheme-site-header .wp-block-search__input { min-width: 0; }
.maintheme-site-header .wp-block-navigation__responsive-container-open,
.maintheme-site-header .wp-block-navigation__responsive-container-close { color: var(--wp--preset--color--contrast); }

.maintheme-site-footer { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.maintheme-site-footer a { color: inherit; }
.maintheme-checkout-footer { border-block-start: 1px solid var(--wp--preset--color--border); color: var(--wp--preset--color--muted); }
.maintheme-footer-contact address { display: grid; font-style: normal; gap: var(--wp--preset--spacing--20); }
.maintheme-footer-contact address > span { display: block; }
.maintheme-footer-contact a,
.maintheme-footer-social a { text-underline-offset: .2em; }
.maintheme-footer-social { display: flex; flex-wrap: wrap; gap: .5rem; margin-block-start: var(--wp--preset--spacing--30); }

.maintheme-card,
.is-style-maintheme-card,
.is-style-maintheme-interactive-card {
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--wp--custom--radius--medium);
  box-shadow: var(--wp--preset--shadow--subtle);
}
.is-style-maintheme-interactive-card { transition: box-shadow var(--wp--custom--transition--standard), transform var(--wp--custom--transition--standard); }
.is-style-maintheme-interactive-card:hover,
.is-style-maintheme-interactive-card:focus-within { box-shadow: var(--wp--preset--shadow--elevated); transform: translateY(-2px); }

.maintheme-surface-muted,
.is-style-maintheme-surface-muted { background: var(--wp--preset--color--surface); border-radius: var(--wp--custom--radius--medium); }
.is-style-maintheme-outline { border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--medium); }
.is-style-maintheme-rounded img,
.is-style-maintheme-rounded { border-radius: var(--wp--custom--radius--medium); }
.is-style-maintheme-soft .wp-block-button__link { background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--accent-strong); }
.is-style-maintheme-full,
.is-style-maintheme-full .wp-block-button__link { width: 100%; }
.is-style-maintheme-full .wp-block-button__link { text-align: center; }

.maintheme-hero { background: var(--wp--preset--gradient--accent-wash); border-radius: var(--wp--custom--radius--large); }
.maintheme-promo-panel,
.maintheme-newsletter { border-radius: var(--wp--custom--radius--large); }
.maintheme-brand-strip { border-block: 1px solid var(--wp--preset--color--border); }
.maintheme-brand-chip { border: 1px solid var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--pill); font-weight: 700; margin: 0; padding: .625rem 1.25rem; }

.maintheme-section-heading { align-items: end; display: flex; gap: var(--wp--preset--spacing--30); justify-content: space-between; }
.maintheme-section-heading > * { margin-block: 0; }
.maintheme-muted { color: var(--wp--preset--color--muted); }

.maintheme-empty-state { border: 1px dashed var(--wp--preset--color--border); border-radius: var(--wp--custom--radius--large); padding: clamp(2rem, 5vw, 5rem); text-align: center; }
.maintheme-category-intro { margin-block-end: var(--wp--preset--spacing--50); }
.maintheme-category-intro:empty { display: none; }

.wp-block-details { border-block-end: 1px solid var(--wp--preset--color--border); padding-block: var(--wp--preset--spacing--30); }
.wp-block-details summary { cursor: pointer; font-weight: 700; }
.wp-block-details > :not(summary) { color: var(--wp--preset--color--muted); }

.wp-block-latest-posts.is-grid { gap: var(--wp--preset--spacing--40); }
.wp-block-latest-posts__featured-image img { aspect-ratio: 16 / 10; border-radius: var(--wp--custom--radius--medium); object-fit: cover; width: 100%; }

.maintheme-visually-hidden { border: 0; clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }

@media (max-width: 781px) {
  .maintheme-section-heading { align-items: start; flex-direction: column; }
  .maintheme-header-inner { column-gap: var(--wp--preset--spacing--20); }
  .maintheme-header-brand { flex: 1 1 auto; }
  .maintheme-header-brand .wp-block-site-title { font-size: var(--wp--preset--font-size--small) !important; }
  .maintheme-header-actions { order: 2; }
  .maintheme-primary-navigation { flex-basis: auto; order: 3; }
  .maintheme-header-inner > .maintheme-product-search { flex-basis: 100%; max-width: none; min-width: 0; order: 4; }
}

@media (max-width: 420px) {
  .maintheme-header-brand .wp-block-site-logo { display: none; }
  .maintheme-header-actions { gap: var(--wp--preset--spacing--10); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
