/*
Theme Name: Good With Inside
Description: Block theme for the GWi marketing site. Layout is built from Sections, Columns and blocks; colours, fonts, text sizes, buttons and widths live in Site Editor -> Styles; a few extra sizes and images in Appearance -> Design settings.
Version: 0.2.1
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: goodwith-inside
*/

/* --------------------------------------------------------------------------
   Link the global Styles palette to the shared design variables.
   Changing "Accent" in Styles -> Colors changes every CTA button.
   -------------------------------------------------------------------------- */
:root {
  --gw-accent: var(--wp--preset--color--accent, #00dc72);
  --gw-accent-ink: var(--wp--preset--color--accent-ink, #0a0a0a);
  --gw-ink: var(--wp--preset--color--ink, #0a0a0a);
  --gw-line: var(--wp--preset--color--line, #2b2b2b);
  --gw-accent-hover: var(--wp--preset--color--accent-hover, #c8f7dc);
  --gw-accent-active: var(--wp--preset--color--accent-active, #d3ed3c);   /* Dark lime (brand) */
  --gw-lime-hover: var(--wp--preset--color--lime-hover, #eef59a);
  --gw-card-bg: var(--wp--preset--color--card, #ffffff);
  --gw-mint: var(--wp--preset--color--mint, #8fe6a4);
  --gw-green: var(--wp--preset--color--green, #6fdc86);
  --gw-lime: var(--wp--preset--color--lime, #e6f5a3);
  --gw-butter: var(--wp--preset--color--butter, #f6f7c8);
  --gw-cream: var(--wp--preset--color--cream, #fbfdf1);
  --gw-aqua: var(--wp--preset--color--aqua, #c9f3de);
}

/* --------------------------------------------------------------------------
   WordPress adapter - maps core block markup onto the shared gw.css look.
   -------------------------------------------------------------------------- */
.gw-site .wp-site-blocks { padding: 0; }
.gw-site .wp-site-blocks > * { margin-block-start: 0; }
.gw-site main { margin: 0; }
.gw-site .wp-block-post-content > * { margin-block: 0 !important; }
.gw-site .wp-site-blocks > footer { margin-block-start: 0; }

/* Vertical rhythm inside sections, columns and cards */
.gw-stack > * { margin-block-start: 0; margin-block-end: 0; }
.gw-stack > * + * { margin-block-start: var(--gw-block-gap, 20px); }   /* Design settings -> Space between blocks */
.gw-stack > .wp-block-heading + * { margin-block-start: var(--gw-heading-gap, 12px); }   /* Design settings -> Space under headings */
.wp-block-column > * + *, .gw-card > * + * { margin-block-start: 16px; }
.gw-site .wp-block-heading { margin-bottom: 0; }

/* Columns */
.gw-section .wp-block-columns { gap: 32px; margin-bottom: 0; }
.gw-card .wp-block-columns { gap: 20px; }

/* Buttons: colours, border, corners, padding and text size are in Site Editor -> Styles -> Blocks -> Button
   (theme.json), including the Outline and Secondary styles. Only the hover colours of those two styles live here. */
.gw-section .wp-block-buttons { gap: 12px; }
.gw-align--center .wp-block-buttons { justify-content: center; }
.gw-header .wp-block-navigation-item__content:hover { background: var(--gw-accent-hover); }
.gw-header .wp-block-navigation-item__content:active { background: var(--gw-accent-active); }
/* Hero: the outline button is frosted half-white glass so it reads on the photo ("Learn more") */
.gw-hero .wp-block-button.is-style-outline .wp-block-button__link { background: rgba(255, 255, 255, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* Outline (white -> mint -> lime) and Secondary (lime -> pale lime -> green) hover and pressed colours */
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--gw-accent-hover); }
.wp-block-button.is-style-outline .wp-block-button__link:active { background: var(--gw-accent-active); }
.wp-block-button.is-style-secondary .wp-block-button__link:hover { background: var(--gw-lime-hover); }
.wp-block-button.is-style-secondary .wp-block-button__link:active { background: var(--gw-accent); }
/* Footer: legal text on the left, page links as outline pills on the right */
/* Legal text: 12px / 16px, taking the remaining width */
.gw-footer-legal { flex: 1 0 0; min-width: calc(300px * var(--gw-s)); font-size: calc(12px * var(--gw-s)); line-height: calc(16px * var(--gw-s)); }
.gw-footer-links { flex: none; }
.gw-footer-legal p { margin: 0 0 1em; }
.gw-footer-legal p:last-child { margin-bottom: 0; }
.gw-footer-links { gap: 12px; }

/* Images */
.gw-section .wp-block-image { margin: 0; }
.gw-block-image--blend img { mix-blend-mode: multiply; }
.gw-block-image--rounded img { border-radius: var(--gw-radius); border: 1px solid var(--gw-line); }

/* Logos (core images inside gw/logos) */
.gw-marquee__list .wp-block-image { margin: 0 !important; flex: none; }
.gw-marquee__list img { height: var(--gw-logo-h, 44px) !important; width: auto !important; }
.gw-logostrip__list .wp-block-image, .gw-logogrid .wp-block-image { margin: 0 !important; flex: none; }
.gw-logostrip__list img { height: var(--gw-logo-h, 44px) !important; width: auto !important; }
.gw-logogrid img { height: var(--gw-logo-h, 26px) !important; width: auto !important; }

/* Header navigation pills */
.gw-header .wp-block-navigation { gap: 10px; justify-content: flex-end; }
.gw-header .wp-block-navigation-item__content { display: inline-block; padding: .35em .85em !important; border: 1.5px solid var(--gw-ink); border-radius: 999px; background: #fff; color: var(--gw-ink) !important; font-weight: 700; font-size: .8125rem; text-decoration: none; }
/* Accent menu button ("Sign in"): Dark lime with a thin black border */
.gw-header .wp-block-navigation-item.is-accent .wp-block-navigation-item__content { background: var(--gw-accent-active); border: 1px solid #000; border-radius: 30px; }
.gw-header .wp-block-navigation-item.is-accent .wp-block-navigation-item__content:hover { background: var(--gw-lime-hover); }
.gw-header .wp-block-site-logo img { width: var(--gw-logo-w, 80px) !important; height: auto; }
.gw-header--links .wp-block-navigation-item:not(.is-accent) .wp-block-navigation-item__content { border-color: transparent; background: transparent; }
.gw-header .wp-block-navigation-item__content:hover { background: var(--gw-accent-hover); }
.gw-header--centered .wp-block-navigation, .gw-header--centered .wp-block-navigation__container { justify-content: center; }
.gw-header--stacked .wp-block-navigation, .gw-header--stacked .wp-block-navigation__container { justify-content: flex-start; }
.admin-bar .gw-header--fixed, .admin-bar .gw-header--sticky { top: 32px; }

/* Mobile menu: WordPress's own hamburger, styled as a pill to match the buttons */
.gw-header .wp-block-navigation__responsive-container-open { padding: .35em .85em; border: 1.5px solid var(--gw-ink); border-radius: 999px; background: #fff; color: var(--gw-ink); }
.gw-header .wp-block-navigation__responsive-container-open::after { content: "Menu"; font-weight: 700; font-size: .8125rem; margin-left: 6px; }
.gw-header .wp-block-navigation__responsive-container-open svg { width: 18px; height: 18px; }
@media (max-width: 800px) {
  .gw-logostrip__list img, .gw-marquee__list img { height: calc(var(--gw-logo-h, 44px) * .78) !important; }
  .gw-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-end; }
}

/* Buttons: full width on mobile */
@media (max-width: 800px) {
  .wp-block-buttons.gw-btns--mobile-full { flex-direction: column; align-items: stretch; }
  .wp-block-buttons.gw-btns--mobile-full > .wp-block-button, .wp-block-buttons.gw-btns--mobile-full .wp-block-button__link { width: 100%; text-align: center; }
}

/* Ordinary pages (Privacy, Terms, Cookies...): title and text in the content column, clear of the overlaid header */
.gw-site:not(.home, .page-template-page-sections, .error404) main { padding-top: 150px; }

/* "Sections (like Home)" pages that start with the Home page link bar (section class gw-topbar):
   the bar stays at the very top and the overlaid header sits on the section after it, like on Home */
.wp-site-blocks:has(> main > .gw-topbar:first-child) { display: grid; grid-template-columns: 100%; }
.wp-site-blocks:has(> main > .gw-topbar:first-child) > main { display: contents; }
.wp-site-blocks:has(> main > .gw-topbar:first-child) > * { margin-block: 0; }
.wp-site-blocks:has(> main > .gw-topbar:first-child) > .gw-header { position: relative; grid-row: 2; grid-column: 1; align-self: start; }
.wp-site-blocks > main > .gw-topbar:first-child + * { grid-row: 2; grid-column: 1; }
.gw-site main.gw-page { margin-inline: auto; padding-bottom: 80px; }
.gw-page .wp-block-post-title { margin: 0 0 .6em; }
.gw-page .wp-block-post-content > * + * { margin-block-start: 1em; }

/* Editor-only niceties */
/* Gradient swatches in the Section sidebar */
.gw-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gw-swatch { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: 6px; background: none; cursor: pointer; font-size: 11px; }
.gw-swatch.is-selected { border-color: var(--wp-admin-theme-color, #3858e9); box-shadow: 0 0 0 1px var(--wp-admin-theme-color, #3858e9); }
.gw-swatch__chip { display: block; width: 100%; aspect-ratio: 4/3; border-radius: 4px; border: 1px solid #ccc; }
.gw-swatch__chip.gw-bg--none { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
/* Header/footer layout preview in the Site Editor */
.gw-bar--centered { flex-direction: column !important; align-items: center !important; }
.gw-bar--stacked { flex-direction: column !important; align-items: flex-start !important; }
.gw-bar--links .wp-block-navigation-item:not(.is-accent) .wp-block-navigation-item__content { border-color: transparent; background: transparent; }
.editor-styles-wrapper [class*="gw-editor-hidden-"] { opacity: .45; outline: 1px dashed #999; }
.editor-styles-wrapper .gw-hide-mobile, .editor-styles-wrapper .gw-hide-desktop { display: revert !important; }
/* Core Columns: reverse on mobile, or move the middle column to the top (WordPress stacks columns below 782px) */
@media (max-width: 781px) {
  .wp-block-columns.gw-mobile-reverse { flex-direction: column-reverse; }
  .wp-block-columns.gw-mobile-middle-first > .wp-block-column:nth-child(2) { order: -1; }
}
.editor-styles-wrapper .gw-section { min-height: 60px; }
.editor-styles-wrapper .gw-header { position: relative; }
