/**
 * Agrié Educational Tools — 共通ヘッダー
 * agrie-header.css  v1.0
 *
 * ━━━━ 使い方 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *   <link rel="stylesheet" href="assets/agrie-header.css" />
 *
 * ━━━━ HTML 構造テンプレート ━━━━━━━━━━━━━━━━━━━━━━━
 *
 *   <!-- トップ画面（ボタンなし） -->
 *   <header class="agrie-header">
 *     <div class="agrie-header-brand">
 *       <div class="agrie-header-logo" aria-hidden="true">A</div>
 *       <div class="agrie-header-brand-text">
 *         <span class="agrie-header-brand-name">Agrié</span>
 *         <span class="agrie-header-brand-sub">Educational Tools</span>
 *       </div>
 *     </div>
 *     <nav class="agrie-header-actions" aria-label="ヘッダーメニュー">
 *       <!-- 将来: <button class="agrie-hdr-btn agrie-hdr-btn-apps">アプリ一覧</button> -->
 *     </nav>
 *   </header>
 *
 *   <!-- サブ画面（戻るボタンあり） -->
 *   <header class="agrie-header">
 *     <div class="agrie-header-brand"> ... </div>
 *     <nav class="agrie-header-actions" aria-label="ヘッダーメニュー">
 *       <button class="agrie-hdr-btn agrie-hdr-btn-back"
 *               onclick="gotoScreen('s-xxx')" aria-label="前の画面へ戻る">←</button>
 *     </nav>
 *   </header>
 *
 * ━━━━ 対応アプリ例 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 *   ・LDトリアージュ チェック
 *   ・よみかき支援ポータル
 *   ・算数困難そうかチャート
 *   ・吃音学習ワーク
 *   ・不登校支援ナビ
 */

/* ════════════════════════════════════════════════
   ヘッダー本体
════════════════════════════════════════════════ */
.agrie-header {
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  min-height: 52px;
  background: linear-gradient(135deg, #4f46e5 0%, #3b6eea 55%, #60a5fa 100%);
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.22);
}

/* ════════════════════════════════════════════════
   左側: ブランド
════════════════════════════════════════════════ */
.agrie-header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* A マーク（ロゴ） */
.agrie-header-logo {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
}

/* ブランドテキスト（縦並び） */
.agrie-header-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}

.agrie-header-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.agrie-header-brand-sub {
  font-size: 8.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

/* ════════════════════════════════════════════════
   右側: アクション
════════════════════════════════════════════════ */
.agrie-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 汎用ヘッダーボタン */
.agrie-hdr-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  white-space: nowrap;
  transition: background .15s;
}
.agrie-hdr-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}
.agrie-hdr-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}
.agrie-hdr-btn:active {
  background: rgba(255, 255, 255, 0.34);
}

/* 戻るボタン */
.agrie-hdr-btn-back {
  padding: 5px 11px;
  font-size: 18px;
  letter-spacing: 0;
  border-radius: 8px;
}

/* アプリ一覧ボタン（メニュー本体は app-list.js が表示） */
.agrie-hdr-btn-apps {
  padding: 7px 16px;
  gap: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.agrie-hdr-btn-icon {
  font-size: 15px;
  line-height: 1;
}
/* スマホ: アイコンのみ表示 */
@media (max-width: 480px) {
  .agrie-hdr-btn-apps .agrie-hdr-btn-label {
    display: none;
  }
  .agrie-hdr-btn-apps {
    padding: 7px 11px;
    gap: 0;
  }
}

/* ════════════════════════════════════════════════
   レスポンシブ
════════════════════════════════════════════════ */
@media (min-width: 640px) {
  .agrie-header {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: max(16px, calc((100% - var(--app-content-max, 1240px)) / 2 + var(--app-content-pad, 24px)));
    padding-right: max(16px, calc((100% - var(--app-content-max, 1240px)) / 2 + var(--app-content-pad, 24px)));
  }
}

@media (min-width: 900px) {
  .agrie-header {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: max(16px, calc((100% - var(--app-content-max, 1240px)) / 2 + var(--app-content-pad, 24px)));
    padding-right: max(16px, calc((100% - var(--app-content-max, 1240px)) / 2 + var(--app-content-pad, 24px)));
  }
  .agrie-header-brand-name {
    font-size: 16px;
  }
  .agrie-header-brand-sub {
    font-size: 9px;
  }
  .agrie-header-logo {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }
}

/* ════════════════════════════════════════════════
   印刷時は非表示
════════════════════════════════════════════════ */
@media print {
  .agrie-header {
    display: none !important;
  }
}
