/*
Theme Name: Reefline
Author: Tidepoint Press
Author URI: https://tidepointpress.com
Description: A block theme for dive shops, dive centers and independent instructors. Includes patterns for a full-bleed hero, local conditions, certification courses, an upcoming course schedule, boat dive trips, dive sites, instructors, gear rental and servicing, group dive travel, an FAQ and a booking call to action, plus Night Dive and Cold Water style variations. Styled for WooCommerce shop, product, cart and checkout pages.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: reefline
Tags: education, e-commerce, blog, one-column, custom-colors, custom-menu, editor-style, full-site-editing, block-patterns, style-variations, wide-blocks, accessibility-ready
*/

/* Most styling lives in theme.json. Keep this file for small refinements and plugin styling only. */

:where(.wp-site-blocks) *:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Submenu toggles and links meet the 24 px minimum target size. */
.wp-block-navigation .wp-block-navigation-submenu__toggle {
	min-width: 24px;
	min-height: 24px;
}

.wp-block-navigation .wp-block-navigation-submenu > .wp-block-navigation-item__content {
	padding-block: 0.25em;
}

.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

/* Full-width sections sit flush against the footer, and the footer stays at the bottom on short pages. */
.wp-site-blocks > footer {
	margin-block-start: auto;
}

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

.is-style-reefline-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	padding: var(--wp--preset--spacing--40);
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}

.reefline-grid .wp-block-image img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	width: 100%;
	border-radius: 4px;
}

.reefline-grid .wp-block-image figcaption {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	text-align: left;
}

/* Post titles in query grids read as headings, not links. */
.wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.wp-block-post-title a:hover,
.wp-block-post-title a:focus-visible {
	text-decoration: underline;
}

/* Course schedule table. */
.reefline-schedule table {
	border-collapse: collapse;
	width: 100%;
}

.reefline-schedule th,
.reefline-schedule td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.85rem 0.75rem;
	text-align: left;
	vertical-align: top;
}

.reefline-schedule thead th {
	border-bottom: 2px solid var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* FAQ: native details/summary, with a clear marker and focus ring. */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: 1rem;
}

.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

.wp-block-details > :not(summary) {
	color: var(--wp--preset--color--muted);
	margin-block-start: 0.75rem;
}

/* Rental price list: item and price on one line. */
.reefline-price-list .wp-block-group {
	border-bottom: 1px dashed var(--wp--preset--color--line);
	padding-block: 0.6rem;
}

.reefline-price-list .wp-block-group > p:last-child {
	flex-shrink: 0;
	white-space: nowrap;
}

/* ------------------------------------------------------------------
 * WooCommerce. These rules only apply when WooCommerce is active.
 * ------------------------------------------------------------------ */

/* Sale badges: readable contrast and the theme's highlight color. */
.woocommerce span.onsale,
.wc-block-components-product-sale-badge,
.wp-block-woocommerce-product-sale-badge .wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--highlight);
	border: 0;
	border-radius: 999px;
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1;
	min-height: 0;
	min-width: 0;
	padding: 0.45em 0.8em;
	text-transform: none;
}

/* Product images: rounded corners to match the rest of the theme. */
.woocommerce ul.products li.product img,
.wc-block-components-product-image img,
.wp-block-woocommerce-product-image img,
.woocommerce div.product div.images img {
	border-radius: 8px;
}

/* Prices. */
.woocommerce .price,
.wc-block-components-product-price {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

.woocommerce .price del,
.wc-block-components-product-price del {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.woocommerce .price ins,
.wc-block-components-product-price ins {
	text-decoration: none;
}

/* Form fields: the same border, radius and focus ring everywhere. */
.woocommerce form .input-text,
.woocommerce .quantity .qty,
.woocommerce select,
.wc-block-components-text-input input,
.wc-block-components-combobox .wc-block-components-combobox-control input,
.wc-blocks-components-select__select,
.wc-block-components-quantity-selector {
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 8px;
}

.woocommerce form .input-text:focus-visible,
.woocommerce .quantity .qty:focus-visible,
.woocommerce select:focus-visible,
.wc-block-components-text-input input:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Notices. */
.woocommerce-message,
.woocommerce-info,
.wc-block-components-notice-banner.is-info,
.wc-block-components-notice-banner.is-success {
	background: var(--wp--preset--color--accent-soft);
	border-color: var(--wp--preset--color--accent);
	border-radius: 8px;
	color: var(--wp--preset--color--contrast);
}

/* Product tabs on single product pages. */
.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
	border-bottom-color: var(--wp--preset--color--accent);
}

/* Cards in the cart and checkout sidebars. */
.wc-block-components-sidebar-layout .wc-block-components-sidebar .wc-block-components-panel,
.wp-block-woocommerce-checkout-order-summary-block {
	border-color: var(--wp--preset--color--line);
	border-radius: 12px;
}

/* Keep the closed mini-cart drawer out of the keyboard tab order. */
.wc-block-mini-cart__drawer[aria-hidden="true"] {
	visibility: hidden;
}

.woocommerce .woocommerce-ordering select {
	padding: 0.4rem 0.6rem;
}

/* Show-password button: WooCommerce's is 22 px, under the 24 px minimum target size. */
.woocommerce form .show-password-input {
	min-width: 24px;
	min-height: 24px;
	padding: 1px;
}
