/* Custom header styles for Airdrop Lab */

/* ─── Color variables ─── */
:root {
  --adlab-blue: #1232A6;
  --adlab-gradient: linear-gradient(135deg, #FF6B35 0%, #FF8E53 65%);
}

/* ─── 1. Header background and shadow ─── */
#gh-head {
  background-color: var(--adlab-blue) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
  height: 70px !important;
}

/* Adjust inner header height */
#gh-head .gh-head-inner {
  height: 70px !important;
}

/* Adjust logo size for new header height */
#gh-head .gh-head-logo img {
  max-height: 32px !important;
}

/* ─── 2. Header text and navigation links ─── */
#gh-head,
#gh-head a,
#gh-head .gh-head-logo,
#gh-head .gh-head-menu a {
  color: #fff !important;
}

/* Make navigation menu font size consistent with sign in/account links */
#gh-head .gh-head-menu {
  font-size: 1.6rem !important;
}

#gh-head .gh-head-menu a {
  font-size: inherit !important;
}

/* ─── 3. Search icon specific styling (stroke only, no fill) ─── */
#gh-head .gh-search svg {
  stroke: #fff !important;
  fill: none !important;
}

/* ─── 4. Mobile menu toggle (hamburger) icon ─── */
#gh-head .gh-burger::before,
#gh-head .gh-burger::after {
  background-color: #fff !important;
}

/* Fix the X mark color when menu is open */
.is-head-open #gh-head .gh-burger::before,
.is-head-open #gh-head .gh-burger::after {
  background-color: #fff !important;
}

/* ─── 5. Mobile menu overlay styling ─── */
.is-open #gh-head {
  background-color: var(--adlab-blue) !important;
}

.is-open .gh-head-menu a {
  color: #fff !important;
}

/* ─── 6. Sign up button (orange gradient) ─── */
#gh-head a[data-portal="signup"] {
  background: none !important;
  background-image: var(--adlab-gradient) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0.7rem !important;
  padding: 0.5em 1.2em !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
  transition: filter 0.15s ease !important;
}

#gh-head a[data-portal="signup"]:hover {
  filter: brightness(1.1) !important;
}

/* ─── 7. Sign in / Account link (plain text) ─── */
#gh-head a[data-portal="signin"],
#gh-head a[data-portal="account"] {
  background: none !important;
  color: #fff !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 1rem !important;
  font-weight: 400 !important;
  display: inline !important;
  line-height: inherit !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

/* ─── 8. Mobile header height adjustment ─── */
@media (max-width: 767px) {
  #gh-head {
    height: 64px !important;
  }
  
  #gh-head .gh-head-inner {
    height: 64px !important;
  }
  
  #gh-head .gh-head-logo img {
    max-height: 40px !important;
  }
}

/* ─── 9. Mobile menu specific fixes ─── */
@media (max-width: 991px) {
  /* Fix mobile menu background */
  .gh-head-inner.is-open {
    background-color: var(--adlab-blue) !important;
  }
  
  /* Fix mobile menu button styling */
  .is-open .gh-head-actions {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  /* Remove white background from mobile menu actions container */
  .gh-head-actions {
    background: transparent !important;
    background-color: transparent !important;
  }
  
  /* Ensure mobile sign up button is properly styled */
  .is-open #gh-head a[data-portal="signup"] {
    background-image: var(--adlab-gradient) !important;
    color: #fff !important;
    width: auto !important;
    margin: 1rem !important;
  }
  
  /* Fix white rectangle at bottom - target the actions wrapper */
  .is-open .gh-head-actions,
  .gh-head-inner.is-open .gh-head-actions {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  /* Additional fix for any container that might have white background */
  .gh-head-inner.is-open > * {
    background-color: transparent !important;
  }
  
  /* Keep the blue background only on the main container */
  .gh-head-inner.is-open {
    background-color: var(--adlab-blue) !important;
  }
}

/* ─── 10. Form button styling (for consistency) ─── */
.form-button {
  background: none !important;
  background-image: var(--adlab-gradient) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0.7rem !important;
  padding: 0.85em 1.8em !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
  transition: filter 0.15s ease !important;
}

.form-button:hover {
  filter: brightness(1.1) !important;
}

/* ─── 11. Article CTA button styling（会員限定記事のCTAボタン） ─── */
button.single-cta-button[data-portal="signup"],
a.single-cta-button[data-portal="signup"],
button.single-cta-button,
a.single-cta-button {
  /* オレンジ単色（記事内ボタンと統一） */
  background: #FF6B35 !important;
  background-image: none !important;
  
  /* ボタンの基本スタイル */
  color: #fff !important;
  border: none !important;
  border-radius: 0.5rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  
  /* サイズ調整 */
  padding: 14px 42px !important;
  min-height: 48px !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  
  /* 立体的な影を追加（記事内ボタンと同じ） */
  box-shadow: 0 4px 0 #d45a2a, 0 6px 12px rgba(0, 0, 0, 0.15) !important;
  
  /* ホバーエフェクト用のトランジション */
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease !important;
  cursor: pointer !important;
  
  /* ボタンの配置 */
  margin: 1.5rem auto !important;
  width: auto !important;
  
  /* 押し込み効果のための位置調整 */
  position: relative !important;
  top: 0 !important;
}

button.single-cta-button[data-portal="signup"]:hover,
a.single-cta-button[data-portal="signup"]:hover,
button.single-cta-button:hover,
a.single-cta-button:hover {
  /* ホバー時は少し明るく */
  background: #FF7B45 !important;
  /* 影をそのまま維持 */
  box-shadow: 0 4px 0 #d45a2a, 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

/* アクティブ（クリック）時のエフェクト - 押し込まれる感覚 */
button.single-cta-button[data-portal="signup"]:active,
a.single-cta-button[data-portal="signup"]:active,
button.single-cta-button:active,
a.single-cta-button:active {
  /* 押し込まれる動き */
  top: 4px !important;
  /* 影を小さく */
  box-shadow: 0 0 0 #d45a2a, 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* ─── 12. Tag styling (moved from code injection) ─── */
.post-card-tags a,
.tag-label {
  background: #10C6A4 !important;
  color: #fff !important;
  border-radius: 9999px !important;
  padding: .15em .55em !important;
  font-size: .75rem !important;
}

/* ─── 13. Hide Ghost branding ─── */
.gh-powered-by { 
  display: none !important; 
}

/* ─── 14. Additional mobile menu fixes ─── */
@media (max-width: 767px) {
  /* Reset mobile menu default styles that might be hiding it */
  #gh-head .gh-head-menu {
    display: flex !important;
  }
  
  /* Mobile menu opened state */
  .is-head-open #gh-head {
    background-color: var(--adlab-blue) !important;
    height: 100% !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 3999999 !important;
    overflow-y: scroll !important;
  }
  
  .is-head-open #gh-head .gh-head-inner {
    background-color: var(--adlab-blue) !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr auto !important;
    gap: 48px !important;
  }
  
  /* Keep header brand layout consistent when menu is open */
  .is-head-open .gh-head-brand {
    display: grid !important;
    grid-template-columns: 1fr auto auto !important;
    align-items: center !important;
    height: 64px !important;
    grid-column-start: 1 !important;
  }
  
  /* Ensure mobile menu is visible and properly positioned */
  .is-head-open #gh-head .gh-head-menu {
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    display: flex !important;
    justify-content: center !important;
  }
  
  /* Style mobile navigation container and links */
  .is-head-open #gh-head .nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    align-items: center !important;
    line-height: 1.4 !important;
  }
  
  .is-head-open #gh-head .nav li {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: transform .2s, opacity .2s !important;
  }
  
  .is-head-open #gh-head .nav a {
    color: #fff !important;
    font-size: 2.6rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
  }
  
  /* Actions section at the bottom */
  .is-head-open #gh-head .gh-head-actions {
    opacity: 1 !important;
    visibility: visible !important;
    position: sticky !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background-color: var(--adlab-blue) !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    padding: var(--gap) 0 calc(var(--gap) + 8px) !important;
    text-align: center !important;
  }
  
  /* Ensure all action buttons are visible */
  .is-head-open #gh-head .gh-head-actions > *,
  .is-head-open #gh-head :is(.gh-head-btn, .gh-head-link) {
    background: transparent !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: transform .4s, opacity .4s !important;
    transition-delay: .2s !important;
  }
  
  /* Style the sign up button in mobile menu */
  .is-head-open #gh-head a[data-portal="signup"] {
    background-image: var(--adlab-gradient) !important;
    color: #fff !important;
    width: 100% !important;
    font-size: 1.8rem !important;
    text-transform: none !important;
  }
  
  /* Hide main content when menu is open */
  .is-head-open #gh-main {
    opacity: 0 !important;
    transition: opacity .4s !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   15. 記事内のボタンカスタマイズ
   Article Content Button Customization
   ═══════════════════════════════════════════════════════════════ */

/* Ghostエディタで作成されたボタンカード (.kg-btn, .kg-btn-accent) をカスタマイズ
   - PCでは横幅を約1.5倍に拡大して強調
   - スマホでは画面の横幅にフィット（左右に適切な余白）
   - アクセントカラー（オレンジグラデーション）を適用 */

/* 基本スタイル - すべての記事内ボタンに適用 */
.gh-content .kg-btn,
.gh-content .kg-btn-accent,
.gh-content a.kg-btn,
.gh-content a.kg-btn-accent,
.kg-card.kg-button-card .kg-btn,
.kg-card.kg-button-card .kg-btn-accent {
  /* オレンジ単色（グラデーションなし） */
  background: #FF6B35 !important;
  background-image: none !important;
  
  /* ボタンの基本スタイル */
  color: #fff !important;
  border: none !important;
  border-radius: 0.5rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  
  /* PC: 横幅をさらに拡大 */
  padding: 14px 42px !important;
  min-height: 48px !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
  
  /* 立体的な影を追加 */
  box-shadow: 0 4px 0 #d45a2a, 0 6px 12px rgba(0, 0, 0, 0.15) !important;
  
  /* ホバーエフェクト用のトランジション */
  transition: transform 0.1s ease, box-shadow 0.1s ease !important;
  cursor: pointer !important;
  
  /* ボタンの配置 */
  margin: 1.5rem auto !important;
  width: auto !important;
  
  /* 押し込み効果のための位置調整 */
  position: relative !important;
  top: 0 !important;
}

/* ホバー時のエフェクト */
.gh-content .kg-btn:hover,
.gh-content .kg-btn-accent:hover,
.gh-content a.kg-btn:hover,
.gh-content a.kg-btn-accent:hover,
.kg-card.kg-button-card .kg-btn:hover,
.kg-card.kg-button-card .kg-btn-accent:hover {
  /* ホバー時は少し明るく */
  background: #FF7B45 !important;
  /* 影をそのまま維持 */
  box-shadow: 0 4px 0 #d45a2a, 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

/* アクティブ（クリック）時のエフェクト - 押し込まれる感覚 */
.gh-content .kg-btn:active,
.gh-content .kg-btn-accent:active,
.gh-content a.kg-btn:active,
.gh-content a.kg-btn-accent:active,
.kg-card.kg-button-card .kg-btn:active,
.kg-card.kg-button-card .kg-btn-accent:active {
  /* 押し込まれる動き */
  top: 4px !important;
  /* 影を小さく */
  box-shadow: 0 0 0 #d45a2a, 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

/* ボタンカードコンテナの中央揃え */
.gh-content .kg-card.kg-button-card {
  text-align: center !important;
  margin: 2rem 0 !important;
}

/* 複数ボタンが並ぶ場合の調整 */
.gh-content .kg-button-card + .kg-button-card {
  margin-top: 1rem !important;
}

/* ─── PC表示：より大きく強調 ─── */
@media (min-width: 1024px) {
  .gh-content .kg-btn,
  .gh-content .kg-btn-accent,
  .gh-content a.kg-btn,
  .gh-content a.kg-btn-accent,
  .kg-card.kg-button-card .kg-btn,
  .kg-card.kg-button-card .kg-btn-accent {
    /* PCでは横幅をさらに約1.5倍に拡大（より目立つように） */
    padding: 16px 72px !important;
    min-height: 52px !important;
    font-size: 17px !important;
  }
}

/* ─── タブレット表示：中間的なサイズ ─── */
@media (min-width: 768px) and (max-width: 1023px) {
  .gh-content .kg-btn,
  .gh-content .kg-btn-accent,
  .gh-content a.kg-btn,
  .gh-content a.kg-btn-accent,
  .kg-card.kg-button-card .kg-btn,
  .kg-card.kg-button-card .kg-btn-accent {
    /* タブレットでは少し控えめなサイズ */
    padding: 13px 36px !important;
    font-size: 16px !important;
  }
}

/* ─── スマホ表示：画面幅にフィット ─── */
@media (max-width: 767px) {
  .gh-content .kg-btn,
  .gh-content .kg-btn-accent,
  .gh-content a.kg-btn,
  .gh-content a.kg-btn-accent,
  .kg-card.kg-button-card .kg-btn,
  .kg-card.kg-button-card .kg-btn-accent {
    /* スマホでは画面幅いっぱいに広がる */
    width: 100% !important;
    max-width: 100% !important;
    
    /* 左右の余白（画面端からの距離） */
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    
    /* パディングは少し小さめに */
    padding: 12px 24px !important;
    min-height: 48px !important;
    
    /* フォントサイズは維持（タップしやすいように） */
    font-size: 16px !important;
    
    /* ブロック要素として表示 */
    display: flex !important;
  }
}