/* =======================================
   春日土地フェア用 エリアボタンレイアウト調整
   8つのボタン用レスポンシブ対応（4行2列）
   ======================================= */

/* =======================================
   PC表示（1024px以上）
   ======================================= */
@media (min-width: 1024px) {
  .area-buttons {
    position: absolute;
    top: 32% !important;  /* 8エリアなので少し上に配置 */
    left: 50%;
    transform: translateX(-50%);
    width: 74% !important;  /* PCでは大きめに */
    max-width: 850px;  /* 最大幅を制限 */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);  /* 4行に対応 */
    row-gap: 0.5rem !important;     /* 8エリアなので行間を狭める */
    column-gap: 0.8rem !important;
    padding: 0;
  }
}

/* =======================================
   タブレット表示（768px〜1023px）
   ======================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  .area-buttons {
    position: absolute;
    top: 32% !important;
    left: 50%;
    transform: translateX(-50%);
    width: 74% !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    row-gap: 0.6rem !important;
    column-gap: 0.9rem !important;
    padding: 0;
  }
}

/* =======================================
   スマホ横向き（481px〜767px）
   ======================================= */
@media (min-width: 481px) and (max-width: 767px) {
  .area-buttons {
    position: absolute;
    top: 32% !important;
    left: 50%;
    transform: translateX(-50%);
    width: 74% !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    row-gap: 0.4rem !important;
    column-gap: 0.6rem !important;
    padding: 0;
  }
}

/* =======================================
   スマホ縦向き（480px以下）
   ======================================= */
@media (max-width: 480px) {
  .area-buttons {
    position: absolute;
    top: 32% !important;
    left: 50%;
    transform: translateX(-50%);
    width: 74% !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    row-gap: 0.3rem !important;
    column-gap: 0.5rem !important;
    padding: 0;
  }
}

/* =======================================
   小型スマホ（360px以下）
   ======================================= */
@media (max-width: 360px) {
  .area-buttons {
    position: absolute;
    top: 32% !important;
    left: 50%;
    transform: translateX(-50%);
    width: 74% !important;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    row-gap: 0.25rem !important;
    column-gap: 0.45rem !important;
    padding: 0;
  }
}

/* =======================================
   共通スタイル（全デバイス）
   ======================================= */
.area-buttons {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

/* 各ボタンのスタイル */
.area-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  max-width: 100%;
  position: relative;
}

.area-btn img {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.2s, transform 0.2s;
}

/* ホバー効果（PCとタブレットのみ） */
@media (hover: hover) and (pointer: fine) {
  .area-btn:hover img {
    transform: scale(1.05);
    opacity: 0.95;
  }
}

/* クリック/タップ効果 */
.area-btn:active img {
  opacity: 0.8;
  transform: scale(0.98);
}

/* =======================================
   背景画像のレスポンシブ対応
   ======================================= */
.area-section {
  position: relative;
  width: 100%;
}

.area-bg {
  width: 100%;
  height: auto;
  display: block;
}

/* =======================================
   特殊な画面サイズへの対応
   ======================================= */

/* 大型ディスプレイ（1920px以上） */
@media (min-width: 1920px) {
  .area-buttons {
    top: 31% !important;
    width: 65% !important;
    max-width: 1000px;
    row-gap: 0.7rem !important;
    column-gap: 1.0rem !important;
  }
}

/* iPad Pro等の大型タブレット */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
  .area-buttons {
    top: 31% !important;
    width: 60% !important;
    row-gap: 0.7rem !important;
    column-gap: 1rem !important;
  }
}
