/* =========================
   DSR 共通ヘッダーCSS（PC + スマホ）
   ========================= */

/* ヘッダー全体 */
.dsr-unified-header {
  background: #fff;
  padding: 10px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.dsr-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

/* ロゴ */
.dsr-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: auto;
  height: 36px;
  margin-left: 6px;
}
.dsr-logo img {
  display: block;
  height: 100%;
  width: auto;
  max-width: 110px;
}

/* PCナビゲーション */
.dsr-pc-nav {
  display: block;
  flex-grow: 1;
  text-align: center;
}
.dsr-pc-nav ul {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.dsr-pc-nav li {
  position: relative;
}
.dsr-pc-nav li a {
  text-decoration: none;
  color: #333;
  font-weight: 600;
  padding: 0 12px;
  white-space: nowrap;
  line-height: 1.6;
  display: flex;
  align-items: center;
  height: 48px;
}

/* ▼アイコン（サブメニューあり） - PC用 */
.dsr-pc-nav .has-submenu > a::after {
  content: "▼";
  font-size: 0.65em;
  margin-left: 6px;
  color: #666;
  transition: transform 0.2s ease;
  display: inline-block;
  transform: translateY(1px);
}
.dsr-pc-nav .has-submenu:hover > a::after {
  transform: rotate(180deg) translateY(1px);
}

/* PCサブメニュー */
.dsr-pc-nav .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 180px;
  z-index: 9999;
}
.dsr-pc-nav .has-submenu:hover .submenu {
  display: block;
}
.dsr-pc-nav .submenu li a {
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  color: #333;
}

/* ボタン共通 */
.dsr-entry-fixed-header,
.dsr-diagnosis-fixed-header {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 92px;
  height: 38px;
  padding: 0 6px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-grow: 1;
  flex-basis: 0;
}

/* ボタン色別 */
.dsr-entry-fixed-header {
  background: linear-gradient(90deg, #b3f35c 0%, #3aba0d 100%);
  color: #014b00;
}
.dsr-diagnosis-fixed-header {
  background: linear-gradient(90deg, #ffe066 0%, #ffd600 100%);
  color: #665200;
}

.dsr-entry-content-header,
.dsr-entry-content-header-diagnosis {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2px;
  padding: 4px 0;
}
.dsr-entry-line1-header,
.dsr-entry-line2-header {
  font-size: 0.88em;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* ボタンのコンテナ */
.dsr-header-buttons {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-right: 6px;
}

/* ハンバーガー（スマホ） */
.dsr-menu-toggle-header {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 6px;
  margin-right: 10px;
}
.dsr-menu-icon {
  width: 28px;
  height: 3px;
  background: #333;
  position: relative;
  display: block;
}
.dsr-menu-icon::before,
.dsr-menu-icon::after {
  content: "";
  width: 28px;
  height: 3px;
  background: #333;
  position: absolute;
  left: 0;
}
.dsr-menu-icon::before {
  top: -8px;
}
.dsr-menu-icon::after {
  bottom: -8px;
}

/* メニューパネル（スマホ） */
.dsr-menu-panel {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(255,255,255,0.97);
  padding: 80px 20px 20px;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dsr-menu-panel.open {
  display: block;
}
.dsr-menu-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
}

/* スマホメニュー内のナビ */
.dsr-mobile-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dsr-mobile-nav li {
  margin: 20px 0;
}
.dsr-mobile-nav li a {
  text-decoration: none;
  font-size: 1.2em;
  color: #333;
  display: block;
  padding: 5px 0;
}

/* スマホメニューのサブメニュー */
.dsr-mobile-nav .has-submenu {
  position: relative;
}
.dsr-mobile-nav .submenu {
  display: none;
  list-style: none;
  padding: 0 0 0 20px;
  margin: 10px 0 0;
  border-left: 2px solid #eee;
}
.dsr-mobile-nav .has-submenu.open > .submenu {
  display: block;
}
.dsr-mobile-nav .submenu li {
  margin: 10px 0;
}
.dsr-mobile-nav .submenu li a {
  font-size: 1em;
  padding: 5px 0;
  color: #555;
}
.dsr-mobile-nav .has-submenu > a {
  padding-right: 30px;
}
.dsr-mobile-nav .has-submenu > a::after {
  content: '▼';
  font-size: 0.8em;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.3s ease;
  color: #888;
}
.dsr-mobile-nav .has-submenu.open > a::after {
  transform: translateY(-50%) rotate(180deg);
}

/* =========================
   スマホ向け調整（修正済）
   ========================= */
@media screen and (max-width: 768px) {
  .dsr-pc-nav {
    display: none;
  }
  .dsr-menu-toggle-header {
    display: block;
  }
  .dsr-unified-header {
    background: rgba(255,255,255,0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
  .dsr-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
  }
  .dsr-logo {
    margin-left: 6px;
    margin-right: 0;
  }
  .dsr-logo img {
    max-width: 120px;
  }
  .dsr-header-buttons {
    gap: 5px;
    flex-wrap: nowrap;
    margin-left: auto;
    margin-right: 6px;
  }
  .dsr-entry-fixed-header,
  .dsr-diagnosis-fixed-header {
    font-size: 0.65em;
    padding: 5px 6px;
    min-width: 60px;
    min-height: 36px;
    white-space: normal;
    word-break: break-word;
    flex-grow: 1;
    flex-basis: 0;
  }
  .dsr-entry-content-header,
  .dsr-entry-content-header-diagnosis {
    height: auto;
    min-height: 36px;
  }
}

/* =========================
   ページごとの余白調整
   ========================= */
body.page-template-dsr-custom-top-page {
  scroll-padding-top: 80px;
}
body.single .l-mainContent,
body.single .post_content,
body.single .entry-content,
body.single main,
body.single .wp-site-blocks {
  margin-top: 80px;
}

body.no-scroll {
  overflow: hidden;
  height: 100vh;
  position: fixed;
  width: 100%;
}