/*
 * Layout for the content blocks written in scripts/phase4 (hero, sections, cards, steps, FAQ, call to action).
 * Colours come from theme.json (primary, primary-dark, primary-light, accent, accent-5, border).
 * Phase 4 base styles; the visual polish (Phase 5) refines this file.
 */

/* Left-aligned body text everywhere: justified text makes uneven gaps in narrow columns */
.wp-block-post-content p,
.wp-block-post-content li { text-align: left; }

/* Hero */
.help-hero { padding-top: var(--wp--preset--spacing--80); padding-bottom: var(--wp--preset--spacing--80); }
.help-hero h1 { font-weight: 400; line-height: 1.15; margin-bottom: var(--wp--preset--spacing--40); }
.help-hero p { font-size: 1.15rem; color: var(--wp--preset--color--primary-light); margin-bottom: var(--wp--preset--spacing--50); }
.help-hero .wp-block-buttons { gap: var(--wp--preset--spacing--30); }
.help-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link {
    background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); font-weight: 700; border-radius: 4px;
}
.help-hero .is-style-outline .wp-block-button__link { color: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--base); border-radius: 4px; }

/* Sections */
.help-section { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.help-section--light { background-color: var(--wp--preset--color--accent-5); }
.help-section > h2:first-child { color: var(--wp--preset--color--primary); margin-top: 0; }
.help-section > * + * { margin-top: var(--wp--preset--spacing--30); }
.help-section a { text-underline-offset: 3px; }

/* Cards: equal height, button/link at the bottom */
.wp-block-columns.help-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: var(--wp--preset--spacing--40);
    margin-top: var(--wp--preset--spacing--50);
    max-width: min(1140px, 100%) !important;   /* wider than the reading column so card text is not squeezed */
}
/* four cards read best as 2 x 2 (three or six fill 3 columns on their own) */
.wp-block-columns.help-cards:has(> .wp-block-column:nth-child(4):last-child) { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.help-cards > .wp-block-column { flex-basis: auto !important; width: auto; }
.help-card {
    display: flex; flex-direction: column; height: 100%;
    padding: var(--wp--preset--spacing--40); border-radius: 8px;
    background: var(--wp--preset--color--primary-light); border-top: 3px solid var(--wp--preset--color--primary);
}
.help-section--light .help-card { background: var(--wp--preset--color--base); }
.wp-block-group.help-card h3.wp-block-heading { margin: 0 0 var(--wp--preset--spacing--30); color: var(--wp--preset--color--primary); font-size: 1.3rem; line-height: 1.25; font-weight: 600; }
.wp-block-group.help-card p { margin: 0; }
.wp-block-group.help-card p + p { margin-top: var(--wp--preset--spacing--20); }
.help-card .help-card-link { margin-top: auto; padding-top: var(--wp--preset--spacing--30); font-weight: 600; }

/* Steps */
ol.help-steps { list-style: none; counter-reset: step; padding: 0; margin-top: var(--wp--preset--spacing--40); display: grid; gap: var(--wp--preset--spacing--30); }
ol.help-steps > li { counter-increment: step; position: relative; padding-left: 3.2rem; min-height: 2.4rem; }
ol.help-steps > li::before {
    content: counter(step); position: absolute; left: 0; top: -0.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
    background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* FAQ (core/details) */
.wp-block-details { border: 1px solid var(--wp--preset--color--border); border-radius: 6px; padding: 0; margin-top: var(--wp--preset--spacing--20); background: var(--wp--preset--color--base); }
/* the whole question row is the click / tap target (>= 44px) */
.wp-block-details summary { cursor: pointer; font-weight: 600; color: var(--wp--preset--color--primary); padding: 0.9rem 1.1rem; min-height: 44px; box-sizing: border-box; }
.wp-block-details > *:not(summary) { padding-left: 1.1rem; padding-right: 1.1rem; }
.wp-block-details[open] summary { margin-bottom: 0.2rem; }
.wp-block-details > *:last-child { margin-bottom: 0; padding-bottom: 0.9rem; }

/* Closing call to action */
.help-cta { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); text-align: center; }
.help-cta h2 { color: var(--wp--preset--color--base); margin-top: 0; }
.help-cta p { color: var(--wp--preset--color--primary-light); }
.help-cta .wp-block-buttons { justify-content: center; margin-top: var(--wp--preset--spacing--40); }
.help-cta .wp-block-button__link { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); font-weight: 700; border-radius: 4px; }

/* Tables (privacy policy) */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table th, .wp-block-table td { border: 1px solid var(--wp--preset--color--border); padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; }
.wp-block-table thead th { background: var(--wp--preset--color--accent-5); }

/* Header: white band, logo left, navigation right */
.help-header { border-bottom: 1px solid var(--wp--preset--color--border); }
.help-brand { display: inline-flex; align-items: center; line-height: 0; }
.help-brand img { height: 52px; width: auto; display: block; }
@media (max-width: 600px) { .help-brand img { height: 44px; } }
.help-header .wp-block-navigation a:where(:not(.wp-element-button)) { text-decoration: none; }
.help-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.help-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--primary); }

/* Inner pages without a hero (contact, legal, privacy): room under the header and above the footer */
.wp-block-post-content:not(:has(> .help-hero:first-child)) {
    padding-top: var(--wp--preset--spacing--60);
    padding-bottom: var(--wp--preset--spacing--60);
}

/* Design tokens (Phase 5): readable body size and weight, firmer headings */
body { font-size: 1.0625rem; font-weight: 400; line-height: 1.65; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h3, h4 { font-weight: 600; }
.help-hero h1 { font-weight: 700; }
.wp-block-post-title { font-size: clamp(2rem, 4vw, 2.6rem); }
.wp-block-post-content h2 { font-size: clamp(1.5rem, 2.6vw, 1.85rem); margin-top: var(--wp--preset--spacing--50); }
.wp-block-post-content h3 { font-size: 1.25rem; }
.help-card, .help-card > * { text-align: left; align-items: stretch; }
.help-card { align-items: stretch !important; }
/* constrained layout centres children with auto margins; inside the flex card that centres the text blocks */
.wp-block-group.help-card > * { margin-left: 0 !important; margin-right: 0 !important; max-width: none; }


/* Footer: link colours readable on the dark band, visible focus */
footer .wp-block-navigation-link a, footer .wp-block-navigation-item__content { color: var(--wp--preset--color--base); }
footer a:hover { color: var(--wp--preset--color--accent); }
/* Focus ring: brand blue by default (8.7:1 on white); yellow only on the dark blue bands, where blue would vanish */
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--wp--preset--color--primary); outline-offset: 2px; }
.help-hero a:focus-visible, .help-hero button:focus-visible, .help-cta a:focus-visible, .help-cta button:focus-visible,
footer a:focus-visible, footer button:focus-visible { outline-color: var(--wp--preset--color--accent); }
footer .site-logo img, footer .wp-block-site-logo img { background: #fff; border-radius: 8px; padding: 4px; }
.wp-site-blocks > footer.wp-block-template-part, .wp-site-blocks > * + footer { margin-block-start: 0; }
footer .wp-block-group.is-vertical { list-style: none; }
footer ul, footer .wp-block-navigation-link { list-style: none; padding-left: 0; }
footer .wp-block-navigation-link::marker { content: none; }
footer li { list-style: none; }
footer .wp-block-separator, footer .wp-block-group > p.has-text-align-center { max-width: var(--wp--style--global--wide-size, 1340px); }

/* Team / portrait patterns (used once photos exist) */
.help-member__photo img { width: 100%; border-radius: 8px; }
.help-member h3 { margin: var(--wp--preset--spacing--30) 0 0; }
.help-member p { margin: .25rem 0 0; color: var(--wp--preset--color--accent-4); }

/* Breadcrumb: small trail above the title (hero: light on blue; other pages: muted on white) */
.help-breadcrumb { font-size: .875rem; margin: 0 0 var(--wp--preset--spacing--30); }
.help-breadcrumb p { margin: 0; text-align: left; color: var(--wp--preset--color--accent-4); }
.help-breadcrumb a { color: var(--wp--preset--color--primary); text-decoration: none; }
.help-breadcrumb a:hover { text-decoration: underline; }
.help-breadcrumb .separator { margin: 0 .5rem; }
.help-breadcrumb .last { font-weight: 600; color: var(--wp--preset--color--contrast); }
.help-breadcrumb--hero { margin-bottom: var(--wp--preset--spacing--40); }
.help-breadcrumb--hero p, .help-breadcrumb--hero a { color: var(--wp--preset--color--primary-light); }
.help-breadcrumb--hero .last { color: var(--wp--preset--color--base); }

/* The theme justifies every paragraph and list item: menus and breadcrumbs must stay left-aligned */
li, .wp-block-navigation-item__content { text-align: left; }
.wp-block-navigation__submenu-container .wp-block-navigation-item__content { white-space: nowrap; }

/* Card links pinned to the bottom edge (the generic card paragraph rule has a higher specificity) */
.help-cards > .wp-block-column { display: flex; }
.wp-block-group.help-card { flex: 1; }
.wp-block-group.help-card p.help-card-link { margin-top: auto; padding-top: var(--wp--preset--spacing--30); }


/* ── Phase 12: header, buttons, headings, footer lists ───────────────────────────── */

/* Header row: logo left, navigation + language switcher together on the right (the switcher is a sibling of the nav) */
.help-header .alignwide { justify-content: flex-end; gap: 0.75rem; }
.help-header .alignwide > .help-brand { margin-right: auto; }

/* Hamburger up to 1023px (the core block only collapses below 600px and wraps to two lines before that) */
@media (min-width: 600px) and (max-width: 1023px) {
    .help-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
    .help-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
/* Touch targets on small screens */
@media (max-width: 1023px) {
    .help-header .wp-block-navigation__responsive-container-open,
    .help-header .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
    .help-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: inline-flex; }
}
@media (min-width: 600px) and (max-width: 1023px) {
    .help-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: inline-flex; }
}
/* Open menu: one left edge for items and sub-items */
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
    align-items: flex-start; justify-content: flex-start; text-align: left;
}
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container { padding-left: 1rem; }
/* Submenu toggle: at least 24 x 24 CSS px (WCAG 2.5.8) */
.help-header .wp-block-navigation__submenu-icon,
.help-header .wp-block-navigation-submenu__toggle { min-width: 24px; min-height: 24px; padding: 6px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }

/* Primary (yellow) buttons react to hover */
.help-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.help-cta .wp-block-button__link:hover { background: #e3b800; color: var(--wp--preset--color--contrast); }
.help-hero .is-style-outline .wp-block-button__link:hover { background: rgba(255, 255, 255, .14); }

/* Plain pages (contact, legal, privacy): H2 in the brand blue like everywhere else */
.wp-block-post-content > h2.wp-block-heading { color: var(--wp--preset--color--primary); }

/* Footer link lists are real <nav><ul> now */
footer .wp-block-navigation { gap: 0; }
footer .wp-block-navigation .wp-block-navigation__container { gap: var(--wp--preset--spacing--20); align-items: flex-start; }
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.has-child { align-items: flex-start; justify-content: flex-start; }
.help-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { justify-content: flex-start; text-align: left; flex-grow: 0; }

/* Call-to-action band: the generic left-aligned paragraph rule must not win over the centred band */
.wp-block-post-content .help-cta p, .help-cta p { text-align: center; }

/* 404 page */
.help-404 .help-hero { padding-top: var(--wp--preset--spacing--70); padding-bottom: var(--wp--preset--spacing--70); }
.help-404 .help-hero > * { max-width: var(--wp--style--global--content-size, 800px); margin-left: auto; margin-right: auto; }
.help-404 .help-section > * { max-width: var(--wp--style--global--content-size, 800px); margin-left: auto; margin-right: auto; }
.help-404-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--wp--preset--spacing--20); }
.help-404-links a { display: block; padding: .75rem 1rem; border: 1px solid var(--wp--preset--color--border); border-radius: 6px; font-weight: 600; text-decoration: none; min-height: 44px; box-sizing: border-box; }
.help-404-links a:hover { background: var(--wp--preset--color--accent-5); }
.wp-site-blocks > .help-404 { margin-block-start: 0; }
.help-404 .wp-block-buttons { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--30); margin-top: var(--wp--preset--spacing--40); }
.help-404 .help-hero p { color: var(--wp--preset--color--primary-light); font-size: 1.15rem; }
.help-404 .help-hero .is-style-outline .wp-block-button__link { color: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--base); border-radius: 4px; background: transparent; }
.help-404 .help-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); font-weight: 700; border-radius: 4px; }
