@charset "utf-8";
/*
 * スマートフォン・タブレット対応（construction.css / style.css の後に読み込む）
 *
 *   960px 以上 … 何もしない（従来の PC 表示のまま）
 *   959px 以下 … 幅を画面に合わせる。ヘッダーのリンクと製品分類はメニューボタンで開閉
 *   767px 以下 … 右列（お問い合わせ・バナー）を本文の下に回し、1列にする
 *
 * 画像の上に座標で部品を置いた図（給餌システムの図・トップの「選ぶ理由」）は
 * 組み方を変えず、common/js/responsive.js が画面幅に合わせて縮小する（transform）。
 */

.menu-toggle { display: none; }

@media (max-width: 959px) {

	/* --- 全体 ------------------------------------------------------------ */
	html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
	body { min-width: 0; }
	.wrapper { width: auto; margin: 0; padding: 0 16px; box-sizing: border-box; }
	img { max-width: 100%; height: auto; }
	iframe { max-width: 100%; }
	iframe[src*="youtube.com"] { height: auto; aspect-ratio: 16 / 9; }
	iframe[src*="maps.google"] { height: 320px; }

	/* 本文と右列：本文を可変幅、右列は 232px のまま */
	.container { display: flex; align-items: flex-start; gap: 24px; }
	.main { float: none; width: auto; flex: 1 1 auto; min-width: 0; }
	.sub, .home .sub { float: none; flex: 0 0 232px; width: 232px; }

	/* --- ヘッダー：ロゴ＋メニューボタン ---------------------------------------- */
	.header {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		padding: 12px 0;
	}
	.header p.logo { margin: 0; }
	.header p.logo a { float: none; }

	.menu-toggle {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		width: 56px;
		height: 48px;
		margin: 0 -6px 0 0;
		padding: 0;
		border: 0;
		border-radius: 4px;
		background: none;
		color: #00529F;
		font: bold 10px/1 sans-serif;
		cursor: pointer;
	}
	.menu-toggle:focus-visible { outline: 2px solid #00529F; outline-offset: 2px; }
	.menu-toggle-bar,
	.menu-toggle-bar::before,
	.menu-toggle-bar::after {
		display: block;
		width: 24px;
		height: 2px;
		background: #00529F;
		border-radius: 1px;
		transition: transform .2s, background-color .2s;
	}
	.menu-toggle-bar { position: relative; margin: 6px 0 8px; }
	.menu-toggle-bar::before,
	.menu-toggle-bar::after { content: ""; position: absolute; left: 0; }
	.menu-toggle-bar::before { top: -7px; }
	.menu-toggle-bar::after { top: 7px; }
	.menu-open .menu-toggle-bar { background: transparent; }
	.menu-open .menu-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
	.menu-open .menu-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

	/* メニュー：画像のナビを文字のリストにする（リンクの文字はもともと HTML にある） */
	ul.h-nav,
	ul.g-nav { display: none; }
	.menu-open ul.h-nav,
	.menu-open ul.g-nav { display: block; }

	ul.h-nav { flex: 1 0 100%; float: none; width: auto; margin: 10px 0 0; border-top: 2px solid #00529F; }
	ul.g-nav { margin: 0 0 16px; border-bottom: 2px solid #00529F; }
	ul.g-nav::before {
		content: "製品・設備";
		display: block;
		padding: 14px 4px 6px;
		color: #666;
		font-size: 12px;
		font-weight: bold;
	}
	ul.h-nav, ul.g-nav { padding: 0; }
	ul.h-nav li,
	ul.g-nav li { display: block; margin: 0; }
	.header ul.h-nav li[class] a,
	.wrapper ul.g-nav li[class] a {
		float: none;
		display: block;
		width: auto;
		height: auto !important;
		padding: 13px 28px 13px 4px;
		border-bottom: 1px solid #DDD;
		background: url(../images/base/icon01.gif) no-repeat right 10px center;
		color: #333 !important;
		font-size: 15px;
		font-weight: bold;
		line-height: 1.4;
		text-decoration: none !important;
	}
	.header ul.h-nav li[class] a:hover,
	.wrapper ul.g-nav li[class] a:hover { background-color: #F2F6FA; }
	/* いま見ているページ（ナビ画像の「選択中」表示の代わり） */
	.home ul.h-nav li.home a,
	.news ul.h-nav li.news a,
	.reason ul.h-nav li.reason a,
	.about ul.h-nav li.about a,
	.contact ul.h-nav li.contact a,
	.pig ul.g-nav li.pig a,
	.cow ul.g-nav li.cow a,
	.dairy ul.g-nav li.dairy a,
	.mushroom ul.g-nav li.mushroom a,
	.environment ul.g-nav li.environment a { color: #00529F !important; }
	ul.g-nav li:last-child a { border-bottom: 0; }

	/* パンくず */
	.pan { padding: 8px 0 14px; }
	.pan li { font-size: 11px; }

	/* --- トップ ---------------------------------------------------------- */
	.home #slide,
	.home #img { width: 100%; height: auto; aspect-ratio: 960 / 390; }
	.home #img .main-img,
	.home #img img { width: 100%; height: 100%; }
	.home #img img { object-fit: cover; }

	.home_box01 {
		display: grid;
		grid-template-columns: repeat(5, 1fr);
		gap: 8px;
		margin: 10px 0 20px;
	}
	.home_box01-type01,
	.home_box01-type02 { float: none; width: auto; margin: 0; height: auto !important; }
	.home_box01 p img { width: auto; max-width: 100%; margin: 0 auto; }

	.home-box02 h2 { width: auto; }
	.home-box02 h2 .ichiran { left: auto; right: 12px; }
	.home-box02 ul li a.title { float: none; width: auto; overflow: hidden; }

	/* 座標で組んだ図は JS が縮小する（幅は元のまま） */
	.home-box03.is-fitted { width: 700px; box-sizing: border-box; }
	.feed-system01.is-fitted,
	.feed-system02.is-fitted,
	.feed-system03.is-fitted,
	.feed-system04.is-fitted { width: 700px; }

	/* --- 本文の汎用部品 ---------------------------------------------------- */
	.f-left230, .f-left280, .f-left340,
	.f-right230, .f-right245, .f-right250, .f-right340, .f-right345,
	.f-right490, .f-right570 { max-width: 100%; }

	table { max-width: 100%; }
	.rt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1em; }
	.rt-scroll > table { min-width: 560px; max-width: none; }
	table th[style*="width"],
	table td[style*="width"] { width: auto !important; }
	table[style*="width"] { width: 100% !important; }

	/* 見出しボックスの列：幅を固定せず折り返す */
	.midashi-box01, .midashi-box02, .catalog-box01,
	.reason-box01, .reason-box02, .reason-box05, .sitemap-box {
		display: grid;
		gap: 16px;
		margin-right: 0;
	}
	.midashi-box01 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
	.midashi-box02, .reason-box01, .reason-box05 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
	.catalog-box01 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.reason-box02 { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
	.sitemap-box { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 24px; }
	.midashi-box01 li, .midashi-box02 li, .catalog-box01 li,
	.reason-box01 li, .reason-box02 li, .reason-box05 li, .sitemap-box ul {
		float: none;
		width: auto;
		margin: 0;
		height: auto !important;
	}
	.img-box01, .img-box02 {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 9px;
		width: auto;
		margin-right: 0;
		padding: 9px;
	}
	.img-box01 li, .img-box02 li { float: none; width: auto; margin: 0; }
	.img-box01 li img, .img-box02 li img,
	.reason-box01 li img, .reason-box02 li img, .reason-box05 li img { width: 100%; }

	/* 選ぶ理由 03：右側の写真の背景に文字を重ねた枠 */
	.reason-box03 { padding-right: 20px; background-size: cover; }

	/* --- フッター -------------------------------------------------------- */
	.footer { min-width: 0; margin-top: 48px; }
	.footer-inner {
		width: auto;
		padding: 0 16px;
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
		gap: 0 16px;
	}
	.footer-box01 { grid-column: 1 / -1; width: auto; float: none; }
	.f-nav01, .f-nav02, .f-nav03 { float: none; width: auto; }
	.f-nav01 li a, .f-nav02 li a, .f-nav03 li a { padding: 6px 0 6px 10px; background-position: 0 13px; }
	.page-top { display: none; }
}

@media (max-width: 767px) {

	.home_box01 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

	/* 右列は本文の下へ */
	.container { display: block; }
	.sub, .home .sub { width: auto; margin-top: 32px; }
	.sub > p:first-child { text-align: center; }
	.contact-box { max-width: 420px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
	.banner_box01 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
	.banner_box01 li { text-align: center; }
	.s-nav li a { padding-top: 10px; padding-bottom: 10px; background-position: 10px 20px; }
	.s-nav li ul li a { padding-top: 8px; padding-bottom: 8px; background-position: 22px 14px; }

	/* 見出し */
	h1 { margin-bottom: 16px; }
	h2 { padding: 12px 16px; margin-bottom: 20px; background-size: cover; }
	h3 { margin-bottom: 20px; }

	/* 文字入りの横長見出し画像は、代替テキストを文字で表示する（responsive.js が印を付ける） */
	.rt-alt-heading > img { display: none; }
	.rt-alt-heading::before {
		content: attr(data-alt);
		display: block;
		padding: 10px 14px;
		border-left: 4px solid #00529F;
		background: #ECECEC;
		color: #00529F;
		font-size: 16px;
		font-weight: bold;
		line-height: 1.5;
	}

	/* トップのニュース見出し（画像）を文字に */
	.home-box02 h2 { min-height: 40px; background: #ECECEC; border-left: 4px solid #00529F; box-sizing: border-box; }
	.home-box02 h2 > img:first-child { display: none; }
	.home-box02 h2::before { content: "News"; display: block; padding: 8px 12px; color: #00529F; font-size: 18px; line-height: 24px; }
	.home-box02 h2 .ichiran { top: 13px; }

	/* トップの「選ぶ理由」：図をやめ、3つのポイントを文字のカードで並べる */
	.home-box03 dd { height: auto; padding: 12px; background: none; }
	.home-box03 ul { display: grid; gap: 10px; }
	.home-box03 ul li { position: static; }
	.home-box03 ul li {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 12px;
		border: 1px solid #F3C27A;
		border-radius: 4px;
		background: #FFF8EE;
	}
	.home-box03 ul li span { display: block; font-size: 13px; line-height: 1.6; }
	.home-box03 ul li a { flex: 0 0 auto; }

	/* 左右に並べた写真と説明を縦に */
	.f-left, .f-right, .f-left230, .f-left280, .f-left340,
	.f-right230, .f-right245, .f-right250, .f-right340, .f-right345,
	.f-right490, .f-right570,
	.ph-left, .ph-right {
		float: none !important;
		width: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.f-left340, .f-left230, .f-left280 { text-align: center; margin-bottom: 12px; }
	.reason .f-right245, .reason-box04 .f-right250, .news-box03 .f-right250 { padding: 0 0 16px; }
	.reason .f-right245 p { text-align: center; }
	.reason .f-right245 img { display: block; margin: 0 auto 4px; }
	.reason-box04 .comment span { margin-left: 0; }
	.reason-box06 li,
	.reason-box06 li[class] { padding: 110px 12px 16px; background-position: center top; }

	/* 2列の表：見出しセルを上、内容を下に（3列以上の表は横スクロール。responsive.js が判定） */
	.main table.rt-stack,
	.main table.rt-stack tbody,
	.main table.rt-stack tr { display: block; width: 100% !important; }
	.main table.rt-stack th,
	.main table.rt-stack td { display: block; width: auto !important; box-sizing: border-box; }
	.main table.rt-stack th { border-bottom: 0; }

	/* ニュース一覧（トップ）：分類・日付・題名を2段に */
	.home-box02 h2 img:first-child { max-width: 100%; }
	.home-box02 ul li span.date { width: auto; }
	.home-box02 ul li a.title { clear: both; padding-top: 6px; }

	/* フッター */
	.footer-inner { grid-template-columns: 1fr 1fr; }
}
