/*
Theme Name: Catholic Journeys Block Theme
Theme URI: https://catholicjourneys.com
Author: Catholic Journeys
Author URI: https://catholicjourneys.com
Description: A full-site-editing WordPress Block Theme for Catholic Journeys, built with Gutenberg and FSE principles.
Version: 1.0.1
License: GPL-2.0-or-later
Text Domain: cj-block-theme
Requires at least: 6.5
Requires PHP: 8.1
*/

/* ==========================================================================
   CSS CUSTOM PROPERTIES
   Mirrors theme.json tokens so non-block CSS can reference the same values.
   ========================================================================== */

:root {
	/* --- Brand Colors --- */
	--cj-color-navy:        #2D4675;
	--cj-color-gold:        #BFB266;
	--cj-color-gold-dark:   #A79458;
	/* Gold panels and gold buttons that carry white text: white is 4.52:1 (AA, any size).
	   --cj-color-gold stays for accents, rules, focus rings and gold on navy. */
	--cj-color-gold-panel:  #827737;
	--cj-color-white:       #FFFFFF;
	--cj-color-off-white:   #F7F6F2;
	--cj-color-light-gray:  #EFEFEF;
	--cj-color-mid-gray:    #6B6B6B;  /* was #888 (3.54:1); now AA: 5.33 white, 4.93 off-white, 4.63 light-gray */
	/* AA text on light backgrounds (a11y rule): gold-dark fails 4.5:1 */
	--cj-color-gold-text:   #7A6A2E;  /* 5.35:1 on white */
	--cj-color-text-muted:  #595959;  /* 7.0:1 on white */
	--cj-color-foreground:  #1A1A1A;
	--cj-color-line:        #E3E0D6;  /* warm hairline for dividers, card borders */
	--cj-color-alert:       #B23B3B;  /* sale / low-availability accent */

	/* --- Typography --- */
	--cj-font-heading: 'Unna', Georgia, serif;
	--cj-font-body:    'Ubuntu', Arial, sans-serif;

	--cj-font-weight-light:   300;
	--cj-font-weight-regular: 400;
	--cj-font-weight-medium:  500;
	--cj-font-weight-bold:    700;

	--cj-line-height-tight:  1.15;
	--cj-line-height-snug:   1.3;
	--cj-line-height-normal: 1.7;

	--cj-letter-spacing-wide:  0.05em;
	--cj-letter-spacing-wider: 0.08em;
	--cj-letter-spacing-caps:  0.1em;

	/* --- Spacing --- */
	--cj-space-1:  0.25rem;
	--cj-space-2:  0.5rem;
	--cj-space-3:  0.75rem;
	--cj-space-4:  1rem;
	--cj-space-5:  1.5rem;
	--cj-space-6:  2rem;
	--cj-space-7:  3rem;
	--cj-space-8:  4rem;
	--cj-space-9:  6rem;
	--cj-space-10: 8rem;

	/* --- Layout --- */
	--cj-content-width: 860px;
	--cj-wide-width:    1280px;

	/* --- Borders & Radius --- */
	--cj-radius-sm:   4px;
	--cj-radius-md:   8px;
	--cj-radius-lg:   16px;
	--cj-radius-pill: 999px;

	/* --- Shadows --- */
	--cj-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.10);
	--cj-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
	--cj-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);

	/* --- Transitions --- */
	--cj-transition: 0.2s ease;
}


/* ==========================================================================
   BASE RESET & DEFAULTS
   ========================================================================== */

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--cj-font-body);
	font-weight: var(--cj-font-weight-light);
	font-size: 1rem;
	line-height: var(--cj-line-height-normal);
	color: var(--cj-color-foreground);
	background-color: var(--cj-color-white);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Prevent CLS — always set explicit dimensions on images */
img[width][height] {
	height: auto;
}


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

h1, h2, h3, h4 {
	font-family: var(--cj-font-heading);
	font-weight: var(--cj-font-weight-regular);
	color: var(--cj-color-navy);
	margin-block-start: 0;
	margin-block-end: var(--cj-space-4);
}

h5, h6 {
	font-family: var(--cj-font-body);
	font-weight: var(--cj-font-weight-medium);
	text-transform: uppercase;
	letter-spacing: var(--cj-letter-spacing-wider);
	color: var(--cj-color-gold);
	margin-block-start: 0;
	margin-block-end: var(--cj-space-3);
}

p {
	margin-block-start: 0;
	margin-block-end: var(--cj-space-5);
}

p:last-child {
	margin-block-end: 0;
}

a {
	color: var(--cj-color-navy);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	transition: color var(--cj-transition);
}

a:hover,
a:focus-visible {
	color: var(--cj-color-gold-dark);
}

/* Eyebrow label utility */
.cj-eyebrow {
	font-family: var(--cj-font-body);
	font-weight: var(--cj-font-weight-medium);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: var(--cj-letter-spacing-caps);
	color: var(--cj-color-gold);
}

/* Pull quote utility */
blockquote {
	border-inline-start: 4px solid var(--cj-color-gold);
	padding-inline-start: var(--cj-space-5);
	margin-inline: 0;
	font-family: var(--cj-font-heading);
	font-size: 1.375rem;
	line-height: var(--cj-line-height-snug);
	color: var(--cj-color-navy);
	font-style: italic;
}


/* ==========================================================================
   HEADER → CONTENT SPACING
   theme.json's root blockGap puts a top margin on every top-level block, so a
   white strip showed between the header and the first section on every page.
   Heroes now sit flush under the header. Pages that open straight onto a
   title (no hero) keep their breathing room as padding inside <main>.
   ========================================================================== */

.wp-site-blocks > :is(header, div).wp-block-template-part + * {
	margin-block-start: 0;
}

.wp-site-blocks > :is(header, div).wp-block-template-part + main:not(:has(> :first-child:is(.alignfull, .cj-archive-hero, .cj-home-hero, .cj-page-hero))) {
	padding-block-start: var(--wp--style--block-gap, 2.25rem);
}


/* ==========================================================================
   FOCUS STYLES (ADA — WCAG 2.1 AA)
   ========================================================================== */

:focus-visible {
	outline: 3px solid var(--cj-color-gold);
	outline-offset: 3px;
	border-radius: var(--cj-radius-sm);
}

/* Remove default outline when focus-visible is supported */
:focus:not(:focus-visible) {
	outline: none;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

/* One element per button carries all the styling and the hover. A core Button
   block puts its className on the .wp-block-button wrapper, not the link, so the
   cj-btn rules skip that wrapper (:not(.wp-block-button)) and the variants are
   mapped onto its .wp-block-button__link below. Before this, a "cj-btn
   cj-btn--primary" Button block had a padded gold wrapper around the gold link,
   and hovering the wrapper edge turned it navy around a still-gold link. */
.wp-block-button__link,
.cj-btn:not(.wp-block-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--cj-space-2);
	padding: 0.75rem 2rem;
	font-family: var(--cj-font-body);
	font-size: 0.875rem;
	font-weight: var(--cj-font-weight-medium);
	letter-spacing: var(--cj-letter-spacing-wide);
	text-transform: uppercase;
	text-decoration: none;
	border: none;
	border-radius: var(--cj-radius-pill);
	cursor: pointer;
	transition: background-color var(--cj-transition), color var(--cj-transition), transform var(--cj-transition);
}

/* Primary: Gold Panel fill, white text (4.52:1). Hover goes navy: white on
   gold-dark is 2.99:1. The default for a Button block link. */
.wp-block-button:not(.is-style-outline) .wp-block-button__link,
.cj-btn--primary:not(.wp-block-button) {
	background-color: var(--cj-color-gold-panel);
	color: var(--cj-color-white);
}

.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.cj-btn--primary:not(.wp-block-button):hover {
	background-color: var(--cj-color-navy);
	color: var(--cj-color-white);
	transform: translateY(-1px);
}

/* Secondary: Navy fill */
.wp-block-button.cj-btn--secondary .wp-block-button__link,
.cj-btn--secondary:not(.wp-block-button) {
	background-color: var(--cj-color-navy);
	color: var(--cj-color-white);
}

.wp-block-button.cj-btn--secondary .wp-block-button__link:hover,
.cj-btn--secondary:not(.wp-block-button):hover {
	background-color: #1e2f52;
	color: var(--cj-color-white);
	transform: translateY(-1px);
}

/* Outline: white border (for dark backgrounds) */
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.cj-btn--outline .wp-block-button__link,
.cj-btn--outline:not(.wp-block-button) {
	background-color: transparent;
	color: var(--cj-color-white);
	border: 2px solid var(--cj-color-white);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.cj-btn--outline .wp-block-button__link:hover,
.cj-btn--outline:not(.wp-block-button):hover {
	background-color: var(--cj-color-white);
	color: var(--cj-color-navy);
}

/* Outline Navy */
.wp-block-button.cj-btn--outline-navy .wp-block-button__link,
.cj-btn--outline-navy:not(.wp-block-button) {
	background-color: transparent;
	color: var(--cj-color-navy);
	border: 2px solid var(--cj-color-navy);
}

.wp-block-button.cj-btn--outline-navy .wp-block-button__link:hover,
.cj-btn--outline-navy:not(.wp-block-button):hover {
	background-color: var(--cj-color-navy);
	color: var(--cj-color-white);
}


/* ==========================================================================
   FORMS (shared base — used across search, booking, contact, payment)
   ========================================================================== */

.cj-form-field {
	display: flex;
	flex-direction: column;
	gap: var(--cj-space-2);
}

.cj-form-field label {
	font-family: var(--cj-font-body);
	font-size: 0.75rem;
	font-weight: var(--cj-font-weight-medium);
	text-transform: uppercase;
	letter-spacing: var(--cj-letter-spacing-caps);
	color: var(--cj-color-navy);
}

.cj-input,
.cj-select,
.cj-textarea {
	width: 100%;
	padding: 0.625rem 0.875rem;
	font-family: var(--cj-font-body);
	font-size: 0.875rem;
	font-weight: var(--cj-font-weight-light);
	color: var(--cj-color-foreground);
	background-color: var(--cj-color-white);
	border: 1.5px solid var(--cj-color-gold);
	border-radius: var(--cj-radius-sm);
	transition: border-color var(--cj-transition), box-shadow var(--cj-transition);
	appearance: none;
	-webkit-appearance: none;
}

.cj-input::placeholder,
.cj-select::placeholder,
.cj-textarea::placeholder {
	color: var(--cj-color-mid-gray);
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: var(--cj-letter-spacing-wide);
}

.cj-input:focus-visible,
.cj-select:focus-visible,
.cj-textarea:focus-visible {
	outline: none;
	border-color: var(--cj-color-navy);
	box-shadow: 0 0 0 3px rgba(45, 70, 117, 0.15);
}


/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Screen-reader only (ADA) */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Skip-to-content link (ADA) */
.skip-link {
	position: absolute;
	top: -100%;
	left: var(--cj-space-4);
	z-index: 9999;
	padding: var(--cj-space-3) var(--cj-space-5);
	background-color: var(--cj-color-navy);
	color: var(--cj-color-white);
	font-weight: var(--cj-font-weight-medium);
	text-decoration: none;
	border-radius: var(--cj-radius-md);
	transition: top var(--cj-transition);
}

.skip-link:focus {
	top: var(--cj-space-4);
}

/* Text color helpers */
.has-navy-color        { color: var(--cj-color-navy) !important; }
.has-gold-color        { color: var(--cj-color-gold) !important; }
.has-gold-dark-color   { color: var(--cj-color-gold-dark) !important; }
.has-gold-panel-color  { color: var(--cj-color-gold-panel) !important; }
.has-white-color       { color: var(--cj-color-white) !important; }

/* Background helpers */
.has-navy-background-color      { background-color: var(--cj-color-navy) !important; }
.has-gold-background-color      { background-color: var(--cj-color-gold) !important; }
.has-gold-panel-background-color { background-color: var(--cj-color-gold-panel) !important; color: var(--cj-color-white); }
.has-off-white-background-color { background-color: var(--cj-color-off-white) !important; }

/* Star ratings */
.cj-stars {
	display: inline-flex;
	gap: 2px;
	color: var(--cj-color-gold);
	font-size: 1rem;
}
