/* =================================================================
   北米ページ専用CSS（/css/style.css の後に読み込む）
   .board / .panel / .ph / .pb などの土台は style.css のものを共用
================================================================= */

/* ---------- タイトル ---------- */
.usa-title {
	margin: 15px 0;
	font-size: 24px;
	font-weight: bold;
	text-align: left;
	text-indent: 0;
}

/* ボード同士の間 */
.board + .board { margin-top: 4px; }
.board + .linkrow,
.linkrow + .board { margin-top: 8px; }

/* ---------- 列の組み方 ---------- */
.board.cols1  { grid-template-columns: minmax(0, 1fr); }
.board.cols3  { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board.cols10 { grid-template-columns: repeat(10, minmax(0, 1fr)); }   /* 6:4 と 7:3 を両方作れる */
.board.cols10 > .s3  { grid-column: span 3; }
.board.cols10 > .s4  { grid-column: span 4; }
.board.cols10 > .s6  { grid-column: span 6; }
.board.cols10 > .s7  { grid-column: span 7; }
.board.cols10 > .s10 { grid-column: span 10; }

/* ---------- 見出し・リンクの間隔 ---------- */
.usa .ph a { margin-right: 1em; }
.usa .linkblock a { margin-right: .9em; }
.usa .linkrow { align-items: center; }

/* ---------- METAR/TAF 入力欄 ---------- */
.usa form[name="textForm"] input[name="ids"] { width: 150px; }   /* 候補の薄い文字が切れない幅 */
.usa form[name="textForm"] + .linkblock { margin-top: .8em; }   /* 入力欄とATISリンクの間をあける */
@media (max-width: 760px) { .usa form[name="textForm"] input[name="ids"] { width: 180px; } }

/* ---------- ATIS: 地域ごとに色分け＋都市名つきのボタン ---------- */
.atis-groups {
	display: flex;
	flex-wrap: nowrap;               /* PCは必ず1段（スマホは下で折り返し） */
	gap: 6px 6px;
	margin-top: 4px;
}
.atis-group {
	flex: 0 0 auto; /* ATISの地域は縮めない（PCで中のボタンが2段に割れるのを防ぐ） */
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 4px 3px;
	padding: 3px 3px 5px;
	border-left: 4px solid var(--atis-edge);
}
.atis-label {
	flex: 0 0 100%;                 /* 地域名はボタンの上の行 */
	font-size: 12px;
	font-weight: bold;
	color: #333;
	text-indent: 0;
}
.btn-atis {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 52px;
	padding: 3px 3px 4px;
	border: 1px solid #777;
	border-radius: 5px;
	background: var(--atis-bg);
	color: #000;
	font: inherit;
	line-height: 1.25;
	cursor: pointer;
	text-indent: 0;
}
.btn-atis b    { font-size: 14px; }
.btn-atis span { font-size: 10px; font-weight: normal; }
.btn-atis:hover { filter: brightness(.94); }
.btn-atis:focus-visible { outline: 2px solid #8b4513; outline-offset: 2px; }

/* 地域の色（背景は淡く、左の線は濃く） */
.atis-east    { --atis-bg: #CFE3F7; --atis-edge: #4F86C6; }   /* 東海岸 */
.atis-central { --atis-bg: #F7E7B4; --atis-edge: #C9A227; }   /* 中部・南部 */
.atis-west    { --atis-bg: #CDEBCB; --atis-edge: #4E9A4A; }   /* 西海岸 */
.atis-canada  { --atis-bg: #F7CDD6; --atis-edge: #C95A74; }   /* カナダ */

/* 画像は幅いっぱい（style.css の指定）。高さ固定にしたい画像だけ別扱い */
.board .pb > a > img.fixed-h {
	width: auto;
	height: 338px;
	max-width: 100%;
}

/* iframeの高さ（幅は style.css でセル幅いっぱい） */
.if-250  { height: 250px; }
.if-400  { height: 400px; }
.if-600  { height: 600px; }
.if-50vh { height: 50vh; }

/* 300hPa 風の切替ボタン */
.switch-buttons { margin: 4px 0 6px; }

/* ---------- 縦に長いパネル（Windy・SIG WX） ---------- */
.panel.tall {
	display: flex;
	flex-direction: column;
	grid-row: auto;
}
.panel.tall > .pb { flex: 1 1 auto; }

/* ---------- SIGチャートの一覧（コード・領域・説明を縦にそろえる） ---------- */
.sigrow {
	display: grid;
	grid-template-columns: 7em 14em auto;
	gap: 0 1em;
	margin: 0 0 .3em;
}
.sig-other { margin-top: 1em; }

/* =================================================================
   配置（grid-template-areas）
   ※ 名前は各ボード内だけで使う。パネル側は class="a-名前"
================================================================= */

/* 北米現況・予想天気図・衛星・SIGMET */
.board.charts {
	grid-template-areas:
		"na h24 h36"
		"na h24 h36"
		"tm tm  tm"
		"ir wv  wd"
		"ir wv  wd"
		"sg su  wd"
		"sg su  wd";
}
.board.areas > .a-na  { grid-area: na; }
.board.areas > .a-h24 { grid-area: h24; }
.board.areas > .a-h36 { grid-area: h36; }
.board.areas > .a-tm  { grid-area: tm; }
.board.areas > .a-ir  { grid-area: ir; }
.board.areas > .a-wv  { grid-area: wv; }
.board.areas > .a-wd  { grid-area: wd; }
.board.areas > .a-sg  { grid-area: sg; }
.board.areas > .a-su  { grid-area: su; }

/* カナダ・アメリカ・メキシコ・カリブ */
.board.regional {
	grid-template-areas:
		"cir  sig    cturb"
		"cir  sig    cturb"
		"air  sig    aturb"
		"air  sig    aturb"
		"crad echo   aurora"
		"crad echo   aurora"
		"mex  mex    mex"
		"sat  sfc    pop"
		"sat  sfc    pop"
		"car  hur    blank"
		"car  hur    blank";
}
.board.areas > .a-cir    { grid-area: cir; }
.board.areas > .a-sig    { grid-area: sig; }
.board.areas > .a-cturb  { grid-area: cturb; }
.board.areas > .a-air    { grid-area: air; }
.board.areas > .a-aturb  { grid-area: aturb; }
.board.areas > .a-crad   { grid-area: crad; }
.board.areas > .a-echo   { grid-area: echo; }
.board.areas > .a-aurora { grid-area: aurora; }
.board.areas > .a-mex    { grid-area: mex; }
.board.areas > .a-sat    { grid-area: sat; }
.board.areas > .a-sfc    { grid-area: sfc; }
.board.areas > .a-pop    { grid-area: pop; }
.board.areas > .a-car    { grid-area: car; }
.board.areas > .a-hur    { grid-area: hur; }
.board.areas > .a-blank  { grid-area: blank; }

/* =================================================================
   スマートフォン（760px以下）: すべて1列
================================================================= */
@media (max-width: 760px) {
	.usa-title { font-size: 20px; margin: 10px 0; }

	.board.cols1,
	.board.cols3,
	.board.cols10 { grid-template-columns: minmax(0, 1fr); }
	.board.cols10 > .s3,
	.board.cols10 > .s4,
	.board.cols10 > .s6,
	.board.cols10 > .s7,
	.board.cols10 > .s10,
	.board .panel.span2 { grid-column: auto; }

	/* 配置指定をやめて、書いた順に1列で並べる */
	.board.areas { grid-template-areas: none; }
	.board.areas > .panel { grid-area: auto; }   /* 名前付きの指定(.a-xx)より後ろに書いて上書き */
	.board .panel { display: block; grid-row: auto; }

	.atis-groups { flex-wrap: wrap; gap: 8px 10px; }
	.atis-group { flex: 0 1 auto; }
	.btn-atis span { font-size: 11px; }
	.btn-atis { min-width: 84px; min-height: 44px; }   /* 指で押しやすく */
	.sigrow { grid-template-columns: 6em 1fr; }
	.sigrow span:nth-child(3) { grid-column: 2; }
	.board .pb > a > img.fixed-h { height: auto; width: 100%; }
}
