/*
 * HWS Starter: custom CSS
 *
 * Loaded on the site and in the editor (see functions.php).
 * Try these first: Styles (colors, fonts, widths) and block styles
 * (Card, Section: Light/Cream/Dark, Label, Gold, Rounded corners).
 * Use this file only for what the editor can't do, and comment each rule.
 *
 * Breakpoints (same as Kadence): phones 767px and below, tablets 768 to 1024px, desktop 1025px and up.
 *
 * ADDING A CLASS YOU CAN PICK IN THE EDITOR:
 * write the class at the end of this file, save, and reload the editor. Then select
 * a block, open "HWS Classes" in the sidebar, type part of the class name and pick it.
 * Use clear names with the hws- prefix (e.g. .hws-shadow, .hws-dots).
 * The built-in classes below are picked in "HWS Layout" instead.
 */

/* ---------- Cards per row (HWS Layout panel, Group blocks) ----------
   The blocks inside the group wrap at the set count and the last row always fills.
   Tablets: 2 per row. Phones: 1 per row.
   hws-fill-row is the original name for 3 per row (kept so older blocks still work). */
.hws-row-2, .hws-row-3, .hws-row-4, .hws-fill-row {
	display: flex !important;
	flex-wrap: wrap !important;
	align-items: stretch;
	gap: 2rem;
}
.hws-row-2 > *, .hws-row-3 > *, .hws-row-4 > *, .hws-fill-row > * {
	box-sizing: border-box;
	margin: 0 !important;
}
.hws-row-2 > * { flex: 1 1 47%; }
.hws-row-3 > *, .hws-fill-row > * { flex: 1 1 29%; }
.hws-row-4 > * { flex: 1 1 22%; }
@media (max-width: 1024px) {
	.hws-row-3 > *, .hws-row-4 > *, .hws-fill-row > * { flex-basis: 47%; }
}
@media (max-width: 767px) {
	.hws-row-2 > *, .hws-row-3 > *, .hws-row-4 > *, .hws-fill-row > * { flex-basis: 100%; }
}

/* ---------- Hide by screen size (HWS Layout panel, any block) ---------- */
@media (max-width: 767px) { .hws-hide-mobile { display: none !important; } }
@media (min-width: 768px) and (max-width: 1024px) { .hws-hide-tablet { display: none !important; } }
@media (min-width: 1025px) { .hws-hide-desktop { display: none !important; } }

/* In the editor, hidden blocks stay visible (faded, dashed outline) so they can still be edited. */
.editor-styles-wrapper .hws-hide-mobile,
.editor-styles-wrapper .hws-hide-tablet,
.editor-styles-wrapper .hws-hide-desktop {
	display: revert !important;
	opacity: 0.55;
	outline: 1px dashed currentColor;
}
.editor-styles-wrapper .hws-row-2[class*="hws-hide-"],
.editor-styles-wrapper .hws-row-3[class*="hws-hide-"],
.editor-styles-wrapper .hws-row-4[class*="hws-hide-"],
.editor-styles-wrapper .hws-fill-row[class*="hws-hide-"] {
	display: flex !important;
}

/* ---------- Accordion: modern style for every Details block (FAQs) ----------
   Each question is a rounded card with a round chevron button; the open one is highlighted.
   Opening/closing animates in browsers that support it (others just open instantly). */
:root { interpolate-size: allow-keywords; }
.wp-block-details {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 12%, transparent);
	border-radius: 16px;
	padding: 0;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.wp-block-details > summary {
	list-style: none;
	position: relative;
	cursor: pointer;
	padding: 20px 72px 20px 24px;
	font-weight: 600;
	font-size: 1.0625rem;
	line-height: 1.4;
	transition: color 0.2s ease;
}
.wp-block-details > summary::-webkit-details-marker { display: none; }
/* Round chevron button */
.wp-block-details > summary::after {
	content: "";
	position: absolute;
	right: 20px;
	top: 50%;
	width: 34px;
	height: 34px;
	margin-top: -17px;
	border-radius: 9999px;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www%2Ew3%2Eorg/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23123D2F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 18px;
	transition: transform 0.25s ease, box-shadow 0.2s ease;
}
/* No outline line on the question row when clicked; keyboard users get a ring around the chevron instead */
.wp-block-details > summary:focus,
.wp-block-details > summary:focus-visible { outline: none; }
.wp-block-details > summary:focus-visible::after { box-shadow: 0 0 0 2px var(--wp--preset--color--accent-3); }
/* Hover: border a little darker */
.wp-block-details:hover {
	border-color: color-mix(in srgb, var(--wp--preset--color--contrast) 24%, transparent);
}
/* Open question */
.wp-block-details[open] {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}
.wp-block-details[open] > summary { color: var(--wp--preset--color--accent-3); }
.wp-block-details[open] > summary::after { transform: rotate(180deg); }
/* Answer */
.wp-block-details > :not(summary) {
	margin: 0;
	padding: 0 24px 20px;
	color: color-mix(in srgb, var(--wp--preset--color--contrast) 85%, transparent);
}
/* Smooth open/close (progressive enhancement) */
.wp-block-details::details-content {
	block-size: 0;
	overflow-y: clip;
	transition: block-size 0.3s ease, content-visibility 0.3s ease allow-discrete;
}
.wp-block-details[open]::details-content { block-size: auto; }
@media (prefers-reduced-motion: reduce) {
	.wp-block-details, .wp-block-details > summary::after, .wp-block-details::details-content { transition: none; }
}

/* ---------- Icons with a background color: keep them square so rounded corners make a circle ---------- */
.wp-block-icon svg[class*="-background-color"] {
	height: auto !important;
	aspect-ratio: 1 / 1;
}

/* ---------- Photo sections (Media & Text blocks): rounded corners to match the cards ---------- */
.wp-block-media-text__media,
.wp-block-media-text__media img {
	border-radius: 16px;
}
.wp-block-media-text__media { overflow: hidden; }

/* Photo sections stack on tablets too (WordPress only stacks them below 600px) */
@media (max-width: 1024px) {
	.wp-block-media-text.is-stacked-on-mobile { grid-template-columns: 100% !important; }
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__media { grid-column: 1; grid-row: 1; }
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content { grid-column: 1; grid-row: 2; padding: var(--wp--preset--spacing--40) 0 0; }
	.wp-block-media-text.is-image-fill-element > .wp-block-media-text__media { min-height: 360px; }
}

/* ========== Your classes (add new ones below) ========== */

.hws-shadow { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }

/* Frosted glass panel. Best on top of a photo (e.g. the hero); on plain backgrounds it just looks faint.
   Text inside turns white, including Bit Form labels. */
.hws-glass {
	background: rgba(255, 255, 255, 0.08) !important;
	-webkit-backdrop-filter: blur(8px) saturate(120%);
	backdrop-filter: blur(8px) saturate(120%);
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 24px;
	padding: 36px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	color: var(--wp--preset--color--base) !important;
}
.hws-glass :is(h1, h2, h3, h4, p, label, [class~="bf-lbl"]) {
	color: var(--wp--preset--color--base) !important;
}

/* Bit Form inside a glass panel: solid white fields with dark text, light-red errors that stand out on the dark glass. */
.hws-glass [class~="bf-fld"] {
	background: #FFFFFF !important;
	color: #0B1F18 !important;
}
.hws-glass :is([class~="bf-err-txt"], [class~="bf-error-text"], [class~="bf-err-msg"]),
.hws-glass :is([class~="bf-err-txt"], [class~="bf-error-text"], [class~="bf-err-msg"]) * {
	color: #FFB4AB !important;
}
