/* MARRY compatibility with SANGO 2.19.6 and 3.12.20. */
/* The child theme hides the frontend admin bar. Remove its reserved space
   on articles/pages as well; keep the homepage and wp-admin unchanged. */
html:has(> body.admin-bar.single),
html:has(> body.admin-bar.page:not(.home)) {
 margin-top: 0 !important;
}
#breadcrumb li:first-child a::before { content: "\f015"; }
/* The MARRY PC map replaces the narrow-screen drawer above 765px. */
@media screen and (min-width: 766px) {
 #drawer, .mobile-nav { display: none; }
}
@media screen and (max-width: 765px) {
 #drawer { display: block; }
}
/* Keep the legacy result grid and 404 container widths. */
.search .sidelong, .archive .sidelong { gap: 0; }
.search .sidelong__article, .archive .sidelong__article { box-shadow: none; }
@media screen and (max-width: 768px) {
 .search #inner-content, .error404 #inner-content { width: 92%; }
}

.search #inner-content::before, .archive #inner-content::before { content: " "; display: table; }
.sidelong__link { display: table; padding: 7px; }
.sidelong__img, .sidelong__article-info { display: table-cell; vertical-align: middle; }
.sidelong__img { width: 90px; height: 90px; }
.sidelong__article-info { width: calc(100% - 90px); }
@media screen and (max-width: 414px) {
 .sidelong__img { width: 39%; height: auto; }
}
@media screen and (min-width: 481px) and (max-width: 768px) {
 .sidelong__link { padding: 10px; }
 .sidelong__img { width: 120px; height: 120px; }
 .sidelong__article-info { width: calc(100% - 120px); padding-left: 15px; }
 .sidelong h2 { font-size: 19px; }
}
@media screen and (min-width: 769px) {
 .sidelong__link { padding: 8px; }
 .sidelong__img { width: 100px; height: 100px; }
 .sidelong__article-info { width: calc(100% - 100px); padding-left: 10px; }
}

.pref_small_div { max-height: 85vh; overflow-y: auto; overscroll-behavior: contain; }
.japan_map_overlay .pref_list > .area-small_btn { box-sizing: border-box; width: 50%; padding: .5em; cursor: pointer; font-weight: bold; }

.japan_map_overlay { z-index: 10020; }
.header:has(#drawer__input:checked), .header:has(.checkbox-toggle:checked) { transform: none !important; }
body:has(#drawer__input:checked), body:has(.checkbox-toggle:checked) { overflow: hidden; }

/* A transformed header must not become the drawer's viewport. */
.header:has(#drawer__input:checked), .header:has(.checkbox-toggle:checked) { will-change: auto; pointer-events: auto; overflow: visible; }
#drawer__content { height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
#drawer__content .ham_cont_ul, #drawer__content .ham_search { max-width: 100%; }
#drawer__content .ham_close { position: fixed; z-index: 2; }

/* Existing MARRY related cards use natural image proportions. */
.related-posts.type_c ul { display: flex; flex-wrap: wrap; }
.related-posts.type_c .rlmg { padding: 0 10px 0 0; }
.related-posts.type_c .rlmg img { position: static; height: auto; }
.related-posts.type_c .rlmg img { width: 100%; }

/* Image-protection overlays must not cover the region controls. */
.japan_map > .img-inner, .japan_map > .img-inner::after, .japan_map > .img-inner img { pointer-events: none; }
.japan_map .area_btn, .japan_map .area_btn-normal { z-index: 3; }
@media screen and (max-width: 765px) {
 #pc_nihon .japan_map .area_btn, #pc_nihon .japan_map .area_btn-normal { font-size: 10px; padding: 3px 6px; min-width: 0; }
}
.entry-content.cf::after { content: " "; display: table; clear: both; }

/* Preserve the legacy article header and sidebar surfaces. */
#entry { box-shadow: none; border-radius: 0; }
.normal-sidebar .widget, .fixed-sidebar .widget { box-shadow: none; border-radius: 0; overflow: visible; }
@media screen and (min-width: 769px) { .article-header { padding: 0; } }
/* MARRY search puts its title before main; retain the original block layout. */
.search #inner-content { display: block; }
.cardtype {
  margin-bottom: 1em;
}
.cardtype__article {
  position: relative;
  width: 100%;
  margin: 0 0 25px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.12), 0 2px 3px 0 rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: 0.2s ease-in-out;
}
.cardtype__article:hover {
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15), 0 0 5px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}
.cardtype__link {
  display: block;
  color: #555;
  text-decoration: none;
  cursor: pointer;
}
.cardtype__link:hover {
  color: #555;
  text-decoration: none;
}
.cardtype__img {
  margin: 0;
  overflow: hidden;
  position: relative;
  height: 0;
  padding-bottom: 57.7%;
}
.cardtype__img img {
  border-radius: 2px 2px 0 0;
  width: 100%;
}
.cardtype__link {
  padding-bottom: 25px;
}
.cardtype h2 {
  margin: 8px 13px 0;
  font-size: 17px;
}
.cardtype time {
  display: block;
  margin: 13px 13px 8px;
  color: #b5b5b5;
  font-size: 13px;
  font-weight: bold;
}

@media screen and (min-width: 481px) {
 .cardtype { display: flex; flex-wrap: wrap; }
 .cardtype__article { float: left; width: 46%; margin: 0 1.8% 25px; }
 .cardtype__link { padding-bottom: 15px; }
}
@media screen and (min-width: 1030px) {
 .cardtype__article { width: 45%; margin: 0 4% 25px 0; }
 .cardtype__link { padding-bottom: 25px; }
 .cardtype h2 { font-size: 18px; }
}

/* SANGO 3 removes the clearfix used by legacy MARRY templates. */
.cf::before, .cf::after { content: ""; display: table; }
.cf::after { clear: both; }
.cardtype { gap: 0; }
.sidelong { display: block; }
@media screen and (min-width: 481px) {
 .sidelong__article { width: 96%; margin: 0 1.8% 25px; }
}
@media screen and (min-width: 1030px) {
 .sidelong__article { float: left; width: 45.5%; margin: 0 3% 3% 0; min-height: 117px; }
}

/* Keep the mobile drawer cross centered independently of line-height. */
#drawer__content .ham_close { padding: 0; }
#drawer__content .ham_close span {
 position: absolute; left: 50%; top: 50%; width: 25px; height: 3px;
 margin: 0; transform-origin: center; transition: none;
}
#drawer__input:checked ~ #drawer__content .ham_close span {
 transform: translate(-50%, -50%) rotate(45deg); transition: none;
}
#drawer__content .ham_close span::before {
 top: 0; left: 0; width: 25px; height: 3px; margin: 0;
 transform-origin: center; transition: none;
}
#drawer__input:checked ~ #drawer__content .ham_close span::before {
 transform: rotate(90deg); transition: none;
}
/* The desktop map also shows the figures already present on mobile. */
#pc_nihon .pc_common-inner { position: relative; }
#pc_nihon .search_hosoku {
 top: 20%; left: 0; width: 62%; margin: 0; z-index: 3;
 font-size: clamp(10px, .9vw, 16px); pointer-events: none;
}
#pc_nihon .search_hosoku dt { font-size: 1.1em; }
#pc_nihon .search_hosoku dd {
 width: 100%; margin: 5px 0 0; padding: 6px 10px; font-size: inherit;
}
#pc_nihon .search_hosoku dd p {
 width: 100%; padding: 0; gap: 4px; font-size: inherit !important; line-height: 1.4; white-space: nowrap;
}

@media screen and (max-width: 765px) {
 .header #drawer #drawer__open {
  top: 0; height: 100%; display: flex; align-items: center; justify-content: center; line-height: 1;
 }
 .header .header-search { top: 0; height: 100%; line-height: 1; }
 .header .header-search__open { height: 100%; display: flex; align-items: center; justify-content: center; line-height: 1; }
 .header #logo .header-logo__link { height: 100%; display: flex; align-items: center; }
 .header #logo .header-logo__link .img-inner { margin-top: 0; margin-bottom: 0; line-height: 0; }
 .header #logo .header-logo__link img { transform: none; vertical-align: middle; }
}
@media screen and (max-width: 765px) {
 .header { --marry-control-height: 62px; }
 .header #drawer #drawer__open, .header .header-search { height: var(--marry-control-height); }
 .header .header-search { right: 48px; width: 48px; }
}
@media screen and (max-width: 500px) {
 .header { --marry-control-height: 60px; }
 .header.fixed { --marry-control-height: 40px; }
}
@media screen and (min-width: 766px) and (max-width: 1023px) {
 .header #inner-header { width: min(897px, calc(100% - 36px)) !important; max-width: 897px; }
 .header .outer-menu { right: -14px; }
}

@media screen and (max-width: 765px) {
 #pc_nihon .search_hosoku { position: static; width: 100%; margin-bottom: 12px; font-size: 12px; }
}
/* Match the left text inset to the visible right-hand menu bars. */
@media screen and (min-width: 766px) {
 .header #inner-header { width: min(897px, calc(100% - 36px)) !important; max-width: 897px !important; padding: 0 !important; margin: 0 auto !important; }
 .header #logo { display: flex; align-items: center; justify-content: center; width: 100% !important; height: 62px; margin: 0; }
 .header #logo .pc_header_disc { position: absolute; left: 0; top: 50%; margin: 0; transform: translateY(-50%); float: none; }
 .header #logo .header-logo__link { position: static; display: inline-flex; align-items: center; height: 62px; }
 .header .outer-menu { position: absolute; right: -16px; }
}
@media screen and (max-width: 765px) {
 .header #logo { width: calc(100% - 96px) !important; }
 .header #logo .header-logo__link { width: 100%; max-width: 240px; justify-content: flex-start; }
 .header #logo .header-logo__link > .img-inner { min-width: 0; flex: 0 1 42%; }
 .header #logo .header-logo__link > .img-inner + .img-inner { flex-basis: 58%; }
 .header #logo .header-logo__link img { width: 100% !important; height: auto !important; max-height: 36px; object-fit: contain; padding: 0 !important; }
 .header #logo .header-logo__link p:nth-child(2) img { padding: 0 !important; }
 .header .header-search { z-index: 101; }
}
@media screen and (max-width: 765px) {
 .header #inner-header { justify-content: flex-start; }
}
@media screen and (max-width: 765px) {
 .header #logo { height: var(--marry-control-height) !important; }
}
@media screen and (max-width: 765px) {
 .header #logo .header-logo__link { height: var(--marry-control-height) !important; }
 .header #inner-header { padding: 0 15px !important; }
}
