/*
Theme Name: JOT Sri Lanka
Theme URI: https://jot.lk
Author: Telex
Description: A clean, institutional block theme for JOT Sri Lanka — a Japanese language proficiency testing service. Features a confident crimson accent on deep navy, Epilogue typography, and a layout built for clear communication of test levels, registration flows, and certification information.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jot-sri-lanka
Tags: block-patterns, blog, custom-colors, custom-logo, custom-menu, editor-style, full-site-editing, one-column, wide-blocks, translation-ready
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ==========================================================================
   0. Foundations & Resets
   ========================================================================== */

:root,
body,
.wp-site-blocks {
	overflow: visible;
}

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

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* ==========================================================================
   1. Sticky Header
   ========================================================================== */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

/* Backdrop pseudo for scrolled-state — keeps header free of backdrop-filter
   so the mobile nav overlay position:fixed still targets the viewport. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}

.wp-site-blocks > header.wp-block-template-part::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	transition: background 0.4s ease, box-shadow 0.4s ease;
}

body.is-scrolled .wp-site-blocks > header.wp-block-template-part::before {
	background: var(--wp--preset--color--background);
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
}

/* Header inner group transitions */
.site-header {
	transition: padding 0.25s ease;
}

/* Header border bottom */
.site-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* ==========================================================================
   2. Typography Polish
   ========================================================================== */

/* Epilogue has a slightly tall x-height — tighten paragraph spacing */
.wp-block-post-content p,
.entry-content p {
	margin-block-end: 1.25em;
}

.wp-block-post-content p:last-child,
.entry-content p:last-child {
	margin-block-end: 0;
}

/* Heading letter-spacing refinements (reinforce theme.json) */
h1, .wp-block-post-title,
h2, h3 {
	letter-spacing: -0.01em;
}

h6 {
	letter-spacing: 0.06em;
}

/* Small / meta text style */
.has-small-font-size {
	line-height: 1.5;
}

/* Muted text helper */
.has-muted-color {
	color: var(--wp--preset--color--muted);
}

/* ==========================================================================
   3. Link Styles
   ========================================================================== */

a {
	transition: color 0.2s ease;
}

/* Underline treatment for inline content links */
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content),
.entry-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--wp--preset--color--primary);
}

.wp-block-post-content a:not(.wp-block-button__link):hover,
.entry-content a:not(.wp-block-button__link):hover {
	text-decoration-color: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--primary-dark);
}

/* ==========================================================================
   4. Button Styles
   ========================================================================== */

.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
}

.wp-block-button__link:active {
	transform: translateY(0);
}

/* Outline button variant */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 2px solid currentColor;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   5. Navigation
   ========================================================================== */

.wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	transition: color 0.2s ease;
}

/* Active / hover bottom-border indicator */
.wp-block-navigation .wp-block-navigation-item__content::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--wp--preset--color--primary);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.25s ease;
	border-radius: 1px;
}

.wp-block-navigation .wp-block-navigation-item__content:hover::after,
.wp-block-navigation .current-menu-item .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--primary);
}

.wp-block-navigation .current-menu-item .wp-block-navigation-item__content {
	color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   6. Mobile Navigation Overlay
   ========================================================================== */

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

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: var(--wp--preset--spacing--40);
	align-items: flex-start;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--large);
}

/* ==========================================================================
   7. Image Treatments
   ========================================================================== */

.wp-block-image img {
	border-radius: 8px;
}

.wp-block-image.is-style-rounded img {
	border-radius: 50%;
}

/* Cover block images — no border-radius on full-bleed covers */
.wp-block-cover {
	border-radius: 0;
}

.wp-block-cover img {
	border-radius: 0;
}

/* Subtle hover lift on featured images inside post grids */
.wp-block-post-featured-image img {
	transition: transform 0.35s ease, box-shadow 0.35s ease;
	border-radius: 8px;
}

.wp-block-post-featured-image:hover img {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(26, 26, 46, 0.12);
}

/* ==========================================================================
   8. Card & Surface Patterns
   ========================================================================== */

/* Surface background cards */
.has-surface-background-color {
	border-radius: 8px;
}

/* Bordered card utility — use with border color */
.wp-block-group[style*="border-width"] {
	border-radius: 8px;
}

/* ==========================================================================
   9. Separator
   ========================================================================== */

.wp-block-separator {
	border: none;
	border-top: 1px solid var(--wp--preset--color--border);
	opacity: 1;
}

.wp-block-separator.is-style-wide {
	width: 100%;
}

.wp-block-separator.is-style-dots {
	border: none;
}

/* ==========================================================================
   10. Quote
   ========================================================================== */

.wp-block-quote {
	font-style: normal;
}

.wp-block-quote cite {
	display: block;
	margin-top: var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	font-style: normal;
}

/* ==========================================================================
   11. Post Title Links
   ========================================================================== */

.wp-block-post-title a {
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   12. Post Meta / Date / Author
   ========================================================================== */

.wp-block-post-date,
.wp-block-post-author__name,
.wp-block-post-terms {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

.wp-block-post-terms a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	font-weight: 500;
}

.wp-block-post-terms a:hover {
	color: var(--wp--preset--color--primary-dark);
}

/* ==========================================================================
   13. Site Title
   ========================================================================== */

.wp-block-site-title a {
	text-decoration: none;
	transition: color 0.2s ease;
}

/* ==========================================================================
   14. Cover Block
   ========================================================================== */

.wp-block-cover .wp-block-cover__inner-container {
	max-width: var(--wp--style--global--wide-size, 1280px);
}

/* Hero accent – crimson left-edge line on hero covers */
.wp-block-cover.hero-cover::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(
		to bottom,
		transparent 10%,
		var(--wp--preset--color--primary) 30%,
		var(--wp--preset--color--primary) 70%,
		transparent 90%
	);
	z-index: 5;
	pointer-events: none;
}

/* ==========================================================================
   15. Hero Section Specifics
   ========================================================================== */

/* Hero badge (inline pill) */
.hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: rgba(214, 25, 63, 0.15);
	border: 1px solid rgba(214, 25, 63, 0.3);
	border-radius: 100px;
	padding: 0.4rem 1rem;
}

.hero-badge-dot {
	width: 7px;
	height: 7px;
	background: var(--wp--preset--color--primary);
	border-radius: 50%;
	flex-shrink: 0;
	display: inline-block;
}

/* Hero stats bar */
.hero-stats-bar {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	flex-wrap: wrap;
}

.hero-stat-value {
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 800;
	font-size: 1.6rem;
	letter-spacing: -0.02em;
}

.hero-stat-label {
	font-weight: 500;
	font-size: 0.68rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.5;
	margin-top: 0.15rem;
}

.hero-stat-divider {
	width: 1px;
	height: 36px;
	background: currentColor;
	opacity: 0.15;
}

/* ==========================================================================
   16. Step / Number Cards
   ========================================================================== */

.step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1;
	flex-shrink: 0;
}

/* Icon badge (teal circle) */
.icon-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 12px;
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--white);
	flex-shrink: 0;
}

/* ==========================================================================
   17. Accordion / FAQ (wp:details)
   ========================================================================== */

details.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--30);
}

details.wp-block-details summary {
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--foreground);
	transition: color 0.2s ease;
}

details.wp-block-details summary::-webkit-details-marker {
	display: none;
}

details.wp-block-details summary::after {
	content: '+';
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--wp--preset--color--primary);
	flex-shrink: 0;
	transition: transform 0.25s ease;
}

details[open].wp-block-details summary::after {
	content: '-';
	transform: rotate(0);
}

details[open].wp-block-details summary {
	color: var(--wp--preset--color--primary);
}

details.wp-block-details > *:not(summary) {
	padding-top: var(--wp--preset--spacing--20);
}

/* ==========================================================================
   18. Tables
   ========================================================================== */

.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table th,
.wp-block-table td {
	border: 1px solid var(--wp--preset--color--border);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	text-align: left;
}

.wp-block-table th {
	background: var(--wp--preset--color--surface);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wp-block-table tr:hover td {
	background: var(--wp--preset--color--surface);
}

/* ==========================================================================
   19. Columns Responsive
   ========================================================================== */

@media (max-width: 782px) {
	.wp-block-columns {
		flex-direction: column;
	}

	.wp-block-column {
		flex-basis: 100% !important;
	}
}

/* ==========================================================================
   20. Footer Styles
   ========================================================================== */

/* Footer heading accents */
.footer-section-heading {
	color: var(--wp--preset--color--primary);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* Footer link styles */
.has-secondary-background-color a,
.has-foreground-background-color a {
	transition: color 0.2s ease;
}

/* ==========================================================================
   21. Focus States (Accessibility)
   ========================================================================== */

a:focus-visible,
button:focus-visible,
.wp-block-button__link:focus-visible,
.wp-block-navigation-item__content:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

/* ==========================================================================
   22. Selection
   ========================================================================== */

::selection {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* ==========================================================================
   23. Pagination
   ========================================================================== */

.wp-block-query-pagination {
	gap: var(--wp--preset--spacing--20);
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 0.5rem;
	border-radius: 100px;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	color: var(--wp--preset--color--foreground);
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-query-pagination-numbers .page-numbers:hover {
	background: var(--wp--preset--color--surface);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* ==========================================================================
   24. Tag / Category Chips
   ========================================================================== */

.wp-block-post-terms a {
	display: inline-block;
	padding: 0.2rem 0.75rem;
	border-radius: 100px;
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-post-terms a:hover {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* ==========================================================================
   25. Search Block
   ========================================================================== */

.wp-block-search__input {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 100px;
	padding: 0.65rem 1.25rem;
	font-family: var(--wp--preset--font-family--primary);
	font-size: var(--wp--preset--font-size--small);
	transition: border-color 0.2s ease;
}

.wp-block-search__input:focus {
	border-color: var(--wp--preset--color--primary);
	outline: none;
}

.wp-block-search__button {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border: none;
	border-radius: 100px;
	padding: 0.65rem 1.5rem;
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.wp-block-search__button:hover {
	background: var(--wp--preset--color--primary-dark);
}

/* ==========================================================================
   26. Scrollytelling — Invert-on-scroll header (Variant kept in style.css)
   ========================================================================== */

/* No invert variant needed — overlayHero is false.
   Header is opaque-surface on scroll, handled by the ::before pseudo above. */

/* ==========================================================================
   Loop layout utilities
   ========================================================================== */
/* These classes are wired to the wp:query blocks emitted by content/pages and
   templates. Do not rename. Tune colours and spacing to theme.json tokens. */

/* Horizontal scrollable rail */
.wp-block-query.is-style-loop-rail .wp-block-post-template {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: var(--wp--preset--spacing--20);
}
.wp-block-query.is-style-loop-rail .wp-block-post-template > * {
	flex: 0 0 320px;
	scroll-snap-align: start;
}

/* Compact list with hairline row dividers */
.wp-block-query.is-style-loop-list .wp-block-post-template > * {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-block: var(--wp--preset--spacing--30);
}
.wp-block-query.is-style-loop-list .wp-block-post-template > *:last-child {
	border-bottom: 0;
}

/* Zigzag — flip the columns inside every even entry */
.wp-block-query.is-style-loop-zigzag .wp-block-post-template > *:nth-child(even) .wp-block-columns {
	flex-direction: row-reverse;
}

/* Timeline — vertical line with node markers per entry */
.wp-block-query.is-style-loop-timeline .wp-block-post-template {
	position: relative;
	padding-inline-start: 2.5rem;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template::before {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0.5rem;
	width: 2px;
	background: var(--wp--preset--color--border);
	opacity: 0.5;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > * {
	position: relative;
}
.wp-block-query.is-style-loop-timeline .wp-block-post-template > *::before {
	content: '';
	position: absolute;
	inset-inline-start: -2.25rem;
	inset-block-start: 0.6rem;
	width: 1rem;
	height: 1rem;
	border: 2px solid var(--wp--preset--color--primary);
	border-radius: 50%;
	background: var(--wp--preset--color--background);
}

/* Magazine — first child spans 2 columns of the grid */
.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
	grid-column: span 2;
}
@media (max-width: 600px) {
	.wp-block-query.is-style-loop-magazine .wp-block-post-template > *:first-child {
		grid-column: auto;
	}
}

/* ==========================================================================
   27. Utility: Crimson accent text
   ========================================================================== */

.accent-text,
.has-primary-color {
	color: var(--wp--preset--color--primary);
}

/* ==========================================================================
   28. Smooth scrolling (respects reduced motion)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ==========================================================================
   29. Print Styles
   ========================================================================== */

@media print {
	.wp-site-blocks > header.wp-block-template-part,
	.wp-site-blocks > footer.wp-block-template-part,
	.wp-block-navigation,
	.wp-block-button,
	.wp-block-buttons,
	.scroll-progress {
		display: none !important;
	}

	body {
		font-size: 12pt;
		color: #000;
		background: #fff;
	}

	a {
		color: #000;
		text-decoration: underline;
	}

	img {
		max-width: 100% !important;
	}
}