/*
Theme Name: Millennial Coin
Description: ミレニアルコイン 旧サイト(独自PHP/Twig)のデザインを移植したオリジナルテーマ。商品カタログ＋お問い合わせ形式。
Version: 1.0.0
Author: パーク株式会社
Text Domain: millennial-coin
Requires at least: 6.8
Requires PHP: 8.0
*/

/*
 * 旧サイトのCSSは reset.css / base.css / site.css(旧 style.css) / haru.css をそのまま読み込んでいる。
 * このファイルには WordPress 化に伴う追加・調整分だけを書く。
 */

/* --- WordPress 管理バー表示時のずれ補正 --- */
body.admin-bar header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar header { top: 46px; }
}

/* --- 旧 CSS は PC 表示の main 幅が 1480px 固定で、それより狭い画面では右サイドバーがはみ出していた --- */
@media screen and ( min-width: 840px ) {
  main { width: min(1480px, 100%); }
  article { min-width: 0; }
}

/* --- 商品カード ---
 * 画像: WordPress が付ける height 属性のせいで縦に伸びていたので、2:1 の比率を保つ
 * 高さ: 同じ行のカードの高さをそろえ、「詳しく見る」を下端に置く
 */
#conthome .container section img.ct,
#contitem #container section img.ct {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}
#conthome .container,
#contitem #container {
  align-items: stretch;
}
#conthome .container section,
#contitem #container section {
  display: flex;
}
#conthome .container section a,
#contitem #container section a {
  display: flex;
  flex-direction: column;
  width: 100%;
}
#conthome .container section .grade,
#contitem #container section .grade {
  display: block;
}
#conthome .container section a > br,
#contitem #container section a > br {
  display: none;
}
#conthome .container section .detail,
#contitem #container section .detail {
  float: none;
  align-self: flex-start;
  margin-top: auto;
}
#conthome .container section .price,
#contitem #container section .price {
  margin-bottom: 8px;
}

/* --- 左サイド: 特集から探す --- */
aside#left ul.collections { margin: 0 0 20px; }
aside#left ul.collections li a {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #E3D7B4;
  color: #31271f;
  text-decoration: none;
}
aside#left ul.collections li a::before { content: "▶ "; font-size: .7em; color: #b08d3c; }
aside#left ul.collections li a:hover { background-color: #f5f0e3; }

/* --- 商品詳細: お問い合わせボタン --- */
#order .btn_inquiry,
.btn_inquiry {
  display: inline-block;
  margin: 10px 0 0;
  padding: 10px 30px;
  border-radius: 4px;
  background-color: #31271f;
  color: #fff !important;
  font-weight: bold;
  text-decoration: none !important;
}
.btn_inquiry:hover { background-color: #5a4636; }
.btn_inquiry.disabled {
  background-color: #999;
  pointer-events: none;
}

/* --- 特集(コレクション)紹介 --- */
img#theme { width: 100%; height: auto; }

/* --- お問い合わせフォーム --- */
#contrgst .form_msg {
  margin: 0 0 20px;
  padding: 15px;
  border-radius: 4px;
}
#contrgst .form_msg.ok  { background-color: #eef7ea; border: 1px solid #7fae6b; }
#contrgst .form_msg.err { background-color: #fbeceb; border: 1px solid #c0504d; }
#contrgst .hp { position: absolute; left: -9999px; }
#contrgst textarea.full { width: 100%; min-height: 12em; }
#contrgst .item_ref {
  display: block;
  padding: 8px 10px;
  background-color: #f5f0e3;
  border-radius: 4px;
}
#contrgst .submit { text-align: center; margin: 20px 0; }
#contrgst .submit button {
  padding: 12px 60px;
  border: none;
  border-radius: 4px;
  background-color: #31271f;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
}

/* --- ニュース一覧ページ --- */
#contnews .news { margin-bottom: 10px; }

/* --- 固定ページ本文(ブロックエディタ出力の最低限の整形) --- */
#contpage .entry > * + * { margin-top: 1em; }
