/* Only enqueued for the opt-in standalone page template. */
.tanba-site-sidebar-page .tanba-site-sidebar-main { box-sizing:border-box; width:min(1200px,calc(100% - 40px)); margin:0 auto; padding:18px 0 72px; }
.tanba-site-sidebar-columns { display:grid; grid-template-columns:minmax(0,1fr) clamp(250px,23.5vw,280px); gap:44px; align-items:start; }
.tanba-site-sidebar-content,.tanba-site-sidebar { min-width:0; }
.tanba-site-sidebar { position:static; align-self:start; }
.tanba-site-sidebar,.tanba-site-sidebar * { box-sizing:border-box; }
/* Narita accordion card geometry, adapted to Tanba's existing images and palette. */
.tanba-site-sidebar__nav { display:grid; gap:10px; }
.tanba-site-sidebar__group { min-width:0; margin:0; padding:0; }
.tanba-site-sidebar .tanba-site-sidebar__toggle {
 width:100%; min-height:54px; padding:12px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px;
 border:1px solid #b4d18e !important; border-radius:12px; background:#fff !important; color:#456331 !important;
 font:inherit; font-size:15px; font-weight:700; line-height:1.35; text-align:left; text-decoration:none;
 box-shadow:0 3px 10px rgba(69,99,49,.06) !important; appearance:none; cursor:pointer;
}
.tanba-site-sidebar .tanba-site-sidebar__toggle:is(:hover,:focus,:active,[aria-expanded="true"]) { background:#f1f8e9 !important; border-color:#8cbc57 !important; color:#365322 !important; }
.tanba-site-sidebar__toggle:focus-visible { outline:2px solid #557b38; outline-offset:2px; }
.tanba-site-sidebar__mark { flex:0 0 auto; color:#557b38; font-size:24px; font-weight:400; line-height:1; }
.tanba-site-sidebar .tanba-site-sidebar__links { display:grid; gap:8px; list-style:none; margin:8px 0 0; padding:4px 4px 2px; }
.tanba-site-sidebar .tanba-site-sidebar__links[hidden] { display:none !important; }
.tanba-site-sidebar__links li { list-style:none; margin:0; padding:0; }
.tanba-site-sidebar__links a { display:block; width:min(220px,100%); margin:0 auto; line-height:0; text-decoration:none; }
.tanba-site-sidebar__links img { display:block; width:100%; height:auto; max-width:100%; }
.tanba-site-sidebar__links a:hover { opacity:.82; }
.tanba-site-sidebar__links a:focus-visible { outline:3px solid #557b38; outline-offset:3px; }
/* The common drawer is available below 1024px; keep body full width. */
@media (max-width:1023px) {
 .tanba-site-sidebar-page .tanba-site-sidebar-main { width:min(760px,calc(100% - 32px)); }
 .tanba-site-sidebar-columns { display:block; }
 .tanba-site-sidebar { display:none; }
}
@media (max-width:767px) {
 .tanba-site-sidebar-page .tanba-site-sidebar-main { width:calc(100% - 28px); padding:14px 0 60px; }
}

/* Keep the legacy body opening aligned during the opt-in migration.
 * A migrated page with the common intro starts both columns at the same edge. */
@media (min-width:1024px) {
 .tanba-site-sidebar { position:static; margin-top:48px; }
 .tanba-site-sidebar-columns:has(> .tanba-site-sidebar-content .tanba-page-intro) > .tanba-site-sidebar { margin-top:0; }
}

/* No nested scrollbar. Short menus stick to the top; long expanded menus
 * follow page scroll, with the sticky offset adjusted by direction. */
@media (min-width:1024px) {
 .tanba-site-sidebar { --tanba-side-top:20px; }
 body.admin-bar .tanba-site-sidebar { --tanba-side-top:52px; }
 .tanba-site-sidebar-columns > .tanba-site-sidebar {
  position:sticky; top:var(--tanba-side-offset,var(--tanba-side-top));
 }
}

/* The opt-in common intro sits above both columns. Preserve the legacy
 * alignment when intro is OFF and the approved sticky sizing in all cases. */
@media (min-width:1024px) {
 .tanba-site-sidebar-main--with-intro > .tanba-site-sidebar-columns > .tanba-site-sidebar { margin-top:0; }
}
/* Ordinary body text only, scoped to fully opted-in pages. Keep block-specific
 * selectors, inline styles, heading styles, table line heights and link colors. */
.tanba-site-sidebar-main--with-intro .tanba-site-sidebar-content { color:#33383d; }
.tanba-site-sidebar-main--with-intro .tanba-site-sidebar-content :where(p,li) { font-size:16px; }
.tanba-site-sidebar-main--with-intro .tanba-site-sidebar-content :where(p,li):where(:not(table *)) { line-height:1.70; }
.tanba-site-sidebar-main--with-intro .tanba-site-sidebar-content :where(td,th) { font-size:16px; }
@media (max-width:767px) {
 .tanba-site-sidebar-main--with-intro .tanba-site-sidebar-content :where(p,li):where(:not(table *)) { line-height:1.65; }
}

/* Align the full-width intro to the existing centered Gutenberg body,
 * without moving or resizing the body or the approved sidebar.
 * The same desktop grid geometry is used in the inset calculation. */
@media (min-width:1024px) {
 .tanba-site-sidebar-main--with-intro > .tanba-page-intro {
  padding-inline-start:max(0px,calc((100% - clamp(250px,23.5vw,280px) - 44px - var(--wp--style--global--content-size,800px)) / 2));
 }
}

/* 0.1.13: news archive only. Match the approved lower-page content width
 * and the category palette of the Narita-compatible Tanba TOP. */
.tanba-site-sidebar-main--news-archive .tanba-page-intro .tanba-page-intro__title--news {
 width:auto; font-size:18px; line-height:1.4; padding:0 0 0 15px;
 border-inline-start:5px solid #8cbc57; color:#3f4741;
}
.tanba-site-sidebar-main--news-archive > .tanba-page-intro { margin-bottom:30px; }
.tanba-site-sidebar-main--news-archive .tanba-page-intro .tanba-page-intro__breadcrumbs { margin-bottom:30px; }
.tanba-site-sidebar-main--news-archive .tanba-page-intro__title--news::after { display:none; }
.tanba-site-sidebar-main--news-archive .sn-archive-panel {
 width:100%; max-width:var(--wp--style--global--content-size,800px); margin:0 auto;
 color:#343b33; scroll-margin-top:20px;
}
.tanba-site-sidebar-main--news-archive .sn-archive-tabs { border-bottom-color:#b4d18e; }
.tanba-site-sidebar-main--news-archive .sn-archive-tab {
 color:#557b38; border:1px solid #8cbc57; background:#fff; box-shadow:none;
}
.tanba-site-sidebar-main--news-archive .sn-archive-tab.is-current {
 background:#eff6e8; color:#3f5c30; border-color:#8cbc57; box-shadow:none;
}
.tanba-site-sidebar-main--news-archive .sn-archive-tab:is(:hover,:focus-visible) {
 background:#e2efd6; color:#3f5c30; border-color:#557b38;
}
/* Same mix ratios as shakyo_news_legacy_color_scheme; base comes from
 * Shakyo News category settings, not hard-coded category names or IDs. */
.tanba-site-sidebar-main--news-archive .sn-archive-tab[style*="--sn-category-color"] {
 border:1px solid color-mix(in srgb,var(--sn-category-color) 65%,white);
 color:color-mix(in srgb,var(--sn-category-color) 42%,#17375e);
 background:color-mix(in srgb,var(--sn-category-color) 28%,white);
 box-shadow:none;
}
.tanba-site-sidebar-main--news-archive .sn-archive-tab[style*="--sn-category-color"].is-current {
 background:var(--sn-category-color);
 border-color:color-mix(in srgb,var(--sn-category-color) 65%,white);
 box-shadow:none;
}
.tanba-site-sidebar-main--news-archive .sn-archive-tab[style*="--sn-category-color"]:is(:hover,:focus-visible) {
 color:color-mix(in srgb,var(--sn-category-color) 42%,#17375e);
 background:color-mix(in srgb,var(--sn-category-color) 72%,white);
 border-color:color-mix(in srgb,var(--sn-category-color) 65%,white);
}
.tanba-site-sidebar-main--news-archive .sn-category-tag {
 background:color-mix(in srgb,var(--sn-category-color,#8cbc57) 42%,white);
 color:color-mix(in srgb,var(--sn-category-color,#8cbc57) 42%,#17375e);
 border-color:color-mix(in srgb,var(--sn-category-color,#8cbc57) 65%,white);
}
.tanba-site-sidebar-main--news-archive .sn-archive-row { border-bottom-color:#c7dbb4; color:#343b33; }
.tanba-site-sidebar-main--news-archive .sn-archive-row-title { color:#343b33; }
.tanba-site-sidebar-main--news-archive .sn-archive-row-meta { color:#4f5d47; }
.tanba-site-sidebar-main--news-archive .sn-archive-chevron { color:#557b38; }
.tanba-site-sidebar-main--news-archive .sn-archive-row:is(:hover,:focus-visible) { background:#f1f8e9; }
.tanba-site-sidebar-main--news-archive .sn-archive-empty { color:#65765d; }
.tanba-site-sidebar-main--news-archive .sn-archive-pagination a { background:#eff6e8; border-color:#b4d18e; color:#3f5c30; }
.tanba-site-sidebar-main--news-archive .sn-archive-pagination a:is(:hover,:focus-visible) { background:#d8e9c8; color:#3f5c30; }
.tanba-site-sidebar-main--news-archive .sn-archive-pagination .is-current { background:#557b38; border-color:#557b38; color:#fff; }
@media(max-width:767px) {
 .tanba-site-sidebar-main--news-archive .tanba-page-intro .tanba-page-intro__title--news { font-size:18px; padding-inline-start:12px; border-inline-start-width:4px; }
 .tanba-site-sidebar-main--news-archive > .tanba-page-intro { margin-bottom:26px; }
 .tanba-site-sidebar-main--news-archive .tanba-page-intro .tanba-page-intro__breadcrumbs { margin-bottom:26px; }
 .tanba-site-sidebar-main--news-archive .sn-archive-row { padding:17px 5px; }
}

/* 0.1.16: news detail, using Narita's recorded 18px / 5px news heading.
 * Keep the confirmed Tanba archive palette and lower-page grid. */
.tanba-site-sidebar-main--news-single > .tanba-page-intro { margin-bottom:30px; }
.tanba-site-sidebar-main--news-single .tanba-page-intro__breadcrumbs { margin-bottom:0; }
.tanba-site-sidebar-main--news-single .tanba-page-intro__breadcrumbs li { min-width:0; overflow-wrap:anywhere; }
.tanba-site-sidebar-main--news-single .tanba-news-single-article { width:100%; max-width:var(--wp--style--global--content-size,800px); margin:0 auto; }
.tanba-site-sidebar-main--news-single .tanba-news-single-header { margin:0 0 30px; }
.tanba-site-sidebar-main--news-single .tanba-news-single-title { margin:0 0 16px; padding:0 0 0 15px; border:0; border-inline-start:5px solid #8cbc57; background:none; color:#3f4741; font-size:18px; font-weight:700; line-height:1.4; overflow-wrap:anywhere; }
.tanba-site-sidebar-main--news-single .tanba-news-single-title::after { display:none; }
.tanba-site-sidebar-main--news-single .sn-single-meta { color:#4f5d47; }
.tanba-site-sidebar-main--news-single .sn-category-tag { background:color-mix(in srgb,var(--sn-category-color,#8cbc57) 42%,white); color:color-mix(in srgb,var(--sn-category-color,#8cbc57) 42%,#17375e); border-color:color-mix(in srgb,var(--sn-category-color,#8cbc57) 65%,white); }
.tanba-site-sidebar-main--news-single .tanba-news-single-content { font-size:16px; line-height:1.7; overflow-wrap:anywhere; }
.tanba-site-sidebar-main--news-single .tanba-news-single-content :where(img,iframe,video) { max-width:100%; }
.tanba-site-sidebar-main--news-single .tanba-news-single-content :where(img,video) { height:auto; }
.tanba-site-sidebar-main--news-single .sn-back-link { color:#456331; border-color:#8cbc57; background:#fff; font-size:15px; line-height:1.8; padding:10px 20px; }
.tanba-site-sidebar-main--news-single .sn-back-link:is(:hover,:focus-visible) { background:#eff6e8; }
@media(max-width:767px) {
 .tanba-site-sidebar-main--news-single > .tanba-page-intro { margin-bottom:26px; }
 .tanba-site-sidebar-main--news-single .tanba-news-single-title { padding-inline-start:12px; border-inline-start-width:4px; }
 .tanba-site-sidebar-main--news-single .tanba-news-single-header { margin-bottom:26px; }
 .tanba-site-sidebar-main--news-single .tanba-news-single-content { line-height:1.65; }
}

/* 0.1.20: migrated fixed-page Shakyo Blocks. Keep the constrained parent at
 * the same width as its ordinary paragraphs; SB alignment is intentional
 * and must not be overridden (it uses important inline-axis margins).
 * Exclude explicitly wide/full/floated groups and all news templates. */
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .wp-block-group:is(.is-layout-constrained,.wp-block-group-is-layout-constrained):not(.alignwide,.alignfull,.alignleft,.alignright):has(> .sb:is(.sb-box,.sb-table)) {
 max-width: min(100%,var(--wp--style--global--content-size,800px));
 margin-inline:auto!important;
}
/* Narita 0.1.22: heading margin 30px / 12px; 18px H2 and 16px H3
 * are supplied by Shakyo Blocks. Explicit bold counters theme resets. */
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-heading {
 margin-block:30px 12px;
}
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-heading :is(h2,h3,h4).shakyo-heading__text {
 font-weight:700;
}
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-heading + p:not([style*="margin"]) {
 margin-block-start:12px;
}
/* Narita table header alignment. Preserve ordinary data cells and all
 * block-specific colors, widths, and scroll behavior. */
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-table.sb-table--left table th[scope="row"],
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-table.sb-table--top table thead th {
 text-align:center;
}
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-table.sb-table--left table th[scope="row"] {
 vertical-align:middle;
}
/* Tanba mobile trial: simple unmerged two-column row-header tables only.
 * JS from Shakyo Blocks marks these tables; other tables retain their layout. */
@media(max-width:767px) {
 .tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content .sb.sb-table.sb-table--left .sb-table-scroll>table.sb-table-fit-two tr>th[scope="row"]:first-child { width:25%; }
}

/* 0.1.21: match Narita's opening-content spacing (title margin 22px / 20px).
 * Migrated pages still have transparent legacy columns/groups, so the opening
 * SB heading is not a direct child of the article. Avoid adding the regular
 * section margin on top of the page-title gap. No change to later headings,
 * explicitly authored margins/spacers, or news. */
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content > .sb.sb-heading:first-child:not([style*="margin"]),
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content > .wp-block-group:first-child > .sb.sb-heading:first-child:not([style*="margin"]),
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content > .wp-block-columns:first-child > .wp-block-column:first-child > .sb.sb-heading:first-child:not([style*="margin"]),
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content > .wp-block-columns:first-child > .wp-block-column:first-child > .wp-block-group:first-child > .sb.sb-heading:first-child:not([style*="margin"]),
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content > .wp-block-group:first-child > .wp-block-columns:first-child > .wp-block-column:first-child > .sb.sb-heading:first-child:not([style*="margin"]),
.tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) .tanba-site-sidebar-content > .wp-block-group:first-child > .wp-block-group:first-child > .sb.sb-heading:first-child:not([style*="margin"]) {
 margin-block-start:0;
}

/* 0.1.32: three newly authored pages lack the migrated constrained group.
 * Match its content width and the existing page-intro inset. Screen only;
 * do not change the sidebar track, other pages, or saved block content. */
@media screen {
 body:is(.page-id-2153,.page-id-2256,.page-id-3581).tanba-site-sidebar-page .tanba-site-sidebar-main--with-intro:not(.tanba-site-sidebar-main--news-archive,.tanba-site-sidebar-main--news-single) > .tanba-site-sidebar-columns > .tanba-site-sidebar-content {
  box-sizing:border-box;
  width:100%;
  max-width:min(100%,var(--wp--style--global--content-size,800px));
  margin-inline:auto;
 }
}

.tanba-site-sidebar > .tanba-utility-nav { margin-top:12px; }
