/*
Theme Name: Mouri Masatsugu Gallery
Theme URI: https://miki-fujisawa.jp/
Author: Miki / Mouri Gallery
Description: 毛利将司ギャラリー専用WordPressテーマ。作品カスタム投稿タイプ works / work_category 対応。
Version: 1.9.2
Text Domain: mouri-gallery
*/

/* WordPress dynamic gallery additions */
.mg-work-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px;list-style:none;margin:40px auto;padding:0;max-width:1180px}
.mg-work-card a{display:block;color:inherit;text-decoration:none}
.mg-work-card img{display:block;width:100%;height:320px;object-fit:cover;background:#f3f3f3}
.mg-work-card h2{font-size:18px;font-weight:400;margin:12px 0 4px}
.mg-work-meta{font-size:14px;line-height:1.8;margin:0;color:#555}
.mg-work-single{max-width:1100px;margin:80px auto;padding:0 24px}
.mg-work-single__image{text-align:center;margin-bottom:42px}
.mg-work-single__image img{max-width:100%;height:auto}
.mg-work-single__title{text-align:center;font-size:28px;font-weight:400;margin-bottom:24px}
.mg-work-single__meta{max-width:640px;margin:0 auto;border-top:1px solid #ddd;padding-top:20px}
.mg-work-single__meta dl{display:grid;grid-template-columns:110px 1fr;gap:10px 20px;margin:0}
.mg-work-single__meta dt{font-weight:500}.mg-work-single__meta dd{margin:0}
.mg-category-title{text-align:center;margin:90px 0 30px;font-size:32px;font-weight:400}
.mg-category-nav{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:20px auto 60px;padding:0 20px}
.mg-category-nav a{border:1px solid #222;padding:10px 22px;text-decoration:none;color:#222}
.mg-contact-form{max-width:720px;margin:50px auto 80px;padding:0 24px}
.mg-contact-form label{display:block;margin:0 0 8px}.mg-contact-form input,.mg-contact-form textarea{box-sizing:border-box;width:100%;padding:12px;border:1px solid #aaa;font:inherit}.mg-contact-form textarea{min-height:180px}.mg-contact-form .field{margin-bottom:22px}.mg-contact-form button{padding:13px 42px;border:1px solid #222;background:#fff;font:inherit;cursor:pointer}.mg-notice{max-width:720px;margin:30px auto;padding:14px 18px;background:#f5f5f5}.mg-phone a{color:inherit;text-decoration:none}
@media(max-width:767px){.mg-work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:0 16px}.mg-work-card img{height:44vw}.mg-work-single{margin-top:45px;padding:0 16px}.mg-category-title{margin-top:55px;font-size:26px}}

/* Final responsive layout for category tiles and artwork. */
.sec-gallery__list{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;max-width:1200px;margin:55px auto 85px!important;padding:0 20px!important}
.sec-gallery__list .mg-category-link{display:block;min-width:0;color:#fff;text-decoration:none}
.sec-gallery__list .mg-category-link>span{box-sizing:border-box;width:100%;height:auto;aspect-ratio:1;margin:0!important;background-position:center;background-size:cover;padding:12px;text-align:center;font-size:clamp(1.35rem,2.3vw,2.2rem);line-height:1.5;text-shadow:0 1px 5px #333;transition:transform .25s}
.sec-gallery__list .mg-category-link:hover>span{transform:scale(1.035)}
.mg-work-grid{box-sizing:border-box}
.mg-work-card img{object-fit:contain}
.mg-work-card a:focus-visible,.mg-category-link:focus-visible,.mg-category-nav a:focus-visible,.mg-contact-form button:focus-visible{outline:3px solid #225689;outline-offset:3px}
.mg-work-single__image img{max-height:80vh;width:auto;object-fit:contain}
.mg-contact-link{display:inline-block;margin:22px auto;color:inherit;border:1px solid currentColor;padding:13px 28px;text-decoration:none}
.mg-honeypot{position:absolute!important;left:-10000px!important;width:1px;height:1px;overflow:hidden}
@media(max-width:959px){.sec-gallery__list{grid-template-columns:repeat(2,minmax(0,1fr));max-width:600px}}
@media(max-width:540px){.sec-gallery__list{gap:12px;margin:35px auto 65px!important;padding:0 14px!important}.sec-gallery__list .mg-category-link>span{font-size:1.2rem}.mg-work-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mg-work-card img{height:42vw}.mg-work-single__meta dl{grid-template-columns:95px 1fr}}

/* Artwork keeps its original proportions; compact metadata stays with its image. */
.mg-work-grid .mg-work-card img{width:100%;height:auto;max-height:380px;object-fit:contain;background:transparent}
.mg-work-grid .mg-work-card h2{margin:12px 0 4px;padding:0;text-align:left;font-size:20px;line-height:1.5}
.mg-work-grid .mg-work-card h2::after{display:none}
.mg-work-grid .mg-work-card .mg-work-meta{margin:0;font-size:15px;line-height:1.6}
@media(max-width:540px){.mg-work-grid .mg-work-card img{height:auto;max-height:260px}.mg-work-grid .mg-work-card h2{font-size:17px}.mg-work-grid .mg-work-card .mg-work-meta{font-size:13px}}
/* Readable contact form and artwork details. */
.mg-work-single__meta{font-size:17px;line-height:1.8}
.mg-work-single__meta dl{gap:12px 22px}
.mg-contact-form{margin-top:28px}
.mg-contact-form .field{margin-bottom:24px}
.mg-contact-form label{font-size:17px;line-height:1.6}
.mg-contact-form label span{font-size:13px;margin-left:8px}
.mg-contact-form input,.mg-contact-form textarea{font-size:16px;line-height:1.5;min-height:48px}
.mg-contact-form button{font-size:17px;min-height:52px}
@media(max-width:767px){.mg-work-single__meta{font-size:15px}.mg-contact-form{margin-top:18px}}

/* Sitewide small-screen containment. */
*,*::before,*::after{box-sizing:border-box}
html,body{max-width:100%;overflow-x:clip}
main,main section,main div,main ul,main li{min-width:0}
main img{max-width:100%}
main p,main h1,main h2,main h3,main li,main dd{overflow-wrap:anywhere}
header .open-btn,header .close-btn{border:0;background:transparent;font-family:inherit}
@media(max-width:1039px){
 header .open-btn{display:block}header nav{display:none}header nav.mg-nav-open{display:block}
 header nav ul{padding:0 16px}header nav ul li{margin:26px 14px}
 header nav ul li a{display:block;max-width:100%;font-size:19px;line-height:1.6;white-space:normal}
 header nav ul li a::after{display:none}
}
@media(max-width:767px){
 header{height:78px}header img{top:19px;left:15px;width:clamp(145px,50vw,210px)}
 header .open-btn{right:12px;top:14px;z-index:20}
 main{width:100%;max-width:100%;padding-left:0;padding-right:0}
 main h1{padding:25px 18px 12px;max-width:100%;font-size:23px;line-height:1.5}
 main h1::after{top:auto;bottom:0;width:calc(100% - 36px)}
 .sec-gallery__list{grid-template-columns:repeat(2,minmax(0,1fr));width:100%;padding:0 14px!important}
 .sec-gallery__list .mg-category-link>span{font-size:clamp(15px,4.1vw,21px)}
 .mg-work-grid{grid-template-columns:repeat(2,minmax(0,1fr));width:100%;margin:24px 0;padding:0 14px;gap:22px 12px}
 .mg-work-card h2,.mg-work-meta{overflow-wrap:anywhere}
 .mg-category-title{padding-left:18px;padding-right:18px}
 .mg-category-nav{gap:8px;padding:0 14px}
 .mg-category-nav a{padding:9px 12px;font-size:14px}
 .mg-work-single{padding:0 18px;margin:35px auto 65px}
 .mg-work-single__image{margin-bottom:24px}
 .mg-work-single__title{font-size:24px;margin-bottom:20px}
 .mg-work-single__meta dl{grid-template-columns:minmax(80px,32%) minmax(0,1fr)}
 .sec-top__img img,#changePic{height:clamp(280px,80vw,480px)}
 .sec-profile__img{height:auto;min-height:580px;padding:30px 16px 45px;background-position:center;background-size:cover}
 .sec-profile h3{padding:0;font-size:16px}.sec-profile h2{font-size:30px}
 .sec-profile__img-message p{margin:clamp(180px,48vw,260px) auto 24px;padding:0 6px;font-size:clamp(15px,4vw,18px);line-height:1.9}
 .sec-profile__img-message p br{display:none}
 .sec-profile__img-message button{width:auto;max-width:100%;margin:0;padding:10px 18px}
 .sec-profile__img-message button a{font-size:17px}
 .sec-contact .number,.page-template-page-contact .number{flex-wrap:wrap;gap:0 12px;margin:44px auto 18px;padding:0 16px;align-items:center}
 .sec-contact .number h3,.page-template-page-contact .number h3{padding:0;font-size:clamp(22px,7vw,32px);overflow-wrap:normal;white-space:nowrap}
 .sec-contact .number h4,.page-template-page-contact .number h4{padding:0;margin:0;font-size:18px}
 .page-template-page-contact .comment{padding:0 18px;margin:30px 0 0;font-size:17px;line-height:1.9}
 .page-template-page-contact .comment br{display:none}
 .page-template-page-contact .time{padding:0 16px 18px;font-size:17px}
 .page-template-page-contact .time::after{width:min(80%,350px)}
 .mg-contact-form{width:100%;padding:0 18px;margin:26px auto 55px}
 .mg-contact-form input,.mg-contact-form textarea{max-width:100%}
 .page-template-page-profile main{padding:0 18px}
 .page-template-page-profile main h1{padding-left:0;padding-right:0}
 .page-template-page-profile main h1::after{width:100%}
 .page-template-page-profile main p,.page-template-page-profile main h2,.page-template-page-profile main h3{padding-left:0;padding-right:0}
 .page-template-page-profile .messege p{font-size:16px;line-height:2;margin-top:26px}
 .page-template-page-profile .picture img{height:auto;max-height:620px;object-fit:contain}
 .page-template-page-profile .profession{display:block}
 .page-template-page-profile .place-name ul{padding-left:0}
 .page-template-page-profile .now{margin:50px 0 70px}
 .footer{height:auto;min-height:160px;padding:35px 16px}
 .footer img{width:min(240px,70vw);padding:0;margin:0 auto}
 #scroll-top{right:12px;bottom:12px;padding:6px;font-size:12px}
}
@media(max-width:360px){.sec-gallery__list{grid-template-columns:1fr;max-width:260px}.mg-work-grid{grid-template-columns:1fr}.mg-work-grid .mg-work-card img{max-height:320px}}

/* Gallery: classic thumbnails, full image viewer. */
.mg-work-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:36px 22px;align-items:start}
.mg-work-card__image{display:block;position:relative;appearance:none;width:100%;padding:0;border:0;background:#f5f3eb;cursor:zoom-in;overflow:hidden}
.mg-work-grid .mg-work-card__image img{width:100%;height:clamp(165px,19vw,235px);max-height:none;object-fit:cover;background:transparent;transition:transform .35s ease}
.mg-work-card__image:hover img{transform:scale(1.035)}
.mg-work-card__zoom{position:absolute;right:0;bottom:0;padding:8px 13px;color:#fff;background:rgba(42,44,42,.75);font-size:13px;letter-spacing:.06em}
.mg-work-grid .mg-work-card h2{margin:12px 0 3px;font-size:19px;font-weight:400}
.mg-work-card h2 a{color:#515151;text-decoration:none}
.mg-work-card h2 a:hover{text-decoration:underline;text-underline-offset:4px}
.mg-work-grid .mg-work-card .mg-work-meta{font-size:14px;color:#68645d}
.mg-work-card__image:focus-visible,.mg-work-card h2 a:focus-visible{outline:3px solid #8f876a;outline-offset:3px}
.mg-gallery-empty{text-align:center;margin:60px 20px;font-size:18px}
.mg-lightbox-open{overflow:hidden}
.mg-lightbox{position:fixed;inset:0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:30px 75px 24px;border:0;background:rgba(28,29,28,.97);color:#f4f1e9;overflow:hidden}
.mg-lightbox::backdrop{background:rgba(22,22,22,.92)}
.mg-lightbox__stage{position:relative;width:100%;height:calc(100% - 77px);overflow:hidden;touch-action:pan-y}
.mg-lightbox__photo{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;transition:transform .3s ease,opacity .3s ease}
.mg-lightbox__photo--from-right{transform:translateX(15%);opacity:0}
.mg-lightbox__photo--from-left{transform:translateX(-15%);opacity:0}
.mg-lightbox__photo--to-left{transform:translateX(-15%);opacity:0}
.mg-lightbox__photo--to-right{transform:translateX(15%);opacity:0}
.mg-lightbox__close,.mg-lightbox__arrow{position:absolute;z-index:2;appearance:none;border:0;background:transparent;color:#fff;font-family:inherit;cursor:pointer}
.mg-lightbox__close{right:17px;top:8px;padding:5px 15px;font-size:40px;line-height:1}
.mg-lightbox__arrow{top:45%;width:64px;height:70px;font-size:62px;line-height:1}
.mg-lightbox__arrow--prev{left:2px}.mg-lightbox__arrow--next{right:2px}
.mg-lightbox__close:hover,.mg-lightbox__arrow:hover{color:#dacaa3}
.mg-lightbox__close:focus-visible,.mg-lightbox__arrow:focus-visible,.mg-lightbox__detail:focus-visible{outline:2px solid #dacaa3;outline-offset:2px}
.mg-lightbox__caption{display:flex;align-items:center;justify-content:center;gap:22px;min-height:65px;font-size:17px}
.mg-lightbox__title{font-size:19px}.mg-lightbox__counter{color:#b8b4aa;font-size:14px}
.mg-lightbox__detail{color:#f4f1e9;text-decoration:none;border-bottom:1px solid #a9a494;padding-bottom:4px;font-size:15px}
@media(max-width:767px){
 .mg-work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 13px}
 .mg-work-grid .mg-work-card__image img{height:30vw;min-height:120px;max-height:205px}
 .mg-work-grid .mg-work-card h2{font-size:16px}
 .mg-work-card__zoom{font-size:11px;padding:6px}
 .mg-lightbox{padding:48px 34px 16px}
 .mg-lightbox__stage{height:calc(100% - 100px)}
 .mg-lightbox__arrow{width:36px;font-size:48px}
 .mg-lightbox__caption{flex-wrap:wrap;gap:7px 16px;text-align:center;font-size:15px}
 .mg-lightbox__title{width:100%;font-size:17px}
}
@media(max-width:360px){.mg-work-grid{grid-template-columns:1fr}.mg-work-grid .mg-work-card__image img{height:220px;max-height:none}}
@media(prefers-reduced-motion:reduce){.mg-lightbox__photo,.mg-work-grid .mg-work-card__image img{transition:none}}

/* Contact form in the gallery's warm paper and muted ink palette. */
.page-template-page-contact .mg-contact-form{max-width:770px;padding:36px 44px 44px;margin:25px auto 95px;background:#f6f4e9;border:1px solid #e5e0ca}
.page-template-page-contact .mg-contact-form .field{margin:0 0 24px}
.page-template-page-contact .mg-contact-form label{display:block;color:#514d43;font-size:17px;margin-bottom:9px}
.page-template-page-contact .mg-contact-form label span{display:inline-block;margin-left:9px;padding:2px 7px;background:#e7e0cc;color:#5d5543;font-size:12px;line-height:1.4;vertical-align:middle}
.page-template-page-contact .mg-contact-form input,.page-template-page-contact .mg-contact-form textarea{width:100%;max-width:100%;border:1px solid #bdb7a6;border-radius:0;background:#fff;color:#333;font-family:'Noto Serif JP',serif;font-size:17px;padding:13px 16px;line-height:1.6}
.page-template-page-contact .mg-contact-form input:focus,.page-template-page-contact .mg-contact-form textarea:focus{outline:2px solid #8b856c;outline-offset:2px}
.page-template-page-contact .mg-contact-form textarea{min-height:180px;resize:vertical}
.page-template-page-contact .mg-contact-form button{display:block;min-width:240px;margin:34px auto 0;padding:14px 32px;background:#928f74;border:1px solid #928f74;color:#fff;font-family:'Noto Serif JP',serif;font-size:18px;letter-spacing:.12em;box-shadow:5px 5px 0 #d5d1c3;transition:background .2s,transform .2s;cursor:pointer}
.page-template-page-contact .mg-contact-form button:hover{background:#77735e;transform:translateY(-2px)}
.page-template-page-contact .mg-notice{max-width:770px;background:#f0f3e8;border-left:4px solid #928f74;font-size:16px;line-height:1.7}
@media(max-width:767px){.page-template-page-contact .mg-contact-form{margin:20px 16px 70px;padding:24px 18px 30px}.page-template-page-contact .mg-contact-form button{width:100%;min-width:0}.page-template-page-contact .mg-notice{margin:25px 16px}}
.mg-gallery-page{max-width:1200px;margin:0 auto;padding:0 24px}
.mg-gallery-page>h1{max-width:100%;text-align:left}
.mg-gallery-page .mg-category-title{max-width:100%;text-align:left;font-size:clamp(26px,3vw,42px);margin:42px auto 0;padding:0;border:0}
.mg-gallery-page .mg-category-title::after{display:none}
.mg-gallery-page .mg-category-nav{max-width:100%;justify-content:flex-start;margin:24px auto 32px;padding:0;gap:10px}
.mg-gallery-page .mg-category-nav a{font-size:15px;color:#515151;border-color:#bcb9a9;padding:9px 17px}
.mg-gallery-page .mg-category-nav a[aria-current="page"]{background:#928f74;border-color:#928f74;color:#fff}
.mg-gallery-page .mg-work-grid{max-width:100%;margin:0 auto 50px;padding:0}
.mg-gallery-page .text{margin:60px auto 70px;padding:0;font-size:15px;text-align:left}
@media(max-width:767px){.mg-gallery-page{padding:0 16px}.mg-gallery-page>h1{padding-left:0;padding-right:0}.mg-gallery-page>h1::after{width:100%}.mg-gallery-page .mg-category-title{margin-top:32px;font-size:25px}.mg-gallery-page .mg-category-nav{margin:18px auto 28px;gap:7px}.mg-gallery-page .mg-category-nav a{font-size:13px;padding:8px 10px}.mg-gallery-page .mg-work-grid{padding:0}.mg-gallery-page .text{margin:45px 0;font-size:13px}}
/* Preloaded two-layer hero; no opacity reset or duplicate frame. */
.sec-top__img.mg-hero{position:relative;height:466px;overflow:hidden;background:#e8e7e2}
.sec-top__img.mg-hero .mg-hero__image,#changePic{animation:none}
.sec-top__img.mg-hero .mg-hero__image{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 1.5s ease-in-out;will-change:opacity}
.sec-top__img.mg-hero .mg-hero__image--visible{opacity:1}
.sec-profile__img-message .mg-profile-link{display:inline-block;background:#928f74;border:2px solid #fff;box-shadow:6px 6px 0 #00000029;color:#fff;text-decoration:none;font-size:20px;padding:12px 25px;margin:0 auto}
.sec-profile__img-message .mg-profile-link:hover{background:#77735e}
@media(min-width:960px){.sec-top__img.mg-hero{height:min(66vw,960px)}.sec-profile__img-message .mg-profile-link{margin:80px 0 0 150px}}
@media(max-width:767px){.sec-top__img.mg-hero{height:clamp(280px,80vw,480px)}.sec-profile__img-message .mg-profile-link{margin:0;font-size:17px}}
@media(prefers-reduced-motion:reduce){.sec-top__img.mg-hero .mg-hero__image{transition:none}}
/* Language switch beside the original navigation. */
header{z-index:20}
header>div{position:relative;height:100%}
.mg-language{position:absolute;right:53px;top:12px;display:flex;gap:8px;align-items:center;color:#6f6d62;font:14px/1.4 'Noto Serif JP',serif}
.mg-language a{color:#6f6d62;text-decoration:none}
.mg-language a[aria-current="page"]{font-weight:700;border-bottom:1px solid currentColor}
.mg-language a:focus-visible{outline:2px solid #928f74;outline-offset:3px}
@media(max-width:1039px){.mg-language{top:25px;right:96px;font-size:13px}}
@media(max-width:440px){.mg-language{top:81px;right:12px;z-index:2;padding:5px 9px;background:#efeddb}}
.mg-work-back{text-align:center;margin:42px auto 0;font-size:16px}.mg-work-back a{color:#5e5a4d;text-underline-offset:4px}
@media(max-width:440px){header{height:115px}.mg-language{top:83px;right:15px;background:transparent}}

/* v1.6: clear profile copy and breathing room around the category links. */
.sec-profile__img-message .mg-profile-line{display:block}
.sec-profile__img-message .mg-profile-link{min-width:260px;padding:18px 38px;text-align:center;line-height:1.5;transition:background .2s,transform .2s}
.sec-profile__img-message .mg-profile-link:hover{transform:translateY(-3px)}
.sec-gallery__list{gap:30px!important;max-width:1240px}
.sec-gallery__list .mg-category-link>span{overflow:hidden}
.sec-gallery__list .mg-category-link:focus-visible>span{outline:3px solid #8f876a;outline-offset:3px}
@media(max-width:959px){.sec-gallery__list{gap:22px!important}}
@media(max-width:767px){
 .sec-profile__img-message p{line-height:1.9;margin-top:clamp(135px,40vw,205px)}
 .sec-profile__img-message .mg-profile-link{min-width:230px;padding:15px 30px}
 .sec-gallery__list{gap:18px!important}
}
@media(max-width:360px){.sec-gallery__list{gap:20px!important}}

/* The same readable contact form on the home and contact pages. */
.mg-contact-area{width:min(100%,820px);margin:0 auto;padding:0 24px}
.mg-contact-area .mg-contact-form{box-sizing:border-box;width:100%;max-width:none;margin:28px auto 62px;padding:36px 44px 44px;background:#f6f4e9;border:1px solid #e5e0ca}
.mg-contact-area .mg-contact-form .field{margin:0 0 24px}
.mg-contact-area .mg-contact-form label{display:block;color:#514d43;font-size:17px;margin-bottom:9px}
.mg-contact-area .mg-contact-form label span{display:inline-block;margin-left:9px;padding:2px 7px;background:#e7e0cc;color:#5d5543;font-size:12px;line-height:1.4;vertical-align:middle}
.mg-contact-area .mg-contact-form input,.mg-contact-area .mg-contact-form textarea{width:100%;max-width:100%;border:1px solid #bdb7a6;border-radius:0;background:#fff;color:#333;font-family:'Noto Serif JP',serif;font-size:17px;padding:13px 16px;line-height:1.6}
.mg-contact-area .mg-contact-form input:focus,.mg-contact-area .mg-contact-form textarea:focus{outline:2px solid #8b856c;outline-offset:2px}
.mg-contact-area .mg-contact-form textarea{min-height:180px;resize:vertical}
.mg-contact-area .mg-contact-form button{display:flex;align-items:center;justify-content:center;gap:18px;width:min(100%,380px);margin:34px auto 0;padding:17px 26px;background:#615d49;border:2px solid #615d49;color:#fff;font-family:'Noto Serif JP',serif;font-size:19px;font-weight:600;letter-spacing:.06em;line-height:1.5;box-shadow:6px 6px 0 #c7c0aa;transition:background .2s,transform .2s,box-shadow .2s;cursor:pointer}
.mg-contact-area .mg-contact-form button:hover{background:#484635;transform:translate(2px,2px);box-shadow:4px 4px 0 #c7c0aa}
.mg-contact-area .mg-contact-form button:focus-visible,.mg-contact-dialog button:focus-visible,.mg-related a:focus-visible{outline:3px solid #225689;outline-offset:4px}
.sec-contact .time{padding-bottom:25px}
.sec-contact .text{padding:0 18px 55px;line-height:1.8}
.mg-contact-area .mg-notice{max-width:none;margin:24px 0 0;background:#f0f3e8;border-left:4px solid #928f74;font-size:16px;line-height:1.8}
.mg-contact-area .mg-notice--error{background:#fff1ee;border-color:#a54d3d}
.mg-contact-area .mg-notice[hidden]{display:none}
@media(max-width:767px){.mg-contact-area{padding:0 16px}.mg-contact-area .mg-contact-form{margin:20px auto 55px;padding:24px 18px 30px}.mg-contact-area .mg-contact-form button{font-size:17px}.sec-contact .time{padding-bottom:20px}.sec-contact .time::after{width:min(80%,350px)}}

/* Success overlay; inline status remains available if JavaScript cannot run. */
.mg-contact-dialog{width:min(92vw,540px);max-width:none;max-height:90dvh;padding:0;border:0;background:#f6f4e9;color:#514d43;box-shadow:0 16px 55px #0004;text-align:center}
.mg-contact-dialog::backdrop{background:#171912a6}
.mg-contact-dialog__inner{padding:42px 28px 38px}
.mg-contact-dialog__icon{width:58px;height:58px;margin:0 auto 18px;border-radius:50%;background:#928f74;color:#fff;font:34px/58px Georgia,serif}
.mg-contact-dialog h2{padding:0;margin:0 0 16px;color:#514d43;font-size:clamp(19px,4.8vw,25px);line-height:1.5}
.mg-contact-dialog h2::after{display:none}
.mg-contact-dialog p{font-size:16px;line-height:1.9}
.mg-contact-dialog button{margin:28px auto 0;padding:11px 32px;border:1px solid #615d49;background:#615d49;color:#fff;font:17px/1.5 'Noto Serif JP',serif;cursor:pointer}
@media(max-width:540px){.mg-contact-dialog__inner{padding:32px 18px}}

/* Shop and art school links follow the gallery's muted palette. */
.mg-related{padding:35px 20px 95px;background:#f8f7f2;color:#515151;text-align:center}
.mg-related h2{margin:10px auto 32px;font-size:clamp(23px,3vw,34px);font-weight:400}
.mg-related__links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px;max-width:1000px;margin:0 auto}
.mg-related__links>a{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:230px;padding:26px;background:#fff;border:1px solid #e4dfd2;color:#515151;text-decoration:none;font-size:21px;line-height:1.6;transition:transform .2s,box-shadow .2s}
.mg-related__links>a:hover{transform:translateY(-3px);box-shadow:0 8px 22px #0001}
.mg-related__shop img{display:block;width:min(100%,360px);max-height:150px;object-fit:contain;margin-bottom:12px}
.mg-related__school{background:#eaece3!important}
.mg-related__eyebrow{display:block;margin-bottom:6px;color:#777762;font-size:15px;letter-spacing:.13em}
.mg-related__action{display:block;margin-top:18px;border-bottom:1px solid #928f74;font-size:16px}
@media(max-width:767px){.mg-related{padding:30px 16px 65px}.mg-related__links{grid-template-columns:1fr;gap:16px;max-width:490px}.mg-related__links>a{min-height:170px;padding:20px;font-size:18px}}
@media(prefers-reduced-motion:reduce){.sec-profile__img-message .mg-profile-link,.mg-contact-area .mg-contact-form button,.mg-related__links>a{transition:none}}

/* Larger language controls remain readable beside the mobile menu. */
.mg-language{font-size:17px;gap:10px;top:10px;right:48px;white-space:nowrap}
.mg-language a{display:inline-block;padding:4px 2px;line-height:1.5}
@media(max-width:1039px){.mg-language{font-size:16px;top:17px;right:98px}}
@media(max-width:440px){header{height:115px}.mg-language{font-size:16px;top:78px;right:15px;gap:8px;background:transparent}}

/* Copyright information and privacy link. */
.footer{height:auto;min-height:250px;padding-bottom:30px}
.mg-footer-legal{clear:both;max-width:1200px;margin:20px auto 0;padding:0 20px;text-align:center;color:#514d43;font-size:13px;line-height:1.8}
.mg-footer-legal p{margin:0 0 8px}
.mg-footer-legal a,.mg-contact-privacy a,.mg-policy a{color:#4e4a3c;text-underline-offset:4px}
@media(min-width:960px){.footer{height:auto;min-height:320px;padding-bottom:30px}.mg-footer-legal{padding-top:0;margin-top:20px}}
.mg-contact-area .mg-contact-form .mg-contact-privacy{font-size:14px;line-height:1.9;margin:8px 0 0;color:#514d43}
.mg-policy{width:min(100%,900px);margin:0 auto;padding:65px 28px 100px;color:#514d43;line-height:1.95}
.mg-policy h1{margin-bottom:38px}
.mg-policy h2{font-size:21px;font-weight:500;margin:36px 0 8px;line-height:1.5}
.mg-policy h2::after{display:none}
.mg-policy p{font-size:16px;margin:0 0 12px}
@media(max-width:767px){.mg-policy{padding:35px 20px 70px}.mg-policy h1{padding:0 0 15px;margin:0 0 28px}.mg-policy h2{font-size:19px;margin-top:28px}.mg-footer-legal{font-size:12px}}

/* Theme-integrated mobile layout and related-site photo. */
.mg-related__school-photo{display:block;width:min(100%,360px);height:150px;object-fit:cover;margin-bottom:16px}
.mg-language--mobile{display:none}
.mg-related__links>.mg-related__school::before{content:none!important}
@media(max-width:1039px){
 .mg-language--desktop{display:none}
 header #mouri-primary-nav{overflow-y:auto}
 header #mouri-primary-nav .mg-language--mobile{position:static;display:flex;justify-content:center;gap:16px;margin:30px 16px;padding:12px 0;background:transparent;font-size:17px}
}
@media(max-width:767px){header{height:78px}}
.messege p,.now p,.career p,.page-template-page-contact .comment{white-space:pre-line}

/* Vertically center the logo and the three-line menu icon. */
header > div > a > img{top:50%;transform:translateY(-50%)}
@media(max-width:1039px){
 header #open-btn.open-btn{top:50%;transform:translateY(-50%);height:50px;padding:0}
 header #open-btn.open-btn > span{top:50%;transform:translateY(-50%)}
 header #open-btn.open-btn > span::before{top:-14px;bottom:auto}
 header #open-btn.open-btn > span::after{top:14px;bottom:auto}
}

/* Same artist-name design, with a semantic H1 and non-heading reading aid. */
.sec-profile .mg-home-title{position:static;padding:0;margin:10px 0 0;width:auto;max-width:none;font-size:3.2rem;letter-spacing:1px;text-align:center;line-height:normal;font-weight:700;overflow-wrap:anywhere}
.sec-profile .mg-home-title::before,.sec-profile .mg-home-title::after{content:none;display:none}
.sec-profile .mg-home-ruby{font-size:1.5rem;margin:0;padding-top:60px;letter-spacing:1px}
@media(min-width:960px){.sec-profile .mg-home-title{font-size:5.4rem;margin:14px 0 0 146px;text-align:left}.sec-profile .mg-home-ruby{font-size:2.9rem;margin-left:160px;padding-top:90px;text-align:left}}
@media(max-width:767px){.sec-profile .mg-home-title{font-size:30px}.sec-profile .mg-home-ruby{padding:0;font-size:16px}}
