/*
Theme Name: Quattro Venti
Theme URI: https://quattroventi.com.au/
Author: Quattro Venti – New Italy Lifestyle Farm
Description: Block theme for Quattro Venti – New Italy Lifestyle Farm. A single-page site for the free range egg farm at New Italy, NSW — built entirely from standard WordPress blocks, template parts and theme.json (no page builders, no plugins).
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quattro-venti
Tags: block-theme, full-site-editing, one-column, custom-colors, custom-logo, editorial-layout
*/

/* ==========================================================================
   Quattro Venti — New Italy Lifestyle Farm
   style.css — single stylesheet, mobile-first, plain CSS.
   Breakpoints: 640px (small), 900px (desktop nav / multi-column).

   Order: Tokens · Base · Layout · Header · Hero · Sections · Cards ·
          Contact · Footer · Responsive · Utilities · Print
   ========================================================================== */

/* ==========================================================================
   Tokens (:root custom properties — brand style guide)
   ========================================================================== */
:root {
  /* Colours */
  --color-primary: #febd3b;        /* Pantone 136 — brand yellow */
  --color-primary-dark: #e8a81f;   /* hover/active deepening of the yellow */
  --color-black: #000000;          /* Pantone Black 6C */
  --color-grey: #939598;           /* Cool Grey 6C */
  --color-grey-light: #d1d3d4;     /* Cool Grey 3C */
  --color-white: #ffffff;
  --color-cream: #fffdf7;          /* tinted neutral background for alt sections */

  /* Derived functional colours */
  --color-ink: #161616;            /* softer-than-black body ink */
  --color-ink-soft: #4a4a4a;       /* secondary text */
  --color-line: #e6e4dd;           /* hairline borders on warm background */
  --color-focus: #0b57d0;          /* high-contrast focus ring colour */

  /* Fonts */
  --font-body: "Cooper Hewitt", "Hanken Grotesk", "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Archivo Black", "Anton", "Cooper Hewitt", "Segoe UI", Helvetica, Arial, sans-serif;

  /* Type scale (clamp for fluid headings) */
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: clamp(1.15rem, 1rem + 0.6vw, 1.35rem);
  --text-h3: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --text-h2: clamp(1.9rem, 1.4rem + 2.2vw, 3.1rem);
  --text-hero: clamp(2.5rem, 1.5rem + 5vw, 5.25rem);
  --text-kicker: clamp(0.85rem, 0.8rem + 0.3vw, 1rem);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12), 0 24px 60px rgba(0, 0, 0, 0.10);
  --shadow-header: 0 2px 12px rgba(0, 0, 0, 0.10);

  /* Layout */
  --container: 70rem;              /* 1120px */
  --container-narrow: 46rem;
  --header-height: 4.5rem;
  --section-pad-y: clamp(3.5rem, 6vw, 6.5rem);
}

/* ==========================================================================
   Base — reset, typography, global focus, anchor offset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 300;
  line-height: 1.65;
  color: var(--color-ink);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-4);
  line-height: 1.1;
  font-weight: 700;
  color: var(--color-black);
  letter-spacing: -0.015em;
}

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-black);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  margin: 0;
  padding: 0;
}

button {
  font: inherit;
}

/* Visible, consistent focus ring everywhere */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Anchor links must not hide beneath the sticky header */
[id] {
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

::selection {
  background: var(--color-primary);
  color: var(--color-black);
}

/* --- WordPress core block adjustments ------------------------------------
   The ported design spaces everything through element and component rules
   (as the original static site did), so any default sibling rhythm core may
   add inside groups is neutralised here, once, before the component rules. */
.is-layout-flow > * + *,
.wp-block-group > * + * {
  margin-block-start: 0;
}

.wp-block-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wp-block-image {
  margin: 0;
}

.wp-block-buttons {
  gap: var(--space-3);
}

.wp-block-paragraph + .wp-block-paragraph {
  margin-block-start: 0;
}

/* Skip link — a paragraph block pinned off-screen until keyboard-focused */
.skip-link-wrap {
  position: absolute;
  top: -5rem;
  left: var(--space-4);
  z-index: 300;
  margin: 0;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  background-color: var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: top 0.2s ease;
}

.skip-link-wrap:focus-within {
  top: var(--space-4);
}

.skip-link-wrap .skip-link {
  color: var(--color-black);
  text-decoration: none;
}

/* ==========================================================================
   Layout — container, section rhythm, section headers
   ========================================================================== */
.container {
  width: min(100% - var(--space-6), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-pad-y);
  background-color: var(--color-white);
}

.section--alt {
  background-color: var(--color-cream);
}

/* Horizontal rhythm: constrain and centre the direct children of every
   section, the hero and the footer so content never touches the viewport
   edges. Template parts and groups render their children directly, so these
   selectors work exactly as they did on the static site. */
.section > *,
.hero > *,
.site-footer > * {
  width: min(calc(100% - var(--space-6) * 2), var(--container));
  margin-inline: auto;
}

/* Long-form copy stays comfortable to read (children, so the block keeps
   the container's left edge aligned with the section header) */
.section__body > * {
  max-width: 68ch;
}

/* Section header pattern (kicker + title + intro) used by every section */
.section__header {
  margin-bottom: var(--space-5);
}

.section__kicker {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-kicker);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-black);
}

/* Yellow highlight bar beside the kicker — colour only, never yellow text */
.section__kicker::before {
  content: "";
  display: inline-block;
  width: 2.25rem;
  height: 0.55em;
  margin-right: var(--space-3);
  vertical-align: middle;
  background-color: var(--color-primary);
  border-radius: var(--radius-pill);
}

.section__title {
  font-size: var(--text-h2);
  max-width: 18ch;
}

.section__intro {
  max-width: 62ch;
  font-size: var(--text-lg);
  color: var(--color-ink-soft);
}

/* ==========================================================================
   Header — sticky template part, logo, core navigation
   ========================================================================== */
/* The header template part is a direct child of the page, so sticky works
   across the whole document. The footer part uses a <footer> element, so the
   element selector keeps this rule header-only. */
header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-white);
}

.site-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  min-height: var(--header-height);
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-line);
}

.site-logo {
  margin: 0;
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  border-radius: var(--radius-sm);
}

.site-logo img {
  width: auto;
  height: 2.6rem;
  object-fit: contain;
}

/* --- Core navigation block (standard responsive menu) -------------------- */
.site-nav {
  margin-left: auto;
}

.site-nav .wp-block-navigation__container,
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav .wp-block-navigation-item__content {
  display: block;
  padding: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-black);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.site-nav .wp-block-navigation-item__content:hover,
.site-nav .wp-block-navigation-item__content:focus-visible {
  background-color: var(--color-cream);
}

/* Hamburger button — mirrors the original 2px bordered toggle */
.site-nav .wp-block-navigation__responsive-container-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.6rem;
  background: transparent;
  border: 2px solid var(--color-black);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.site-nav .wp-block-navigation__responsive-container-open svg {
  width: 100%;
  height: 100%;
  fill: var(--color-black);
}

/* Full-screen overlay menu (core handles open/close + Escape) */
.site-nav .wp-block-navigation__responsive-container.is-menu-open {
  background-color: var(--color-white);
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__container {
  gap: var(--space-2);
}

.site-nav .wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content {
  font-size: var(--text-lg);
  padding: var(--space-3);
}

/* ==========================================================================
   Buttons — core button block, original .btn look
   ========================================================================== */
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem 1.6rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  background-color: var(--color-primary);
  color: var(--color-black);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.wp-block-button.btn--primary .wp-block-button__link {
  background-color: var(--color-primary);
  color: var(--color-black);
  border-color: var(--color-black); /* keeps the button visible on yellow/black blocks */
}

.wp-block-button.btn--primary .wp-block-button__link:hover,
.wp-block-button.btn--primary .wp-block-button__link:focus-visible {
  background-color: var(--color-primary-dark);
}

.wp-block-button.btn--ghost .wp-block-button__link {
  background-color: transparent;
  color: var(--color-black);
  border-color: var(--color-black);
}

.wp-block-button.btn--ghost .wp-block-button__link:hover,
.wp-block-button.btn--ghost .wp-block-button__link:focus-visible {
  background-color: var(--color-black);
  color: var(--color-white);
}

.wp-block-button__link:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* ==========================================================================
   Hero — bold black block, display headline, badges
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--color-black);
  color: var(--color-white);
  padding-block: clamp(3.5rem, 8vw, 7rem);
}

/* Warm yellow glow accent — decorative only */
.hero::after {
  content: "";
  position: absolute;
  right: -8rem;
  top: -8rem;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 189, 59, 0.35) 0%, rgba(254, 189, 59, 0) 70%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero__kicker {
  display: inline-block;
  margin: 0 0 var(--space-4);
  padding: 0.4rem 1rem;
  font-family: var(--font-display);
  font-size: var(--text-kicker);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-black);
  background-color: var(--color-primary);
  border-radius: var(--radius-pill);
}

.hero__title {
  max-width: 15ch;
  margin-bottom: var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-white);
}

/* "farm gate" emphasis — yellow on black, never yellow on white */
.hero__title em {
  font-style: normal;
  color: var(--color-primary);
}

.hero__subtitle {
  max-width: 46ch;
  margin-bottom: var(--space-6);
  font-size: var(--text-lg);
  color: var(--color-grey-light);
}

.wp-block-buttons.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}

/* Ghost button needs a light border on the dark hero */
.hero .wp-block-button.btn--ghost .wp-block-button__link {
  color: var(--color-white);
  border-color: var(--color-white);
}

.hero .wp-block-button.btn--ghost .wp-block-button__link:hover,
.hero .wp-block-button.btn--ghost .wp-block-button__link:focus-visible {
  background-color: var(--color-white);
  color: var(--color-black);
}

.wp-block-list.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.wp-block-list.hero__badges li {
  padding: 0.45rem 1rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-white);
  border: 1px solid var(--color-grey);
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   Cards — product grid
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-7);
}

.card {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--space-4);
  font-size: 1.6rem;
  line-height: 1;
  background-color: var(--color-primary);
  border-radius: 50%;
}

.card__title {
  font-size: var(--text-h3);
}

.card__text {
  color: var(--color-ink-soft);
}

/* ==========================================================================
   Split layout — text + media
   ========================================================================== */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
  margin-top: var(--space-7);
}

.split__text {
  max-width: 60ch;
}

.split__media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Chips — service-area tags
   ========================================================================== */
.wp-block-list.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
  list-style: none;
  padding: 0;
}

.wp-block-list.chips li {
  padding: 0.45rem 1.1rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-black);
  background-color: var(--color-primary);
  border-radius: var(--radius-pill);
}

/* Stockist callout — where to buy the eggs in store */
p.stockist {
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-left: 6px solid var(--color-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stockist__icon {
  font-size: 1.75rem;
  line-height: 1;
}

.stockist strong {
  font-weight: 700;
}

/* ==========================================================================
   Contact section
   ========================================================================== */
.section--contact {
  background-color: var(--color-cream);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: start;
  margin-top: var(--space-7);
}

/* The details card stands alone (no form) */
.contact-details {
  max-width: 36rem;
  padding: var(--space-6);
  background-color: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.contact-details h3 {
  font-size: var(--text-h3);
}

.contact-details a {
  font-weight: 500;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer.wp-block-template-part {
  background-color: var(--color-black);
}

.site-footer {
  padding-block: var(--space-6) var(--space-5);
  background-color: var(--color-black);
  color: var(--color-grey-light);
}

.wp-block-list.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-bottom: var(--space-6);
  list-style: none;
  padding: 0;
}

.site-footer__nav a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
}

.site-footer__nav a:hover,
.site-footer__nav a:focus-visible {
  color: var(--color-primary);
}

.site-footer__copy {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-grey-light);
}

.site-footer__credit {
  font-size: var(--text-sm);
  color: var(--color-grey);
}

.site-footer__credit a {
  color: var(--color-primary);
}

/* ==========================================================================
   Responsive — 640px, then 900px
   ========================================================================== */
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .wp-block-buttons.hero__actions {
    gap: var(--space-5);
  }
}

/* Between the core navigation's mobile breakpoint and our desktop layout the
   inline link row must stay compact next to the logo */
@media (min-width: 600px) and (max-width: 899px) {
  .site-nav .wp-block-navigation-item__content {
    padding: var(--space-2);
    font-size: var(--text-sm);
  }

  .site-header {
    gap: var(--space-3);
  }
}

/* Below 900px the menu stays behind the hamburger (panel style), regardless
   of where core's own mobile breakpoint sits — never both at once */
@media (max-width: 899px) {
  .site-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }
}

@media (min-width: 900px) {
  :root {
    --header-height: 5.25rem;
  }

  .site-header {
    padding-inline: var(--space-6);
    gap: var(--space-6);
  }

  .site-logo img {
    height: 3.1rem;
  }

  /* Nav is an inline row on desktop */
  .site-nav .wp-block-navigation-item__content {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }

  .site-nav .wp-block-navigation__responsive-container-open {
    display: none;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Split: text + media side by side; reverse alternates the order */
  .split {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .split--reverse .split__text {
    order: 2;
  }

  .split--reverse .split__media {
    order: 1;
  }

  .contact-layout {
    gap: var(--space-7);
  }

  .site-footer__nav {
    margin-bottom: var(--space-4);
  }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }

/* Respect reduced-motion preferences across all transitions/animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Print — simple, legible, black on white
   ========================================================================== */
@media print {
  header.wp-block-template-part,
  .site-nav,
  .hero__actions,
  .wp-block-list.hero__badges,
  .site-footer__nav {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .hero,
  .section,
  .section--alt,
  .section--contact,
  .site-footer {
    background: #fff !important;
    color: #000 !important;
    padding-block: 1rem;
    box-shadow: none;
  }

  .hero__title,
  .hero__kicker,
  .hero__subtitle,
  .wp-block-list.hero__badges li,
  .site-footer,
  .site-footer__copy,
  .site-footer__credit {
    color: #000 !important;
    background: transparent !important;
    border-color: #000 !important;
  }

  .card,
  .contact-details {
    border: 1px solid #000;
    box-shadow: none;
    break-inside: avoid;
  }

  a {
    color: #000;
  }
}
