/* ============================================================
   Pageforge — Base structural styles
   ============================================================
   Always loaded on every Pageforge page, before the active design
   preset. Contains layout primitives only:

     - box-sizing reset
     - container width
     - section/grid topology
     - responsive breakpoint collapses
     - position/inset/z-index for stacked components

   Decorative styling (colors, fonts, button shapes, hover effects,
   shadows, borders) lives in design-presets/{name}.css instead.

   IMPORTANT: this file MUST NOT redefine `:root { --pf-* }`.
   The plugin injects the only :root definition via wp_head priority 5
   (pf_output_design_styles() in pageforge.php).
   ============================================================ */

html { scroll-behavior: smooth; }

.pf-page,
.pf-page *,
.pf-page *::before,
.pf-page *::after {
    box-sizing: border-box;
}
.pf-page * { margin: 0; padding: 0; }

/* v1.7.4 — fluid images. Without this, raw <img> tags inserted via
   markdown inside arbitrary blocks (not just .pf-figure) overflow their
   container on narrow screens. .pf-services__img defines its own sizing
   and is unaffected. */
.pf-page img { max-width: 100%; height: auto; }

.pf-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Section wrappers (structural padding only) ---------- */
.pf-section { padding: 90px 0; }

.pf-section-header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
.pf-section-header .pf-section-desc { margin: 0 auto; }
.pf-section-body {
    max-width: 860px;
    margin: 0 auto;
}

/* ---------- Hero structural shell ---------- */
.pf-hero {
    position: relative;
    /* 100vh causes a layout jump on iOS Safari when the URL bar
       collapses. 100svh (small viewport height) is the stable value;
       100vh stays as a fallback for browsers that don't support svh. */
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.pf-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.pf-hero__overlay {
    position: absolute;
    inset: 0;
}
.pf-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 120px 0 80px;
}
.pf-hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---------- Why grid ---------- */
.pf-why__grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 250px, 1fr ) );
    gap: 28px;
    margin-top: 48px;
}

/* ---------- Services rows ---------- */
.pf-services__rows { display: block; }
.pf-services__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
    margin-bottom: 90px;
}
.pf-services__row:last-of-type { margin-bottom: 0; }
.pf-services__row--reverse { direction: rtl; }
.pf-services__row--reverse > * { direction: ltr; }

.pf-services__col-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.pf-services__col-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}
.pf-services__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ---------- CTA structural shell ---------- */
.pf-cta {
    position: relative;
    overflow: hidden;
    text-align: center;
}
.pf-cta__decoration {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.pf-cta__inner {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
}
.pf-cta__buttons,
.pf-cta__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Service areas grid ---------- */
.pf-areas__grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
    gap: 24px;
}
.pf-areas__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pf-areas__footer {
    margin: 48px auto 0;
    text-align: center;
    max-width: 760px;
}

/* ---------- FAQ accordion ---------- */
.pf-faq__list {
    max-width: 820px;
    margin: 0 auto;
}
.pf-faq__item { overflow: hidden; }
.pf-faq__question {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    text-align: left;
}
.pf-faq__icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.pf-faq__answer {
    max-height: 0;
    overflow: hidden;
}

/* ---------- Find Us layout (structural grid only) ---------- */
.pf-findus__inner {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 40px;
    align-items: stretch;
}
.pf-findus__details,
.pf-findus__map {
    min-height: 360px;
}
.pf-findus__map {
    position: relative;
    overflow: hidden;
}
.pf-findus__map iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: 0;
}
.pf-findus__map-placeholder {
    width: 100%;
    height: 100%;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pf-findus__item {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}
.pf-findus__icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pf-findus__resources {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 280px, 1fr ) );
    gap: 20px;
    margin-top: 32px;
}
.pf-findus__resource {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pf-findus__resource-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.pf-findus__resource-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* ---------- Section actions ---------- */
.pf-section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin-top: 36px;
    text-align: center;
}

/* ---------- Cross-link section grid ---------- */
.pf-xlinks__grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax( 280px, 1fr ) );
    gap: 36px;
    max-width: 1180px;
    margin: 0 auto;
}
.pf-xlinks__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

/* ---------- Hero scroll indicator (structural positioning) ---------- */
.pf-hero__scroll {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX( -50% );
    z-index: 3;
    pointer-events: none;
}
.pf-hero__scroll-chevron {
    display: block;
    width: 22px;
    height: 22px;
    transform: rotate( 45deg );
    margin: 0 auto;
}

/* ---------- Animation primitives ---------- */
.pf-animate {
    opacity: 0;
    transform: translateY( 30px );
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.pf-animate.pf-visible {
    opacity: 1;
    transform: translateY( 0 );
}

/* ---------- Render-failure fallback page ---------- */
.pf-page--error {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}
.pf-page--error .pf-container {
    max-width: 720px;
    text-align: center;
}

/* ============================================================
   Responsive — 768px and below
   ============================================================ */
@media ( max-width: 768px ) {
    .pf-section { padding: 60px 0; }

    .pf-hero__content { padding: 100px 0 60px; }
    .pf-hero__actions .pf-btn {
        width: 100%;
        justify-content: center;
    }

    .pf-why__grid { grid-template-columns: 1fr; }

    .pf-services__row {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 56px;
    }
    .pf-services__row--reverse { direction: ltr; }
    .pf-services__col-image { order: -1; }

    .pf-areas__grid { grid-template-columns: 1fr; }

    .pf-findus__inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .pf-findus__details,
    .pf-findus__map,
    .pf-findus__map iframe,
    .pf-findus__map-placeholder {
        min-height: 0;
    }
    .pf-findus__map iframe,
    .pf-findus__map-placeholder {
        min-height: 280px;
    }
    .pf-findus__map { order: -1; }

    .pf-hero__scroll { display: none; }
}

@media ( max-width: 540px ) {
    .pf-cta__buttons .pf-btn { width: 100%; }
}

@media ( max-width: 480px ) {
    .pf-hero__actions,
    .pf-section-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .pf-hero__actions > a,
    .pf-section-actions > a {
        width: 100%;
        justify-content: center;
    }

    /* v1.7.4 — tighter container gutters on narrow phones. 24px each
       side leaves <280px content width on 320px devices, which pinches
       long suburb names in pill rows. */
    .pf-container { padding: 0 16px; }
}

/* ============================================================
   v1.10.0 — Breadcrumb trail (Home → Hub → Zone → current)
   ============================================================ */
.pf-breadcrumb {
    padding: 12px 0;
    font-size: 0.875em;
}
.pf-breadcrumb__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.pf-breadcrumb__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.pf-breadcrumb__item + .pf-breadcrumb__item::before {
    content: "/";
    opacity: 0.5;
}
.pf-breadcrumb__item [aria-current="page"] {
    opacity: 0.7;
}
