/*
Theme Name: Nepal China Academy
Theme URI: https://nepalchinaacademy.org
Author: Nepal China Academy
Description: A diplomatic and culturally warm WordPress block theme for Nepal China Academy, fostering Nepal-China friendship, academic cooperation, and cultural exchange. Built with Cormorant Garamond, Inter, and JetBrains Mono typography, anchored in a Silk Road Meridian palette of Prussian blue, ivory parchment, vermillion, and ceremonial gold.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nepal-china-academy
Tags: block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, featured-images, full-site-editing, one-column, sticky-post, threaded-comments, translation-ready, wide-blocks
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ==========================================================================
   FOUNDATION
   ========================================================================== */

/* Ensure sticky header works — no overflow traps */
:root,
body,
.wp-site-blocks {
	overflow: visible;
}

/* Smooth scroll for anchor links */
html {
	scroll-behavior: smooth;
}

/* ==========================================================================
   STICKY HEADER
   ========================================================================== */

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

/* Backdrop pseudo for scrolled-state chrome */
.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--prussian-blue);
	box-shadow: 0 1px 0 var(--wp--preset--color--gold);
}

/* ==========================================================================
   TYPOGRAPHY POLISH
   ========================================================================== */

/* Refined body prose */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Headings — subtle warmth with Cormorant Garamond */
h1, h2, h3, h4, h5, h6 {
	text-wrap: balance;
}

/* Drop cap for editorial longform */
.has-drop-cap:not(:focus)::first-letter {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	color: var(--wp--preset--color--vermillion);
	float: left;
	font-size: 3.5em;
	line-height: 0.85;
	margin-right: 0.08em;
	margin-top: 0.05em;
}

/* Small caps utility for subtitles and section labels */
.is-style-small-caps {
	font-variant: small-caps;
	letter-spacing: 0.05em;
}

/* Metadata and administrative text — mono warmth */
.wp-block-post-date,
.wp-block-post-terms,
figcaption,
.wp-element-caption {
	font-family: var(--wp--preset--font-family--mono);
}

/* ==========================================================================
   LINK STYLES
   ========================================================================== */

/* Body links: vermillion with warm gold hover */
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content) {
	color: var(--wp--preset--color--vermillion);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
	transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

.wp-block-post-content a:not(.wp-block-button__link):not(.wp-block-navigation-item__content):hover {
	color: var(--wp--preset--color--gold);
	text-decoration-color: var(--wp--preset--color--gold);
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

/* Navigation link hover underline — vermillion accent line */
.wp-block-navigation a {
	position: relative;
	transition: color 0.3s ease;
}

.wp-block-navigation a::after {
	content: "";
	position: absolute;
	bottom: -2px;
	left: 50%;
	width: 0;
	height: 1px;
	background-color: var(--wp--preset--color--vermillion);
	transition: width 0.3s ease, left 0.3s ease;
}

.wp-block-navigation a:hover::after,
.wp-block-navigation a:focus::after {
	width: 100%;
	left: 0;
}

.wp-block-navigation a:hover {
	color: var(--wp--preset--color--gold);
}

/* Current page indicator */
.wp-block-navigation .current-menu-item > a {
	color: var(--wp--preset--color--gold);
}

.wp-block-navigation .current-menu-item > a::after {
	width: 100%;
	left: 0;
	background-color: var(--wp--preset--color--gold);
}

/* ==========================================================================
   MOBILE HAMBURGER OVERLAY
   ========================================================================== */

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

.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);
	color: var(--wp--preset--color--ivory-parchment);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--gold);
}

/* Close button in overlay */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--ivory-parchment);
}

/* ==========================================================================
   BUTTON STYLES
   ========================================================================== */

/* Primary button transitions */
.wp-block-button__link {
	transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.wp-block-button__link:hover {
	box-shadow: 0 2px 8px rgba(27, 42, 74, 0.25);
}

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

.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
	border-color: var(--wp--preset--color--vermillion);
}

/* CTA double-border treatment from the picked hero design */
.wp-block-button.is-style-cta-border .wp-block-button__link {
	position: relative;
	background: transparent;
	border: 1px solid var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
	padding: 1rem 3rem;
}

.wp-block-button.is-style-cta-border .wp-block-button__link::before {
	content: "";
	position: absolute;
	top: -5px;
	left: -5px;
	right: -5px;
	bottom: -5px;
	border: 1px solid rgba(192, 57, 43, 0.4);
	transition: all 0.4s ease;
	pointer-events: none;
}

.wp-block-button.is-style-cta-border .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
}

.wp-block-button.is-style-cta-border .wp-block-button__link:hover::before {
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-color: var(--wp--preset--color--vermillion);
}

/* ==========================================================================
   IMAGE TREATMENTS
   ========================================================================== */

/* Diplomatic, no-rounded-corners, grounded images */
.wp-block-image img {
	border-radius: 0;
}

/* Subtle shadow for featured images */
.wp-block-image.is-style-shadow img {
	box-shadow: 0 4px 20px rgba(27, 42, 74, 0.12);
}

/* Gold border accent for ceremonial / highlight images */
.wp-block-image.is-style-gold-border img {
	border: 2px solid var(--wp--preset--color--gold);
	padding: 4px;
}

/* Gallery hover — lift effect */
.wp-block-gallery .wp-block-image img {
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.wp-block-gallery .wp-block-image img:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 24px rgba(27, 42, 74, 0.15);
}

/* Cover block gradient treatment */
.wp-block-cover::after {
	pointer-events: none;
}

/* ==========================================================================
   HERO STYLES
   ========================================================================== */

/* Hero gradient overlay — used on cover blocks */
.hero-gradient-overlay .wp-block-cover__background {
	background: linear-gradient(
		to bottom,
		rgba(27, 42, 74, 0.2) 0%,
		rgba(27, 42, 74, 0.5) 50%,
		rgba(27, 42, 74, 1) 100%
	) !important;
}

/* Hero divider — vermillion accent line */
.wp-block-separator.is-style-hero-divider {
	width: 80px;
	border-top: 2px solid var(--wp--preset--color--vermillion);
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   SEPARATOR / DIVIDER
   ========================================================================== */

/* Gold decorative separator */
.wp-block-separator.is-style-gold-rule {
	border-color: var(--wp--preset--color--gold);
	border-width: 2px;
}

/* Thin subtle separator */
.wp-block-separator.is-style-subtle {
	border-color: var(--wp--preset--color--muted-slate);
	border-width: 1px;
	opacity: 0.3;
}

/* ==========================================================================
   QUOTE & PULLQUOTE
   ========================================================================== */

/* Quote — italic Cormorant with gold border */
.wp-block-quote {
	position: relative;
}

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

/* Pullquote citation */
.wp-block-pullquote cite {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--gold);
	font-style: normal;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

/* ==========================================================================
   CARDS & CONTENT BLOCKS
   ========================================================================== */

/* Card style for groups — used on member profiles, event cards, etc. */
.is-style-card {
	background-color: var(--wp--preset--color--warm-cream);
	border: 1px solid rgba(27, 42, 74, 0.08);
	padding: var(--wp--preset--spacing--40);
	transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.is-style-card:hover {
	box-shadow: 0 4px 24px rgba(27, 42, 74, 0.1);
	transform: translateY(-2px);
}

/* Gold top-border card accent */
.is-style-card-gold-top {
	border-top: 3px solid var(--wp--preset--color--gold);
}

/* Vermillion top-border card accent */
.is-style-card-vermillion-top {
	border-top: 3px solid var(--wp--preset--color--vermillion);
}

/* ==========================================================================
   TABLE STYLES
   ========================================================================== */

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

.wp-block-table td,
.wp-block-table th {
	border-bottom: 1px solid rgba(27, 42, 74, 0.1);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	text-align: left;
}

.wp-block-table th {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	color: var(--wp--preset--color--prussian-blue);
	background-color: var(--wp--preset--color--warm-cream);
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
}

.wp-block-table tr:hover td {
	background-color: rgba(245, 240, 232, 0.5);
}

/* Striped variant */
.is-style-stripes tbody tr:nth-child(odd) td {
	background-color: var(--wp--preset--color--warm-cream);
}

/* ==========================================================================
   SEARCH
   ========================================================================== */

.wp-block-search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--muted-slate);
	border-radius: 0;
	padding: 0.75rem 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	background-color: var(--wp--preset--color--warm-cream);
	transition: border-color 0.3s ease;
}

.wp-block-search .wp-block-search__input:focus {
	border-color: var(--wp--preset--color--vermillion);
	outline: none;
	box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

.wp-block-search .wp-block-search__button {
	background-color: var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
	border: none;
	border-radius: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 0.75rem 1.5rem;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.wp-block-search .wp-block-search__button:hover {
	background-color: var(--wp--preset--color--prussian-blue);
}

/* ==========================================================================
   FORM ELEMENTS (general)
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
	border: 1px solid var(--wp--preset--color--muted-slate);
	border-radius: 0;
	padding: 0.75rem 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	background-color: var(--wp--preset--color--warm-cream);
	color: var(--wp--preset--color--charcoal);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
	border-color: var(--wp--preset--color--vermillion);
	outline: none;
	box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */

/* Footer link warmth */
footer .wp-block-navigation a,
footer a {
	transition: color 0.3s ease;
}

footer .wp-block-navigation a:hover,
footer a:hover {
	color: var(--wp--preset--color--gold);
}

/* Footer gold separator */
footer .wp-block-separator {
	border-color: var(--wp--preset--color--gold);
	opacity: 0.4;
}

/* ==========================================================================
   DARK SURFACE UTILITY
   ========================================================================== */

/* For sections with Prussian Blue background — ensure links shift to gold */
.has-prussian-blue-background-color a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--soft-gold);
}

.has-prussian-blue-background-color a:not(.wp-block-button__link):hover {
	color: var(--wp--preset--color--gold);
}

/* Deep Navy surface links */
.has-deep-navy-background-color a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--soft-gold);
}

.has-deep-navy-background-color a:not(.wp-block-button__link):hover {
	color: var(--wp--preset--color--gold);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

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

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0.25rem 0.5rem;
	border: 1px solid var(--wp--preset--color--muted-slate);
	color: var(--wp--preset--color--prussian-blue);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	transition: all 0.3s ease;
}

.wp-block-query-pagination-numbers .page-numbers:hover {
	background-color: var(--wp--preset--color--vermillion);
	border-color: var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
}

.wp-block-query-pagination-numbers .page-numbers.current {
	background-color: var(--wp--preset--color--prussian-blue);
	border-color: var(--wp--preset--color--prussian-blue);
	color: var(--wp--preset--color--ivory-parchment);
}

/* ==========================================================================
   POST / ARCHIVE STYLING
   ========================================================================== */

/* Featured image hover on archive cards */
.wp-block-post-featured-image img {
	transition: transform 0.5s ease;
}

.wp-block-post-featured-image:hover img {
	transform: scale(1.03);
}

/* Post featured image container overflow clip */
.wp-block-post-featured-image {
	overflow: hidden;
}

/* Post terms — category/tag pills */
.wp-block-post-terms a {
	text-decoration: none;
	color: var(--wp--preset--color--vermillion);
	transition: color 0.3s ease;
}

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

/* ==========================================================================
   SELECTION COLOR
   ========================================================================== */

::selection {
	background-color: var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
}

::-moz-selection {
	background-color: var(--wp--preset--color--vermillion);
	color: var(--wp--preset--color--ivory-parchment);
}

/* ==========================================================================
   SCROLLBAR STYLING
   ========================================================================== */

::-webkit-scrollbar {
	width: 8px;
}

::-webkit-scrollbar-track {
	background: var(--wp--preset--color--ivory-parchment);
}

::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--muted-slate);
	border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--wp--preset--color--prussian-blue);
}

/* ==========================================================================
   FOCUS STYLES — Accessibility
   ========================================================================== */

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

.wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

/* ==========================================================================
   GOLD ACCENT BORDER UTILITY
   ========================================================================== */

/* Bottom gold border — for diplomatic section dividers */
.is-style-gold-bottom-border {
	border-bottom: 2px solid var(--wp--preset--color--gold);
	padding-bottom: var(--wp--preset--spacing--30);
}

/* Top gold border */
.is-style-gold-top-border {
	border-top: 2px solid var(--wp--preset--color--gold);
	padding-top: var(--wp--preset--spacing--30);
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 781px) {
	/* Tighter spacing on mobile for cards */
	.is-style-card {
		padding: var(--wp--preset--spacing--30);
	}

	/* Stack columns on mobile — ensure breathing room */
	.wp-block-columns {
		gap: var(--wp--preset--spacing--40);
	}
}

@media (max-width: 600px) {
	/* Reduce hero type on very small screens gracefully handled by fluid */
	.wp-block-cover .wp-block-heading {
		word-break: break-word;
	}

	/* Tighter mobile gallery */
	.wp-block-gallery {
		gap: var(--wp--preset--spacing--20);
	}
}

/* ==========================================================================
   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--muted-slate);
	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--gold);
	opacity: 0.3;
}
.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--vermillion);
	border-radius: 50%;
	background: var(--wp--preset--color--ivory-parchment);
}

/* 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;
	}
}