/* Memomaister: shared presentation of the existing site.
 * Draft-only until publication. No content, media or commerce setting changes.
 * Do not hide articles, captions, forms, gallery items or useful sidebar blocks.
 */
body.mm-site {
    background-color: var(--mm-paper) !important;
    background-image: none !important;
    color: var(--mm-ink);
}
body.mm-site:not(:has(#mm-home)) #main > article > .entry-header {
    margin: 0 0 28px;
    padding: 0;
    background: transparent;
    border: 0;
}
body.mm-site:not(:has(#mm-home)) #content h1,
body.mm-site:not(:has(#mm-home)) #intro-container h1 {
    font: 400 clamp(30px, 3.6vw, 48px)/1.16 Georgia, serif !important;
    font-style: normal !important;
    text-transform: none !important;
    letter-spacing: -.02em !important;
    overflow-wrap: break-word;
    color: var(--mm-ink) !important;
    text-shadow: none !important;
}
body.mm-site:not(:has(#mm-home)) #content h1::before { display: none !important; }
body.mm-site #content .entry-content :where(h2, h3, h4) { margin-top: 1.35em; }
body.mm-site #content .entry-content :where(ul, ol) { padding-inline-start: 1.5em; }
body.mm-site #content .entry-content :where(li + li) { margin-top: .35em; }
body.mm-site #content .entry-content :where(blockquote) {
    border-inline-start: 3px solid var(--mm-accent);
    background: #f0eee7;
    padding: 20px 24px;
    margin-inline: 0;
    color: var(--mm-ink);
}
body.mm-site #content :where(figcaption, .wp-caption-text) {
    margin-top: 10px;
    padding-inline: 4px;
    line-height: 1.6;
}
body.mm-site #content :where(table) {
    border-collapse: collapse;
    border-color: var(--mm-line);
    max-width: 100%;
}
body.mm-site #content :where(th, td) {
    padding: 12px 14px;
    border-color: var(--mm-line);
    text-align: start;
    vertical-align: top;
}
body.mm-site #content :where(thead) { background: #f0eee7; color: var(--mm-ink); }
body.mm-site #content :where(pre, code) { overflow-wrap: anywhere; }

/* Article, category and search lists share one card design. */
body.mm-site:is(.blog, .archive, .search):not(.woocommerce) .site-content-inner { display: block !important; }
body.mm-site:is(.blog, .archive, .search):not(.woocommerce) #primary {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
}
body.mm-site:is(.blog, .archive, .search) #posts {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin: 0 !important;
}
body.mm-site:is(.blog, .archive, .search) #posts::before,
body.mm-site:is(.blog, .archive, .search) #posts::after { display: none; }
body.mm-site:is(.blog, .archive, .search) #posts > article {
    display: flex !important;
    flex-direction: column !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 0 24px !important;
    float: none !important;
    border: 1px solid var(--mm-line) !important;
    border-radius: 6px;
    background: var(--mm-surface) !important;
}
body.mm-site:is(.blog, .archive, .search) #posts .entry-media,
body.mm-site:is(.blog, .archive, .search) #posts figure { margin: 0 !important; padding: 0 !important; }
body.mm-site:is(.blog, .archive, .search) #posts .entry-media img {
    display: block;
    width: 100% !important;
    height: 270px !important;
    object-fit: contain !important;
    background: #f0eee7;
    border-radius: 5px 5px 0 0;
}
body.mm-site:is(.blog, .archive, .search) #posts .entry-header { padding: 24px 24px 10px !important; margin: 0 !important; background: transparent !important; }
body.mm-site:is(.blog, .archive, .search) #posts .entry-title {
    font: 400 clamp(24px, 2.4vw, 30px)/1.25 Georgia, serif !important;
    letter-spacing: -.015em;
    margin: 0 !important;
    overflow-wrap: break-word;
}
body.mm-site:is(.blog, .archive, .search) #posts .entry-title a { color: var(--mm-ink); }
body.mm-site:is(.blog, .archive, .search) #posts .entry-meta { margin: 0 0 12px !important; padding: 0 24px !important; font: 13px/1.6 Arial, sans-serif !important; color: var(--mm-muted); }
body.mm-site:is(.blog, .archive, .search) #posts .entry-content { width: auto !important; padding: 0 24px !important; font-size: 16px !important; }
body.mm-site:is(.blog, .archive, .search) #posts .link-more { margin: 18px 0 0; }
body.mm-site:is(.blog, .archive, .search):not(.woocommerce) #secondary { width: 100% !important; float: none !important; margin: 44px 0 0 !important; padding: 28px 0 0 !important; border-top: 1px solid var(--mm-line); }
body.mm-site #content .pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 36px; }
body.mm-site #content .pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--mm-line); border-radius: 4px; background: var(--mm-surface); color: var(--mm-ink); }
body.mm-site #content .pagination .current { background: var(--mm-green); color: #fff; border-color: var(--mm-green); }

/* Existing shop: visual changes only. Never change product fields or purchase flow. */
body.mm-site .woocommerce ul.products li.product { background: var(--mm-surface); border: 1px solid var(--mm-line); border-radius: 6px; padding: 18px; box-sizing: border-box; }
body.mm-site .woocommerce ul.products li.product img { object-fit: contain !important; height: auto; }
body.mm-site #content .woocommerce-loop-product__title { font: 400 23px/1.3 Georgia, serif !important; }
body.mm-site #content .woocommerce div.product .product_title { font-style: normal !important; }
body.mm-site .woocommerce div.product .woocommerce-product-gallery img { object-fit: contain; }
body.mm-site .woocommerce :where(.woocommerce-info, .woocommerce-message) { border-top-color: var(--mm-green); background: #f0eee7; color: var(--mm-ink); }

/* Forms retain validation, required fields and the original destinations. */
body.mm-site :where(.wpforms-container, .woocommerce, #commentform, .search-form, .woocommerce-product-search) :where(input:not([type=hidden]):not([type=checkbox]):not([type=radio]), textarea, select) {
    box-sizing: border-box;
    max-width: 100%;
    min-height: 44px;
    border-radius: 4px;
    font-size: 16px;
}
body.mm-site :where(.wpforms-container) :where(label, .wpforms-field-label) { color: var(--mm-ink); }
body.mm-site :where(.wpforms-container, #commentform) :where(button[type=submit], input[type=submit]),
body.mm-site #colophon button[type=submit] {
    min-height: 46px;
    padding: 11px 20px;
    border: 1px solid var(--mm-green);
    border-radius: 4px;
    background: var(--mm-green);
    color: #fff;
    font: 16px/1.4 Arial, sans-serif;
}
body.mm-site :where(button, input[type=submit]):disabled { opacity: .6; cursor: not-allowed; }
body.mm-site :where(.wpforms-error, .woocommerce-error) { color: #9d2828; }

/* Keep every existing footer widget, social link, search field and legal link. */
body.mm-site #colophon { background: #333c2d !important; color: #f0f0e8 !important; font: 15px/1.7 Arial, sans-serif; }
body.mm-site #colophon :where(.site-footer-area) { background: transparent !important; border-color: #68705f; }
body.mm-site #colophon :where(.site-footer-area-inner) { max-width: 1128px; margin-inline: auto; }
body.mm-site #colophon :where(h2, h3, .widget-title) { color: #fff !important; font-family: Georgia, serif !important; font-style: normal !important; font-weight: 400 !important; text-transform: none !important; letter-spacing: 0 !important; }
body.mm-site #colophon :where(h2, .widget-title) { font-size: 24px !important; line-height: 1.25; margin-bottom: 18px; }
body.mm-site #colophon :where(h3) { font-size: 18px !important; line-height: 1.4; }
body.mm-site #colophon :where(a) { color: #f9f8f3 !important; text-underline-offset: 4px; }
body.mm-site #colophon a:hover { color: #ead1b3 !important; }
body.mm-site #colophon .widget { min-width: 0; border-color: #68705f; }
body.mm-site #colophon .woocommerce-product-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
body.mm-site #colophon .woocommerce-product-search .search-field { flex: 1 1 190px; width: auto; min-width: 0; background: var(--mm-surface); color: var(--mm-ink); padding: 10px 14px; }
body.mm-site #colophon .woocommerce-product-search button { background: #f0eee7; border-color: #f0eee7; color: var(--mm-ink); }

@media (max-width: 650px) {
    body.mm-site:is(.blog, .archive, .search) #posts { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    body.mm-site:is(.blog, .archive, .search) #posts .entry-media img { height: 235px !important; }
    body.mm-site:is(.blog, .archive, .search) #posts .entry-header { padding: 20px 20px 10px !important; }
    body.mm-site:is(.blog, .archive, .search) #posts .entry-meta,
    body.mm-site:is(.blog, .archive, .search) #posts .entry-content { padding-inline: 20px !important; }
    body.mm-site #content :where(th, td) { padding: 9px; }
    body.mm-site #colophon :where(.widget-area) { display: block; }
    body.mm-site #colophon .widget { float: none; width: 100%; margin: 0 0 28px !important; }
    body.mm-site #colophon .footer-menu-inner { display: block; }
    body.mm-site #colophon .woocommerce-product-search { margin-top: 20px; }
}

/* Keep WordPress's hierarchy in the all-sections panel. */
body.mm-site #mm-shared-header .mm-shell-menu nav { display: block; }
body.mm-site #mm-shared-header .mm-shell-menu:not([open]) nav { display: none; }
body.mm-site #mm-all-sections .mm-sections-tree {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px; margin: 0; padding: 0; list-style: none;
}
body.mm-site #mm-all-sections .mm-sections-tree li { min-width: 0; margin: 0; padding: 0; list-style: none; }
body.mm-site #mm-all-sections .mm-sections-tree a { display: block; min-height: 44px; }
body.mm-site #mm-all-sections .mm-sections-children { margin: 5px 0 0; padding: 0 0 0 14px; list-style: none; border-left: 2px solid var(--mm-line); }
body.mm-site #mm-all-sections .mm-menu-group { display: block; padding: 10px 2px; color: var(--mm-accent); font: 600 15px/1.5 Arial, sans-serif; }
body.mm-site #mm-all-sections .mm-sections-tree > li > a { font-weight: 600; }
/* On short landscape screens the native menu must fit even before JS runs. */
html.no-js body.mm-site #mm-shared-header .mm-shell-menu nav { max-height: min(60vh, max(80px, calc(100vh - 190px))); }
/* Restore the existing WordPress footer on pages carrying inline home markup. */
body.mm-site:has(#mm-home) #colophon { display: block !important; }
body.mm-site:has(#mm-home) #colophon .site-footer-area-inner { width: calc(100% - 72px); padding: 24px 0; }
body.mm-site #colophon .mm-footer-supplement { max-width: 1128px; margin: auto; padding: 24px 0 !important; border-bottom: 1px solid #68705f; color: #f0f0e8; }
body.mm-site #colophon .mm-footer-supplement .mm-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; padding: 0; }
body.mm-site #colophon .mm-footer-supplement .mm-wrap > div { display: flex; flex-wrap: wrap; gap: 14px 24px; }
body.mm-site #mm-home [data-mm-footer-supplement] { padding-block: 24px !important; }
body.mm-site #colophon .widget-area { min-width: 0; }
/* Keep the existing contact details readable and reachable on small screens. */
body.mm-site .contacts-card p[style*="font-size:11px"] { color: var(--mm-muted) !important; font-size: 13px !important; }
body.mm-site .contacts-card a { max-width: 100%; overflow-wrap: anywhere; }
body.mm-site .contacts-card a:is([href^="tel:"],[href^="mailto:"],[href^="viber:"],[href^="https://wa.me/"],[href^="https://t.me/"],[href^="https://www.facebook.com/"]) { display: inline-block !important; min-height: 44px; padding-top: 10px !important; padding-bottom: 10px !important; box-sizing: border-box; }
@media (max-width:650px) {
    body.mm-site .contacts-card { padding: 20px !important; border-radius: 6px !important; }
}
/* Native image sources and a non-JavaScript gallery fallback. */
body.mm-site .mm-gallery-native .img-wrapper { background: #f0eee7; }
body.mm-site .mm-gallery-native .img-wrapper img { object-fit: contain !important; }
html.no-js body.mm-site .mm-gallery-native .gallery-isotope-wrapper { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)); height: auto !important; }
html.no-js body.mm-site .mm-gallery-native .gt3pg-isotope-item { position: relative !important; width: auto !important; height: auto !important; inset: auto !important; transform: none !important; opacity: 1 !important; visibility: visible !important; }
html.no-js body.mm-site .mm-gallery-native .img-wrapper img { opacity: 1 !important; visibility: visible !important; }
@media (max-width:760px) {
    body.mm-site #mm-all-sections .mm-sections-tree { grid-template-columns: minmax(0,1fr); gap: 14px; }
    body.mm-site:has(#mm-home) #colophon .site-footer-area-inner,
    body.mm-site #colophon .mm-footer-supplement { width: calc(100% - 40px); }
    html.no-js body.mm-site .mm-gallery-native .gallery-isotope-wrapper { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:480px) {
    html.no-js body.mm-site .mm-gallery-native .gallery-isotope-wrapper { grid-template-columns: minmax(0,1fr); }
}
