/* nstmyogyoji.org — minimal, accessible, mobile-first CSS */
:root{
  --bg:#ffffff;
  --surface:#ffffff;
  --muted:#f6f1eb;
  --ink:#1f2937;
  --ink-dim:#4b5563;
  --border:#e6d4c9;
  --brand:#9b1b30;
  --brand-600:#7f1526;
  --brand-dark:#5d0f1b;
  --accent-gold:#d4a73d;
  --accent-rose:#f8ebe9;
  --focus:#bb6c12;
  --maxw:1200px;
  --radius:12px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font:16px/1.6 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu; color:var(--ink); background:var(--bg)}
a{color:var(--brand); text-decoration:none; transition:color .2s ease}
a:hover{color:var(--brand-dark); text-decoration:underline}

header,footer{background:var(--muted)}
.container{max-width:var(--maxw); margin:auto; padding:24px}

/* Top bar + brand + nav */
.topbar{display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:24px}
.brand{display:inline-flex; align-items:center; gap:14px; color:var(--ink); text-decoration:none; white-space:nowrap; flex-shrink:0}
.brand:hover{text-decoration:none}
.brand-mark{height:28px; width:auto; display:block}
.brand-name{font-weight:700; font-size:18px; letter-spacing:.08em; text-transform:uppercase; display:block; line-height:1}
.brand-tagline{font-size:13px; letter-spacing:.18em; text-transform:uppercase; color:var(--ink-dim); display:block; margin-top:4px}

/* Nav wraps to a new line instead of scrolling */
.nav{display:flex; gap:8px; flex-wrap:wrap; align-items:center; justify-content:center; white-space:nowrap; min-width:0; overflow-x:visible; padding-bottom:4px}
.nav a{flex:0 0 auto; display:inline-flex; align-items:center; padding:8px 10px; border-radius:999px; font-weight:600; color:var(--ink); font-size:13px; line-height:1}
.nav a[aria-current="page"]{background:color-mix(in srgb, var(--brand) 14%, #fff 86%); color:var(--brand)}

/* Language control */
.header-tools{display:flex; flex-direction:column; gap:6px; align-items:flex-end}
.language-label{font-size:12px; text-transform:uppercase; letter-spacing:.14em; color:var(--ink-dim)}
.language-select{min-width:170px; border-radius:999px; padding:8px 14px; font-size:13px; font-weight:600; background:var(--surface); border:1px solid var(--border); color:var(--ink)}
.language-select:focus-visible{outline:2px solid var(--brand); outline-offset:2px}

/* Banner */
.site-banner{border-top:1px solid var(--border); border-bottom:1px solid var(--border); background:var(--surface); padding:0}
.hero-img{
  display:block;
  width:100%;
  height:clamp(280px, 35vw, 520px);
  object-fit:cover;
  object-position:center 35%;
  border-radius:18px;
  box-shadow:0 18px 42px rgba(15,23,42,.12);
  background:#fff;
}

/* Layout */
section{padding:32px 0}
h1,h2{margin:0 0 12px}
.lead{color:var(--ink-dim)}
img{max-width:100%; height:auto; border-radius:8px}
figure{margin:0}

/* Hero */
.hero{padding:32px 0 40px; display:grid; gap:18px}
.hero h1{font-size:36px; line-height:1.15; margin:0}

/* ⬇️ Key alignment fix: center the two-column block */
.hero-grid{
  display:grid;
  gap:24px;
  align-items:start;
  justify-content:center;                 /* center columns as a unit */
  grid-template-columns:1fr;              /* mobile first */
}
.hero-copy{max-width:640px}               /* matches column width below */
.hero-media{display:grid; gap:18px; align-self:start}
.hero-photo img{display:block; width:100%; border-radius:16px; object-fit:cover; aspect-ratio:16/9}
.hero-cta{display:flex; flex-wrap:wrap; gap:12px; margin:18px 0 0}
.hero-cta .cta{flex:0 0 auto}
.hero-video-card{padding:20px; border-radius:16px; border:1px solid var(--border); background:var(--surface); box-shadow:0 18px 40px rgba(91,17,28,.12); display:grid; gap:12px; max-width:520px; align-self:start}
.hero-video-card h2{margin:0}
.hero-video-card video{width:100%; border-radius:12px; background:#000; box-shadow:0 12px 30px rgba(31,41,55,.2); aspect-ratio:16/9}
.hero-video-card p{margin:0}

/* Cards & grids */
.grid{display:grid; gap:18px}
.cards{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.card{border:1px solid var(--border); border-radius:var(--radius); padding:18px; background:var(--surface); box-shadow:0 6px 18px rgba(139,30,45,.06)}
.card h3{margin:0 0 8px}

/* Buttons */
.cta{display:inline-block; padding:10px 18px; border-radius:999px; background:var(--brand); color:#fff; font-weight:600; letter-spacing:.02em; text-transform:uppercase; font-size:14px}
.cta:hover{background:var(--brand-600); text-decoration:none}
.cta-inline{display:inline-block; padding:10px 18px; border-radius:999px; border:1px solid var(--brand); color:var(--brand); font-weight:600; letter-spacing:.02em; text-transform:uppercase; font-size:14px; background:var(--surface)}
.cta-inline:hover{background:var(--brand); color:#fff; text-decoration:none}

.badge{display:inline-block;padding:4px 10px;border-radius:999px;background:color-mix(in srgb, var(--brand) 12%, #fff 88%);color:var(--brand);font-size:12px;font-weight:600}
.badge-link{color:inherit; text-decoration:none; display:inline-flex; align-items:center; gap:6px}
.badge-link span{font-size:14px}
.small{font-size:14px;color:var(--ink-dim)}

.home-highlights{display:grid; gap:24px}
.gosho-card,.schedule-card{padding:24px; border-radius:var(--radius); background:var(--surface); border:1px solid var(--border); box-shadow:0 12px 32px rgba(91,17,28,.08)}
.gosho-card h2,.schedule-card h2{margin-top:0}
.gosho-meta{font-size:13px; text-transform:uppercase; letter-spacing:.16em; color:var(--brand)}
.gosho-card blockquote{margin:18px 0; font-style:italic; padding-left:18px; border-left:4px solid var(--brand); background:var(--accent-rose); border-radius:6px; padding:18px; color:var(--ink)}
.schedule-card strong{font-size:18px}
.schedule-list{list-style:none; margin:16px 0; padding:0; display:grid; gap:10px}
.schedule-list li{padding:12px 14px; border:1px solid var(--border); border-radius:10px; background:var(--accent-rose); display:flex; gap:12px; align-items:flex-start}
.schedule-list time{font-weight:700; min-width:72px}
.schedule-notes{margin:12px 0 0}
.notice{padding:12px 14px; background:color-mix(in srgb, var(--accent-gold) 15%, #fff 85%); border:1px solid var(--accent-gold); border-radius:10px}

.kv{display:grid; grid-template-columns:1fr; gap:14px}
.kv div{padding:16px; background:var(--surface); border-radius:12px; border:1px solid var(--border); box-shadow:0 6px 18px rgba(91,17,28,.05)}

.member-lookup .member-lookup-results{margin-top:12px; display:grid; gap:12px}
.member-result{border:1px solid var(--border); border-radius:10px; padding:14px; background:color-mix(in srgb, var(--muted) 40%, #fff 60%); box-shadow:0 4px 12px rgba(139,30,45,.05)}
.member-result h4{margin:0 0 4px; font-size:16px}
.member-result p{margin:6px 0; font-size:14px}
.member-result-time{color:var(--ink-dim); font-style:italic}
.member-result-contact a{font-weight:600}
.member-result-zoom a{display:inline-flex; align-items:center; gap:6px; font-weight:600}
.member-result-fallback{background:color-mix(in srgb, var(--muted) 60%, #fff 40%)}

.zoom-card{display:grid; gap:10px}
.zoom-card [data-zoom-local]{font-style:italic}
.zoom-card .zoom-calendar-link{display:inline-flex; margin-top:6px; font-weight:600; align-items:center; gap:6px}
.zoom-card .zoom-calendar-link::after{content:'→'; font-size:12px}

.goods-form{display:grid; gap:10px}
.goods-form label{font-weight:600; font-size:14px}
.goods-form input,
.goods-form select,
.goods-form textarea{width:100%; border:1px solid var(--border); border-radius:8px; padding:8px 10px; font:inherit; background:#fff}
.goods-form textarea{resize:vertical; min-height:80px}
.goods-form button{justify-self:flex-start}
[data-goods-status]{min-height:1.2em}
[data-goods-status].is-error{color:#b91c1c}

/* Timeline */
.timeline{list-style:none; margin:24px 0 0; padding:0; display:grid; gap:16px}
.timeline li{border:1px solid var(--border); border-left:4px solid var(--brand); border-radius:14px; padding:16px 18px; background:var(--surface); box-shadow:0 8px 24px rgba(91,17,28,.08)}
.timeline time{display:block; font-size:13px; letter-spacing:.16em; text-transform:uppercase; color:var(--brand); margin-bottom:6px}
.timeline h3{margin:0 0 6px}

/* Plan a visit */
.visit-layout{display:grid; gap:24px}
.visit-info{display:grid; gap:18px}
.visit-card{padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:0 10px 28px rgba(91,17,28,.08)}
.visit-card ul{margin:12px 0 0; padding-left:20px}
address{font-style:normal; margin:12px 0}
.address-link{display:inline-block; font-weight:700; color:var(--brand); line-height:1.5}
.address-link:hover{text-decoration:underline}
.map-embed{border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:0 18px 40px rgba(91,17,28,.12); min-height:320px}
.map-embed iframe{width:100%; height:100%; min-height:320px; border:0}

/* Hokkeko map */
.map-layout{display:grid; gap:24px; align-items:start}
.map-visual{padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:0 18px 42px rgba(91,17,28,.1); display:grid; gap:16px}
.map-svg{width:100%; height:auto; max-width:640px; margin:auto}
.map-svg path{fill:color-mix(in srgb, var(--brand) 4%, #fff 96%); stroke:color-mix(in srgb, var(--brand) 18%, #fff 82%); stroke-width:1; transition:fill .22s ease, stroke .22s ease}
.map-state{cursor:pointer; fill:color-mix(in srgb, var(--brand) 20%, #fff 80%); stroke:var(--brand); stroke-width:1.4; outline:none; -webkit-tap-highlight-color:transparent}
.map-state:hover{fill:color-mix(in srgb, var(--brand) 32%, #fff 68%); stroke:var(--brand-dark)}
.map-state:focus,
.map-state:focus-visible{outline:none; stroke:var(--focus); stroke-width:1.4}
.map-state:active{outline:none; stroke:var(--brand)}
.map-state.is-active{fill:color-mix(in srgb, var(--brand) 48%, #fff 52%); stroke:var(--brand); stroke-width:1.4}
.map-state-static{cursor:default; opacity:.92}
.map-state-static:hover{fill:color-mix(in srgb, var(--brand) 20%, #fff 80%); stroke:var(--brand)}
.map-state-silhouette{fill:color-mix(in srgb, var(--brand) 3%, #fff 97%); stroke:color-mix(in srgb, var(--brand) 10%, #fff 90%); stroke-width:1; pointer-events:none}
.map-label-layer{pointer-events:none}
.map-label{font-weight:700; fill:var(--ink); text-anchor:middle; dominant-baseline:middle; alignment-baseline:middle; paint-order:stroke; stroke:#fff; stroke-width:3; stroke-linejoin:round; line-height:1}
.map-info{margin-top:16px; padding-top:12px; border-top:1px solid var(--border); display:grid; gap:8px}
.map-info-members{margin:0; font-weight:600; color:var(--brand)}
.map-info h4{margin:0; font-size:15px}
.map-info-meetings{margin:0; padding-left:18px; display:grid; gap:6px; font-size:14px}
.map-panel{padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:0 12px 30px rgba(91,17,28,.08); display:grid; gap:12px}
.map-panel h3{margin-top:0}
.map-panel ul{margin:12px 0 0; padding-left:20px}
.map-directory{padding-top:16px}
.map-directory-grid{display:grid; gap:18px; margin-top:18px}
.map-directory-grid article{border:1px solid var(--border); border-radius:var(--radius); padding:18px; background:var(--surface); box-shadow:0 8px 26px rgba(91,17,28,.08); transition:border-color .2s ease, box-shadow .2s ease}
.map-directory-grid article.is-active{border-color:var(--brand); box-shadow:0 16px 36px rgba(91,17,28,.14)}
.map-region{font-weight:600; color:var(--ink-dim)}

form{display:grid; gap:12px; max-width:680px}
input,textarea,select{width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--ink)}
label{font-weight:600}
table{width:100%; border-collapse:collapse}
th,td{padding:10px; border-bottom:1px solid #e5e7eb; text-align:left}

.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0}

.btn{display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:10px 18px; border-radius:999px; border:1px solid var(--brand); background:var(--brand); color:#fff; font-weight:600; font-size:14px; letter-spacing:.02em; cursor:pointer; transition:background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease}
.btn:hover{background:var(--brand-600); color:#fff; text-decoration:none; box-shadow:0 8px 24px rgba(91,17,28,.18)}
.btn:focus-visible{outline:3px solid var(--focus); outline-offset:2px}
.btn[disabled]{cursor:not-allowed; opacity:.65; box-shadow:none}
.btn-secondary{background:var(--surface); color:var(--brand); border-color:var(--brand)}
.btn-secondary:hover{background:var(--brand); color:#fff}
.btn-tertiary{background:transparent; color:var(--ink); border-color:var(--border)}
.btn-tertiary:hover{color:var(--brand); border-color:var(--brand)}

.language-suggestion{margin-top:12px; max-width:320px; background:color-mix(in srgb, var(--brand) 10%, #fff 90%); border:1px solid var(--border); border-radius:16px; padding:14px 16px; box-shadow:0 12px 28px rgba(91,17,28,.15); display:grid; gap:12px}
.language-suggestion p{margin:0; font-size:14px; color:var(--ink)}
.language-suggestion-actions{display:flex; gap:10px; flex-wrap:wrap}

.temple-locator{padding-top:16px}
.temple-locator-grid{display:grid; gap:24px; align-items:start}
.temple-map-shell{padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:0 18px 42px rgba(91,17,28,.1); display:grid; gap:16px}
.temple-map-toolbar{display:flex; flex-wrap:wrap; gap:10px; align-items:center}
.temple-map-toolbar .temple-search{display:flex; gap:8px; align-items:center; flex:1; min-width:220px}
.temple-map-toolbar .temple-search input{flex:1 1 200px}
.temple-map-toolbar .temple-search button{flex:0 0 auto}
.temple-map-canvas{width:100%; height:520px; border:1px solid var(--border); border-radius:18px; overflow:hidden; box-shadow:0 16px 40px rgba(91,17,28,.1)}
.temple-map-meta{display:grid; gap:6px; font-size:14px; color:var(--ink-dim)}
.temple-map-insight{background:color-mix(in srgb, var(--brand) 12%, #fff 88%); color:var(--brand-dark); padding:10px 14px; border-radius:12px; border:1px solid color-mix(in srgb, var(--brand) 28%, #fff 72%)}
.temple-panel{padding:20px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); box-shadow:0 16px 42px rgba(91,17,28,.1); display:grid; gap:16px}
.temple-panel h3{margin:0}
.temple-panel p{margin:0 0 8px}
.temple-panel-details{display:grid; gap:14px}
.temple-contact{display:grid; gap:10px; margin:0}
.temple-contact dt{font-weight:700; font-size:14px; color:var(--ink-dim)}
.temple-contact dd{margin:0; font-weight:600}
.temple-hours ul,.temple-services ul,.temple-events ul,.temple-social ul{margin:0; padding-left:20px; display:grid; gap:6px}
.temple-hours h4,.temple-services h4,.temple-events h4,.temple-social h4{margin:0}
.temple-actions{display:flex; flex-wrap:wrap; gap:10px}
.temple-notes{margin:0; padding:12px 14px; border-left:4px solid var(--accent-gold); background:color-mix(in srgb, var(--accent-gold) 10%, #fff 90%); border-radius:12px}
.temple-support{padding:16px; border:1px dashed var(--border); border-radius:16px; background:color-mix(in srgb, var(--accent-rose) 60%, #fff 40%); display:grid; gap:8px}
.temple-support h4{margin:0}
.temple-support p{margin:0}
.temple-learning{display:grid; gap:18px; margin-top:24px}
.temple-learning article{padding:18px; border:1px solid var(--border); border-radius:16px; background:color-mix(in srgb, var(--muted) 70%, #fff 30%); box-shadow:0 12px 30px rgba(91,17,28,.08); display:grid; gap:8px}
.temple-learning h3{margin:0}

.temple-panel ul{list-style:disc}

@media (min-width: 900px){
  .temple-locator-grid{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); align-items:start}
  .temple-learning{grid-template-columns:repeat(3, minmax(0,1fr))}
}

@media (max-width: 640px){
  .temple-map-canvas{height:420px}
  .temple-map-toolbar{flex-direction:column; align-items:stretch}
  .temple-map-toolbar .temple-search{width:100%}
  .temple-map-toolbar .btn{width:100%; justify-content:center}
}

hr{border:0; border-top:1px solid #e5e7eb; margin:24px 0}
blockquote{margin:18px 0; padding-left:18px; border-left:4px solid var(--brand); font-style:italic; color:var(--ink)}

/* Footer */
.footer-content{display:grid; gap:24px; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); align-items:start}
.footer-heading{margin:0 0 10px; font-size:18px}
.social-links{list-style:none; margin:12px 0; padding:0; display:grid; gap:8px}
.social-links a{font-weight:600; color:var(--brand)}
.footer-note{padding-top:0; text-align:center}
.footer-brand p{margin:6px 0}
.footer-connect p,.footer-visit p{margin:6px 0}
.footer-visit .cta{margin-top:6px}

/* Responsive: make hero two columns and keep it centered */
@media (min-width: 720px){
  .hero-grid{
    grid-template-columns: minmax(0,640px) minmax(0,520px);
    column-gap:32px;
  }
  .kv{grid-template-columns:1fr 1fr}
  .home-highlights{grid-template-columns:1.1fr 1fr}
  .visit-layout{grid-template-columns:minmax(0,400px) minmax(0,1fr)}
  .map-directory-grid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
}
@media (max-width: 719px){
  .topbar{grid-template-columns:1fr; gap:16px}
  .nav{order:3}
  .header-tools{align-items:flex-start}
  .language-select{width:100%}
}

/* Skip link */
.skip-link{position:absolute; left:-999px; top:auto; width:1px; height:1px; overflow:hidden}
.skip-link:focus{left:16px; top:16px; width:auto; height:auto; background:var(--brand); color:#fff; padding:10px 14px; border-radius:8px; box-shadow:0 6px 20px rgba(91,17,28,.35); z-index:9999}

/* Chatbot widget */
.chat-fab{position:fixed; right:18px; bottom:calc(18px + env(safe-area-inset-bottom,0px)); width:56px; height:56px; border-radius:50%; border:0; background:var(--brand); color:#fff; font-size:24px; box-shadow:0 8px 24px rgba(0,0,0,.25); cursor:pointer; z-index:99999;}
.chat-fab[aria-expanded="true"]{ background:var(--brand-600); }
.chat-panel{position:fixed; right:18px; bottom:calc(84px + env(safe-area-inset-bottom,0px)); width:380px; max-width:calc(100vw - 24px); max-height:min(75vh, 640px); background:var(--surface); border:1px solid var(--border); border-radius:12px; box-shadow:0 20px 48px rgba(0,0,0,.35); display:none; overflow:hidden; z-index:99998; flex-direction:column;}
.chat-panel.is-open{display:flex}
.chat-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:12px 14px; background:color-mix(in srgb, var(--brand) 8%, transparent); border-bottom:1px solid var(--border); font-weight:800;}
.status-dot{width:10px;height:10px;border-radius:50%}
.status-online{background:#22c55e; box-shadow:0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent)}
.status-offline{background:#ef4444; box-shadow:0 0 0 3px color-mix(in srgb, #ef4444 25%, transparent)}
.chat-sub{font-size:12px;color:var(--ink-dim)}
.chat-body{flex:1; min-height:180px; padding:12px; background:var(--muted); overflow:auto;}
.chat-row{display:flex; gap:8px; margin:10px 0}
.chat-row.user{justify-content:flex-end}
.avatar{width:28px;height:28px;border-radius:50%; display:flex; align-items:center; justify-content:center; background:#fff; border:1px solid var(--border); font-size:14px;}
.bubble{padding:10px 12px; border-radius:12px; border:1px solid var(--border); max-width:78%; background:#fff;}
.user .bubble{ background:color-mix(in srgb, var(--brand) 8%, #fff 92%) }
.meta{font-size:11px;color:var(--ink-dim); margin-top:4px}
.typing{display:inline-block; min-width:28px}
.typing span{display:inline-block; width:6px;height:6px;margin-right:3px;border-radius:50%; background:var(--ink-dim); opacity:.4; animation: blink 1.2s infinite;}
.typing span:nth-child(2){animation-delay:.2s}
.typing span:nth-child(3){animation-delay:.4s}
@keyframes blink{0%,80%,100%{opacity:.2} 40%{opacity:1}}
.chat-foot{display:grid; gap:8px; padding:10px; border-top:1px solid var(--border); background:var(--surface); overflow:auto; max-height:240px;}
.chat-foot input, .chat-foot select{width:100%}
.chat-controls{display:grid; grid-template-columns:1fr auto; gap:8px}
.chat-foot .cta.is-disabled{opacity:.5; cursor:not-allowed}

@media (max-width:600px){
  .chat-panel{right:12px; left:12px; width:auto; max-width:none; bottom:calc(80px + env(safe-area-inset-bottom,0px)); max-height:min(80vh, 620px);}
  .chat-foot{max-height:50vh;}
}
