/* ==========================================================================
   Community Partners — 2027 redesign (template-support-local-businesses.php)
   Source: Figma "SMGLI | Design Devsite" → "*Community Partners"
   (node 2196:10451, 1440 wide, content column 1140). Everything is scoped
   under .cp27 so nothing here reaches other templates. Colour and font
   tokens come from site.css; the Figma values are noted where they differ.
   ========================================================================== */

.cp27 {
    --cp27-cream: var(--stone);          /* #f2ebe4 page + card fill */
    --cp27-card: #f2ebe3;                /* Figma card fill */
    --cp27-tan: var(--stone-dark);       /* #e4d9cb invite band */
    --cp27-ink: #2e2521;                 /* body copy */
    --cp27-plum: #47151e;                /* Figma plum (site --plum is #47141f) */
    --cp27-clay: var(--clay);            /* #ba4a29 */
    --cp27-ochre: var(--ochre);          /* #d68a1c */
    --cp27-teal: #05575e;
    --cp27-teal-panel: #065a62;
    --cp27-verde: #405e1c;
    --cp27-serif: var(--font-accent);    /* Crimson Text */
    --cp27-mono: var(--font-label);      /* Inconsolata */
    --cp27-sans: var(--font-body);       /* Figtree */
    --cp27-content: 1140px;              /* Figma content column (1440 − 150×2) */
    --cp27-torn: clamp(40px, 5.5vw, 80px);
    color: var(--cp27-plum);
    overflow-x: clip;
}

.cp27-inner {
    position: relative;
    z-index: 3;
    width: min(100% - (var(--space-page) * 2), var(--cp27-content));
    margin-inline: auto;
}

/* ---- Shared type --------------------------------------------------------- */

.cp27-eyebrow {
    margin: 0 0 16px;
    font-family: var(--cp27-mono);
    font-weight: 600;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--cp27-clay);
}
.cp27-eyebrow--small {
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0;
    color: var(--cp27-plum);
}

.cp27-h1 {
    margin: 0;
    font-family: var(--cp27-serif);
    font-weight: 600;
    font-size: clamp(34px, 3.6vw, 52px);
    line-height: 1;
    color: var(--cp27-plum);
}
.cp27-h2 {
    margin: 0;
    font-family: var(--cp27-serif);
    font-weight: 600;
    font-size: clamp(30px, 2.9vw, 42px);
    line-height: 1.15;
    color: var(--cp27-plum);
}
.cp27-h2--small { font-size: clamp(28px, 2.5vw, 36px); }

.cp27-intro {
    font-family: var(--cp27-sans);
    font-size: 16px;
    line-height: 26px;
    color: var(--cp27-ink);
}
.cp27-intro p { margin: 0; }
.cp27-intro p + p { margin-top: 1em; }

/* Underlined caps text link (hero + Join band style). */
.cp27-textlink {
    font-family: var(--cp27-mono);
    font-weight: 800;
    font-size: 20px;
    line-height: 32px;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--cp27-ochre);
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1.5px;
}
.cp27-textlink:hover,
.cp27-textlink:focus-visible { color: var(--cp27-clay); }

/* Manicule button: caps label + pointing hand + hairline underneath. */
.cp27-manicule {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    color: var(--cp27-plum);
    text-decoration: none;
}
.cp27-manicule__row {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    font-family: var(--cp27-mono);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.cp27-manicule__row img,
.cp27-manicule__row svg { display: block; width: 48px; height: 17px; }
.cp27-manicule__rule {
    display: block;
    width: 100%;
    height: 1px;
    background: currentColor;
    opacity: .9;
}
.cp27-manicule--clay { color: var(--cp27-clay); }
.cp27-manicule:hover .cp27-manicule__row,
.cp27-manicule:focus-visible .cp27-manicule__row { text-decoration: underline; text-underline-offset: 3px; }

/* ---- 1. Hero ------------------------------------------------------------- */

.cp27-hero {
    position: relative;
    isolation: isolate;
    padding: clamp(3rem, 4.7vw, 68px) 0 clamp(6rem, 13.5vw, 200px);
    text-align: center;
    overflow: hidden;
}
.cp27-hero__inner { width: min(100% - (var(--space-page) * 2), 665px); }
.cp27-hero__title { max-width: 600px; margin-inline: auto; }
.cp27-hero__burst {
    display: block;
    width: min(313px, 70%);
    height: auto;
    margin: 26px auto 0;
}
.cp27-hero__lede {
    max-width: 640px;
    margin: 18px auto 0;
    font-family: var(--cp27-sans);
    font-size: 20px;
    line-height: 32px;
    color: var(--cp27-ink);
}
.cp27-hero__lede p { margin: 0; }
.cp27-hero__lede p + p { margin-top: .75em; }
.cp27-hero__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 36px;
    margin-top: clamp(32px, 4vw, 58px);
}

/* Collages: left floating heart-and-manuscript, right milagro + marigold +
   handwriting. Positions are Figma's at 1440, scaled with the viewport. */
.cp27-hero__art {
    position: absolute;
    z-index: -1;
    height: auto;
    pointer-events: none;
    user-select: none;
}
.cp27-hero__art--left {
    /* Figma export is the visible part of "Floating / Right / Heart" (357 × 789
       at 1440, flush with the page edge, 63px under the header). */
    left: 0;
    top: clamp(24px, 4.4vw, 63px);
    width: clamp(170px, 24.8vw, 357px);
}
.cp27-hero__art--paper {
    right: -1.2%;
    top: clamp(300px, 31vw, 448px);
    width: clamp(160px, 24vw, 349px);
}
.cp27-hero__art--flower {
    right: -0.3%;
    top: clamp(170px, 18.2vw, 262px);
    width: clamp(130px, 19.4vw, 279px);
    transform: rotate(-5.3deg);
}
.cp27-hero__art--heart {
    right: 7%;
    top: clamp(220px, 23.1vw, 333px);
    width: clamp(130px, 19.4vw, 280px);
    transform: rotate(6.7deg);
}

/* Torn paper between the hero and Our Community: flipped so the ragged edge
   hangs into the hero. */
.cp27-tear {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: var(--cp27-torn);
    margin-top: calc(-1 * var(--cp27-torn));
    background: url("../img/dividers/torn-paper-stone.svg") center / 100% 100% no-repeat;
    pointer-events: none;
}
.cp27-tear--flip { transform: none; } /* the SVG is already ragged on top; no flip (29 Oct) */

/* ---- Flat panel behind Our Community + the directory ---------------------
   Plain cream (#f2ebe4), full width, no paper texture (client call, 29 Oct). */
.cp27-panel {
    position: relative;
    isolation: isolate;
}
.cp27-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--cp27-cream);
    z-index: 0;
    pointer-events: none;
}
.cp27-panel > * { position: relative; z-index: 1; }

/* ---- 2. Our Community (intro + category jump links) ---------------------- */

.cp27-community {
    position: relative;
    padding: clamp(2rem, 2.5vw, 36px) 0 clamp(3rem, 5vw, 70px);
    text-align: center;
}
.cp27-community .cp27-h2 { margin-bottom: clamp(18px, 2vw, 30px); }
.cp27-community .cp27-intro { max-width: 820px; margin-inline: auto; }
.cp27-jumplinks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    justify-content: flex-start;
    margin: clamp(28px, 4vw, 56px) 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}
.cp27-jumplinks a {
    font-family: var(--cp27-sans);
    font-size: 16px;
    line-height: 1.25;
    color: var(--cp27-plum);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cp27-jumplinks a::after { content: " \2193"; text-decoration: none; display: inline-block; }
.cp27-jumplinks a:hover,
.cp27-jumplinks a:focus-visible { color: var(--cp27-clay); }

/* ---- 3. Partner directory ------------------------------------------------ */

.cp27-directory {
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 0 0 clamp(4rem, 7vw, 100px);
}
.cp27-category {
    --cat: var(--cp27-plum);
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-margin-top: 110px;
}
.cp27-category--plum  { --cat: var(--cp27-plum); }
.cp27-category--teal  { --cat: var(--cp27-teal); }
.cp27-category--clay  { --cat: var(--cp27-clay); }
.cp27-category--verde { --cat: var(--cp27-verde); }

.cp27-category__band {
    display: flex;
    align-items: center;
    min-height: 76px;
    padding: 12px 24px;
    border-radius: 8px;
    background: var(--cat);
}
.cp27-category__title {
    margin: 0;
    font-family: var(--cp27-serif);
    font-weight: 600;
    font-size: clamp(24px, 2.1vw, 30px);
    line-height: 1.25;
    color: var(--cp27-cream);
}

.cp27-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp27-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    min-height: 112px;
    padding: 16px 22px;
    border: 1px solid color-mix(in srgb, var(--cat) 22%, transparent);
    border-radius: 6px;
    background: var(--cp27-card);
}
.cp27-card--logo { padding-right: 150px; }
.cp27-card__name {
    margin: 0;
    font-family: var(--cp27-serif);
    font-weight: 600;
    font-size: clamp(20px, 1.7vw, 24px);
    line-height: 1.15;
    color: var(--cp27-plum);
}
.cp27-card__name a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.cp27-card__name a:hover,
.cp27-card__name a:focus-visible { color: var(--cp27-clay); }
.cp27-card__text {
    margin: 0;
    font-family: var(--cp27-sans);
    font-size: 14px;
    line-height: 20px;
    color: var(--cp27-ink);
}
.cp27-card__logo {
    position: absolute;
    top: 50%;
    right: 22px;
    width: 100px;
    height: 72px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cp27-card__logo img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ---- 4. Make the Most (destination guides) ------------------------------- */

.cp27-guides {
    position: relative;
    padding: clamp(3rem, 3.2vw, 45px) 0 clamp(4rem, 7vw, 100px);
    text-align: center;
}
.cp27-guides .cp27-eyebrow--small { margin-bottom: 22px; }
.cp27-guides__intro {
    max-width: 900px;
    margin: 18px auto 0;
    font-family: var(--cp27-sans);
    font-size: 18px;
    line-height: 1.35;
    color: var(--cp27-plum);
}
.cp27-guides__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px 30px;
    margin: clamp(32px, 4vw, 54px) 0 0;
    padding: 0;
    list-style: none;
}
.cp27-guide {
    --guide: var(--cp27-teal);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 245px;
    padding: 28px 28px 22px;
    border: 1.5px solid var(--guide);
    border-radius: 14px;
    background: var(--cp27-card);
    overflow: hidden;
    text-align: center;
}
.cp27-guide::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 9px;
    background: var(--guide);
}
.cp27-guide--teal  { --guide: var(--cp27-teal); }
.cp27-guide--ochre { --guide: #d68c1c; }
.cp27-guide--verde { --guide: var(--cp27-verde); }
.cp27-guide--clay  { --guide: var(--cp27-clay); }
.cp27-guide__kicker {
    margin: 0;
    font-family: var(--cp27-mono);
    font-weight: 800;
    font-size: 14px;
    line-height: 1.35;
    text-transform: uppercase;
    color: var(--cp27-plum);
}
.cp27-guide__title {
    margin: 0;
    font-family: var(--cp27-serif);
    font-weight: 600;
    font-size: clamp(24px, 2vw, 29px);
    line-height: 1.35;
    color: var(--cp27-plum);
}
.cp27-guide__text {
    margin: 0;
    max-width: 499px;
    font-family: var(--cp27-sans);
    font-size: 17px;
    line-height: 1.35;
    color: var(--cp27-plum);
}
.cp27-guide .cp27-manicule { margin-top: auto; align-items: center; }

/* ---- 5. Become a Local Community Partner --------------------------------- */

.cp27-invite {
    position: relative;
    isolation: isolate;
    z-index: 0;
    margin-top: 0;
    margin-bottom: -80px;                      /* runs under the community CTA's torn top edge */
    padding: calc(clamp(3rem, 4.9vw, 70px) + var(--cp27-torn) * .6) 0 calc(clamp(3rem, 4.9vw, 70px) + 80px);
    background: var(--cp27-tan);
    scroll-margin-top: 90px;
}
/* The cream band above tears into the tan: solid cream on top, ragged edge
   hanging into the tan band (the SVG is ragged on top, so it is flipped). */
.cp27-invite .cp27-tear {
    position: absolute;
    top: -1px;
    left: 0;
    margin: 0;
    z-index: 1;
    transform: scaleY(-1);
}
.cp27-invite__grid {
    display: grid;
    grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 90px);
    align-items: start;
    width: min(100% - (var(--space-page) * 2), 1260px);
}
.cp27-invite__panel {
    position: relative;
    min-height: 460px;
    padding: 64px 55px 60px;
    border-radius: 20px;
    background: var(--cp27-teal-panel);
    color: var(--cp27-cream);
    text-align: center;
    overflow: visible;
}
.cp27-invite__panel-clip {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    overflow: hidden;
    pointer-events: none;
}
.cp27-invite__eyebrow {
    margin: 0 0 36px;
    font-family: var(--cp27-mono);
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    color: var(--cp27-ochre);
}
.cp27-invite__title {
    margin: 0 0 clamp(40px, 5vw, 78px);
    font-family: var(--cp27-serif);
    font-weight: 600;
    font-size: 36px;
    line-height: 46px;
    color: var(--cp27-cream);
}
.cp27-invite__lead {
    position: relative;
    max-width: 380px;
    margin: 0 auto;
    font-family: var(--cp27-sans);
    font-size: 16px;
    line-height: 23px;
    color: var(--cp27-cream);
}
.cp27-invite__lead p { margin: 0; }
.cp27-invite__agave {
    position: absolute;
    top: -51px;
    right: 0;
    width: 97px;
    height: auto;
    transform: scaleX(-1);   /* mirrored: leaves point into the panel (Laura, 29 Oct) */
    pointer-events: none;
}
.cp27-invite__panel-clip img { z-index: 0; }
.cp27-invite__panel > :not(.cp27-invite__panel-clip) { position: relative; z-index: 1; }
.cp27-invite__corner {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 133px;
    height: 177px;
    object-fit: contain;
    object-position: left bottom;
    pointer-events: none;
}
.cp27-invite__body {
    padding-top: clamp(40px, 7.6vw, 110px);
    max-width: 610px;
}
.cp27-invite__body .cp27-intro p + p { margin-top: 26px; }
.cp27-invite__body .cp27-manicule { margin-top: 40px; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1100px) {
    .cp27-hero__art--left { display: none; }
    .cp27-hero__art--heart { right: 4%; }
}

@media (max-width: 900px) {
    /* Hero art never sits behind the copy: the collages move into a strip
       under the links (the hero gets 250px of extra bottom padding). */
    .cp27-hero { padding-bottom: calc(250px + var(--cp27-torn)); }
    .cp27-hero__inner { width: min(100% - (var(--space-page) * 2), 560px); }
    .cp27-hero__art--left { display: none; }
    /* One cluster at the right edge, same overlap as desktop: marigold behind
       top-right, heart over its lower-left, handwriting underneath. */
    .cp27-hero__art--paper  { top: auto; bottom: 0;     right: -8%; width: 250px; }
    .cp27-hero__art--flower { top: auto; bottom: 95px;  right: -6%; width: 205px; }
    .cp27-hero__art--heart  { top: auto; bottom: 40px;  right: 16%; width: 190px; opacity: 1; }
        .cp27-guides__grid { grid-template-columns: minmax(0, 1fr); }
    .cp27-invite__grid { grid-template-columns: minmax(0, 1fr); }
    .cp27-invite__body { padding-top: 0; }
    .cp27-invite__corner { display: none; }
}

@media (max-width: 720px) {
    .cp27-cards { grid-template-columns: minmax(0, 1fr); }
    .cp27-card--logo { padding-right: 22px; padding-bottom: 60px; }
    .cp27-card__logo { top: auto; bottom: 10px; right: 16px; width: 80px; height: 44px; transform: none; }
    .cp27-textlink { font-size: 17px; }
    .cp27-invite__panel { padding: 56px 28px 48px; min-height: 0; }
    .cp27-invite__title { font-size: 30px; line-height: 38px; }
}

@media (max-width: 480px) {
    .cp27-hero { padding-bottom: calc(235px + var(--cp27-torn)); }
    .cp27-hero__art--paper  { width: 210px; bottom: 0;    right: -12%; }
    .cp27-hero__art--flower { width: 170px; bottom: 80px; right: -10%; }
    .cp27-hero__art--heart  { width: 160px; bottom: 34px; right: 18%; }
    .cp27-hero__lede { font-size: 18px; line-height: 28px; }
    .cp27-jumplinks { flex-direction: column; gap: 10px; }
    .cp27-manicule__row { white-space: normal; }
}

@media (prefers-reduced-motion: no-preference) {
    .cp27 { scroll-behavior: smooth; }
}
