/*
Theme Name: ECCA
Theme URI: https://www.eccaustralia.org/
Description: Block theme for The Ecumenical Catholic Church of Australia. Rebuilds the original site as fully editable WordPress blocks with a responsive layout. On activation it creates the site's pages, imports the images and documents into the Media Library, and sets the Home page as the front page.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ecca
Tags: block-patterns, full-site-editing, one-column, custom-colors, custom-logo, editor-style, wide-blocks
*/

/* Styles that theme.json cannot express. Loaded on the front end and in the editor. */

/* No gap between header, main and footer */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* ---------- Header ---------- */
.ecca-site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
}
.admin-bar .ecca-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ecca-site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .ecca-site-header { top: 0; } }

.ecca-topbar a { color: inherit; text-decoration: none; }
.ecca-topbar a:hover { text-decoration: underline; }
@media (max-width: 600px) { .ecca-topbar .ecca-topbar__note { display: none; } }

/* Switch to the menu button below 1000px (core switches at 600px), so the
   logo, church name and menu never crowd each other on tablets. */
@media (max-width: 999px) {
	.ecca-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.ecca-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
.ecca-header .wp-block-navigation__responsive-container-open svg,
.ecca-header .wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }
@media (max-width: 480px) {
	.ecca-header .wp-block-site-logo img { width: 52px !important; }
	.ecca-header .wp-block-site-title { font-size: .95rem !important; }
}

.ecca-header .wp-block-site-title a { text-decoration: none; }
.ecca-header .wp-block-site-title { line-height: 1.15; max-width: 16ch; }

.ecca-header .wp-block-navigation .wp-block-navigation-item__content { padding-block: .4em; }
.ecca-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.ecca-header .wp-block-navigation .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--primary); }

.ecca-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 0 !important;
	border-radius: 8px;
	box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .18);
	padding: .5em 0;
	min-width: 230px !important;
}
.ecca-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: .55em 1.25em; }

/* Mobile overlay menu */
.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__responsive-container-content {
	gap: 1.1em;
	font-size: var(--wp--preset--font-size--large);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	font-size: var(--wp--preset--font-size--medium);
	padding-top: .6em !important;
	gap: .7em;
}

/* ---------- Hero and page banner ---------- */
.ecca-hero h1, .ecca-hero p { text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.ecca-scroll {
	display: inline-block;
	width: 26px;
	height: 42px;
	border: 2px solid rgba(255, 255, 255, .8);
	border-radius: 14px;
	position: relative;
}
.ecca-scroll::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 8px;
	width: 4px;
	height: 8px;
	margin-left: -2px;
	border-radius: 2px;
	background: #fff;
	animation: ecca-scroll 1.8s infinite;
}
@keyframes ecca-scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { .ecca-scroll::after { animation: none; } }

/* ---------- Cards (whole card is clickable via the Read More link) ---------- */
.ecca-card {
	position: relative;
	height: 100%;
	overflow: hidden;
	border-radius: 10px;
	background: var(--wp--preset--color--base);
	box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .25);
	transition: transform .3s ease, box-shadow .3s ease;
	display: flex;
	flex-direction: column;
}
.ecca-card:hover, .ecca-card:focus-within {
	transform: translateY(-6px);
	box-shadow: 0 20px 34px -14px rgba(0, 0, 0, .35);
}
.ecca-card > .wp-block-image { margin: 0; }
.ecca-card > .wp-block-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	display: block;
}
.ecca-card .ecca-card__body { flex: 1; display: flex; flex-direction: column; }
.ecca-card .ecca-card__more { margin-top: auto; }
.ecca-card .ecca-card__more a {
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--primary);
}
.ecca-card .ecca-card__more a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.ecca-card .ecca-card__more a:focus-visible { outline: none; }
.ecca-card:focus-within { outline: 2px solid var(--wp--preset--color--navy); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .ecca-card, .ecca-card:hover { transition: none; transform: none; } }

/* ---------- Content images ---------- */
.ecca-photo img { border-radius: 10px; width: 100%; height: auto; object-fit: cover; }
.ecca-portrait img { border-radius: 10px; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

/* Side-panel used for lists of locations, policies etc. */
.ecca-panel { border-radius: 10px; }

/* Lists inside content */
.entry-content ul.wp-block-list li,
.entry-content ol.wp-block-list li { margin-bottom: .35em; }

/* ---------- Footer ---------- */
.ecca-footer a { text-decoration: none; }
.ecca-footer a:hover { text-decoration: underline; }
.ecca-footer .wp-block-navigation .wp-block-navigation-item__content { padding: .2em 0; }

/* Columns stack a little earlier than core's 782px so text never gets cramped */
@media (max-width: 900px) {
	.wp-block-columns.ecca-stack-md { flex-wrap: wrap !important; }
	.wp-block-columns.ecca-stack-md > .wp-block-column { flex-basis: 100% !important; }
}

/* Accessibility helper */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

/* PayPal donate button (Welfare Services) */
.ecca-donate { margin-top: 1.5rem; }
.ecca-donate button { cursor: pointer; }
.ecca-photo, .ecca-portrait, .ecca-card > .wp-block-image { margin: 0; }
