/* ===== MUU MART — blog posts, analog print look =====
   Paste at the TOP of Appearance > Customize > Additional CSS
   (the @import line must be first). Scoped to single posts + blog archives. */
@import url("https://fonts-api.wp.com/css?family=Cormorant+Garamond:400,500,600,400italic,500italic,600italic|Shippori+Mincho:400,500,600&display=swap");

.single-post, .blog, .archive {
  --mp-c:#14231A; --mp-c2:#1F3A29; --mp-lich:#D8DDC2; --mp-pap:#EDEFE2;
  --mp-fern:#5B7B3E; --mp-seed:#D1A53B; --mp-red:#A8432F; --mp-kraft:#E3D6B2; --mp-card:#FAF6E9;
  --mp-ser:'Cormorant Garamond','Shippori Mincho','Hiragino Mincho ProN','Yu Mincho',serif;
  background:var(--mp-pap);
}

/* film grain */
.single-post::after, .blog::after, .archive::after {
  content:"";position:fixed;inset:-50%;width:200%;height:200%;pointer-events:none;z-index:9990;
  opacity:.16;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1  0 0 0 0 .1  0 0 0 0 .05  0 0 0 1.1 -.15'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@media (prefers-reduced-motion:no-preference){
  .single-post::after, .blog::after, .archive::after{animation:mp-grain 1.1s steps(1) infinite}
  @keyframes mp-grain{0%{transform:translate(0,0)}20%{transform:translate(-3%,2%)}40%{transform:translate(2%,-3%)}60%{transform:translate(-2%,-1%)}80%{transform:translate(3%,3%)}}
}

/* type */
.single-post :is(.entry-content,.entry-title,.page-title,.entry-meta,.ct-related-posts),
.single-post :is(.entry-content,.ct-related-posts) :is(h1,h2,h3,h4,p,li,a,blockquote,figcaption),
.blog :is(.entry-card,.page-title), .archive :is(.entry-card,.page-title){
  font-family:var(--mp-ser)!important;
}
.single-post .entry-content{color:var(--mp-c);font-size:1.2rem;line-height:1.95;font-weight:500}
.single-post .entry-content a{color:var(--mp-c2);text-decoration:underline dotted;text-underline-offset:4px}
.single-post .entry-content a:hover{background:rgba(209,165,59,.45)}

/* title: marker highlight, centered */
.single-post :is(.page-title,.entry-title){
  text-align:center;color:var(--mp-c)!important;font-weight:600!important;letter-spacing:.03em;line-height:1.3;
}
.single-post .hero-section :is(.page-title,.entry-title){
  display:inline;background:linear-gradient(transparent 60%,rgba(209,165,59,.55) 60%);
  -webkit-box-decoration-break:clone;box-decoration-break:clone;padding:0 .15em;
}
.single-post .hero-section{text-align:center}
.single-post .entry-meta, .single-post .entry-meta a{
  justify-content:center;color:var(--mp-fern)!important;letter-spacing:.08em;font-size:.95rem;
}

/* headings: wavy underline on h2, stamp-ish h3 */
.single-post .entry-content h2{
  text-align:center;font-weight:600;letter-spacing:.06em;margin:3.2rem 0 1.6rem;padding-bottom:.6rem;
  background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='10' viewBox='0 0 44 10'><path d='M0 5 Q5.5 0 11 5 T22 5 T33 5 T44 5' fill='none' stroke='%2314231A' stroke-width='1.6' stroke-linecap='round' opacity='.55'/></svg>") repeat-x 50% 100%/44px 10px;
}
.single-post .entry-content h3{
  font-weight:600;letter-spacing:.04em;color:var(--mp-c2);margin:2.4rem 0 1rem;
  border-left:4px solid var(--mp-red);padding-left:.8rem;
}

/* images: taped polaroids */
.single-post .entry-content figure:not(.wp-block-embed):not(.wp-block-gallery) img,
.single-post .ct-media-container img, .single-post .entry-content .wp-block-image img{
  border-radius:0!important;filter:sepia(.14) saturate(.92) contrast(1.05);
}
.single-post .entry-content .wp-block-image:not(.alignfull){
  background:var(--mp-card);padding:12px 12px 12px;border:1px solid rgba(20,35,26,.3);
  box-shadow:6px 7px 0 rgba(20,35,26,.88);transform:rotate(-.6deg);margin-block:2.4rem;
}
.single-post .entry-content .wp-block-image:not(.alignfull):nth-of-type(even){transform:rotate(.7deg)}
.single-post .entry-content .wp-block-image figcaption{font-style:italic;color:var(--mp-fern);text-align:center;margin-top:.6rem}

/* quotes + pullquotes: kraft index card */
.single-post .entry-content :is(blockquote,.wp-block-quote,.wp-block-pullquote){
  background:var(--mp-kraft)!important;color:var(--mp-c)!important;border:1.5px solid var(--mp-c)!important;
  border-left:1.5px solid var(--mp-c)!important;border-radius:2px!important;
  box-shadow:5px 5px 0 var(--mp-c);padding:1.6rem 1.8rem;margin:2.6rem 0;transform:rotate(-.3deg);font-style:italic;
}
.single-post .entry-content :is(blockquote,.wp-block-pullquote) :is(p,cite){color:var(--mp-c)!important}
.single-post .entry-content cite{font-style:normal;letter-spacing:.06em;font-size:.95rem}

/* remap theme colour blocks used inside older posts */
.single-post .has-primary-background-color{background-color:var(--mp-c)!important;color:var(--mp-pap)!important}
.single-post .has-secondary-background-color{background-color:var(--mp-lich)!important;color:var(--mp-c)!important}
.single-post .has-contrast-background-color{background-color:var(--mp-c)!important;color:var(--mp-pap)!important}
.single-post .has-base-background-color{background-color:var(--mp-pap)!important}
.single-post .has-primary-background-color :is(h1,h2,h3,p,li),
.single-post .has-contrast-background-color :is(h1,h2,h3,p,li){color:var(--mp-pap)!important}

/* lists, rules, code, tables */
.single-post .entry-content hr, .single-post .entry-content .wp-block-separator{
  border:0!important;border-top:2px dashed var(--mp-c)!important;opacity:.55;background:none!important;max-width:240px;margin:2.8rem auto;
}
.single-post .entry-content :is(ul,ol) li::marker{color:var(--mp-red)}
.single-post .entry-content .wp-block-code, .single-post .entry-content pre{
  background:var(--mp-card);color:var(--mp-c);border:1.5px solid var(--mp-c);border-radius:2px;box-shadow:4px 4px 0 var(--mp-c);
}
.single-post .entry-content table{border-collapse:collapse;width:100%}
.single-post .entry-content :is(td,th){border:0;border-bottom:2px dotted rgba(20,35,26,.4);padding:.7rem .5rem}
.single-post .entry-content th{text-transform:uppercase;letter-spacing:.08em;text-align:left}

/* buttons: ticket style */
.single-post .entry-content .wp-block-button__link, .single-post .entry-content .wp-element-button{
  background:var(--mp-seed)!important;color:var(--mp-c)!important;border:2px solid var(--mp-c)!important;border-radius:2px!important;
  box-shadow:4px 4px 0 var(--mp-c);font-family:var(--mp-ser)!important;font-weight:600;letter-spacing:.08em;text-decoration:none;
  transition:transform .12s steps(2),box-shadow .12s steps(2),background .12s,color .12s;
}
.single-post .entry-content .wp-block-button__link:hover{transform:translate(2px,2px);box-shadow:2px 2px 0 var(--mp-c);background:var(--mp-c)!important;color:var(--mp-pap)!important}

/* cards: related posts + archive/blog lists */
.single-post .ct-related-posts .ct-media-container, .blog .entry-card .ct-media-container, .archive .entry-card .ct-media-container{border-radius:0}
.single-post .ct-related-posts article, .blog .entry-card, .archive .entry-card{
  background:var(--mp-card);border:1.5px solid var(--mp-c);border-radius:2px!important;padding:1.1rem 1.1rem 1.4rem;
  box-shadow:5px 5px 0 var(--mp-c);transform:rotate(-.5deg);transition:transform .18s steps(3),box-shadow .18s steps(3);
}
.blog .entry-card:nth-child(even), .archive .entry-card:nth-child(even){transform:rotate(.5deg)}
.single-post .ct-related-posts article:hover, .blog .entry-card:hover, .archive .entry-card:hover{
  transform:rotate(0) translate(-2px,-3px);box-shadow:8px 9px 0 var(--mp-c);
}
:is(.blog,.archive) .entry-card :is(.entry-title,.entry-title a){font-weight:600!important;color:var(--mp-c)!important}
:is(.blog,.archive) .entry-card .entry-excerpt{color:var(--mp-c2)}
:is(.blog,.archive) .page-title{text-align:center;text-transform:uppercase;letter-spacing:.07em;font-weight:600}

/* prev/next + pagination */
.single-post .post-navigation a, :is(.blog,.archive) .ct-pagination a, :is(.blog,.archive) .ct-pagination span{
  border:2px solid var(--mp-c)!important;border-radius:2px!important;background:var(--mp-card);box-shadow:3px 3px 0 var(--mp-c);color:var(--mp-c)!important;
}

/* mobile: tame the tilt */
@media (max-width:689px){
  .single-post .entry-content .wp-block-image:not(.alignfull){transform:none;box-shadow:4px 5px 0 rgba(20,35,26,.88)}
  .single-post .entry-content{font-size:1.1rem}
}
@media (prefers-reduced-motion:reduce){
  .single-post *, .blog *, .archive *{transition:none!important}
}

/* ===== MUU MART — footer that grows out of the last block on each page =====
   Paste at the BOTTOM of Appearance > Customize > Additional CSS
   (below the blog CSS; the @import stays at the very top). */

/* 1. work out what colour the page ends in */
body{--ft-top:#EDEFE2;--ft-text:#D8DDC2;--ft-link:#D1A53B}

/* ends in a lichen section (alt / buy) */
body:has(.muu-product > .mp-alt:last-child),
body:has(.muu-product > .mp-buy:last-child),
body:has(.muu-product > .mp-gallery:last-child){--ft-top:#D8DDC2}

/* ends in the donation block (cream) — shop, home, about, for-the-earth */
body:has(.wpcom-ai-donations-outer-wrap:last-child){--ft-top:#FFF9F1}

/* ends in a dark section: footer simply continues the dark green */
body:has(.muu-product > .mp-dark:last-child){--ft-top:#14231A}

/* ends in a cover / photo block: fade from the deep green of the photo */
body:has(.entry-content > .wp-block-cover:last-child){--ft-top:#1F3A29}

/* blog posts & archives end on paper */
body.single-post, body.blog, body.archive{--ft-top:#EDEFE2}

/* ===== MUU MART: paste into Appearance > Customize > Additional CSS ===== */
/* Gives blog posts the same header + footer as the pages, and fixes small contrast / tap-size gaps sitewide. */

/* --- contrast: slightly deeper green + red so small text passes AA (4.5:1) --- */
.muu-product {
  --fern: #4b6a30;
  --red: #9c3b28;
}

/* --- bigger tap targets on touch screens --- */
@media (pointer: coarse) {
  .mp-crumb a,
  #footer .ct-menu-link {
    display: inline-block;
    padding-block: 0.55rem;
  }
  #footer .ct-menu-link {
    min-height: 44px;
  }
}

/* --- header + footer (same look as the pages) --- */
#header,
#footer,
#offcanvas {
  --hf-ser:
    "Cormorant Garamond", "Shippori Mincho", "Hiragino Mincho ProN",
    "Yu Mincho", serif;
}
#header .ct-menu-link {
  font-family: var(--hf-ser) !important;
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.09em;
  color: #14231a !important;
  text-transform: uppercase;
  text-decoration: none;
}
#header .menu > li > .ct-menu-link:hover,
#header .menu > li:focus-within > .ct-menu-link {
  text-decoration: underline;
  text-decoration-color: rgba(209, 165, 59, 0.75);
  text-decoration-thickness: 0.5em;
  text-underline-offset: -0.22em;
  text-decoration-skip-ink: none;
}
#header .menu > li.current-menu-item > .ct-menu-link,
#header .menu > li.current-menu-ancestor > .ct-menu-link {
  color: #a8432f !important;
  text-decoration: underline;
  text-decoration-color: rgba(209, 165, 59, 0.75);
  text-decoration-thickness: 0.5em;
  text-underline-offset: -0.22em;
  text-decoration-skip-ink: none;
}
#header :is(.ct-header-search, .ct-cart-item, .ct-header-trigger) {
  color: #14231a !important;
  --theme-icon-color: #14231a;
  --theme-icon-hover-color: #a8432f;
}
#header .ct-dynamic-count-cart {
  background: #a8432f !important;
  color: #edefe2 !important;
  border-radius: 2px;
}
#header .sub-menu {
  background: #faf6e9 !important;
  border: 1.5px solid #14231a;
  border-radius: 2px;
  box-shadow: 5px 5px 0 #14231a;
}
#header .sub-menu .ct-menu-link {
  text-transform: none;
  letter-spacing: 0.04em;
  text-decoration: none !important;
}
#header .sub-menu li:hover > .ct-menu-link {
  background: #d1a53b !important;
}
#header a:focus-visible,
#header button:focus-visible,
#footer a:focus-visible {
  outline: 3px dashed #a8432f;
  outline-offset: 4px;
}
@media (min-width: 1000px) and (max-width: 1360px) {
  #header .ct-menu-link {
    font-size: 0.9rem !important;
    letter-spacing: 0.03em;
  }
  #header .menu > li > .ct-menu-link {
    padding-inline: 0.45rem !important;
  }
  #header #menu-item-5243,
  #header #menu-item-5242 {
    display: none;
  }
}
#offcanvas .ct-panel-inner {
  background: #edefe2 !important;
}
#offcanvas .ct-menu-link {
  font-family: var(--hf-ser) !important;
  font-size: 1.3rem !important;
  font-weight: 600 !important;
  color: #14231a !important;
  letter-spacing: 0.06em;
}
#offcanvas .current-menu-item > .ct-menu-link {
  color: #a8432f !important;
}
#offcanvas :is(.ct-toggle-dropdown-mobile, .ct-toggle-close) {
  color: #14231a !important;
}
#offcanvas .ct-icon {
  fill: #14231a;
}
#footer {
  background: #14231a;
  color: #d8ddc2;
  font-family: var(--hf-ser);
  margin-top: -10px;
  padding-top: 10px;
  padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  clip-path: polygon(
    0 7px,
    4% 2px,
    9% 8px,
    15% 3px,
    22% 9px,
    29% 4px,
    36% 8px,
    44% 2px,
    51% 7px,
    58% 3px,
    66% 9px,
    73% 4px,
    81% 8px,
    88% 2px,
    94% 7px,
    100% 3px,
    100% 100%,
    0 100%
  );
}
#footer [data-row] {
  min-height: 0 !important;
}
#footer [data-row] > div {
  grid-template-columns: minmax(0, 1fr) !important;
}
#footer [data-column="ghost"] {
  display: none;
}
#footer [data-column="menu"],
#footer [data-column="socials"],
#footer [data-column="copyright"] {
  justify-content: center;
  text-align: center;
}
#footer [data-row="top"] {
  padding-top: 2.6rem;
  padding-bottom: 0;
}
#footer .footer-menu-inline .menu {
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem 1.8rem;
}
#footer .ct-menu-link {
  font-family: var(--hf-ser) !important;
  font-size: 1.05rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em;
  text-transform: none !important;
  color: #d8ddc2 !important;
  transition: color 0.12s steps(2);
}
#footer .ct-menu-link:hover,
#footer .current-menu-item > .ct-menu-link {
  color: #d1a53b !important;
}
#footer :is(.ct-footer-socials, .ct-social-box) {
  justify-content: center;
  width: 100%;
}
#footer .ct-social-box a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  --theme-icon-color: #d8ddc2;
  --theme-icon-hover-color: #d1a53b;
}
#footer .ct-social-box svg {
  fill: #d8ddc2;
  transition: fill 0.12s steps(2);
}
#footer .ct-social-box a:hover svg {
  fill: #d1a53b;
}
#footer [data-row="middle"] {
  padding-block: 0.8rem;
}
#footer [data-row="bottom"] {
  border-top: 2px dotted rgba(216, 221, 194, 0.35);
  padding-top: 1.2rem;
}
#footer .ct-footer-copyright,
#footer .ct-footer-copyright p {
  color: rgba(216, 221, 194, 0.85) !important;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}
.ct-back-to-top {
  background: #14231a !important;
  color: #edefe2 !important;
  border: 2px solid #edefe2;
  border-radius: 2px !important;
  box-shadow: 3px 3px 0 #d1a53b;
}
.ct-back-to-top svg,
.ct-back-to-top .ct-icon {
  fill: #edefe2 !important;
}
@media (max-width: 689px) {
  #footer .footer-menu-inline .menu {
    gap: 0.2rem 1.2rem;
  }
  #footer .ct-menu-link {
    font-size: 1rem !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  #header *,
  #footer * {
    animation: none !important;
    transition: none !important;
  }
}
