:root{
  --green-dark:#000000;--green-mid:#333333;--green-light:#CCCCCC;
  --orange:#4D4D4D;--navy:#1A1A1A;--off-white:#F5F5F5;--gray:#666666;
}
*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;scroll-padding-top:64px;}
body{font-family:"Yu Gothic","Hiragino Sans",sans-serif;color:#222;background:#fff;line-height:1.75;}
img{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}

/* ===== Header ===== */
header{
  position:sticky;top:0;z-index:100;background:#fff;border-bottom:1px solid #e5e5e5;
  display:flex;align-items:center;justify-content:space-between;padding:0.6rem 5%;
}
header img{height:38px;width:auto;}
header nav{display:flex;align-items:center;}
header nav a{margin-left:1.6rem;font-size:0.92rem;font-weight:600;color:var(--green-dark);}
header nav a:hover{color:var(--orange);}
header nav a.current{border-bottom:2px solid var(--green-dark);}
.header-cta{
  background:var(--green-dark);color:#fff!important;
  padding:0.5rem 1.1rem;border-radius:30px;font-size:0.85rem!important;
}
.nav-toggle{
  display:none;background:none;border:0;width:44px;height:44px;cursor:pointer;
  padding:10px;flex-direction:column;justify-content:center;gap:6px;
}
.nav-toggle span{display:block;height:2px;background:var(--green-dark);transition:transform .2s,opacity .2s;}
.nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(8px) rotate(45deg);}
.nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
.nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-8px) rotate(-45deg);}

/* ===== Blog ===== */
.eyebrow{font-weight:700;font-size:0.82rem;letter-spacing:0.12em;margin-bottom:0.3rem;color:var(--green-light);}
.blog-hero{
  background:linear-gradient(135deg,var(--green-dark) 0%,var(--green-mid) 100%);
  color:#fff;text-align:center;padding:3.2rem 5%;
}
.blog-hero h1{font-size:2rem;font-weight:800;}
.blog-body{padding:3.5rem 5% 4.5rem;min-height:50vh;}
.blog-inner{max-width:800px;margin:0 auto;}
.blog-inner.narrow,.narrow{max-width:460px;margin:0 auto;}
.empty{text-align:center;color:var(--gray);padding:2rem 0;}

.post-card{padding:1.6rem 0;border-bottom:1px solid #e0e0e0;}
.post-card:first-child{padding-top:0;}
.post-card time,.post time{font-size:0.85rem;color:var(--gray);letter-spacing:0.05em;}
.post-card h2{font-size:1.25rem;margin:0.2rem 0 0.5rem;color:var(--navy);line-height:1.5;}
.post-card h2 a:hover{text-decoration:underline;}
.post-card p{color:#444;font-size:0.93rem;}
.post-card .more{display:inline-block;margin-top:0.5rem;font-size:0.85rem;font-weight:700;}

.post h1{font-size:1.8rem;line-height:1.5;color:var(--navy);margin:0.3rem 0 1.8rem;padding-bottom:1rem;border-bottom:2px solid var(--green-dark);}
.post-body p{margin-bottom:1.2rem;font-size:1rem;overflow-wrap:anywhere;}
.post-body a{text-decoration:underline;}
.notice{background:var(--off-white);border:1px solid #ddd;padding:0.6rem 1rem;font-size:0.85rem;margin-bottom:1rem;}
.back{margin-top:2.5rem;font-weight:700;}
.back a:hover{text-decoration:underline;}

.pager{display:flex;justify-content:center;gap:0.5rem;margin-top:2.5rem;flex-wrap:wrap;}
.pager a,.pager span{min-width:40px;height:40px;display:flex;align-items:center;justify-content:center;border:1px solid #ccc;border-radius:50%;font-size:0.9rem;}
.pager .cur{background:var(--green-dark);color:#fff;border-color:var(--green-dark);}
.pager a:hover{background:var(--off-white);}

/* ===== Admin ===== */
.admin h1{font-size:1.5rem;margin-bottom:1.2rem;color:var(--navy);}
.admin label{display:block;font-weight:700;font-size:0.9rem;margin-bottom:1rem;}
.admin .hint{font-weight:400;color:var(--gray);font-size:0.8rem;}
.admin input[type=text],.admin input[type=password],.admin input[type=datetime-local],.admin select,.admin textarea{
  display:block;width:100%;margin-top:0.3rem;padding:0.65rem 0.8rem;border:1px solid #bbb;
  border-radius:6px;font:inherit;font-weight:400;background:#fff;
}
.admin textarea{line-height:1.7;resize:vertical;}
.admin .row{display:grid;grid-template-columns:1fr 1fr;gap:1rem;}
.admin code{background:var(--off-white);padding:0.1rem 0.4rem;border-radius:4px;font-size:0.85em;}
.error{background:#f3f3f3;border-left:4px solid var(--green-dark);padding:0.7rem 1rem;margin-bottom:1rem;font-size:0.9rem;}
.btn-dark,.btn-line{
  display:inline-block;padding:0.6rem 1.4rem;border-radius:30px;font:inherit;font-size:0.88rem;
  font-weight:700;cursor:pointer;border:1px solid var(--green-dark);line-height:1.4;
}
.btn-dark{background:var(--green-dark);color:#fff;}
.btn-line{background:#fff;color:var(--green-dark);}
.btn-dark:hover{background:var(--green-mid);}
.btn-line:hover{background:var(--off-white);}
.btn-line.danger{border-color:#999;color:#444;}
form.inline{display:inline;}
.admin-bar{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1.2rem;}
.admin-bar h1{margin:0;}
.admin-list{list-style:none;border-top:1px solid #e0e0e0;}
.admin-list li{display:flex;align-items:center;gap:1rem;padding:0.9rem 0;border-bottom:1px solid #e0e0e0;}
.admin-list .meta{flex:0 0 7.5rem;font-size:0.82rem;color:var(--gray);}
.admin-list .ttl{flex:1;font-weight:700;overflow-wrap:anywhere;}
.admin-list .ops{display:flex;gap:0.5rem;}
.admin-list .btn-line{padding:0.35rem 0.9rem;font-size:0.8rem;}
.tag{display:inline-block;background:var(--green-mid);color:#fff;font-size:0.7rem;padding:0 0.5rem;border-radius:10px;margin-left:0.3rem;}
.actions{display:flex;gap:0.8rem;margin-top:0.5rem;}

/* ===== Rich text ===== */
.post-body h2{font-size:1.5rem;line-height:1.5;margin:2rem 0 0.8rem;padding-bottom:0.4rem;border-bottom:1px solid #ccc;color:var(--navy);}
.post-body h3{font-size:1.25rem;line-height:1.5;margin:1.8rem 0 0.7rem;color:var(--navy);}
.post-body h4{font-size:1.05rem;line-height:1.5;margin:1.5rem 0 0.6rem;color:var(--navy);}
.post-body ul,.post-body ol{margin:0 0 1.2rem 1.5rem;}
.post-body img{display:inline-block;vertical-align:middle;max-width:100%;height:auto;border-radius:6px;margin:0.3rem 0;}
.toolbar .grp{display:inline-flex;}
.toolbar .grp button{border-radius:0;margin-left:-1px;}
.toolbar .grp button:first-child{border-radius:6px 0 0 6px;margin-left:0;}
.toolbar .grp button:last-child{border-radius:0 6px 6px 0;}
.toolbar button:disabled{opacity:0.6;cursor:wait;}
.admin .lbl{display:block;font-weight:700;font-size:0.9rem;margin-bottom:0.3rem;}
.toolbar{
  display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;padding:0.5rem;
  border:1px solid #bbb;border-bottom:0;border-radius:6px 6px 0 0;background:var(--off-white);
  position:sticky;top:56px;z-index:5;
}
.toolbar button{
  min-width:38px;height:36px;padding:0 0.7rem;border:1px solid #bbb;border-radius:6px;
  background:#fff;font:inherit;font-size:0.9rem;cursor:pointer;
}
.toolbar button:hover{background:#e8e8e8;}
.admin .toolbar select{width:auto;margin:0;height:36px;padding:0 0.5rem;font-size:0.9rem;}
.admin .toolbar label.color{display:flex;align-items:center;gap:0.4rem;margin:0;font-weight:400;font-size:0.9rem;}
.toolbar input[type=color]{width:38px;height:36px;padding:2px;border:1px solid #bbb;border-radius:6px;background:#fff;cursor:pointer;}
.editor{
  min-height:320px;border:1px solid #bbb;border-radius:0 0 6px 6px;padding:1rem;
  background:#fff;outline:none;font-weight:400;overflow-wrap:anywhere;
}
.editor:focus{border-color:var(--green-dark);}
.admin textarea[hidden]{display:none;}

/* ===== Attachments ===== */
.attachments{margin-top:2rem;}
.attachments figure{margin-bottom:1.2rem;}
.attachments figure img{width:100%;height:auto;border-radius:8px;border:1px solid #e0e0e0;}
.pdf-ico{display:inline-block;background:var(--green-dark);color:#fff;font-size:0.7rem;font-weight:800;padding:0.1rem 0.5rem;border-radius:4px;letter-spacing:0.05em;}
.pdf-link{margin-bottom:0.8rem;}
.pdf-link a{display:inline-block;padding:0.7rem 1.1rem;border:1px solid #ccc;border-radius:8px;font-weight:700;overflow-wrap:anywhere;}
.pdf-link a:hover{background:var(--off-white);}
fieldset.attach{border:1px solid #ccc;border-radius:8px;padding:1rem;margin-bottom:1.2rem;}
fieldset.attach legend{font-weight:700;font-size:0.88rem;padding:0 0.4rem;}
.attach-item{display:flex;align-items:center;gap:0.8rem;padding:0.6rem 0;border-bottom:1px solid #eee;margin-bottom:0.6rem;}
.attach-item img{width:64px;height:64px;object-fit:cover;border-radius:6px;border:1px solid #ddd;}
.attach-item .pdf-ico{padding:1.2rem 0.8rem;}
.attach-item .info{flex:1;min-width:0;font-size:0.85rem;}
.attach-item .info a{display:block;font-weight:700;overflow-wrap:anywhere;text-decoration:underline;}
.attach-item .info input{font-size:0.75rem!important;padding:0.3rem 0.5rem!important;}
#fileSlots .slot{display:flex;align-items:center;gap:0.5rem;margin-bottom:0.6rem;}
#fileSlots input[type=file]{max-width:100%;min-width:0;}
.slot-x{width:30px;height:30px;border-radius:50%;border:1px solid #999;background:#fff;color:#333;font-size:1.1rem;line-height:1;cursor:pointer;flex:0 0 auto;}
.slot-x:hover{background:var(--green-dark);color:#fff;}
.slot-x[hidden]{display:none;}
.admin .attach-item label.del{margin:0;font-weight:400;font-size:0.85rem;white-space:nowrap;}

/* ===== Footer ===== */
footer{background:var(--navy);color:#ccc;padding:2.4rem 5% 1.5rem;font-size:0.85rem;}
.footer-grid{display:flex;justify-content:space-between;flex-wrap:wrap;gap:1.5rem;max-width:1080px;margin:0 auto 1.5rem;}
.footer-grid img{height:30px;margin-bottom:0.6rem;filter:brightness(0) invert(1);}
footer .copyright{text-align:center;border-top:1px solid rgba(255,255,255,0.12);padding-top:1.2rem;color:#999;font-size:0.78rem;}

/* ===== Responsive ===== */
@media (max-width:880px){
  .nav-toggle{display:flex;}
  header nav{
    display:none;position:absolute;top:100%;left:0;right:0;background:#fff;
    flex-direction:column;align-items:stretch;border-bottom:1px solid #e5e5e5;
    box-shadow:0 8px 16px rgba(0,0,0,0.08);padding:0.5rem 5% 1rem;
  }
  header nav.open{display:flex;}
  header nav a{margin:0;padding:0.9rem 0;border-bottom:1px solid #eee;}
  header nav a.current{border-bottom:1px solid #eee;font-weight:800;}
  header nav a.header-cta{margin-top:0.8rem;padding:0.8rem 1rem;text-align:center;border-bottom:0;}
  .blog-hero h1{font-size:1.6rem;}
  .post h1{font-size:1.4rem;}
  .admin .row{grid-template-columns:1fr;}
  .admin-list li{flex-wrap:wrap;}
  .admin-list .meta{flex-basis:100%;}
  .admin-list .ttl{flex-basis:100%;}
}
