/*
 * taisei_n Child - Base styles
 * Header / Footer / shared components (buttons, containers, typography)
 * Source: Figma "中野たいせい 公式サイト SP" (node 45:53)
 */

:root {
	/* Forest green — the candidate's established brand color (single shade, used everywhere) */
	--color-green: #179c5a;
	--color-green-dark: #179c5a;

	/* Mikan orange — Matsuyama's iconic citrus; the action/accent color */
	--color-orange: #e8720c;
	--color-orange-dark: #b8570a;

	/* Orange — used only by the 語る会 (talk session) schedule, whose
	   Figma design has its own warm palette distinct from the rest of the
	   site. */
	--color-gold: #f39800;
	--color-gold-dark: #e8720c;
	--color-cream: #fdf8ed;

	--color-white: #ffffff;

	/* Green-tinted ink instead of flat black/gray, ties body copy to the brand */
	--color-text: #16241d;
	--color-text-light: #5b6b61;

	/* Paper (warm neutral) and Mist (pale green-gray) alternate section grounds */
	--color-bg-gray: #eaf0ea;
	--color-bg-gray-light: #faf6ec;
	--color-border: rgba(23, 156, 90, 0.18);

	--font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;
	--font-display: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;

	--header-height: 69px;
	--subnav-height: 42px;

	--container-width: 1080px;
	--container-padding: 24px;

	--ease-brand: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset additions ---------- */
* ,
*::before,
*::after {
	box-sizing: border-box;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

body {
	font-family: var(--font-body);
	color: var(--color-text);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

.container {
	width: 100%;
	max-width: var(--container-width);
	margin-inline: auto;
	padding-inline: var(--container-padding);
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* Offset anchor jumps for the fixed header + sub navigation */
[id] {
	scroll-margin-top: calc(var(--header-height) + var(--subnav-height) + 12px);
}

.is-hidden {
	display: none !important;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Focus visibility ---------- */
:focus-visible {
	outline: 2px solid var(--color-orange);
	outline-offset: 3px;
}

/* ---------- Buttons ---------- */
/* Mikan orange is the "do this" action color; green is reserved for brand
   chrome and secondary/outline actions, so the two colors keep a clear job
   each rather than competing for attention.
   Note: the parent (_s) theme's style.css sets `a:visited { color: #800080 }`.
   That selector's specificity (0,1,1) beats a plain single class like `.btn`
   (0,1,0), so every link-based component below pairs its color rule with an
   explicit `:visited` variant (specificity (0,2,0)) to reliably win instead
   of depending on stylesheet load order. */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 40px;
	padding: 9px 26px;
	border-radius: 999px;
	background: var(--color-orange);
	color: var(--color-white);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.02em;
	border: 1px solid var(--color-orange);
	transition: transform 0.2s var(--ease-brand), background-color 0.2s ease, border-color 0.2s ease;
}

.btn:visited {
	color: var(--color-white);
}

.btn:hover {
	background: var(--color-orange-dark);
	border-color: var(--color-orange-dark);
	transform: translateY(-2px);
}

.btn .btn__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--color-white);
	color: var(--color-orange);
	flex-shrink: 0;
	transition: transform 0.2s var(--ease-brand);
}

.btn:hover .btn__arrow {
	transform: translateX(2px);
}

.btn .btn__arrow svg {
	width: 6px;
	height: 11px;
}

.btn--green {
	background: var(--color-green);
	border-color: var(--color-green);
}

.btn--green:hover {
	background: var(--color-green-dark);
	border-color: var(--color-green-dark);
}

.btn--green .btn__arrow {
	color: var(--color-green);
}

.btn--outline {
	background: transparent;
	color: var(--color-green);
	border-color: var(--color-green);
}

.btn--outline:visited {
	color: var(--color-green);
}

.btn--outline:hover {
	background: var(--color-green);
	color: var(--color-white);
}

.btn--outline .btn__arrow {
	background: var(--color-green);
	color: var(--color-white);
}

.btn--outline:hover .btn__arrow {
	background: var(--color-white);
	color: var(--color-green);
}

.btn--lg {
	min-height: 50px;
	padding: 12px 34px;
	font-size: 16px;
}

/* Quiet inline link used for repeated in-card actions, so every card on the
   page doesn't compete as its own pill button */
.link-arrow,
.link-arrow:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--color-green-dark);
	letter-spacing: 0.02em;
}

.link-arrow__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1px solid currentColor;
	transition: transform 0.2s var(--ease-brand), background-color 0.2s ease, color 0.2s ease;
}

.link-arrow__arrow svg {
	width: 5px;
	height: 9px;
}

.link-arrow:hover .link-arrow__arrow {
	background: var(--color-green-dark);
	color: var(--color-white);
	transform: translateX(2px);
}

.link-arrow--lg {
	gap: 12px;
	font-size: 16px;
}

.link-arrow--lg .link-arrow__arrow {
	width: 32px;
	height: 32px;
	background: var(--color-green-dark);
	color: var(--color-white);
	border-color: transparent;
}

.link-arrow--lg .link-arrow__arrow svg {
	width: 7px;
	height: 13px;
}

.link-arrow--lg:hover .link-arrow__arrow {
	transform: translateX(3px);
}

/* ---------- Category tag + blog card (shared by the front page's BLOG
   section and the post list / related posts on inner pages) ---------- */
.tag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--color-bg-gray);
	color: var(--color-text);
	font-size: 11px;
	font-weight: 700;
}

.news-blog-card {
	transition: transform 0.25s var(--ease-brand);
}

@media (hover: hover) {
	.news-blog-card:hover {
		transform: translateY(-4px);
	}
}

.news-blog-card__image {
	overflow: hidden;
	margin-bottom: 16px;
	border-radius: 12px;
	aspect-ratio: 1200 / 628;
}

.news-blog-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s var(--ease-brand);
}

.news-blog-card:hover .news-blog-card__image img {
	transform: scale(1.05);
}

.news-blog-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-bottom: 8px;
}

.news-blog-card__date {
	font-size: 13px;
	font-weight: 700;
	color: var(--color-green);
}

.news-blog-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.65;
	color: var(--color-text);
	transition: color 0.2s ease;
}

.news-blog-card:hover .news-blog-card__title {
	color: var(--color-green-dark);
}

/* Posts without a featured image: brand-green panel with the white logo
   instead of an empty grey box */
.news-blog-card__image--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-green);
}

.news-blog-card__image--empty img {
	width: 52%;
	height: auto;
	object-fit: contain;
}

.news-blog-card:hover .news-blog-card__image--empty img {
	transform: none;
}

/* ---------- Scroll reveal ---------- */
[data-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s var(--ease-brand), transform 0.7s var(--ease-brand);
}

[data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ---------- Site Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--header-height);
	padding-inline: 20px;
	background: var(--color-green);
	color: var(--color-white);
}

.site-header__brand {
	display: flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.3;
	color: var(--color-white);
}

.site-header__eyebrow {
	font-size: 12px;
	font-weight: 500;
	color: var(--color-white);
	white-space: nowrap;
}

.site-header__name {
	margin: 0;
	font-weight: 700;
	line-height: 0;
}

.site-header__name img {
	display: block;
	width: auto;
	height: 28px;
}

.site-header__brand a,
.site-header__brand a:visited {
	display: flex;
	flex-direction: column;
	gap: 1px;
	color: var(--color-white);
}

.menu-toggle {
	appearance: none;
	background: none;
	border: 0;
	padding: 6px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	cursor: pointer;
}

.menu-toggle__bar {
	display: block;
	width: 26px;
	height: 2px;
	border-radius: 1px;
	background: var(--color-white);
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* Off-canvas primary menu (mobile) */
.site-nav {
	position: fixed;
	inset: var(--header-height) 0 0 0;
	background: var(--color-white);
	transform: translateX(100%);
	transition: transform 0.3s ease;
	overflow-y: auto;
	z-index: 90;
}

.site-nav.is-open {
	transform: translateX(0);
}

.site-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav li {
	border-bottom: 1px solid var(--color-border);
}

.site-nav a,
.site-nav a:visited {
	display: block;
	padding: 18px 24px;
	font-weight: 700;
	color: var(--color-text);
}

/* Give a menu item the "menu-item-cta" CSS class (Appearance → Menus →
   Screen Options → CSS Classes) to render it as a pill button instead of a
   plain link — e.g. for a "中野たいせいを応援する" item. */
.site-nav li.menu-item-cta {
	padding: 8px 24px;
}

.site-nav li.menu-item-cta a,
.site-nav li.menu-item-cta a:visited {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 999px;
	background: var(--color-orange);
	color: var(--color-white);
	font-weight: 700;
	text-align: center;
}

/* ---------- Sub navigation (５つの約束 / 実現する力 / 語る会日程) ---------- */
.sub-nav {
	position: sticky;
	top: var(--header-height);
	z-index: 90;
	background: var(--color-bg-gray);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.sub-nav::-webkit-scrollbar {
	display: none;
}

.sub-nav__list {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0 12px;
	min-height: var(--subnav-height);
	width: max-content;
	min-width: 100%;
	justify-content: space-evenly;
}

.sub-nav__item + .sub-nav__item {
	margin-left: 8px;
}

.sub-nav__link,
.sub-nav__link:visited {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	padding: 10px 8px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--color-green);
}

.sub-nav__link .arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 1px solid var(--color-green);
	font-size: 8px;
	line-height: 1;
}

/* ---------- Site Footer ---------- */
.site-footer {
	background: var(--color-green-dark);
	color: var(--color-white);
	padding-block: 56px 28px;
}

.site-footer__heading {
	font-family: var(--font-display);
	/* Shrink with the screen so the longest line (「実現する」中野たいせい,
	   12 full-width characters) always fits on one line; 32px max. */
	font-size: min(32px, calc((100vw - var(--container-padding) * 2) / 12.5));
	white-space: nowrap;
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
}

/* Mobile: the two lists stack as one centered column with a shared left
   edge and the same spacing as between items, so they read as one list. */
.site-footer__links {
	display: grid;
	justify-content: center;
	gap: 16px;
	margin-top: 40px;
	padding-inline: var(--container-padding);
}

.site-footer__links ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.site-footer__links a,
.site-footer__links a:visited {
	font-size: 14px;
	font-weight: 500;
	color: var(--color-white);
}

.site-footer__social {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 38px;
}

.site-footer__social a {
	display: flex;
	border-radius: 50%;
	transition: transform 0.2s var(--ease-brand);
}

.site-footer__social a:hover {
	transform: translateY(-2px);
}

.site-footer__social .sns-icon {
	width: 30px;
	height: 30px;
}

/* Official SNS icons (assets/img/sns/). The Facebook mark's "f" is a
   transparent cut-out, so it gets a white disc behind it to read correctly
   on the green backgrounds. */
.sns-icon {
	display: block;
	border-radius: 50%;
}

.sns-icon--facebook {
	background: var(--color-white);
}

.site-footer__divider {
	max-width: var(--container-width);
	margin: 30px auto 0;
	border: 0;
	border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.site-footer__office {
	max-width: var(--container-width);
	margin: 26px auto 0;
	padding-inline: var(--container-padding);
	font-size: 14px;
	text-align: center;
	line-height: 1.8;
}

.site-footer__office strong {
	display: block;
	font-size: 18px;
	margin-bottom: 4px;
}

.site-footer__map,
.site-footer__map:visited {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-left: 6px;
	padding: 2px 8px 2px 5px;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	vertical-align: middle;
	transition: opacity 0.2s;
}

.site-footer__map:hover,
.site-footer__map:focus-visible {
	opacity: 0.7;
}

/* Tappable on phones; plain text on mouse devices, where tel: links
   usually have nothing to open */
.site-footer__tel,
.site-footer__tel:visited {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
	.site-footer__tel {
		pointer-events: none;
		text-decoration: none;
	}
}

.site-footer__privacy {
	margin-top: 24px;
	text-align: center;
	font-size: 13px;
}

.site-footer__privacy a,
.site-footer__privacy a:visited {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.site-footer__privacy a:hover {
	opacity: 0.7;
}

.site-footer__copyright {
	margin-top: 24px;
	text-align: center;
	font-size: 16px;
	opacity: 0.9;
}

/* ---------- Back to top ---------- */
.back-to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--color-green);
	color: var(--color-white);
	font-size: 20px;
	line-height: 1;
	box-shadow: 0 4px 10px -4px rgba(22, 36, 29, 0.35);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.2s ease, transform 0.2s var(--ease-brand), bottom 0.3s var(--ease-brand);
}

.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.back-to-top:hover,
.back-to-top:focus-visible {
	background: var(--color-green-dark);
	transform: translateY(-3px);
}

/* ---------- SNS banner (fixed, shown after scrolling like back-to-top) ----------
   Phones: full-width strip along the bottom edge. PC: bottom-right corner.
   The back-to-top button moves up above it while it's shown. */
.sns-banner {
	--sns-banner-height: calc(100vw * 135 / 750);
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 39;
	display: block;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(100%);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.3s var(--ease-brand);
}

.sns-banner img {
	display: block;
	width: 100%;
	height: auto;
}

.sns-banner.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
}

.sns-banner.is-visible ~ .back-to-top {
	bottom: calc(var(--sns-banner-height) + 12px);
}

/* Keep the footer's last lines from sitting under the strip on phones */
body:has(.sns-banner) {
	padding-bottom: calc(100vw * 135 / 750);
}

@media (min-width: 768px) {
	.sns-banner {
		--sns-banner-height: calc(360px * 135 / 750);
		left: auto;
		right: 20px;
		bottom: 20px;
		width: 360px;
		border-radius: 8px;
		overflow: hidden;
		box-shadow: 0 6px 16px -6px rgba(22, 36, 29, 0.45);
		transform: translateY(12px);
	}

	.sns-banner.is-visible:hover,
	.sns-banner.is-visible:focus-visible {
		transform: translateY(-3px);
	}

	.sns-banner.is-visible ~ .back-to-top {
		bottom: calc(20px + var(--sns-banner-height) + 12px);
	}

	body:has(.sns-banner) {
		padding-bottom: 0;
	}
}

@media (min-width: 768px) {
	.site-footer__links {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 24px 80px;
	}
}

@media (min-width: 1024px) {
	.site-footer__links {
		flex-wrap: nowrap;
		gap: 32px;
	}

	.site-footer__links ul {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
		gap: 12px 32px;
	}
}

@media (min-width: 1024px) {
	.site-header {
		padding-inline: 40px;
	}

	.site-header__name img {
		height: 32px;
	}

	.sub-nav__list {
		justify-content: center;
		gap: 56px;
	}
}

/* Header menu breakpoint — keep in sync with the matchMedia query in main.js. */
@media (min-width: 1024px) {
	.menu-toggle {
		display: none;
	}

	.site-nav {
		position: static;
		inset: auto;
		transform: none;
		background: none;
		overflow: visible;
		z-index: auto;
	}

	.site-nav ul {
		display: flex;
		align-items: center;
		gap: 32px;
	}

	.site-nav li {
		border-bottom: 0;
	}

	/* Items listed only in the mobile menu */
	.site-nav li.menu-item--sp {
		display: none;
	}

	.site-nav a,
	.site-nav a:visited {
		padding: 0;
		color: var(--color-white);
		font-size: 15px;
	}

	.site-nav li.menu-item-cta {
		padding: 0;
	}

	.site-nav li.menu-item-cta a,
	.site-nav li.menu-item-cta a:visited {
		padding: 10px 22px;
		color: var(--color-white);
	}
}
