/* AriLife — supplemental styles for touches theme.json cannot express. */

html { scroll-behavior: smooth; }

::selection { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); }

/* Hero ant photo shown as a wide band. */
.arilife-hero-band img {
	width: 100%;
	height: clamp(180px, 34vh, 430px);
	object-fit: cover;
	filter: saturate(0.85) contrast(1.05);
}

/* Profile photo fills its column nicely. */
.wp-block-media-text__media img {
	width: 100%;
	height: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	filter: saturate(0.78) contrast(1.03);
}

/* Paper cards lift slightly on hover. */
.wp-block-group.has-card-background-color {
	transition: transform 260ms ease, box-shadow 260ms ease;
}
.wp-block-group.has-card-background-color:hover {
	transform: translateY(-6px);
	box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

/* Underline links inside body copy for clarity. */
.wp-block-post-content a,
.entry-content a { text-underline-offset: 3px; }

/* Comfortable reading for long-form Japanese text in posts and pages. */
.wp-block-post-content p,
.wp-block-post-content li {
	line-height: 1.95;
}
.wp-block-post-content li { margin-bottom: 0.4rem; }

/* Comments (投稿へのコメント). */
.wp-block-comments .comment-content p { line-height: 1.8; }
.wp-block-comments input:not([type="submit"]),
.wp-block-comments textarea {
	width: 100%;
	max-width: 100%;
	padding: 0.7rem;
	border: 1px solid var(--wp--preset--color--muted);
	background: #fff;
	font: inherit;
	color: var(--wp--preset--color--contrast);
}
.wp-block-comments .comment-form label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; }
.wp-block-comments .comment-form-comment,
.wp-block-comments .comment-form p { margin-bottom: 1rem; }
.wp-block-comments .form-submit .submit,
.wp-block-comments input[type="submit"] {
	padding: 0.7rem 1.4rem;
	border: 0;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-weight: 700;
	letter-spacing: 0.06em;
	cursor: pointer;
}

/* Subtle site view counter in the footer. */
.arilife-views { opacity: 0.7; font-variant-numeric: tabular-nums; }

/* Rotating specimen-photo background (AntWeb-style hero). Activated by JS when specimen photos exist. */
.arilife-specimen-bg { position: relative; overflow: hidden; }
.arilife-specimen-bg.is-active > *:not(.arilife-bg) { position: relative; z-index: 1; }
.arilife-bg { position: absolute; inset: 0; z-index: 0; }
.arilife-bg-layer {
	position: absolute; inset: 0;
	background-size: cover; background-position: center;
	opacity: 0; transition: opacity 1.2s ease;
	filter: saturate(0.9) contrast(1.03);
}
.arilife-bg-layer.is-visible { opacity: 1; }
.arilife-bg-scrim { position: absolute; inset: 0; background: rgba(18, 19, 15, 0.62); }
.arilife-specimen-bg.is-active :is(h1, h2, h3, h4, p, dt, dd, li, span, a) { color: #f4f1e7; }
.arilife-specimen-bg.is-active .has-muted-color { color: rgba(244, 241, 231, 0.78); }
.arilife-specimen-bg.is-active .wp-block-group[style*="border-top"] { border-top-color: rgba(244, 241, 231, 0.28) !important; }

/* Photo library rails (Photography page). */
.arilife-photo-section { margin: 2.5rem 0 3rem; }
.arilife-rail-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.arilife-rail-head h2 { margin: 0; font-size: var(--wp--preset--font-size--large); letter-spacing: -0.02em; }
.arilife-rail-ctrl { display: flex; flex: 0 0 auto; }
.arilife-rail-ctrl button {
	width: 44px; height: 44px;
	border: 1px solid var(--wp--preset--color--muted);
	background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer;
	transition: background .18s ease, color .18s ease;
}
.arilife-rail-ctrl button + button { border-left: 0; }
.arilife-rail-ctrl button:hover { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); }
.arilife-rail {
	display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
	scroll-snap-type: x mandatory; padding-bottom: 12px;
	scrollbar-width: thin; cursor: grab; overscroll-behavior-inline: contain;
}
.arilife-rail.is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.arilife-rail:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.arilife-photo { flex: 0 0 auto; width: clamp(180px, 42vw, 260px); scroll-snap-align: start; }
.arilife-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #e7e3d8; }
.arilife-photo .cap { display: block; margin-top: .5rem; font-size: .8rem; line-height: 1.4; color: var(--wp--preset--color--muted); }

/* Taxon index (亜科 → 属 → 種). */
.arilife-taxon-index, .arilife-taxon-index ul { list-style: none; margin: 0; padding-left: 0; }
.arilife-taxon-index li { padding: .35rem 0; }
.arilife-taxon-index ul { padding-left: 1.2rem; margin-left: .3rem; border-left: 1px solid var(--wp--preset--color--muted); }
.arilife-taxon-index a { text-decoration: none; }
.arilife-taxon-index a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Specimen label table (証拠標本テンプレート). */
.arilife-label table { border-collapse: collapse; width: 100%; }
.arilife-label td {
	border-bottom: 1px solid var(--wp--preset--color--muted);
	padding: 0.55rem 0.6rem;
	vertical-align: top;
	line-height: 1.6;
}
.arilife-label td:first-child {
	width: 38%;
	font-weight: 700;
	color: var(--wp--preset--color--muted);
	font-size: 0.9em;
}
@media (max-width: 480px) {
	.arilife-label td:first-child { width: 42%; }
}

/* Keep the giant hero name from overflowing on very small screens. */
@media (max-width: 480px) {
	.arilife-hero-band img { height: clamp(150px, 40vh, 300px); }
}
