/* TCD Theme Global Overrides
 * Override problematic parent theme styles that affect responsive layout
 */

/* Fix #main_content responsive layout issue */
@media screen and (max-width: 1221px) {
  #main_content {
    width: 100% !important;
    left: 0 !important;
    position: relative !important;
    background: #f8f8f8 !important;
  }
}

@media screen and (min-width: 1222px) {
  #main_content {
    width: calc(100% - 330px) !important;
    left: 330px !important;
    position: relative !important;
    background: #f8f8f8 !important;
  }
}

/* TCD Component Color Overrides
 * Override parent theme default colors with ui-framework accent color
 */

/* Main content header background */
#main_content_header {
  background: var(--ui-primary-dark, #138496) !important;
}

/* Page Header - Primary Color Overlay */
#page_header .overlay,
#page_header > .overlay,
.page_header .overlay,
div#page_header div.overlay {
  opacity: 1 !important;
  background-color: transparent !important;
  background: linear-gradient(
    to bottom,
    rgba(23, 162, 184, 0.70) 0%,
    rgba(19, 132, 150, 0.80) 100%
  ) !important;
}

/* Page Header - Font */
#page_header .catch,
#page_header .desc,
#page_header .content {
  font-family: 'Noto Serif JP', serif !important;
}

/* Page Header - Title with subtitle (split by |) */
#page_header .catch .catch-main {
  display: block;
}

#page_header .catch .catch-sub {
  display: block;
  font-size: 0.5em;
  font-weight: 400;
  letter-spacing: 0.1em;
  margin-top: 8px;
  opacity: 0.9;
}

/* タブレット・モバイル共通スタイル（1221px以下） */
@media screen and (max-width: 1221px) {
  /* Header（左サイドバー）を完全に非表示 */
  #header {
    display: none !important;
  }
  
  /* グローバルメニューを非表示 */
  #global_menu {
    display: none !important;
  }
  
  /* SNSボタンを非表示 */
  #header_sns {
    display: none !important;
  }
  
  /* Sidebar（side_widget）を非表示 */
  #side_widget {
    display: none !important;
  }
  
  /* サイドボタン（ログイン等）を非表示 */
  #side_button {
    display: none !important;
  }
}

/* モバイルヘッダーバー表示範囲（1221px以下 - タブレット・モバイル共通） */
@media screen and (max-width: 1221px) {
  /* Page header を縮小 */
  #page_header {
    height: 200px !important;
  }
  
  #page_header .catch {
    font-size: 1.8em;
  }
  
  /* Header の after（60px白ブロック）を非表示 - すべてのページ */
  #header:after {
    display: none !important;
  }
  
  /* Header の before（border）を非表示 - すべてのページ */
  #header:before {
    display: none !important;
  }
  
  /* Header logo を非表示 - すべてのページ */
  #header_logo {
    display: none !important;
  }
}

/* Mobile Styles - 600px以下 */
@media screen and (max-width: 600px) {
  /* Page header をさらに縮小 */
  #page_header {
    height: 120px !important;
  }
  
  #page_header .catch {
    font-size: 1.5em;
  }
  
  #page_header .content {
    padding: 0 15px;
  }
}

/* News list category label background */
.news_list .category {
  background: var(--ui-accent, #17A2B8) !important;
}

/* Blog list category label background */
.blog_list .category {
  background: var(--ui-accent, #17A2B8) !important;
}

/* Mobile Header Bar - スクロール対応のヘッダー */
#mobile_header_bar {
  display: none; /* デフォルトは非表示 */
}

/* モバイルヘッダーバー表示範囲（1221px以下 - タブレット・モバイル共通） */
@media screen and (max-width: 1221px) {
  /* モバイルヘッダーバーを表示 */
  #mobile_header_bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    transform: translateY(0);
    transition: transform 0.3s ease;
  }
  
  /* スクロールダウン時に非表示 */
  #mobile_header_bar.hidden {
    transform: translateY(-100%);
  }
  
  /* モバイルメニューボタン */
  #mobile_menu_button {
    display: inline-block;
    width: 50px;
    height: 50px;
    position: relative;
    text-decoration: none;
    flex-shrink: 0;
  }
  
  #mobile_menu_button span {
    position: absolute;
    left: 10px;
    width: 30px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
  }
  
  #mobile_menu_button span:nth-child(1) {
    top: 14px;
  }
  
  #mobile_menu_button span:nth-child(2) {
    top: 23px;
  }
  
  #mobile_menu_button span:nth-child(3) {
    top: 32px;
  }
  
  #mobile_menu_button:hover span {
    background: var(--ui-primary-dark, #138496);
  }
  
  /* モバイルヘッダーロゴ */
  .mobile_header_logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
  }
  
  .mobile_header_logo .header-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    transition: opacity 0.3s ease;
  }
  
  .mobile_header_logo .header-logo-img {
    max-height: 40px;
    height: auto;
    width: auto;
    max-width: 200px;
    opacity: 1;  /* 通常時は完全不透明 */
    mix-blend-mode: darken;  /* 白背景を透明に、黒部分は維持 */
    transition: opacity 0.3s ease;
  }
  
  .mobile_header_logo .header-logo-link:hover .header-logo-img {
    opacity: 0.8;
  }
  
  /* Drawer Menu を有効化 */
  #drawer_menu {
    display: block !important;
  }
  
  /* ページコンテンツの上部余白調整 */
  body {
    padding-top: 60px;
  }
}

/* デスクトップでは完全に非表示 */
@media screen and (min-width: 1222px) {
  #mobile_header_bar {
    display: none !important;
  }
  
  body {
    padding-top: 0 !important;
  }
}

/* 既存の #drawer_menu_button を完全に非表示 */
#drawer_menu_button {
  display: none !important;
}

/* モバイルのdrawer_menu内のフッターメニューを非表示 */
#mobile_footer_menu {
  display: none !important;
}

