/*
Theme Name: Maetoato V3
Theme URI: https://maetoato.com/
Author: Maetoato
Description: A new, accessible presentation layer for the Maetoato archive.
Version: 3.2.20-rc.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: maetoato-v3
*/

:root{--ink:#f4efe4;--muted:#aab7cc;--night:#091326;--panel:#101d34;--line:#31415c;--amber:#e9b28a;--teal:#8eb8b4;--measure:1120px;--reading:740px}
.entry-content img{max-width:100%;height:auto}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--night);color:var(--ink);font:16px/1.75 -apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif}a{color:#f0c49e;text-underline-offset:.22em}a:hover{color:#fff}a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid var(--amber);outline-offset:3px}.skip-link{position:absolute;left:1rem;top:-5rem;background:#fff;color:#111;padding:.7rem 1rem;z-index:20}.skip-link:focus{top:1rem}.site-header{border-bottom:1px solid #ffffff1b}.header-inner,.site-main,.site-footer-inner{width:min(calc(100% - 2.5rem),var(--measure));margin-inline:auto}.header-inner{min-height:78px;display:flex;align-items:center;justify-content:space-between;gap:1.5rem}.site-branding{display:flex;align-items:center;gap:.8rem;text-decoration:none;color:var(--ink);font-size:1.05rem;letter-spacing:.05em}.brand-mark{width:12px;height:12px;border:1px solid var(--amber);border-radius:50%;box-shadow:0 0 18px #e9b28a55}.menu-toggle{display:none;border:1px solid var(--line);background:var(--panel);color:var(--ink);border-radius:5px;padding:.55rem .8rem;font:inherit;cursor:pointer}.primary-nav ul{list-style:none;display:flex;gap:clamp(.8rem,2.5vw,2rem);padding:0;margin:0}.primary-nav a{text-decoration:none;color:var(--muted);font-size:.86rem}.primary-nav a:hover,.primary-nav .current-menu-item>a{color:var(--ink)}.site-main{min-height:65vh;padding-block:clamp(2.6rem,7vw,6rem)}.eyebrow{font-size:.7rem;text-transform:uppercase;letter-spacing:.2em;color:var(--amber)}h1,h2,h3{font-weight:450;line-height:1.28;letter-spacing:-.025em}h1{font-size:clamp(2.2rem,6vw,4.7rem);margin:.2em 0 .35em}h2{font-size:clamp(1.45rem,3vw,2.1rem)}.intro{max-width:760px;margin-bottom:3rem}.intro p{color:var(--muted)}.home-grid,.post-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.entry-card{position:relative;min-height:205px;padding:1.4rem;background:linear-gradient(135deg,#14213a,#0d192e);border:1px solid var(--line);border-radius:10px;text-decoration:none;color:var(--ink);transition:border-color .2s,transform .2s}.entry-card:hover{border-color:#9caecb;transform:translateY(-2px);color:var(--ink)}.entry-card .eyebrow{color:var(--teal)}.entry-card h2{font-size:1.5rem;margin:.65rem 0}.entry-card p{color:var(--muted);font-size:.9rem}.content-narrow{max-width:var(--reading);margin-inline:auto}.entry-header{margin-bottom:2.4rem}.entry-meta{font-size:.82rem;color:var(--muted)}.featured-image{margin:2rem 0}.featured-image img,.wp-block-image img{height:auto;max-width:100%;border-radius:8px}.entry-content>*{max-width:100%}.entry-content h2{margin-top:2.5em}.entry-content blockquote{border-left:2px solid var(--amber);margin-left:0;padding-left:1.2rem;color:#d6deeb}.entry-content img{height:auto}.archive-description{max-width:var(--reading);color:var(--muted);margin-bottom:2rem}.pagination{margin-top:2rem}.pagination .nav-links{display:flex;gap:.8rem;flex-wrap:wrap}.pagination a,.pagination span{padding:.45rem .75rem;border:1px solid var(--line);border-radius:4px}.search-form{display:flex;gap:.5rem;max-width:640px}.search-form label{flex:1}.search-field{width:100%;min-height:48px;padding:.6rem .8rem;background:#071021;border:1px solid var(--line);border-radius:5px;color:var(--ink);font:inherit}.search-submit{padding:.6rem 1.2rem;border:0;border-radius:5px;background:var(--ink);color:var(--night);font:inherit;cursor:pointer}.site-footer{border-top:1px solid #ffffff1b;padding:1.5rem 0;color:var(--muted);font-size:.8rem}.site-footer-inner{display:flex;justify-content:space-between;gap:1rem}.no-results{padding:1.5rem;border:1px solid var(--line);border-radius:8px}
@media(max-width:760px){.header-inner{min-height:68px;position:relative}.primary-nav{position:absolute;z-index:10;top:calc(100% + 1px);left:-1.25rem;right:-1.25rem;padding:0 1.25rem;background:var(--night);border-bottom:1px solid var(--line)}.primary-nav ul{display:block;padding:.5rem 0 1rem}.primary-nav li a{display:block;padding:.7rem 0;font-size:1rem}.js .primary-nav[hidden]{display:none}.home-grid,.post-grid{grid-template-columns:1fr}.entry-card{min-height:150px}.site-footer-inner{display:block}.site-main{padding-block:2.5rem}}
@media(min-width:761px){.primary-nav{display:block!important}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*:before,*:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}
.entry-card h2 a{color:var(--ink);text-decoration:none}.entry-card h2 a:hover{color:#f0c49e}.recent-records{margin-top:4rem}

/* Brand shell follows the saved Before and After theme artwork and structure. */
@font-face{font-family:Fahkwang;font-style:normal;font-weight:300;font-display:swap;src:url("assets/brand/fonts/fahkwang-v16-latin-300.woff2") format("woff2")}
@font-face{font-family:Fahkwang;font-style:normal;font-weight:400;font-display:swap;src:url("assets/brand/fonts/fahkwang-v16-latin-regular.woff2") format("woff2")}
@font-face{font-family:Fahkwang;font-style:normal;font-weight:500;font-display:swap;src:url("assets/brand/fonts/fahkwang-v16-latin-500.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans JP";font-style:normal;font-weight:400;font-display:swap;src:url("assets/brand/fonts/IBMPlexSansJP-Regular.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Sans JP";font-style:normal;font-weight:500;font-display:swap;src:url("assets/brand/fonts/IBMPlexSansJP-Medium.woff2") format("woff2")}
:root{--brand-cream:#fff5e6;--brand-blue:#00f;--brand-orange:#ff643c;--brand-line:linear-gradient(90deg,rgb(0 0 255/.3) 6px,transparent 6px,transparent 7px) left bottom/8px 1px repeat-x;--font-en:"Fahkwang",sans-serif;--font-jp:"IBM Plex Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif}
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.svg-sprite{position:absolute;width:0;height:0;overflow:hidden}
#masthead.site-header{position:relative;z-index:30;padding:1.5rem max(1.25rem,4.4vw);background:var(--brand-cream);border:0;color:var(--brand-blue)}
#masthead .site-header-inr{width:min(100%,1440px);min-height:0;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:1rem}
#masthead .site-branding{display:flex;align-items:center;gap:0;color:var(--brand-blue);font-size:inherit;line-height:1}
#masthead .custom-logo-link{display:block;width:6.8rem;color:var(--brand-blue);line-height:0}
#masthead .site-logo{display:block;width:100%;height:auto;color:var(--brand-blue)}
#masthead .site-header-title{flex:1;text-align:center;color:var(--brand-blue);font-family:var(--font-en,Georgia,serif);font-size:1.2rem;letter-spacing:.04em}
#masthead .site-header-title a{color:inherit;text-decoration:none}
.menu-open{overflow:hidden}
@media(min-width:960px){#masthead.site-header{padding-block:2rem}#masthead .custom-logo-link{width:8.4rem}#masthead .site-header-inr::after{content:"";display:block;width:8.4rem}}
@media(min-width:1280px){#masthead.site-header{padding-block:2.9vw}#masthead .custom-logo-link,#masthead .site-header-inr::after{width:6.1vw}}
@media(max-width:760px){#masthead.site-header{padding:1.1rem 1.25rem}#masthead .custom-logo-link{width:5.2rem}#masthead .site-header-title{display:none}}


/* Visual recovery: the saved brand palette belongs to WordPress-owned surfaces.
 * Locked HUB/MAP and their historical renderers keep their existing dark tokens. */
body.maetoato-v3:not(.hub-surface){
  --ink:#25285c;--muted:#5b65b6;--night:#fff5e6;--panel:#fffaf1;
  --line:rgba(0,0,255,.18);--amber:#ff643c;--teal:#141fb4;
  background:var(--brand-cream);color:var(--ink);
  font-family:var(--font-jp,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif);
}
body.maetoato-v3:not(.hub-surface) a{color:var(--brand-blue);}
body.maetoato-v3:not(.hub-surface) a:hover{color:var(--brand-orange);}
body.maetoato-v3:not(.hub-surface) h1,body.maetoato-v3:not(.hub-surface) h2,
body.maetoato-v3:not(.hub-surface) h3,body.maetoato-v3:not(.hub-surface) h4{
  color:var(--ink);font-family:var(--font-jp,sans-serif);
}
body.maetoato-v3:not(.hub-surface) .eyebrow{color:var(--brand-orange);}
body.maetoato-v3:not(.hub-surface) .entry-meta{color:var(--muted);}
body.maetoato-v3:not(.hub-surface) .entry-card{
  background:var(--panel);border-color:var(--line);color:var(--ink);
  box-shadow:0 8px 24px rgba(37,40,92,.045);
}
body.maetoato-v3:not(.hub-surface) .entry-card h2 a{color:var(--brand-blue);}
body.maetoato-v3:not(.hub-surface) .entry-card p,
body.maetoato-v3:not(.hub-surface) .intro p,
body.maetoato-v3:not(.hub-surface) .archive-description{color:var(--muted);}
body.maetoato-v3:not(.hub-surface) .entry-content,
body.maetoato-v3:not(.hub-surface) .mta-article-document,
body.maetoato-v3:not(.hub-surface) .mta-novel-reader-shell,
body.maetoato-v3:not(.hub-surface) .mta-event-page{color:var(--ink);}
body.maetoato-v3:not(.hub-surface) .entry-content blockquote{border-color:var(--brand-orange);color:var(--ink);}
body.maetoato-v3:not(.hub-surface) .featured-image img,
body.maetoato-v3:not(.hub-surface) .wp-block-image img{border-radius:0;}
body.maetoato-v3:not(.hub-surface) .search-field{background:#fffaf1;border-color:var(--line);color:var(--ink);}
body.maetoato-v3:not(.hub-surface) .search-submit{background:var(--brand-blue);color:#fff;}
body.maetoato-v3.mta-novel-reader-active,body.maetoato-v3.mta-reading-active,
body.maetoato-v3.mta-event-active{background:var(--brand-cream);color:var(--ink);}

/* Keep the shared navigation responsive without making the panel flash on open. */
#site-navigation .navigation-container:not([hidden]){
  opacity:0;
  transform:translate3d(0,.65rem,0) scale(.995);
  transition:opacity .24s ease,transform .28s cubic-bezier(.2,.7,.2,1);
  will-change:opacity,transform;
}
#site-navigation .navigation-container:not([hidden]).is-open{
  opacity:1;
  transform:translate3d(0,0,0) scale(1);
}
#site-navigation .navigation-container:not([hidden]).is-closing{
  opacity:0;
  transform:translate3d(0,.65rem,0) scale(.995);
  pointer-events:none;
}

/* v5 base: images keep their aspect ratio (width/height attributes never fix the rendered height).
 * :where() keeps this at plain-element strength so every component rule still wins. HUB/MAP excluded. */
:where(body.maetoato-v3:not(.hub-surface)) img{max-width:100%;height:auto}
