/* ===================================
	 1. Reset & Base Settings
	 =================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	/* Colors */
	--wp--preset--color--gAiiro: #004c71;
	--wp--preset--color--primary: var(--wp--preset--color--gAiiro);
	
	/* Spacing */
	--wp--custom--spacing--top-and-bottom: 6rem;
	--wp--custom--spacing--left-and-right: 1.5rem;
	
	/* Layout dimensions */
	--header-height-desktop: 72px;
	--header-height-mobile: 60px;
	--header-height-sticky: 72px;
	
	/* Floating button positioning */
	--floating-button-bottom: 6rem;
	--floating-button-right: 0.5rem;
	
	/* Z-index scale */
	--z-header: 10;
	--z-pagetop: 2;
	
	/* Mobile optimizations */
	--spacing-mobile-vertical: 3rem;
	--spacing-mobile-horizontal: 1.25rem;
	--tap-target-minimum: 44px;
	--font-size-mobile-base: 16px;
	
	/* Common values */
	--shadow-elevated: 0 4px 6px rgba(0, 0, 0, 0.3);
	--transition-standard: 0.5s ease;
	--border-radius-circle: 50%;
}

:root :where(.is-layout-flow) > *,
:root :where(.is-layout-constrained) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

html {
	scroll-behavior: smooth;
}

body {
	color: #3e3a39;
	padding: 0;
}

/* ===================================
	 2. Base Elements
	 =================================== */
a {
	text-decoration: none;
}

a:not(.wp-element-button) {
	background: linear-gradient(currentColor 0 0) 0 100% / var(--d, 0) 1px no-repeat;
	transition: background-size var(--transition-standard);
}

a:not(.wp-element-button):hover {
	--d: 100%;
}

a:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

iframe {
	width: 100%;
}

/* ===================================
	 3. Layout Containers
	 =================================== */
header,
footer {
	padding-inline: 1rem;
}

header > div:not(.wp-block-navigation__responsive-container),
header .wp-block-group > div:not(.wp-block-navigation__responsive-container) {
	width: 100%;
	height: var(--header-height-desktop);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

header.is-position-sticky {
	height: var(--header-height-sticky);
	background-color: rgba(255, 255, 255, 0.75);
}

header .wp-block-group {
	padding: 0;
}

header figure {
	margin-block-end: 0;
}

header ul {
	padding-left: 0;
}

header li {
	margin-block-end: 0;
}

main > :is(article, section, div) {
	padding: var(--wp--custom--spacing--top-and-bottom) var(--wp--custom--spacing--left-and-right);
}

main.wp-block-group {
	padding: 0;
}

:where(.wp-site-blocks) > main {
	margin-block-start: 0;
}

body:not(.home) main {
	padding: 6rem var(--wp--preset--spacing--50);
}

section {
	background-color: inherit;
}

/* Common styles - section and article */
:is(section, article).alignfull.has-global-padding {
	margin: 0;
	padding: var(--wp--preset--spacing--80) var(--wp--preset--spacing--40);
}

/* Exception: access section */
section.access.alignfull.has-global-padding {
	margin-bottom: -0.5rem;
	padding: var(--wp--preset--spacing--80) 0 0 0;
}

/* Exception: contact section */
section#contact.alignfull.has-global-padding {
	padding: 0;
	margin: 0;
}

footer {
	color: var(--wp--preset--color--white);
	background-color: var(--wp--preset--color--gAiiro);
	margin-block-start: 0;
}

footer a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

footer p {
	margin-block-end: 0;
}

/* ===================================
	 4. WordPress Blocks
	 =================================== */
.wp-block-table td {
	vertical-align: top;
	border: 0;
	border-bottom: 1px dotted;
	padding: 0.75rem 1rem;
}

.wp-block-query li > :is(div, div > div) {
	padding: 1rem 0;
}

section.wp-block-cover.alignfull.has-parallax.hero {
	min-height: calc(96vh + var(--header-height-sticky));
	margin-block-start: calc(-1 * var(--header-height-sticky) + var(--wp-admin--admin-bar--position-offset, -1 * var(--header-height-sticky)));
}

section.wp-block-cover.alignfull.has-parallax.hero .wp-block-cover__inner-container.is-layout-flow.wp-block-cover-is-layout-flow {
	padding-block-start: var(--header-height-sticky);
}

.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container-close {
	right: 16px;
	top: 8px;
}

/* ===================================
	 5. Custom Components
	 =================================== */
.has-calligraffitti-font-family {
	color: var(--wp--preset--color--primary);
}

/* Page top button */
.pagetop,
.wp-block-buttons.page-top {
	position: fixed;
	right: var(--floating-button-right);
	bottom: var(--floating-button-bottom);
	z-index: var(--z-pagetop);
}

.pagetop {
	width: 3rem;
	aspect-ratio: 1;
	background: var(--wp--preset--color--primary);
	border: solid 2px var(--wp--preset--color--white);
	border-radius: var(--border-radius-circle);
	box-shadow: var(--shadow-elevated);
	display: flex;
	justify-content: center;
	align-items: center;
	transition: border-color var(--transition-standard);
}

.pagetop:hover {
	border-color: var(--wp--preset--color--luminous-vivid-amber);
}

.pagetop a {
	transition: color var(--transition-standard);
}

.pagetop a:hover {
	color: var(--wp--preset--color--luminous-vivid-amber);
}

.wp-block-buttons.page-top a {
	width: 4rem;
	aspect-ratio: 1;
	box-shadow: var(--shadow-elevated);
	display: flex;
	justify-content: center;
	align-items: center;
}

.page-info.wp-block-group,
.page-info .wp-block-group {
	padding: 0;
}

.page-info p {
	margin-block-end: 0;
}

/* ===================================
	 6. Typography
	 =================================== */
h1.wp-block-post-title,
h2.wp-block-post-title,
.home main h1.wp-block-heading,
.home main h2.wp-block-heading {
	margin-block-end: 2rem;
}

h2.wp-block-heading {
	margin-block-end: 1.875rem;
}

h3.wp-block-heading {
	margin-block-end: 1.75rem;
}

p {
	margin-block-end: 1.5rem;
}

figure {
	margin-block-end: 1.5rem;
}

ul {
	padding-left: 1.5rem;
}

li {
	margin-block-end: 1.25rem;
}

/* ===================================
	 7. SVG Icons
	 =================================== */
.icon-svg {
	position: relative;
	padding-left: 2.5rem;
	font-size: 24px;
	line-height: 1.5;
}

.icon-svg::before {
	content: "";
	display: block;
	width: 32px;
	aspect-ratio: 1;
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.icon-pc::before {
	background-image: url('../images/icon_pc.svg');
}

.icon-value::before {
	background-image: url('../images/icon_value.svg');
}

.icon-checked::before {
	background-image: url('../images/icon_checked.svg');
}

.icon-ai-robo::before {
	background-image: url('../images/icon_robo.svg');
}

.icon-hint::before {
	background-image: url('../images/icon_hint.svg');
}

/* ===================================
	 8. Entry Content
	 =================================== */
.entry-content {
	padding: 0;
}

.entry-content > *:not(.wp-block-cover) {
	padding-inline: 1rem;
}

.entry-content > .wp-block-list {
	width: calc(100% - 2rem);
}

.entry-content .wp-block-list {
	padding: 0 1rem 0 2rem;
}

main.bsc-gskelton .entry-content {
	max-width: initial;
}

/* ===================================
	 9. Utility Classes
	 =================================== */
.gs-hidden {
	display: none;
}

.is-hidden-on-mobile {
	display: none;
}

body.is-paginated .wp-block-cover.alignfull {
	display: none;
}

.single-post hr {
	width: 100%;
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--70);
}

.block-taxonomy {
	padding-inline: var(--wp--custom--spacing--left-and-right);
}

/* ===================================
	 10. Accessibility
	 =================================== */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	
	a:not(.wp-element-button),
	.pagetop,
	.pagetop a {
		transition: none;
	}
}

/* ===================================
	 11. Mobile Optimizations (max-width: 768px)
	 =================================== */
@media (max-width: 768px) {
	/* CSS Variables Override */
	:root {
		--wp--custom--spacing--left-and-right: var(--spacing-mobile-horizontal);
		--floating-button-bottom: 1.5rem;
		--floating-button-right: 1rem;
		--header-height-sticky: var(--header-height-mobile);
	}
	
	/* Typography */
	body {
		font-size: var(--font-size-mobile-base);
		line-height: 1.6;
		color: #2d2d2d;
	}
	
	h1.wp-block-heading,
	h1.wp-block-post-title {
		font-size: clamp(1.75rem, 5vw, 2.5rem);
		line-height: 1.3;
	}
	
	h2.wp-block-heading,
	h2.wp-block-post-title {
		font-size: clamp(1.5rem, 4vw, 2rem);
		line-height: 1.4;
	}
	
	h3.wp-block-heading {
		font-size: clamp(1.25rem, 3.5vw, 1.75rem);
		line-height: 1.4;
	}
	
	p {
		font-size: 1rem;
		line-height: 1.7;
		margin-block-end: 1.75rem;
	}
	
	/* Layout */
	main > :is(article, section, div) {
		padding: var(--spacing-mobile-vertical) var(--spacing-mobile-horizontal);
	}
	
	body:not(.home) main {
		padding: var(--spacing-mobile-vertical) var(--spacing-mobile-horizontal);
	}
	
	main > section + section {
		margin-top: 2rem;
	}
	
	/* Header */
	header > div:not(.wp-block-navigation__responsive-container),
	header .wp-block-group > div:not(.wp-block-navigation__responsive-container) {
		height: var(--header-height-mobile);
		padding-inline: 0.5rem;
	}
	
	header.is-position-sticky {
		height: var(--header-height-mobile);
	}
	
	header img {
		max-height: 40px;
		width: auto;
	}
	
	/* Footer */
	footer {
		padding: 2rem var(--spacing-mobile-horizontal);
		font-size: 0.9375rem;
	}
	
	footer a {
		padding-block: 0.5rem;
		display: inline-block;
	}
	
	/* Tables */
	thead {
		display: none;
	}
	
	tr {
		display: flex;
		flex-direction: column;
	}
	
	tr td:not(:last-child) {
		border-bottom: 0;
	}
	
	.wp-block-table {
		font-size: 0.9375rem;
	}
	
	.wp-block-table td {
		padding: 1rem 0.75rem;
		display: block;
		width: 100%;
	}
	
	.wp-block-table td:first-child {
		font-weight: 600;
		padding-top: 1.25rem;
	}
	
	.wp-block-table td:last-child {
		padding-bottom: 1.25rem;
	}
	
	/* Links - Enhanced visibility for mobile */
	a:not(.wp-element-button) {
		background: none;
		text-decoration: underline;
		text-decoration-color: rgba(0, 76, 113, 0.3);
		text-underline-offset: 0.2em;
		transition: none;
		padding-block: 0.25rem;
		display: inline-block;
		color: var(--wp--preset--color--primary);
	}
	
	a:not(.wp-element-button):hover,
	a:not(.wp-element-button):focus {
		text-decoration-color: var(--wp--preset--color--primary);
	}
	
	/* Navigation Links */
	.wp-block-navigation__responsive-container a {
		padding: 1rem 0.75rem;
		min-height: var(--tap-target-minimum);
		display: flex;
		align-items: center;
	}
	
	/* Buttons */
	.wp-element-button,
	.wp-block-button__link {
		min-height: 48px;
		padding: 0.875rem 1.5rem;
		font-size: 1rem;
	}
	
	/* Page Top Button */
	.pagetop,
	.wp-block-buttons.page-top a {
		width: 3.5rem;
		aspect-ratio: 1;
		bottom: 1.5rem;
		right: 1rem;
	}
	
	/* Icons */
	.icon-svg {
		font-size: 1rem;
		line-height: 1.6;
		padding-left: 2.75rem;
	}
	
	.icon-svg::before {
		width: 28px;
		aspect-ratio: 1;
	}
	
	/* Images */
	img {
		height: auto;
		max-width: 100%;
	}
	
	figure {
		margin-block-end: 2rem;
	}
	
	.wp-block-image {
		margin-inline: auto;
	}
	
	/* Lists */
	ul,
	ol {
		padding-left: 1.75rem;
	}
	
	li {
		margin-block-end: 1rem;
		line-height: 1.6;
	}
	
	.entry-content .wp-block-list {
		padding: 0 0.5rem 0 1.75rem;
	}
	
	/* Hero Section */
	section.wp-block-cover.alignfull.has-parallax.hero {
		min-height: 70vh;
	}
	
	.wp-block-cover__inner-container {
		padding: 2rem var(--spacing-mobile-horizontal);
	}
	
	/* Forms - Prevent zoom on iOS */
	input[type="text"],
	input[type="email"],
	input[type="tel"],
	textarea,
	select {
		font-size: 16px;
		padding: 0.75rem;
		width: 100%;
	}
	
	/* Utility Classes */
	.is-hidden-on-mobile {
		display: block;
	}
	
	.block-taxonomy {
		padding-inline: var(--wp--custom--spacing--left-and-right);
	}
}

/* ===================================
	 12. Smaller Mobile Devices (max-width: 600px)
	 =================================== */
@media screen and (max-width: 600px) {
	.is-style-block-link {
		padding-inline: var(--wp--preset--spacing--40);
	}
}