/* ==========================================================================
   Gilbert Tencio Ocampo - portable styles
   Target: WordPress.com Premium > Additional CSS

   Portability rules (do not break):
   - No CSS custom properties (:root { --x: ... }) and no var().
   - No clamp(), min(), max(), inset or other modern math functions.
   - No CSS nesting, no :is()/:where() in new rules, no @supports.
   - Colors, widths and spacing are written as literal values.
   - Animations only run when the visitor has not asked for reduced motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. The centred container
   -------------------------------------------------------------------------- */

/* Every visible band (header, main, footer) carries .wpc-shell, so the page
   keeps one single horizontal rhythm instead of drifting to the left. */
.wpc-shell {
	width: 100%;
	max-width: 1120px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 24px;
	padding-right: 24px;
}

/* WordPress adds the site root padding (30px) to .wp-block-post-content and
   pulls alignfull children outwards by the same amount. The shell already owns
   the horizontal rhythm, so both are neutralised here. */
.wpc-main > .wp-block-post-content {
	padding-left: 0;
	padding-right: 0;
}

.wpc-main > .alignfull,
.wpc-main > .wp-block-post-content > .alignfull {
	margin-left: 0;
	margin-right: 0;
}

.wpc-prose > * {
	max-width: 680px;
	margin-left: auto;
	margin-right: auto;
}

/* --------------------------------------------------------------------------
   2. Typography and base rhythm
   -------------------------------------------------------------------------- */

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: #16161a;
	background-color: #ffffff;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
	font-family: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	color: #16161a;
	text-wrap: balance;
}

h1 {
	font-size: 2.5rem;
}

h2 {
	font-size: 1.875rem;
	margin-top: 2.5rem;
}

h3 {
	font-size: 1.375rem;
	margin-top: 2rem;
}

p {
	margin-bottom: 1.25rem;
}

a {
	color: #1b4fd8;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover,
a:focus {
	color: #0e3aa8;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid #1b4fd8;
	outline-offset: 2px;
	border-radius: 2px;
}

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

.wp-block-quote {
	border-left: 4px solid #1b4fd8;
	padding-left: 1.25rem;
	font-style: italic;
	color: #55555e;
}

.wp-block-code,
.wp-block-preformatted {
	background-color: #f4f5f7;
	border: 1px solid #e3e4e8;
	border-radius: 6px;
	font-size: 0.9375rem;
}

.wp-block-separator {
	border-bottom: 1px solid #e3e4e8;
	max-width: 8rem;
}

/* --------------------------------------------------------------------------
   3. Header and single-row navigation
   -------------------------------------------------------------------------- */

.wpc-header__inner {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.wpc-header__brand {
	flex: 1 1 auto;
	min-width: 0;
}

.wpc-header__brand .wp-block-site-title {
	font-size: 1.25rem;
	line-height: 1.25;
}

.wpc-header__nav {
	flex: 0 0 auto;
}

/* One row on desktop: the six short labels never wrap. */
.wp-block-navigation__container {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-end;
	gap: 18px;
}

.wp-block-navigation__container .wp-block-navigation-item__content {
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   4. Hero (front page)
   -------------------------------------------------------------------------- */

.wpc-hero {
	background-color: #f4f5f7;
	border: 1px solid #e3e4e8;
	border-radius: 16px;
	padding: 40px;
	margin-top: 24px;
	margin-bottom: 40px;
}

.wpc-hero__grid {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 32px;
}

/* WordPress pushes every column after the first one down with a preset top
   margin (core emits it through :where()). The hero and the card grid do their
   own spacing, so that inherited margin is removed here. */
.wpc-hero__grid > .wp-block-column,
.wpc-cards > .wp-block-column {
	margin-top: 0;
}

/* 4/5 portrait box. The explicit height is the fallback for the rare case
   where a host strips aspect-ratio; both sizes keep the same ratio. */
.wpc-hero__media {
	flex: 0 0 240px;
	width: 240px;
	max-width: 240px;
}

.wpc-hero__media img {
	display: block;
	width: 100%;
	height: 300px;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: center top;
	border-radius: 12px;
	border: 1px solid #dcdde2;
}

.wpc-hero__body {
	flex: 1 1 0;
	min-width: 0;
}

.wpc-hero__title {
	font-size: 2.5rem;
	margin: 0 0 12px;
}

.wpc-hero__subtitle {
	font-size: 1.25rem;
	line-height: 1.5;
	color: #3d3d45;
	margin: 0 0 16px;
}

.wpc-hero__text {
	color: #45454e;
	margin: 0 0 24px;
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.wpc-hero__actions,
.wpc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 0;
}

.wpc-button {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 999px;
	border: 2px solid #1b4fd8;
	background-color: #1b4fd8;
	color: #ffffff;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wpc-button:hover,
.wpc-button:focus {
	background-color: #0e3aa8;
	border-color: #0e3aa8;
	color: #ffffff;
	transform: translateY(-2px);
}

.wpc-button--secondary {
	background-color: #ffffff;
	color: #0e3aa8;
	border-color: #0e3aa8;
}

.wpc-button--secondary:hover,
.wpc-button--secondary:focus {
	background-color: #0e3aa8;
	border-color: #0e3aa8;
	color: #ffffff;
}

.wp-block-buttons .wp-block-button__link {
	border-radius: 999px;
	font-weight: 600;
	padding: 12px 24px;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

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

/* --------------------------------------------------------------------------
   6. Cards - 4 columns wide, 2 on tablets, 1 on phones
   -------------------------------------------------------------------------- */

.wpc-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	align-items: stretch;
	gap: 20px;
	margin-top: 0;
	margin-bottom: 40px;
}

/* Grid items are 1fr wide; min-width: 0 stops long words from forcing the
   column wider than its share, and the two properties below make sure a word
   is only ever wrapped between words, never in the middle of one. */
.wpc-card,
.wpc-card__title,
.wpc-card__text {
	min-width: 0;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: none;
}

/* Cards are grid items with align-items: stretch, so they are already as tall
   as the tallest one in the same row. No height: 100% here on purpose: it
   resolves against the row and, with a content-box, adds padding and border on
   top, which pushed the cards 42px below the grid. */
.wpc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	background-color: #ffffff;
	border: 1px solid #e3e4e8;
	border-radius: 12px;
	padding: 20px;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.wpc-card:hover,
.wpc-card:focus-within {
	transform: translateY(-4px);
	border-color: #c3c8dd;
	box-shadow: 0 12px 24px rgba(22, 22, 26, 0.08);
}

.wpc-card__title {
	font-size: 1.25rem;
	line-height: 1.3;
	margin: 0 0 8px;
}

.wpc-card__title a {
	color: #16161a;
	text-decoration: none;
}

.wpc-card__title a:hover,
.wpc-card__title a:focus {
	color: #1b4fd8;
	text-decoration: underline;
}

.wpc-card__text {
	color: #55555e;
	font-size: 0.9375rem;
	margin: 0;
}

/* The whole card is clickable, but only the title is a real link, so screen
   readers and keyboard users get a single, clearly named stop per card. */
.wpc-card__title a::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

/* --------------------------------------------------------------------------
   7. Timeline (Roadmap on My Contribution Project)
   -------------------------------------------------------------------------- */

.wpc-timeline {
	margin: 24px 0 40px;
	padding-left: 0;
	list-style: none;
}

.wpc-timeline__item {
	position: relative;
	padding-left: 36px;
	padding-bottom: 32px;
	margin: 0;
}

.wpc-timeline__item:last-child {
	padding-bottom: 0;
}

.wpc-timeline__item::before {
	content: "";
	position: absolute;
	top: 7px;
	left: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: #1b4fd8;
	box-shadow: 0 0 0 4px #e6ecfb;
}

.wpc-timeline__item::after {
	content: "";
	position: absolute;
	top: 24px;
	left: 5px;
	width: 2px;
	height: 100%;
	background-color: #e3e4e8;
}

.wpc-timeline__item:last-child::after {
	display: none;
}

.wpc-timeline__item p {
	margin: 0;
	color: #45454e;
}

/* --------------------------------------------------------------------------
   8. Entrance animation
   -------------------------------------------------------------------------- */

@keyframes wpcFadeUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: no-preference) {
	/* Short on purpose: the longest entrance is 0.4 s plus a 0.2 s delay, so
	   nothing on the page waits on an animation to become readable. */
	.wpc-animate {
		animation: wpcFadeUp 0.4s ease both;
	}

	.wpc-animate-delay-1 {
		animation-delay: 0.05s;
	}

	.wpc-animate-delay-2 {
		animation-delay: 0.1s;
	}

	.wpc-animate-delay-3 {
		animation-delay: 0.15s;
	}

	.wpc-animate-delay-4 {
		animation-delay: 0.2s;
	}
}

/* LCP guard. The hero photo is the Largest Contentful Paint element of the
   front page, so it and every block that wraps it are pinned to a visible,
   static state: no fade-in from opacity 0, no transform, no delay. Only the
   text and the cards are allowed to animate (see section 8). */
.wpc-hero,
.wpc-hero__media,
.wpc-hero__media figure,
.wpc-hero__media img {
	animation: none;
	opacity: 1;
	transform: none;
}

/* Belt and braces: if a browser reports reduced motion, nothing animates. */
@media (prefers-reduced-motion: reduce) {
	.wpc-animate {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.wpc-card,
	.wpc-button,
	.wp-block-buttons .wp-block-button__link {
		transition: none;
	}

	.wpc-card:hover,
	.wpc-card:focus-within,
	.wpc-button:hover,
	.wp-block-buttons .wp-block-button__link:hover {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   9. Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet: two columns of cards, header may stack, hero stays side by side. */
@media (max-width: 1100px) {
	.wpc-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 980px) {
	.wpc-header__inner {
		flex-wrap: wrap;
		justify-content: flex-start;
	}

	.wpc-header__brand {
		flex: 1 1 100%;
	}

	.wpc-header__nav {
		flex: 1 1 100%;
	}

	.wp-block-navigation__container {
		justify-content: flex-start;
		gap: 14px;
	}
}

@media (max-width: 781px) {
	.wpc-shell {
		padding-left: 18px;
		padding-right: 18px;
	}

	h1 {
		font-size: 1.875rem;
	}

	h2 {
		font-size: 1.5rem;
	}

	/* Phones: hero photo above the text. Cards keep two columns down to 640px. */
	.wpc-hero {
		padding: 24px 18px;
		margin-top: 16px;
		margin-bottom: 32px;
	}

	.wpc-hero__grid {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
	}

	.wpc-hero__grid > .wp-block-column.wpc-hero__media {
		flex: 0 0 auto;
		width: 144px;
		max-width: 144px;
		margin-left: auto;
		margin-right: auto;
	}

	.wpc-hero__media img {
		height: 180px;
	}

	.wpc-hero__title {
		font-size: 1.875rem;
	}

	.wpc-hero__subtitle {
		font-size: 1.125rem;
	}

	.wpc-hero__actions .wp-block-button,
	.wpc-actions .wpc-button {
		flex: 1 1 100%;
		text-align: center;
	}
}

/* Small phones: the card grid drops to a single column. */
@media (max-width: 640px) {
	.wpc-cards {
		grid-template-columns: 1fr;
	}
}

/* --------------------------------------------------------------------------
   10. Print
   -------------------------------------------------------------------------- */

@media print {
	.wpc-hero,
	.wpc-card {
		border: 1px solid #000000;
		box-shadow: none;
	}

	.wpc-animate {
		animation: none;
		opacity: 1;
		transform: none;
	}
}
