/* GRAMMIA article components. Scoped to avoid changing Lightning/VK outside articles. */
.grammia-article { --g-navy:#122d45; --g-gold:#95702d; --g-line:#e3ddcf; color:var(--g-navy); background:#fff; font-family:"Noto Sans CJK JP","Yu Gothic",sans-serif; font-size:16px; line-height:2; max-width:780px; margin-inline:auto; overflow-wrap:anywhere; }
.grammia-article *, .grammia-article *::before, .grammia-article *::after { box-sizing:border-box; }
.grammia-article p { margin:1em 0; color:inherit; font-size:1em; line-height:inherit; }
.grammia-article ul, .grammia-article ol { margin:1em 0; padding-inline-start:1.5em; }
.grammia-article a { color:#17566b; text-underline-offset:.24em; }
.grammia-article a:hover { color:#73531c; }
.grammia-article a:focus-visible, .grammia-article summary:focus-visible, .grammia-article [tabindex]:focus-visible { outline:3px solid #95702d; outline-offset:4px; }
.grammia-article h2, .grammia-article h3 { font-family:inherit; font-weight:700; color:var(--g-navy); line-height:1.6; text-wrap:pretty; }
.grammia-article .grammia-heading { margin:3.8em 0 1.2em; padding:0 0 .7em; border:0; border-bottom:1px solid var(--g-line); background:none; font-size:clamp(1.2rem,3vw,1.65rem); font-weight:700; scroll-margin-top:1.5rem; }
.grammia-article .grammia-heading::after { content:""; display:block; width:46px; height:3px; background:var(--g-gold); position:relative; top:.8em; }
.grammia-article .grammia-kicker { display:block; color:#806126; font-size:.7rem; letter-spacing:.16em; font-weight:700; margin-bottom:.65em; }
.grammia-article .grammia-demo { border:1px solid #d8c391; background:#fff9e9; padding:1.2rem 1.4rem; border-radius:6px; font-size:.85rem; margin-bottom:2rem; }
.grammia-article .grammia-demo p { margin:.5em 0 0; }
.grammia-article .grammia-learn { background:#f3f6f8; border-top:3px solid var(--g-gold); padding:1.7rem 2rem; margin:2.5rem 0 1.5rem; }
.grammia-article .grammia-learn h2 { margin:0 0 .9em; padding:0; border:0; font-size:1.3rem; }
.grammia-article .grammia-learn h2::after { display:none; }
.grammia-article .grammia-learn ul { list-style:none; padding:0; margin:0; }
.grammia-article .grammia-learn li { position:relative; padding:.45em 0 .45em 1.7em; }
.grammia-article .grammia-learn li::before { content:"✓"; position:absolute; left:0; color:#806126; font-weight:bold; }
.grammia-article .grammia-scope { color:#52616e; font-size:.85rem; border-left:2px solid var(--g-line); padding-left:1rem; }
.grammia-article .grammia-toc { margin:2.2rem 0; padding:1.3rem 1.5rem; border:1px solid var(--g-line); border-radius:6px; }
.grammia-article .grammia-toc h2 { font-size:1rem; margin:0 0 .6em; padding:0; border:0; background:none; }
.grammia-article .grammia-toc ol { margin:0; padding-left:1.8em; columns:2; column-gap:2rem; font-size:.85rem; }
.grammia-article .grammia-toc li { padding:.3em 0; break-inside:avoid; }
.grammia-article .grammia-toc a { color:var(--g-navy); text-decoration:none; }
.grammia-article .grammia-balloon { display:flex; gap:16px; margin:2rem 0; align-items:flex-start; }
.grammia-article .grammia-person { flex:0 0 56px; padding-top:4px; }
.grammia-article .grammia-avatar { display:flex; align-items:center; justify-content:center; width:56px; height:56px; overflow:hidden; background:#f7f1e5; border:2px solid #d9c38e; border-radius:50%; color:#665127; font-size:1.3rem; font-weight:700; box-shadow:0 2px 8px #122d4510; }
.grammia-article .grammia-avatar img { display:block; width:100%; height:100%; max-width:100%; object-fit:cover; }
.grammia-article .grammia-dialogue { flex:1; min-width:0; max-width:calc(100% - 72px); }
.grammia-article .grammia-speaker { display:block; font-size:.82rem; font-weight:700; color:#30485a; margin:0 0 .5rem; line-height:1.6; }
.grammia-article .grammia-speaker small { display:block; font-weight:400; font-size:.72rem; color:#596975; margin-top:.15rem; }
.grammia-article .grammia-message { position:relative; padding:1rem 1.2rem; border:1px solid #dce4e9; border-radius:12px; background:#f1f4f6; }
.grammia-article .grammia-message::before { content:""; position:absolute; width:12px; height:12px; top:16px; left:-7px; background:inherit; border-left:1px solid #dce4e9; border-bottom:1px solid #dce4e9; transform:rotate(45deg); }
.grammia-article .grammia-message p { margin:0; }
.grammia-article .is-author { flex-direction:row-reverse; }
.grammia-article .is-author .grammia-speaker { text-align:right; }
.grammia-article .is-author .grammia-avatar { color:#fff; background:var(--g-navy); border-color:#b79a5b; }
.grammia-article .is-author .grammia-message { background:#fffbf2; border-color:#d7c28f; }
.grammia-article .is-author .grammia-message::before { left:auto; right:-7px; transform:rotate(225deg); border-color:#d7c28f; }
.grammia-article .grammia-example { margin:1.6rem 0; padding:1.2rem 1.5rem; background:#f7f8f9; border-radius:6px; }
.grammia-article .grammia-example > strong { color:#806126; font-size:.75rem; letter-spacing:.08em; }
.grammia-article .grammia-example p { margin:.5rem 0 0; }
.grammia-article details > summary { cursor:pointer; padding:1rem 1.2rem; font-weight:600; }
.grammia-article details[open] > summary { border-bottom:1px solid var(--g-line); }
.grammia-article .grammia-evidence { border-left:3px solid var(--g-gold); background:#f5f2eb; margin:1.6rem 0; font-size:.85rem; }
.grammia-article .grammia-evidence blockquote { margin:1rem 1.3rem; border:none; padding:0; color:#3f4e59; }
.grammia-article .grammia-evidence cite { font-style:normal; font-size:.8rem; }
.grammia-article .grammia-transition { padding:1rem 0 1rem 1.2rem; border-left:2px solid #c8d2db; color:#526675; margin-top:2rem; }
.grammia-article .grammia-scroll-hint { color:#63717c; text-align:right; font-size:.75rem; margin:.5em 0; }
.grammia-article .grammia-table { overflow-x:auto; max-width:100%; margin-bottom:1rem; }
.grammia-article table { width:100%; min-width:36rem; border-collapse:collapse; font-size:.9rem; }
.grammia-article caption { text-align:left; color:#52616e; font-size:.8rem; padding-bottom:.6rem; }
.grammia-article th, .grammia-article td { padding:.9rem 1rem; border:1px solid #ddd; text-align:left; vertical-align:top; }
.grammia-article thead th { background:var(--g-navy); color:#fff; font-weight:500; }
.grammia-article tbody tr:nth-child(even) { background:#f7f8fa; }
.grammia-article .grammia-ref { display:inline-block; font-size:.72rem; font-weight:500; padding:.12em .65em; margin:0 .2em .3em 0; background:#eef3f5; border:1px solid #d9e3e7; border-radius:3px; text-decoration:none; }
.grammia-article .grammia-unmapped { font-size:.75rem; color:#795520; }
.grammia-article .grammia-summary { border:1px solid #d8c391; border-radius:5px; padding:1.2rem 1.5rem; }
.grammia-article .grammia-faq { border:1px solid var(--g-line); border-radius:5px; margin:.9rem 0; }
.grammia-article .grammia-faq summary span { color:#806126; }
.grammia-article .grammia-faq > div { padding:.2rem 1.2rem 1rem; }
.grammia-article .grammia-source { font-size:.85rem; border-bottom:1px solid var(--g-line); padding:.9rem 0; scroll-margin-top:2rem; }
.grammia-article .grammia-source p { margin:.4rem 0 0; color:#66747e; font-size:.75rem; }
.grammia-article .grammia-review { background:#f6f7f8; margin-top:1.5rem; font-size:.82rem; }
.grammia-article .grammia-review > p, .grammia-article .grammia-claim { margin:1rem 1.2rem; }
.grammia-article .grammia-claim { padding:1rem; background:#fff; border:1px solid var(--g-line); }
.grammia-article .grammia-claim h3 { font-size:.85rem; }
.grammia-article .grammia-claim blockquote { margin:1em 0; padding-left:1em; border-left:2px solid var(--g-line); }
.grammia-article .grammia-related { display:flex; flex-wrap:wrap; gap:.5rem 1rem; align-items:center; padding:1.2rem 1.5rem; border:1px solid var(--g-line); margin:.8rem 0; text-decoration:none; border-radius:5px; }
.grammia-article .grammia-related span:first-child { width:100%; color:#806126; font-size:.7rem; }
.grammia-article .grammia-related strong { flex:1; font-size:.95rem; }
.grammia-article .grammia-quiz { border:1px solid var(--g-line); border-radius:5px; padding:1.3rem 1.5rem; margin:1rem 0; }
.grammia-article .grammia-quiz h3 { font-size:1rem; margin:.7rem 0; }
.grammia-article .grammia-quiz details > summary { color:#fff; background:var(--g-navy); padding:.7rem 1rem; border-radius:3px; }
.grammia-article .grammia-quiz .grammia-answer { color:#806126; font-size:2rem; font-weight:bold; margin:.5rem 0; }
.grammia-article .grammia-footer { border-top:1px solid var(--g-line); padding:1.2rem 0; margin-top:3rem; font-size:.8rem; color:#52616e; }
/* Additional class on native VK balloon. VK itself supplies its base frontend styles. */
.grammia-article .grammia-balloon-native .vk_balloon_content { background:#f1f4f6; border-radius:10px; }
.grammia-article .grammia-balloon-native.vk_balloon-position-right .vk_balloon_content { background:#fffaf0; border:1px solid #dac493; }
@media (max-width:600px) {
 .grammia-article { font-size:16px; }
 .grammia-article .grammia-toc ol { columns:1; }
 .grammia-article table { font-size:1rem; }
 .grammia-article .grammia-learn { padding:1.2rem; }
 .grammia-article .grammia-balloon { gap:12px; }
 .grammia-article .grammia-person { flex-basis:44px; }
 .grammia-article .grammia-avatar { width:44px; height:44px; font-size:1.1rem; }
 .grammia-article .grammia-dialogue { max-width:calc(100% - 56px); }
 .grammia-article .grammia-message { padding:.8rem 1rem; }
 .grammia-article .grammia-quiz, .grammia-article .grammia-summary { padding:1rem; }
}
@media print { .grammia-article details { display:block; } .grammia-article .grammia-table { overflow:visible; } }

/* Reset theme decorations within generated articles; never target Lightning globally. */
.grammia-article .grammia-heading::before, .grammia-article .grammia-toc h2::before,
.grammia-article .grammia-learn h2::before, .grammia-article .grammia-quiz h3::before { content:none; }
.grammia-article .grammia-toc h2::after, .grammia-article .grammia-quiz h3::after { content:none; }
.grammia-article .grammia-quiz h3 { padding:0; border:0; background:none; }

/* Four-column training overview keeps names readable while scrolling on phones. */
.grammia-article .grammia-training-matrix table{min-width:44rem}
.grammia-article .grammia-training-matrix th:first-child,.grammia-article .grammia-training-matrix td:first-child{min-width:6rem;white-space:nowrap}

/* Ordered section content and the accessible two-clock flow share the brand palette. */
.grammia-article .grammia-subheading{color:#122d45;border:0;border-left:3px solid #b59a60;background:#f7f6f2;padding:.65rem .9rem;margin:2rem 0 1rem;font-size:1.15rem;line-height:1.7;scroll-margin-top:1rem}
.grammia-article .grammia-subheading::before,.grammia-article .grammia-subheading::after{content:none}
.grammia-article .grammia-clocks{margin:1.5rem 0;padding:1.3rem;border:1px solid #b59a60;border-radius:12px;background:#faf9f6;max-width:100%;box-sizing:border-box}
.grammia-article .grammia-clocks figcaption{font-weight:700;color:#122d45;margin-bottom:1rem}
.grammia-article .grammia-clock-steps{list-style:none;padding:0;margin:0;counter-reset:clock-step}
.grammia-article .grammia-clock-steps li{counter-increment:clock-step;background:#fff;border:1px solid #dce1e5;border-radius:8px;padding:1rem;margin:0 0 1.4rem;position:relative}
.grammia-article .grammia-clock-steps li::before{content:counter(clock-step);display:inline-flex;align-items:center;justify-content:center;width:1.7rem;height:1.7rem;margin-right:.5rem;border-radius:50%;background:#122d45;color:#fff;font-size:.8rem}
.grammia-article .grammia-clock-paths{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.grammia-article .grammia-clock-path{border:2px solid #8d9baa;border-radius:8px;background:#fff;padding:1rem;min-width:0}
.grammia-article .grammia-clock-path.is-gold{border-color:#9c7e36;background:#fffaf0}
.grammia-article .grammia-clock-path.is-silver{background:#f0f3f6}
.grammia-article .grammia-clock-path h4{color:#122d45;font-size:1rem;line-height:1.7;margin:0 0 .6rem;padding:0;border:0;background:none}
.grammia-article .grammia-clock-path h4::before,.grammia-article .grammia-clock-path h4::after{content:none}
.grammia-article .grammia-clocks p{margin:.6rem 0 0}
.grammia-article .grammia-clock-finish{padding:1rem;border-radius:8px;background:#122d45;color:#fff;font-weight:700}
.grammia-article .grammia-clock-note{font-size:.95rem;color:#3c4c59}
@media(max-width:600px){.grammia-article .grammia-clock-paths{grid-template-columns:1fr}.grammia-article .grammia-clocks{padding:1rem}.grammia-article .grammia-subheading{font-size:1.08rem}}

.grammia-article .grammia-clock-arrow{display:block;text-align:center;color:#806126;font-size:1.4rem;line-height:1.5;margin:.35rem 0}


/* 0.3.0: Optional built-in character portraits. Existing posts retain letter avatars
   until grammia-character-avatars is added to the existing grammia-article wrapper.
   Background URLs are relative to this plugin stylesheet, not WordPress media URLs. */
.grammia-article.grammia-character-avatars .grammia-balloon.is-reader .grammia-avatar,
.grammia-article.grammia-character-avatars .grammia-balloon.is-author .grammia-avatar {
  background-color: #f7f1e5;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.grammia-article.grammia-character-avatars .grammia-balloon.is-reader .grammia-avatar {
  background-image: url("characters/opening-reader.webp");
}
.grammia-article.grammia-character-avatars .grammia-balloon.is-author .grammia-avatar {
  background-image: url("characters/grammia-advisor.webp");
}
/* Suppress only the old letter while preserving its accessible text node. */
.grammia-article.grammia-character-avatars .grammia-balloon.is-reader .grammia-avatar > span,
.grammia-article.grammia-character-avatars .grammia-balloon.is-author .grammia-avatar > span {
  font-size: 0;
  color: transparent;
}
