/* =========================================================
   俳句FAN：トップページ専用CSS
   ファイル：/portal-css/portal-top.css

   役割：
   - トップページの2カラムレイアウト
   - タブ切り替えの見た目
   - 右側サイドボックス
   - トップページ内での共通セクション余白調整

   注意：
   - ニュース／公募カードの中身は portal-base.css に任せる
   - ここではカード内部の余白・線・高さを個別に上書きしない
========================================================= */


/* =========================================================
   1. トップページ 2カラムレイアウト
========================================================= */

.hf-top-layout {
  width: 100%;
  max-width: var(--hf-width-wide);
  margin: 0 auto;
  padding: 0 16px 56px;

  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  align-items: start;

  box-sizing: border-box;
}

.hf-top-layout * {
  box-sizing: border-box;
}

.hf-top-main {
  min-width: 0;
  width: 100%;
  grid-column: 1;
  margin: 0;
  padding: 0;
}

.hf-top-side {
  width: 240px;
  grid-column: 2;
  margin: 0;
  padding: 0;
}


/* =========================================================
   2. タブ切り替え
   - 前の「タブらしい形」を維持
   - 案内文だけ追加
   - 押せることが少し分かる程度に調整
========================================================= */

.hf-top-tabs {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* タブ上の案内文 */
.hf-top-tab-guide {
  margin: 0 0 8px;
  padding: 0;

  color: var(--hf-color-subtext);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* タブボタン全体 */
.hf-top-tab-buttons {
  display: flex;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;

  border-bottom: 1px solid var(--hf-color-border);
}

/* タブボタン */
.hf-top-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 56px;
  padding: 0 22px;

  border: 1px solid var(--hf-color-border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;

  background: #f7f2e8;
  color: #3b2b18;

  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;

  cursor: pointer;

  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}

/* 非選択タブにカーソルを乗せたとき */
.hf-top-tab-button:hover {
  background: #fffaf0;
  color: #3b2b18;
  transform: translateY(-1px);
}

/* 選択中タブ */
.hf-top-tab-button.is-active {
  position: relative;
  z-index: 1;

  background: var(--hf-color-accent);
  border-color: var(--hf-color-accent);
  color: #fff;

  transform: none;
}

/* 選択中タブと下線を自然につなげる */
.hf-top-tab-button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;

  height: 1px;
  background: var(--hf-color-accent);
}

/* 選択中タブはホバー時に動かさない */
.hf-top-tab-button.is-active:hover {
  background: var(--hf-color-accent);
  border-color: var(--hf-color-accent);
  color: #fff;
  transform: none;
}

/* キーボード操作時 */
.hf-top-tab-button:focus-visible {
  outline: 3px solid rgba(138, 109, 59, 0.25);
  outline-offset: 2px;
}

/* タブパネル */
.hf-top-tab-panel {
  display: none;
  margin: 0;
  padding: 0;
}

.hf-top-tab-panel.is-active {
  display: block;
}


/* =========================================================
   3. トップページ内の共通セクション調整
   - 外側レイアウトのみ調整
   - カード内部には触らない
========================================================= */

.hf-top-tab-panel .hf-section {
  margin: 0;
  padding: 34px 36px;
}

/* トップページではニュースも公募も1列表示 */
.hf-top-main .hf-list {
  grid-template-columns: 1fr;
}

/* タブ内の最初の要素に余計な上余白を出さない */
.hf-top-tab-panel > *:first-child {
  margin-top: 0;
}


/* =========================================================
   4. 右側：結社・団体一覧リンクボックス
========================================================= */

.hf-side-box {
  margin: 0;
  padding: 20px 18px 20px;

  background: #ffffff;
  border: 1px solid var(--hf-color-border);
  border-radius: var(--hf-radius-card);
  box-shadow: var(--hf-shadow-card);
}

/* 余計な装飾は出さない */
.hf-side-box::before,
.hf-side-box::after {
  content: none !important;
  display: none !important;
}

.hf-side-box h3 {
  position: relative;

  margin: 0 0 14px;
  padding: 0 0 10px;

  border-bottom: 1px solid var(--hf-color-border-light);

  color: var(--hf-color-text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.5;
}

.hf-side-box h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;

  width: 42px;
  height: 2px;

  background: var(--hf-color-accent);
  border-radius: 999px;
}

.hf-side-lead {
  margin: 0 0 12px !important;

  color: var(--hf-color-subtext);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ボタン */
.hf-side-main-button,
.hf-side-main-button:link,
.hf-side-main-button:visited {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 100%;
  min-height: 48px;
  margin: 0 !important;
  padding: 0 14px !important;

  background: var(--hf-color-accent);
  border: none;
  border-radius: var(--hf-radius-small);

  color: #fff !important;

  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;

  box-shadow: none;

  transition:
    background-color 0.16s ease,
    transform 0.16s ease;
}

/* 矢印などは出さない */
.hf-side-main-button::before,
.hf-side-main-button::after {
  content: none !important;
  display: none !important;
}

.hf-side-main-button:hover {
  background: var(--hf-color-accent-dark);
  color: #fff !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}


/* =========================================================
   右側：姉妹サイト 俳句BOXカード
========================================================= */

.hf-top-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hf-side-box-haikubox {
  padding: 18px 16px 20px;
}

.hf-side-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin: 0 0 10px;
  padding: 4px 10px;

  background: #f4efe3;
  border: 1px solid #e4d6bd;
  border-radius: 999px;

  color: #7a5a25;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
}

.hf-side-banner-link {
  display: block;
  margin: 0 0 12px;
  text-decoration: none !important;
}

.hf-side-banner {
  display: block;
  width: 100%;
  height: auto;

  border-radius: 10px;
  border: 1px solid var(--hf-color-border-light);
  background: #fff;
}

.hf-side-box-haikubox .hf-side-lead {
  margin: 0 0 12px !important;
}


/* =========================================================
   5. タブレット・スマホ
========================================================= */

@media (max-width: 900px) {

  .hf-top-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 0 14px 44px;
  }

  .hf-top-main,
  .hf-top-side {
    width: 100%;
    grid-column: auto;
  }

  .hf-top-tab-guide {
    margin-bottom: 8px;
    font-size: 0.88rem;
  }

  .hf-top-tab-buttons {
    gap: 8px;
    margin-bottom: 14px;
  }

  .hf-top-tab-button {
    flex: 1;
    min-height: 54px;
    padding: 0 10px;
    font-size: 14.5px;
  }

  .hf-top-tab-panel .hf-section {
    padding: 28px 24px;
  }

  .hf-side-box {
    padding: 18px 16px 20px;
  }

  .hf-side-box h3 {
    font-size: 1rem;
  }

  .hf-side-lead {
    margin-bottom: 12px !important;
    font-size: 0.88rem;
    line-height: 1.7;
  }

  .hf-side-main-button {
    min-height: 48px;
    font-size: 0.92rem;
  }
}


@media (max-width: 768px) {

  .hf-top-tab-panel .hf-section {
    padding: 22px 18px;
  }

  .hf-side-main-button {
    min-height: 50px;
  }
}