/* フォント（M PLUS Rounded 1c）は各HTMLの<link rel="preconnect"+stylesheet>で先読み。@importは表示が遅くなるため廃止(2026-07-05) */

:root{
  --cream:#FFF9EC; --ink:#3D2B1F; --orange:#FF9F43; --red:#e63946;
  --line:#F0D9B5; --muted:#7A6055; --soft:#FFFDF7; --green:#3B8F47; --green-bg:#E8F8EC;
  /* フッターのSNSアイコン（データURI・外部読み込みなし） */
  --sns-x:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.9 1.15h3.68l-8.04 9.19 9.46 12.51h-7.41l-5.8-7.58-6.64 7.58H.47l8.6-9.83L0 1.15h7.59l5.24 6.93zm-1.29 19.5h2.04L6.48 3.24H4.29z'/%3E%3C/svg%3E");
  --sns-ig:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.8.25 2.23.41.56.22.96.48 1.38.9.42.42.68.82.9 1.38.16.42.36 1.06.41 2.23.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.25 1.8-.41 2.23-.22.56-.48.96-.9 1.38-.42.42-.82.68-1.38.9-.42.16-1.06.36-2.23.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.8-.25-2.23-.41-.56-.22-.96-.48-1.38-.9-.42-.42-.68-.82-.9-1.38-.16-.42-.36-1.06-.41-2.23-.06-1.27-.07-1.65-.07-4.85s.01-3.58.07-4.85c.05-1.17.25-1.8.41-2.23.22-.56.48-.96.9-1.38.42-.42.82-.68 1.38-.9.42-.16 1.06-.36 2.23-.41 1.27-.06 1.65-.07 4.85-.07M12 0C8.74 0 8.33.01 7.05.07 5.78.13 4.9.33 4.14.63c-.79.3-1.46.72-2.12 1.39C1.35 2.68.93 3.35.63 4.14.33 4.9.13 5.78.07 7.05.01 8.33 0 8.74 0 12s.01 3.67.07 4.95c.06 1.27.26 2.15.56 2.91.3.79.72 1.46 1.39 2.12.66.67 1.33 1.09 2.12 1.39.76.3 1.64.5 2.91.56C8.33 23.99 8.74 24 12 24s3.67-.01 4.95-.07c1.27-.06 2.15-.26 2.91-.56.79-.3 1.46-.72 2.12-1.39.67-.66 1.09-1.33 1.39-2.12.3-.76.5-1.64.56-2.91.06-1.28.07-1.69.07-4.95s-.01-3.67-.07-4.95c-.06-1.27-.26-2.15-.56-2.91-.3-.79-.72-1.46-1.39-2.12C21.32 1.35 20.65.93 19.86.63c-.76-.3-1.64-.5-2.91-.56C15.67.01 15.26 0 12 0zm0 5.84a6.16 6.16 0 100 12.32 6.16 6.16 0 000-12.32zm0 10.16a4 4 0 110-8 4 4 0 010 8zm7.85-10.4a1.44 1.44 0 11-2.88 0 1.44 1.44 0 012.88 0z'/%3E%3C/svg%3E");
  --sns-th:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.589 12c.027 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.964-.065-1.19.408-2.285 1.33-3.082.88-.76 2.119-1.207 3.583-1.291a13.853 13.853 0 013.02.142c-.126-.742-.375-1.332-.75-1.757-.513-.586-1.308-.883-2.359-.89h-.029c-.844 0-1.992.232-2.721 1.32L7.734 7.847c.98-1.454 2.568-2.256 4.478-2.256h.044c3.194.02 5.097 1.975 5.287 5.388.108.046.216.094.321.142 1.49.7 2.58 1.761 3.154 3.07.797 1.82.871 4.79-1.548 7.158-1.85 1.81-4.094 2.628-7.277 2.65zm1.003-11.69c-.242 0-.487.007-.739.021-1.836.103-2.98.946-2.916 2.143.067 1.256 1.452 1.839 2.784 1.767 1.224-.065 2.818-.543 3.086-3.71a10.5 10.5 0 00-2.215-.221z'/%3E%3C/svg%3E");
}
*{margin:0;padding:0;box-sizing:border-box}
body{
  font-family:'M PLUS Rounded 1c','BIZ UDPGothic',sans-serif;
  background:var(--cream); color:var(--ink);
  min-height:100vh; padding:0 0 40px;
  display:flex; flex-direction:column; align-items:center;
}
.wrap{width:100%; max-width:920px; padding:0 16px}

/* ── 全ページ共通：上部の常設ヘッダー＋タブバー ── */
.sitebar{
  position:sticky; top:0; z-index:50; width:100%;
  background:rgba(255,249,236,.92); backdrop-filter:saturate(1.1) blur(6px);
  border-bottom:1px solid var(--line);
}
.sitebar-in{
  max-width:920px; margin:0 auto; padding:8px 16px;
  display:flex; align-items:center; gap:14px;
}
.site-logo{display:flex; align-items:center; gap:9px; text-decoration:none; flex:none}
.site-logo img{width:38px; height:38px; display:block}
.site-logo .nm{font-size:1.15rem; font-weight:900; color:var(--ink); letter-spacing:.03em}
.site-tag{align-self:center; font-size:.73rem; font-weight:700; color:var(--muted); white-space:nowrap;
  line-height:1.25; border-left:1px solid var(--line); padding-left:10px; margin-left:10px}
@media(max-width:940px){ .site-tag{display:none} }
.site-nav{display:flex; gap:4px; overflow-x:auto; -webkit-overflow-scrolling:touch; margin-left:auto; padding-bottom:1px}
.site-nav::-webkit-scrollbar{height:0}
.site-nav a{
  flex:none; font-size:.85rem; font-weight:900; text-decoration:none; white-space:nowrap;
  color:var(--muted); border:2px solid transparent; border-radius:50px; padding:5px 12px; transition:.12s;
}
.site-nav a:hover{color:var(--ink); background:#fff; border-color:var(--line)}
.site-nav a.on{color:#fff; background:var(--orange); border-color:var(--orange)}
.wrap{padding-top:26px}
@media(max-width:900px){
  .site-nav a{font-size:.82rem; padding:5px 10px}
}
@media(max-width:620px){
  .site-logo .nm{font-size:1.02rem}
  .site-nav{gap:2px}
  .site-nav a{font-size:.8rem; padding:5px 9px}
}

/* hero（トップの見出し：ロゴ左＋説明右で1段） */
.hero{
  display:flex; align-items:center; gap:22px;
  margin:12px 0 8px; padding:16px 20px;
  background:var(--soft); border:1px solid var(--line); border-radius:16px;
}
.hero-logo{width:132px; height:auto; flex:none; display:block}
.hero-copy h1{font-size:1.12rem; font-weight:900; line-height:1.5; margin:0 0 7px; color:var(--ink)}
.hero-copy .lead{font-size:.9rem; font-weight:700; color:var(--muted); line-height:1.7; margin:0}
.hero-copy .lead b{color:var(--ink)}
@media(max-width:600px){
  .hero{flex-direction:column; text-align:center; gap:12px; padding:16px 16px 18px}
  .hero-logo{width:108px}
  .hero-copy h1{font-size:1.05rem}
}

/* header */
.brand{display:flex; align-items:center; justify-content:center; gap:13px}
.brand svg{flex:none}
.brand .name{font-size:clamp(1.9rem,5vw,2.4rem); font-weight:900; letter-spacing:.04em}
.tagline{text-align:center; font-size:clamp(.9rem,2.4vw,1.05rem); font-weight:900; color:var(--orange); margin:10px 0 0}
.subhead{font-size:.92rem; font-weight:900; color:#A86A1F; margin:0 0 12px}
/* 「つくれるプリント」の棚（教科ページ・学年ページ）。上に区切り線を引いて、ふつうのアプリと分ける */
.printsec{margin-top:30px; border-top:3px solid var(--line); padding-top:18px}
.printsec .subhead{font-size:1.05rem; margin:0 0 6px}
.secnote{font-size:.82rem; font-weight:700; color:var(--muted); line-height:1.6; margin:0 0 14px}

/* page header (教科ページ) */
.back{display:inline-block; font-weight:900; font-size:.9rem; color:#C25E00; text-decoration:none; margin-bottom:8px}
.back:hover{text-decoration:underline}
.backnav{display:flex; gap:14px; flex-wrap:wrap; align-items:center}
.backnav .back{margin-bottom:0}
.page-title{font-size:clamp(1.4rem,4vw,1.7rem); font-weight:900; margin:6px 0 2px}
.page-note{font-size:.82rem; font-weight:700; color:var(--muted); margin:0 0 14px}

/* grid + cards */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px}
.card{
  background:#fff; border:3px solid var(--line); border-radius:20px;
  padding:18px 16px; text-decoration:none; color:var(--ink);
  display:flex; flex-direction:column; gap:6px; position:relative;
  box-shadow:0 4px 14px rgba(100,60,20,.09); transition:.15s;
}
.card:hover{transform:translateY(-4px); border-color:var(--orange); box-shadow:0 8px 22px rgba(100,60,20,.17)}
.card .ico{font-size:2rem; line-height:1}
.card h3{font-size:1.08rem; font-weight:900}
.card p{font-size:.8rem; font-weight:700; color:var(--muted); line-height:1.55}
.card .badge{align-self:flex-start; font-weight:900; font-size:.72rem; border-radius:50px; padding:3px 12px; margin-top:2px}
.badge.ok{background:var(--green-bg); color:var(--green)}
.badge.pre{background:#F1E6D2; color:#9A7B4F}
/* NEWバッジ（公開30日以内・mm_new.jsが付与）: サムネ左上に乗せる。閲覧数🐾は.ctop側なので重ならない */
.card .badge.new{
  position:absolute; top:9px; left:9px; z-index:3; align-self:auto; margin-top:0;
  background:linear-gradient(135deg,#FFB25E,var(--red)); color:#fff;
  font-size:.66rem; letter-spacing:.06em; padding:3px 11px;
  box-shadow:0 3px 9px rgba(230,57,70,.4); pointer-events:none;
}
.card .views{
  position:absolute; top:10px; right:10px;
  background:transparent; color:#C9B79E; font-weight:700; font-size:.7rem;
  border-radius:50px; padding:2px 4px; letter-spacing:.02em;
  display:inline-flex; align-items:center; gap:3px;
}
.soon{border-style:dashed; border-color:#E5CBA8; background:var(--soft)}
.soon:hover{transform:none; border-color:#E5CBA8; box-shadow:0 4px 14px rgba(100,60,20,.06)}

/* app card with screenshot（画像＋名前＋説明） */
.card.shotcard{padding:0; overflow:hidden; gap:0}
.card .shot{width:100%; height:auto; aspect-ratio:16/10; object-fit:cover; object-position:top center;
  display:block; background:#F3EADB; border-bottom:1px solid var(--line)}
.card .cbody{padding:9px 13px 11px; display:flex; flex-direction:column; gap:2px}
.card .ctop{display:flex; align-items:baseline; justify-content:space-between; gap:8px}
.card .ctop h3{font-size:.96rem; font-weight:900; line-height:1.3}
.card .cbody p{font-size:.75rem; font-weight:700; color:var(--muted); line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
/* 閲覧数バッジは名前の段の右端に控えめに */
.card .ctop .views{position:static; flex:none; background:transparent; color:#C9B79E;
  font-weight:700; font-size:.72rem; padding:0; box-shadow:none}

/* recent */
.recent-sec{margin:26px 0 4px}
.recent-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:13px}
.recent-grid .card{flex-direction:row; align-items:center; gap:11px; padding:14px 15px}
.recent-grid .card .ico{font-size:1.6rem}
.recent-grid .card h3{font-size:.98rem}

/* grade tabs（教科ページ）/ subject tabs（先生のへや）— 見た目は共通 */
.gtabs,.stabs{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin:12px 0 18px}
.gtabs .label,.stabs .label{font-size:.76rem; font-weight:900; color:var(--green)}
.gtab,.stab{font-family:inherit; font-weight:900; font-size:.84rem; border:2px solid var(--line);
  background:#fff; color:var(--muted); border-radius:50px; padding:7px 15px; cursor:pointer; transition:.12s}
.gtab:hover,.stab:hover{border-color:#9CD9A6; color:var(--ink)}
.gtab.on,.stab.on{background:#6BCB77; border-color:#6BCB77; color:#fff}

/* section spacing */
section{margin-bottom:30px}

/* footer */
footer{text-align:center; border-top:1px solid var(--line); padding-top:16px; margin-top:34px;
  font-size:.74rem; font-weight:700; color:var(--muted); line-height:1.8}
.foot-links{display:flex; justify-content:center; column-gap:28px; row-gap:8px; flex-wrap:wrap; margin-bottom:10px}
.foot-links a{color:var(--muted); font-weight:900; font-size:.78rem; text-decoration:none; border-bottom:1px dotted #CDBBA6; padding-bottom:1px}
.foot-links a:hover{color:var(--orange); border-color:var(--orange)}
.foot-sns{display:flex; justify-content:center; align-items:center; column-gap:10px; row-gap:8px; flex-wrap:wrap; margin-bottom:12px}
.foot-sns .lead{color:var(--muted); font-weight:900; font-size:.76rem}
.foot-sns a{display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-weight:900; font-size:.76rem;
  text-decoration:none; background:#fff; border:1px solid var(--line); border-radius:999px; padding:5px 13px}
.foot-sns a:hover{color:var(--orange); border-color:var(--orange)}
/* SNSアイコンはmask-imageで色を文字色に追従させる（外部画像は読み込まない） */
.foot-sns a::before{content:''; width:13px; height:13px; flex:none; background:currentColor;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
  -webkit-mask-size:contain; mask-size:contain;
  -webkit-mask-position:center; mask-position:center}
.foot-sns a.sns-x::before{-webkit-mask-image:var(--sns-x); mask-image:var(--sns-x)}
.foot-sns a.sns-ig::before{-webkit-mask-image:var(--sns-ig); mask-image:var(--sns-ig)}
.foot-sns a.sns-th::before{-webkit-mask-image:var(--sns-th); mask-image:var(--sns-th)}

/* おしらせ（トップ） */
.news-list{list-style:none; margin:0; padding:4px 14px;
  max-height:260px; overflow-y:auto;
  background:#fff; border:2px solid var(--line); border-radius:16px}
.news-list li{font-size:.84rem; font-weight:700; color:var(--ink); line-height:1.7;
  padding:7px 2px; border-bottom:1px dashed var(--line)}
.news-list li:last-child{border-bottom:none}
.news-list .nd{font-size:.76rem; font-weight:900; color:#9A7B4F; margin-right:10px; letter-spacing:.02em}

/* キーボード操作の見える化 */
a:focus-visible, button:focus-visible{outline:3px solid var(--orange); outline-offset:2px; border-radius:6px}

/* 学年の入口（トップの「がくねんで えらぶ」）＋学年ページ */
.grade-row{display:grid; grid-template-columns:repeat(6,1fr); gap:10px}
@media(max-width:640px){ .grade-row{grid-template-columns:repeat(3,1fr)} }
.gbtn{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  background:#fff; border:3px solid #CFEBD4; border-radius:18px;
  padding:14px 6px 12px; text-decoration:none; color:var(--ink);
  box-shadow:0 4px 14px rgba(60,110,70,.10); transition:.15s;
}
.gbtn:hover{transform:translateY(-3px); border-color:#6BCB77; box-shadow:0 8px 20px rgba(60,110,70,.18)}
.gbtn .num{font-size:1.7rem; font-weight:900; line-height:1; color:var(--green)}
.gbtn .lbl{font-size:.82rem; font-weight:900}
.grade-intro{font-size:.86rem; font-weight:700; color:var(--muted); line-height:1.9; margin:2px 0 20px; max-width:780px}
.grade-intro b{color:var(--ink)}
.xnav{display:flex; flex-wrap:wrap; gap:8px}
.xnav a{font-size:.82rem; font-weight:900; text-decoration:none; color:var(--muted);
  background:#fff; border:2px solid var(--line); border-radius:50px; padding:6px 13px; transition:.12s}
.xnav a:hover{color:var(--ink); border-color:var(--orange)}

/* buttons */
.btn{display:inline-flex; align-items:center; gap:8px; font-family:inherit; font-weight:900;
  text-decoration:none; border:none; border-radius:50px; cursor:pointer; transition:.15s}
.btn-primary{background:var(--orange); color:#fff; font-size:1.05rem; padding:14px 30px;
  box-shadow:0 6px 16px rgba(255,159,67,.35)}
.btn-primary:hover{transform:translateY(-2px); box-shadow:0 10px 22px rgba(255,159,67,.45)}
