/*
Theme Name:   PORT51
Theme URI:    https://port51.jp/
Description:  PORT51 の子テーマ。親テーマ Storefront が必要です。業務機能は PORT51 Core プラグインにあります。
Author:       PORT51
Template:     storefront
Version:      2.0.0
Requires PHP: 8.1
Text Domain:  port51-child
License:      GPL-2.0-or-later
*/

/* ---------------------------------------------------------------------------
 * トークン
 * 白地に墨の文字、帯は港の紺、行動と状態だけにブイの橙。
 * 英字の見出し（Oswald）＋日本語の小見出しで、売り場の密度を出す。
 * ------------------------------------------------------------------------ */
:root {
	--p51-ink: #15191e;
	--p51-navy: #13283f;
	--p51-sea: #1f6f78;
	--p51-signal: #f2561d;
	--p51-signal-dark: #c9420f;
	--p51-paper: #f3f4f2;
	--p51-rule: #e1e3e0;
	--p51-muted: #5f6872;
	--p51-radius: 4px;
	--p51c-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
	--p51c-en: "Oswald", "Arial Narrow", "Helvetica Neue", sans-serif;
	--p51c-stencil: "Big Shoulders Stencil Display", "Oswald", "Arial Narrow", sans-serif;
	--p51c-gutter: 16px;
}

/* ---------------------------------------------------------------------------
 * 基本
 * ------------------------------------------------------------------------ */
body,
button,
input,
select,
textarea { font-family: var(--p51c-sans); color: var(--p51-ink); }
html, body { overflow-x: clip; }
body { background: #fff; line-height: 1.75; -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { font-family: var(--p51c-sans); color: var(--p51-ink); font-weight: 700; line-height: 1.4; text-wrap: balance; }
a { color: var(--p51-ink); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible { outline: 3px solid var(--p51-signal); outline-offset: 2px; }
.p51c-stencil { font-family: var(--p51c-stencil); font-weight: 800; letter-spacing: 0.03em; }
.col-full { padding-left: var(--p51c-gutter); padding-right: var(--p51c-gutter); }

/* Storefront のボタン */
button, input[type="button"], input[type="reset"], input[type="submit"], .button,
.single-product div.product form.cart .button,
.wc-block-components-button:not(.is-link) {
	background: var(--p51-signal); border-color: var(--p51-signal); color: #fff;
	border-radius: var(--p51-radius); font-weight: 700;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--p51-signal-dark); border-color: var(--p51-signal-dark); color: #fff; }
.added_to_cart, .button.alt, button.alt { background: var(--p51-navy); border-color: var(--p51-navy); }

/* 共通ボタン */
.p51c-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 48px; padding: 0 22px; border-radius: var(--p51-radius);
	font-weight: 700; font-size: 0.95rem; text-decoration: none; line-height: 1.2; border: 2px solid transparent;
}
.p51c-btn--primary { background: var(--p51-signal); color: #fff; }
.p51c-btn--primary:hover { background: var(--p51-signal-dark); color: #fff; }
.p51c-btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.7); }
.p51c-btn--ghost:hover { background: #fff; color: var(--p51-navy); }
.p51c-btn--line { background: #06c755; color: #fff; }

/* ---------------------------------------------------------------------------
 * ヘッダー
 * ------------------------------------------------------------------------ */
.p51c-nextbar { background: var(--p51-navy); color: #fff; font-size: 0.8125rem; line-height: 1.5; }
.p51c-nextbar a,
.p51c-nextbar span { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 0.5em; padding: 0.5em 0; color: #fff; text-decoration: none; text-align: center; }
.p51c-nextbar .p51c-stencil { font-size: 1.3em; line-height: 1; }
.p51c-nextbar__state { color: #ffb08f; font-weight: 700; padding: 0 !important; }
.p51c-nextbar a:hover { text-decoration: underline; }

.site-header { background: #fff; border-bottom: 1px solid var(--p51-rule); padding-top: 14px; }
.site-header .site-branding { margin-bottom: 10px; }
.p51c-branding { display: flex; align-items: center; }
.p51c-logo { margin: 0; line-height: 0; }
.p51c-logo a { display: inline-block; color: var(--p51-ink); }
.p51c-logo svg { height: 38px; width: auto; display: block; }
.main-navigation ul li a,
.storefront-primary-navigation a { color: var(--p51-ink); font-weight: 700; font-size: 0.9375rem; }
.main-navigation ul.menu > li > a:hover,
.main-navigation ul.nav-menu > li > a:hover { color: var(--p51-signal); }
.secondary-navigation a { font-size: 0.8125rem; color: var(--p51-muted); }
.site-header-cart .cart-contents { color: var(--p51-ink); }
.site-search .widget_product_search form input[type="search"] { border-radius: 999px; background: var(--p51-paper); }
.woocommerce-breadcrumb { font-size: 0.8125rem; color: var(--p51-muted); }

/* ---------------------------------------------------------------------------
 * トップ：セクションの型
 * ------------------------------------------------------------------------ */
.home.storefront-full-width-content .site-content { padding-top: 0; }
.home .woocommerce-breadcrumb { display: none; }
.p51c-home .site-main { margin-bottom: 0; }
.p51c-sec { padding: 44px 0 4px; }

.p51c-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--p51-ink); padding-bottom: 10px; }
.p51c-sec-title { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.p51c-sec-en { font-family: var(--p51c-en); font-weight: 600; font-size: clamp(1.75rem, 6vw, 2.5rem); line-height: 1; letter-spacing: 0.02em; }
.p51c-sec-ja { font-size: 0.875rem; font-weight: 700; color: var(--p51-muted); }
.p51c-sec-more { flex: none; font-size: 0.8125rem; font-weight: 700; text-decoration: none; color: var(--p51-ink); padding: 6px 0; }
.p51c-sec-more::after { content: " ›"; }
.p51c-sec-more:hover { color: var(--p51-signal); }

/* 横スクロールの列（スマホ）／並び（PC） */
.p51c-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 82%); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; margin-right: calc(var(--p51c-gutter) * -1); padding-right: var(--p51c-gutter); }
.p51c-rail > * { scroll-snap-align: start; min-width: 0; }

/* ---------------------------------------------------------------------------
 * ヒーロー
 * ------------------------------------------------------------------------ */
.p51c-hero {
	position: relative; color: #fff;
	margin: 0 calc(50% - 50vw); padding: 0 calc(50vw - 50%);
	background:
		linear-gradient(180deg, rgba(10, 18, 28, 0.15) 0%, rgba(10, 18, 28, 0.82) 100%),
		repeating-linear-gradient(90deg, #c74a1c 0 64px, #a83c14 64px 67px) 0 0 / 100% 34% no-repeat,
		repeating-linear-gradient(90deg, #1f6f78 0 84px, #195c64 84px 87px) 0 34% / 100% 33% no-repeat,
		repeating-linear-gradient(90deg, #2a3a4d 0 72px, #22303f 72px 75px) 0 67% / 100% 33% no-repeat,
		var(--p51-navy);
}
.p51c-hero.has-photo { background: linear-gradient(180deg, rgba(10, 18, 28, 0.1) 0%, rgba(10, 18, 28, 0.85) 100%), var(--p51c-hero) center / cover no-repeat, var(--p51-navy); }
.p51c-hero__inner { max-width: 66.4989378333em; margin: 0 auto; display: grid; gap: 24px; padding: 120px 0 32px; }
.p51c-hero__kicker { display: inline-block; margin: 0 0 12px; font-size: 0.8125rem; font-weight: 700; background: var(--p51-signal); color: #fff; padding: 2px 10px; border-radius: 2px; }
.p51c-hero__title { color: #fff; font-size: clamp(2.25rem, 10vw, 4.25rem); line-height: 1.12; margin: 0 0 14px; font-weight: 900; font-feature-settings: "palt"; }
.p51c-hero__lead { max-width: 30em; margin: 0 0 22px; font-size: 0.95rem; color: rgba(255, 255, 255, 0.92); }
.p51c-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.p51c-hero__actions .p51c-btn { flex: 1 1 11em; }

/* ---------------------------------------------------------------------------
 * 便のラベル（出荷ラベルの形）
 * ------------------------------------------------------------------------ */
.p51c-label {
	display: grid; grid-template-columns: 1fr auto; grid-template-areas: "top top" "rows date" "cta cta";
	gap: 10px 12px; background: #fff; color: var(--p51-ink); text-decoration: none;
	border: 2px solid var(--p51-ink); border-radius: var(--p51-radius); padding: 12px 14px; position: relative;
}
.p51c-label::before { content: ""; position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--p51-ink); }
.p51c-label__top { grid-area: top; display: flex; align-items: baseline; gap: 8px; border-bottom: 1px dashed var(--p51-ink); padding-bottom: 8px; font-family: var(--p51c-en); font-size: 0.75rem; letter-spacing: 0.08em; }
.p51c-label__top b { font-family: var(--p51c-sans); font-size: 1.125rem; letter-spacing: 0; }
.p51c-label__to { margin-left: auto; margin-right: 18px; }
.p51c-label__date { grid-area: date; align-self: center; font-size: 2.5rem; line-height: 0.9; color: var(--p51-navy); }
.p51c-label__rows { grid-area: rows; display: grid; gap: 6px; font-size: 0.8125rem; line-height: 1.35; font-weight: 700; }
.p51c-label__rows i { font-style: normal; font-weight: 400; color: var(--p51-muted); display: block; font-size: 0.6875rem; }
.p51c-label__cta { grid-area: cta; display: block; text-align: center; background: var(--p51-signal); color: #fff; font-weight: 700; border-radius: 2px; padding: 9px; font-size: 0.875rem; }
a.p51c-label:hover .p51c-label__cta { background: var(--p51-signal-dark); }
.p51c-label.is-closed { opacity: 0.7; }
.p51c-label.is-closed .p51c-label__cta { background: var(--p51-muted); }
.p51c-hero__label .p51c-label { box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.6); }

/* ---------------------------------------------------------------------------
 * PICK UP タイル
 * ------------------------------------------------------------------------ */
.p51c-tile { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--p51-ink); background: var(--p51-paper); border-radius: var(--p51-radius); overflow: hidden; }
.p51c-tile__art { display: grid; place-items: end start; aspect-ratio: 16 / 9; padding: 12px 14px; color: #fff; font-size: 2.25rem; line-height: 1; }
.p51c-tile--slot .p51c-tile__art { background: repeating-linear-gradient(90deg, #c74a1c 0 46px, #a83c14 46px 48px); }
.p51c-tile--stock .p51c-tile__art { background: linear-gradient(160deg, var(--p51-sea) 0 58%, #164f56 58%); }
.p51c-tile--cars .p51c-tile__art { background: radial-gradient(ellipse at 50% 130%, #3a3d42 0 45%, transparent 46%), linear-gradient(180deg, #2b2e33, #15181c); }
.p51c-tile__body { padding: 12px 14px 16px; display: grid; gap: 4px; font-size: 0.8125rem; color: var(--p51-muted); }
.p51c-tile__body b { font-size: 1.0625rem; color: var(--p51-ink); }
.p51c-tile:hover b { color: var(--p51-signal); }

/* ---------------------------------------------------------------------------
 * 商品カード（トップ・一覧共通）
 * ------------------------------------------------------------------------ */
.p51c-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
.p51c-card__link { display: grid; gap: 4px; text-decoration: none; color: var(--p51-ink); }
.p51c-card__img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--p51-paper); overflow: hidden; border-radius: 2px; margin-bottom: 6px; }
.p51c-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.p51c-card__link:hover img { transform: scale(1.03); }
.p51c-card__meta { font-size: 0.75rem; color: var(--p51-muted); }
.p51c-card__title { font-size: 0.875rem; font-weight: 700; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p51c-card__price { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.p51c-card__price .p51-price-label { display: block; font-size: 0.6875rem; font-weight: 400; color: var(--p51-muted); }
.p51c-card.is-out .p51c-card__img img { opacity: 0.55; }
.p51c-card--report .p51c-card__img { aspect-ratio: 3 / 2; }

/* バッジ */
.p51c-badges { position: absolute; left: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 4px; z-index: 1; }
.p51c-badge { display: inline-block; font-size: 0.6875rem; font-weight: 700; line-height: 1; padding: 5px 7px; border-radius: 2px; background: #fff; color: var(--p51-ink); }
.p51c-badge--slot { background: var(--p51-navy); color: #fff; }
.p51c-badge--hot { background: var(--p51-signal); color: #fff; }
.p51c-badge--new { background: var(--p51-signal); color: #fff; font-family: var(--p51c-en); letter-spacing: 0.06em; }
.p51c-badge--out { background: var(--p51-ink); color: #fff; font-family: var(--p51c-en); letter-spacing: 0.06em; }
.p51c-badge--one { background: #fff; border: 1px solid var(--p51-ink); }

/* 写真がない記事の仮の枠 */
.p51c-noimg { display: grid; place-items: end start; width: 100%; height: 100%; padding: 10px; box-sizing: border-box; background: linear-gradient(160deg, var(--p51-sea) 0 58%, var(--p51-navy) 58%); color: #fff; font-size: 1.5rem; }
.p51c-noimg--usa { background: linear-gradient(200deg, var(--p51-navy) 0 45%, var(--p51-signal) 45% 52%, #8fa3b1 52%); }
.p51c-noimg--cars { background: linear-gradient(180deg, #8fa3b1 0 58%, var(--p51-navy) 58%); }
.p51c-noimg--europe { background: linear-gradient(160deg, #3d5a73 0 58%, var(--p51-navy) 58%); }

/* WooCommerce の一覧（ショップ・カテゴリ）もカードと同じ見た目に */
ul.products li.product { position: relative; text-align: left; }
ul.products li.product .woocommerce-LoopProduct-link { display: block; position: relative; }
ul.products li.product img { aspect-ratio: 1 / 1; object-fit: cover; background: var(--p51-paper); margin-bottom: 8px; border-radius: 2px; }
ul.products li.product .woocommerce-loop-product__title { font-size: 0.875rem; font-weight: 700; line-height: 1.5; color: var(--p51-ink); }
ul.products li.product .price { color: var(--p51-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
ul.products li.product .button { font-size: 0.8125rem; padding: 0.55em 1em; }
ul.products li.product .p51c-badges { top: 8px; left: 8px; }

/* ---------------------------------------------------------------------------
 * CARS の帯
 * ------------------------------------------------------------------------ */
.p51c-cars-band { margin: 48px calc(50% - 50vw) 0; padding: 0 calc(50vw - 50%); background: var(--p51-ink); color: #fff; }
.p51c-cars-band__inner { max-width: 66.4989378333em; margin: 0 auto; display: grid; gap: 28px; padding: 40px 0 44px; }
.p51c-cars-band .p51c-sec-head { border-bottom-color: #fff; }
.p51c-cars-band .p51c-sec-en,
.p51c-cars-band .p51c-sec-title { color: #fff; }
.p51c-cars-band .p51c-sec-ja { color: #b9c1c9; }
.p51c-cars-band__lead { margin: 0 0 16px; max-width: 32em; color: #dfe3e7; }
.p51c-chips { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.p51c-chips li { border: 1px solid #59616b; border-radius: 999px; padding: 3px 12px; font-size: 0.8125rem; }
.p51c-quote { background: #fff; color: var(--p51-ink); border-radius: var(--p51-radius); padding: 16px 18px; align-self: start; }
.p51c-quote__title { margin: 0 0 8px; font-size: 0.8125rem; font-weight: 700; color: var(--p51-muted); }
.p51c-quote dl { margin: 0 0 10px; }
.p51c-quote dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--p51-rule); font-size: 0.875rem; }
.p51c-quote dt { font-weight: 400; }
.p51c-quote dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 700; }
.p51c-quote .is-total { border-bottom: 0; border-top: 2px solid var(--p51-ink); font-size: 1.0625rem; }
.p51c-quote .is-total dd { color: var(--p51-signal-dark); }
.p51c-quote a { font-size: 0.8125rem; font-weight: 700; color: var(--p51-ink); }

/* ---------------------------------------------------------------------------
 * GUIDE（流れと約束）
 * ------------------------------------------------------------------------ */
.p51c-guide .p51-flow { margin-top: 0; }
.p51c-guide .p51-trust { margin-bottom: 0; }

/* LINE */
.p51c-line-cta { display: grid; gap: 14px; justify-items: start; margin-top: 44px; padding: 22px; background: #eafaf0; border-radius: var(--p51-radius); }
.p51c-line-cta p { margin: 0; }
.p51c-line-cta b { display: block; font-size: 1.0625rem; }

/* ---------------------------------------------------------------------------
 * ショップのタブ
 * ------------------------------------------------------------------------ */
.p51c-shop-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 24px; border-bottom: 2px solid var(--p51-ink); }
.p51c-shop-tabs a { display: block; padding: 12px 12px 10px; text-decoration: none; color: var(--p51-muted); border-bottom: 4px solid transparent; margin-bottom: -2px; }
.p51c-shop-tabs a.is-current { color: var(--p51-ink); border-bottom-color: var(--p51-signal); }
.p51c-shop-tabs b { display: block; font-size: 1.05rem; }
.p51c-shop-tabs span { display: block; font-size: 0.8rem; line-height: 1.4; }

/* ---------------------------------------------------------------------------
 * 本文の表（車の費用内訳など）
 * ------------------------------------------------------------------------ */
.entry-content .wp-block-table { overflow-x: auto; }
.entry-content .wp-block-table table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.entry-content .wp-block-table th,
.entry-content .wp-block-table td { padding: 8px 10px; border-bottom: 1px solid var(--p51-rule); vertical-align: top; text-align: left; }
.entry-content .wp-block-table thead th { background: var(--p51-paper); }
.entry-content .wp-block-table td:last-child { font-variant-numeric: tabular-nums; }
.single-post .entry-content { max-width: 40em; }
.single-post .entry-content p { line-height: 1.95; }
.p51c-admin-hint { padding: 10px 14px; border: 1px dashed var(--p51-signal); color: var(--p51-muted); font-size: 0.875rem; }

/* ---------------------------------------------------------------------------
 * フッター
 * ------------------------------------------------------------------------ */
.p51c-footer-line { background: var(--p51-paper); padding: 28px 0; text-align: center; }
.p51c-footer-line__title { margin: 0 0 12px; font-weight: 700; }
.site-footer { background: var(--p51-navy); color: #c9d4dd; }
.site-footer a { color: #fff; }
.p51c-footer-links ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.875rem; }
.p51c-footer-mark { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 0.875rem; }
.p51c-footer-logo { color: #fff; line-height: 0; }
.p51c-footer-logo svg { height: 28px; width: auto; }

/* ---------------------------------------------------------------------------
 * 広い画面
 * ------------------------------------------------------------------------ */
@media (min-width: 768px) {
	.p51c-logo svg { height: 46px; }
	.p51c-sec { padding-top: 64px; }
	.p51c-hero__inner { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; gap: 48px; padding: 180px 0 56px; }
	.p51c-hero__actions .p51c-btn { flex: 0 0 auto; }
	.p51c-rail { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin-right: 0; padding-right: 0; }
	.p51c-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
	.p51c-cars-band__inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; padding: 64px 0; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
