/* ==========================================================================
   StayHygge Portfolio — Frontend CSS Design System
   Scope: .shp-portfolio  |  Prefix: --shp-*  /  .shp-*
   Scandinavian-luxury aesthetic, mirrors stayhygge-services visual language.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens  (custom properties on the root scope element)
   Override at runtime via Task 7 inline <style>: .shp-portfolio { --shp-primary: ...; }
   Do NOT add !important here — tokens must remain overridable.
   -------------------------------------------------------------------------- */

.shp-portfolio {
    --shp-primary:      #2c2c2c;
    --shp-accent:       #b8956a;
    --shp-cta:          #2c2c2c;
    --shp-text:         #3a3a3a;
    --shp-text-light:   #8a8a8a;
    --shp-bg:           #ffffff;
    --shp-bg-alt:       #faf8f5;
    --shp-bg-dark:      #2f2b26;
    --shp-border:       #e8e4df;
    --shp-gold:         #b8956a;
    --shp-font:         'Quicksand', sans-serif;
    --shp-font-heading: 'Quicksand', sans-serif;
    --shp-radius:       2px;
    --shp-shadow:       0 2px 20px rgba(0, 0, 0, 0.04);
    --shp-shadow-lg:    0 8px 40px rgba(0, 0, 0, 0.08);
    --shp-transition:   0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --shp-max-width:    1200px;

    font-family: var(--shp-font);
    color: var(--shp-text);
    background-color: var(--shp-bg);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   2. Scoped Reset
   -------------------------------------------------------------------------- */

.shp-portfolio *,
.shp-portfolio *::before,
.shp-portfolio *::after {
    box-sizing: border-box;
}

.shp-portfolio h1,
.shp-portfolio h2,
.shp-portfolio h3,
.shp-portfolio h4,
.shp-portfolio h5,
.shp-portfolio h6,
.shp-portfolio p {
    margin: 0;
    padding: 0;
}

/* Headings use the (separately configurable) heading font; body inherits --shp-font. */
.shp-portfolio h1,
.shp-portfolio h2,
.shp-portfolio h3,
.shp-portfolio h4,
.shp-portfolio h5,
.shp-portfolio h6 {
    font-family: var(--shp-font-heading);
}

/* Baseline for content images. Wrapped in :where() so it has ZERO added
   specificity — component images (.shp-ba__img, .shp-gallery__img,
   .shp-hero__bg-img, .shp-card__img …) that need `height:100%; object-fit:cover`
   can override it by source order instead of being silently reset to auto. */
.shp-portfolio :where(img) {
    max-width: 100%;
    height: auto;
    display: block;
}

.shp-portfolio ul,
.shp-portfolio ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.shp-portfolio a {
    color: var(--shp-primary);
    text-decoration: none;
    transition: color var(--shp-transition);
}

.shp-portfolio a:hover {
    color: var(--shp-accent);
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

.shp-portfolio h1 {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.shp-portfolio h2 {
    font-size: 2.25rem;
    font-weight: 300;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.shp-portfolio h3 {
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1.35;
}

.shp-portfolio h4 {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.4;
}

.shp-portfolio p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--shp-text-light);
}

.shp-portfolio p + p {
    margin-top: 1em;
}

/* Eyebrow / label text */
.shp-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--shp-accent);
    margin-bottom: 12px;
}

/* Lead paragraph */
.shp-lead {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--shp-text-light);
}

/* Visually hidden (screen reader only) */
.shp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* --------------------------------------------------------------------------
   4. Container & Section Rhythm  [hook: .shp-container, .shp-section]
   -------------------------------------------------------------------------- */

.shp-container {
    max-width: var(--shp-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

.shp-section {
    padding-top: 96px;
    padding-bottom: 96px;
}

/* Section rhythm — alternate normal sections light/cream by DOM order so no two
   ever stack the same color (mirrors the listings plugin). Only rendered
   sections count, since empty sections return nothing. */
.shp-portfolio > section.shp-section:nth-of-type(odd)  { background-color: var(--shp-bg); }
.shp-portfolio > section.shp-section:nth-of-type(even) { background-color: var(--shp-bg-alt); }

/* Opinionated bands keep their own background regardless of position. Same
   specificity as the nth rules above; later source order wins. */
.shp-portfolio > section.shp-section.shp-hero          { background-color: transparent; }
.shp-portfolio > section.shp-section.shp-midcta        { background-color: var(--shp-bg-alt); }
.shp-portfolio > section.shp-section.shp-quote-section { background-color: var(--shp-bg-dark); }
.shp-portfolio > section.shp-section.shp-cta           { background-color: var(--shp-primary); }

/* Dark testimonial break — light text sitting directly on the dark band. */
.shp-quote-section .shp-quote {
    background-color: transparent;
    border-left: none;
    text-align: center;
    padding: 0;
    max-width: 760px;
    margin: 0 auto;
}
.shp-quote-section .shp-quote__text { color: #ffffff; }
.shp-quote-section .shp-quote__cite { color: rgba(255, 255, 255, 0.7); }

.shp-section__heading {
    font-size: 28px;
    font-weight: 300;
    line-height: 1.3;
    color: var(--shp-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
    margin-bottom: 0;
    position: relative;
    padding-bottom: 20px;
}

.shp-section__heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 1px;
    background-color: var(--shp-gold);
}

.shp-section__subheading {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--shp-text-light);
    text-align: center;
    max-width: 640px;
    margin: 20px auto 0;
}

.shp-section__header {
    margin-bottom: 48px;
}

/* --------------------------------------------------------------------------
   5. Button Styles
   -------------------------------------------------------------------------- */

.shp-btn {
    display: inline-block;
    padding: 14px 36px;
    border-radius: 0;
    font-family: var(--shp-font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color var(--shp-transition),
                color var(--shp-transition),
                border-color var(--shp-transition);
    white-space: nowrap;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
}

.shp-btn:focus-visible {
    outline: 3px solid var(--shp-accent);
    outline-offset: 3px;
}

.shp-btn:active {
    opacity: 0.9;
}

.shp-btn--primary {
    background-color: var(--shp-cta);
    color: #ffffff;
    border-color: var(--shp-cta);
}

.shp-btn--primary:hover {
    background-color: var(--shp-accent);
    border-color: var(--shp-accent);
    color: #ffffff;
}

.shp-btn--accent {
    background-color: var(--shp-accent);
    color: #ffffff;
    border-color: var(--shp-accent);
}

.shp-btn--accent:hover {
    background-color: var(--shp-cta);
    border-color: var(--shp-cta);
    color: #ffffff;
}

.shp-btn--outline {
    background-color: transparent;
    color: var(--shp-primary);
    border-color: var(--shp-primary);
}

.shp-btn--outline:hover {
    background-color: var(--shp-primary);
    color: #ffffff;
}

.shp-btn--ghost {
    background-color: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.6);
}

.shp-btn--ghost:hover {
    background-color: #ffffff;
    color: var(--shp-text);
    border-color: #ffffff;
}

.shp-btn--lg {
    padding: 18px 40px;
    font-size: 1.0625rem;
}

.shp-btn--sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

.shp-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* --------------------------------------------------------------------------
   6. Hero  [hook: .shp-hero]
   Task 7 sets background-image via inline style; overlay opacity via
   --shp-hero-overlay (defaults to 0.45 if not overridden).
   -------------------------------------------------------------------------- */

.shp-hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ffffff;
}

.shp-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* The hero media is a real <img>/<video>/<iframe> element (not a CSS
   background), so it must be told to fill and cover the hero — otherwise the
   generic `.shp-portfolio img { height: auto }` reset leaves it at its
   intrinsic size with gaps around it. */
.shp-hero__bg-img,
.shp-hero__video,
.shp-hero__video-embed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 0;
}

.shp-hero__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, var(--shp-hero-overlay, 0.45));
    z-index: 1;
}

/* Feather-edge fade into page background */
.shp-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, var(--shp-bg), transparent);
    z-index: 2;
    pointer-events: none;
}

.shp-hero__content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 80px 24px;
    max-width: 860px;
}

.shp-hero__title {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.shp-hero__subtitle {
    font-size: 1.25rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
}

.shp-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 28px;
}

.shp-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --------------------------------------------------------------------------
   7. Gallery  [hooks: .shp-gallery, .shp-gallery__item--featured]

   Uniform CSS grid: first item spans 2x2 as a featured tile; items past the
   initial count carry .shp-gallery__item--hidden until "Show more". JS lightbox
   opens on .shp-gallery__item click, scoped per [data-shp-gallery-group].
   -------------------------------------------------------------------------- */

.shp-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 240px;
    grid-auto-flow: row dense;
    gap: 16px;
}

.shp-gallery__heading {
    font-size: 1.25rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--shp-primary);
    text-align: center;
    margin-bottom: 24px;
}

.shp-gallery-block + .shp-gallery-block {
    margin-top: 56px;
}

.shp-gallery__item {
    position: relative;
    overflow: hidden;
    border-radius: var(--shp-radius);
    cursor: pointer;
    background-color: var(--shp-bg-alt);
    grid-row: span 1; /* landscape / square: one base row */
}

/* Portrait shots take a taller tile so they show (nearly) fully, not cropped. */
.shp-gallery__item--portrait {
    grid-row: span 2;
}

/* Featured (first) tile always spans a 2x2 block, whatever its orientation. */
.shp-gallery__item--featured {
    grid-column: span 2;
    grid-row: span 2;
}

.shp-gallery__item--hidden {
    display: none;
}

.shp-gallery__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--shp-transition);
}

.shp-gallery__item:hover .shp-gallery__img {
    transform: scale(1.04);
}

.shp-gallery__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity var(--shp-transition);
}

.shp-gallery__item:hover .shp-gallery__caption {
    opacity: 1;
}

.shp-gallery__more-wrap {
    text-align: center;
    margin-top: 32px;
}

/* --------------------------------------------------------------------------
   8. Before / After Slider Frame  [hook: .shp-ba]

   State contract for Task 8 JS:
   - The "after" panel's width is driven by JS setting inline style:
     .shp-ba__after { width: <percentage>%; }  (default 50%)
   - The handle is positioned via JS updating:
     .shp-ba__handle { left: <percentage>%; }  (default 50%)
   - No active/open class needed; all state is numeric inline styles.
   - Dragging: Task 8 binds pointerdown on .shp-ba__handle.
   -------------------------------------------------------------------------- */

.shp-ba-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.shp-ba {
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--shp-radius);
    --shp-ba-pos: 50%;
    user-select: none;
    touch-action: pan-y;
    cursor: col-resize;
    line-height: 0; /* prevent inline-block gap under images */
}

.shp-ba__before,
.shp-ba__after {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* "After" (right side, matching the top-right tag) is revealed by clipping the
   left portion up to the slider position; "before" shows through on the left. */
.shp-ba__after {
    clip-path: inset(0 0 0 var(--shp-ba-pos));
}

.shp-ba__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.shp-ba__tag {
    position: absolute;
    top: 10px;
    z-index: 3;
    padding: 3px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    pointer-events: none;
}

.shp-ba__tag--before { left: 10px; }
.shp-ba__tag--after  { right: 10px; }

.shp-ba__caption {
    margin-top: 12px;
    text-align: center;
    color: var(--shp-text-light);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Draggable handle — position driven by the --shp-ba-pos custom property */
.shp-ba__handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--shp-ba-pos);
    width: 4px;
    transform: translateX(-50%);
    background-color: #ffffff;
    z-index: 3;
    cursor: ew-resize;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Circular grip on the handle */
.shp-ba__handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: var(--shp-shadow);
    /* Chevron arrows hint — decorative, via background SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232c2c2c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3Cpolyline points='15 18 9 12 15 6' transform='translate(0,0)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
}

/* --------------------------------------------------------------------------
   9. Project Details  [hook: .shp-details]
   Spec table / key-value list for project metadata.
   -------------------------------------------------------------------------- */

.shp-details {
    background-color: var(--shp-bg-alt);
    border-radius: var(--shp-radius);
    padding: 32px;
    border: 1px solid var(--shp-border);
}

.shp-details__title {
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--shp-text);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--shp-border);
}

.shp-details__table {
    width: 100%;
    border-collapse: collapse;
}

.shp-details__row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--shp-border);
    font-size: 0.9375rem;
    align-items: baseline;
}

.shp-details__row:last-child {
    border-bottom: none;
}

.shp-details__key {
    flex: 0 0 140px;
    font-weight: 600;
    color: var(--shp-text);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.shp-details__value {
    flex: 1;
    color: var(--shp-text-light);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   10. Story / Narrative Section  [hook: .shp-story]
   Long-form editorial prose block.
   -------------------------------------------------------------------------- */

.shp-story {
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    padding-top: 56px;
}

.shp-story h2,
.shp-story h3 {
    color: var(--shp-text);
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.shp-story p {
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--shp-text-light);
}

.shp-story p + p {
    margin-top: 1.25em;
}

.shp-story ul,
.shp-story ol {
    list-style: disc;
    padding-left: 1.5em;
    margin: 1em 0;
    color: var(--shp-text-light);
}

.shp-story li {
    margin-bottom: 0.5em;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.shp-story img {
    border-radius: var(--shp-radius);
    margin: 2em 0;
    box-shadow: var(--shp-shadow);
}

/* --------------------------------------------------------------------------
   11. Pull Quote  [hook: .shp-quote]
   -------------------------------------------------------------------------- */

.shp-quote {
    position: relative;
    padding: 40px 48px;
    background-color: var(--shp-bg-alt);
    border-left: 4px solid var(--shp-accent);
    border-radius: var(--shp-radius);
    margin: 2em 0;
}

.shp-quote::before {
    content: '\201C';
    position: absolute;
    top: 16px;
    left: 24px;
    font-size: 4rem;
    line-height: 1;
    color: var(--shp-accent);
    opacity: 0.3;
    font-family: Georgia, serif;
}

.shp-quote__text {
    font-size: 1.25rem;
    font-style: italic;
    line-height: 1.7;
    color: var(--shp-text);
    font-weight: 500;
    margin-bottom: 16px;
}

.shp-quote__cite {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--shp-primary);
    font-style: normal;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   12. Related Projects Grid  [hook: .shp-related]
   -------------------------------------------------------------------------- */

.shp-related {
    border-top: 1px solid var(--shp-border);
    padding-top: 64px;
}

.shp-related__heading {
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--shp-text);
    margin-bottom: 32px;
    text-align: center;
}

.shp-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* --------------------------------------------------------------------------
   13. CTA Band  [hook: .shp-cta]
   Full-width call-to-action section.
   -------------------------------------------------------------------------- */

.shp-cta {
    position: relative;
    padding: 72px 24px;
    background-color: var(--shp-primary);
    color: #ffffff;
    text-align: center;
    overflow: hidden;
}

.shp-cta--accent {
    background-color: var(--shp-accent);
}

/* Subtle decorative circle behind content */
.shp-cta::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.shp-cta__inner {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.shp-cta__heading {
    font-size: 2rem;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.shp-cta__body {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.75;
    margin-bottom: 32px;
}

.shp-cta .shp-btn-group {
    justify-content: center;
}

/* --------------------------------------------------------------------------
   14. Archive Grid  [hooks: .shp-grid, .shp-card]
   Used by the archive page / shortcode listing.
   -------------------------------------------------------------------------- */

.shp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

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

.shp-card {
    background-color: var(--shp-bg);
    border-radius: var(--shp-radius);
    box-shadow: var(--shp-shadow);
    overflow: hidden;
    border: 1px solid var(--shp-border);
    transition: transform var(--shp-transition),
                box-shadow var(--shp-transition);
    display: flex;
    flex-direction: column;
}

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

.shp-card__image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    flex-shrink: 0;
}

.shp-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--shp-transition);
}

.shp-card:hover .shp-card__img {
    transform: scale(1.04);
}

.shp-card__body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.shp-card__category {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--shp-accent);
    margin-bottom: 6px;
}

.shp-card__title {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--shp-text);
    margin-bottom: 8px;
    line-height: 1.35;
}

.shp-card__excerpt {
    font-size: 0.9375rem;
    color: var(--shp-text-light);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 16px;
}

.shp-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--shp-text-light);
    align-items: center;
}

.shp-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.shp-card__link:hover .shp-card__title {
    color: var(--shp-primary);
}

/* Badge / tag on card image */
.shp-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background-color: var(--shp-accent);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   15. Filter Tabs  [hook: .shp-filters]

   State contract for Task 9 JS:
   - Active filter button: add class .shp-filters__btn--active  AND
     set aria-pressed="true" on the button.
   - JS toggles .shp-card[data-category] visibility on click.
   -------------------------------------------------------------------------- */

.shp-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    align-items: center;
}

.shp-filters__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--shp-text-light);
    margin-right: 4px;
}

.shp-filters__btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 100px;
    font-family: var(--shp-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--shp-text-light);
    background-color: var(--shp-bg-alt);
    border: 1.5px solid var(--shp-border);
    cursor: pointer;
    transition: color var(--shp-transition),
                background-color var(--shp-transition),
                border-color var(--shp-transition);
}

.shp-filters__btn:hover {
    color: var(--shp-primary);
    border-color: var(--shp-primary);
    background-color: rgba(44, 44, 44, 0.07);
}

/* Active state — toggled by Task 9 JS */
.shp-filters__btn--active,
.shp-filters__btn[aria-pressed="true"] {
    color: #ffffff;
    background-color: var(--shp-primary);
    border-color: var(--shp-primary);
}

.shp-filters__btn:focus-visible {
    outline: 3px solid var(--shp-accent);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   16. Carousel  [hook: .shp-carousel]

   State contract for Task 8 JS:
   - Track: translate via transform: translateX(-<N * 100>%) or JS
     sets --shp-carousel-offset custom property:
       .shp-carousel__track { transform: translateX(var(--shp-carousel-offset, 0)); }
   - Task 8 sets --shp-carousel-offset on .shp-carousel__track.
   - Active dot: .shp-carousel__dot--active (added/removed by Task 8).
   - Disabled prev/next: set disabled attribute; CSS handles appearance.
   - Auto-advance: Task 8 starts a setInterval; reduced-motion block stops it.
   -------------------------------------------------------------------------- */

.shp-carousel {
    position: relative;
    overflow: hidden;
}

.shp-carousel__viewport {
    overflow: hidden;
    border-radius: var(--shp-radius);
}

.shp-carousel__track {
    display: flex;
    transition: transform var(--shp-transition);
    will-change: transform;
    transform: translateX(var(--shp-carousel-offset, 0));
}

.shp-carousel__slide {
    flex: 0 0 100%;
    min-width: 0;
}

/* Prev / Next arrow buttons */
.shp-carousel__prev,
.shp-carousel__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--shp-text);
    box-shadow: var(--shp-shadow);
    transition: background-color var(--shp-transition),
                color var(--shp-transition),
                transform var(--shp-transition);
}

.shp-carousel__prev {
    left: 12px;
}

.shp-carousel__next {
    right: 12px;
}

.shp-carousel__prev:hover,
.shp-carousel__next:hover {
    background-color: var(--shp-primary);
    color: #ffffff;
}

.shp-carousel__prev:focus-visible,
.shp-carousel__next:focus-visible {
    outline: 3px solid var(--shp-accent);
    outline-offset: 3px;
}

.shp-carousel__prev:disabled,
.shp-carousel__next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Dot pagination */
.shp-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.shp-carousel__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--shp-border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color var(--shp-transition),
                transform var(--shp-transition);
}

.shp-carousel__dot--active,
.shp-carousel__dot[aria-current="true"] {
    background-color: var(--shp-primary);
    transform: scale(1.4);
}

.shp-carousel__dot:focus-visible {
    outline: 3px solid var(--shp-accent);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   17. Lightbox Overlay  [hook: .shp-lightbox]

   State contract for Task 8 JS:
   - Hidden state:  display:none  (default)
   - Open state:    Task 8 adds class .shp-lightbox--open, which sets
                    display:flex + triggers opacity transition
                    via .shp-lightbox--visible (added on next frame).
   - Sequence: open click → add .shp-lightbox--open → requestAnimationFrame
               → add .shp-lightbox--visible → fade in.
   - Close:    remove .shp-lightbox--visible → wait transitionend →
               remove .shp-lightbox--open.
   - Task 8 populates .shp-lightbox__img src and sets alt text.
   - Navigation: Task 8 binds prev/next to cycle gallery images.
   -------------------------------------------------------------------------- */

.shp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Step 1: make it a flex container so children lay out */
.shp-lightbox--open {
    display: flex;
}

/* Step 2: animate to visible (Task 8 adds on next frame) */
.shp-lightbox--visible {
    opacity: 1;
}

.shp-lightbox__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.shp-lightbox__figure {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shp-lightbox__img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    box-shadow: var(--shp-shadow-lg);
}

.shp-lightbox__caption {
    margin-top: 12px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.shp-lightbox__close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--shp-transition);
    line-height: 1;
}

.shp-lightbox__close:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.shp-lightbox__close:focus-visible {
    outline: 3px solid var(--shp-accent);
    outline-offset: 3px;
}

.shp-lightbox__prev,
.shp-lightbox__next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--shp-transition);
}

.shp-lightbox__prev {
    left: 16px;
}

.shp-lightbox__next {
    right: 16px;
}

.shp-lightbox__prev:hover,
.shp-lightbox__next:hover {
    background-color: rgba(255, 255, 255, 0.28);
}

.shp-lightbox__prev:focus-visible,
.shp-lightbox__next:focus-visible {
    outline: 3px solid var(--shp-accent);
    outline-offset: 3px;
}

/* Counter: "3 / 12" */
.shp-lightbox__counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 2;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.shp-text-center  { text-align: center; }
.shp-text-left    { text-align: left; }
.shp-text-right   { text-align: right; }

.shp-color-primary { color: var(--shp-primary); }
.shp-color-accent  { color: var(--shp-accent); }
.shp-color-muted   { color: var(--shp-text-light); }

.shp-divider {
    border: none;
    border-top: 1px solid var(--shp-border);
    margin: 40px 0;
}

/* Badge pill */
.shp-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background-color: var(--shp-bg-alt);
    color: var(--shp-text);
}

.shp-badge--primary {
    background-color: rgba(44, 44, 44, 0.14);
    color: var(--shp-primary);
}

.shp-badge--accent {
    background-color: rgba(184, 149, 106, 0.12);
    color: var(--shp-accent);
}

/* ==========================================================================
   Construction Phases  [hook: .shp-phases-section, .shp-phase]
   ========================================================================== */

.shp-phase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    margin-bottom: 72px;
}

.shp-phase:last-child {
    margin-bottom: 0;
}

/* Zig-zag by explicit column placement — NOT `order`, which would drop the
   media below the full-width image grid / Load-more in the same grid flow. */
.shp-phase__media { grid-column: 1; grid-row: 1; }
.shp-phase__body  { grid-column: 2; grid-row: 1; }
.shp-phase--reverse .shp-phase__media { grid-column: 2; }
.shp-phase--reverse .shp-phase__body  { grid-column: 1; }

.shp-phase__img {
    width: 100%;
    height: auto;
    display: block;
}

.shp-phase__num {
    display: block;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--shp-gold);
    line-height: 1;
    margin-bottom: 12px;
}

.shp-phase__title {
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--shp-primary);
    margin-bottom: 16px;
}

.shp-phase__text {
    color: var(--shp-text);
}

.shp-phase__text p {
    margin: 0 0 1em;
}

.shp-phase__text p:last-child {
    margin-bottom: 0;
}

.shp-phase__grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.shp-phase__grid-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .shp-phase {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .shp-phase__media,
    .shp-phase__body,
    .shp-phase--reverse .shp-phase__media,
    .shp-phase--reverse .shp-phase__body {
        grid-column: 1;
        grid-row: auto;
    }
}

/* ==========================================================================
   Responsive — 1024px Tablet
   ========================================================================== */

@media (max-width: 1024px) {
    .shp-portfolio h1          { font-size: 2.5rem; }
    .shp-portfolio h2          { font-size: 2rem; }
    .shp-section               { padding-top: 64px; padding-bottom: 64px; }

    .shp-hero__title           { font-size: 2.75rem; }

    .shp-gallery { grid-template-columns: repeat(2, 1fr); }
    .shp-gallery__item--featured { grid-column: span 2; grid-row: span 2; }

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

    .shp-related__grid         { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Responsive — 768px Mobile
   ========================================================================== */

@media (max-width: 768px) {
    .shp-portfolio h1           { font-size: 2rem; }
    .shp-portfolio h2           { font-size: 1.625rem; }
    .shp-portfolio h3           { font-size: 1.25rem; }
    .shp-section__heading       { font-size: 1.625rem; }
    .shp-section__subheading    { font-size: 1rem; margin-bottom: 32px; }
    .shp-section                { padding-top: 48px; padding-bottom: 48px; }
    .shp-section__header        { margin-bottom: 32px; }

    .shp-container              { padding-left: 16px; padding-right: 16px; }

    .shp-ba-grid                { grid-template-columns: 1fr; }

    .shp-hero                   { min-height: 65vh; }
    .shp-hero__title            { font-size: 2rem; }
    .shp-hero__subtitle         { font-size: 1.0625rem; }
    .shp-hero__content          { padding: 60px 16px; }

    .shp-gallery { grid-template-columns: 1fr; }
    .shp-gallery__item--featured { grid-column: span 1; grid-row: span 1; }
    .shp-gallery__item--portrait { grid-row: span 2; }

    .shp-grid--2,
    .shp-grid--3,
    .shp-grid--4                { grid-template-columns: 1fr; }

    .shp-related__grid          { grid-template-columns: 1fr; }

    .shp-details                { padding: 20px; }
    .shp-details__key           { flex: 0 0 110px; }

    .shp-quote                  { padding: 28px 24px 28px 32px; }
    .shp-quote__text            { font-size: 1.0625rem; }

    .shp-cta                    { padding: 56px 16px; }
    .shp-cta__heading           { font-size: 1.5rem; }

    .shp-btn--lg                { padding: 16px 28px; font-size: 1rem; }

    .shp-btn-group              { flex-direction: column; align-items: stretch; }
    .shp-btn-group .shp-btn     { text-align: center; }

    .shp-filters                { gap: 6px; }

    .shp-carousel__prev         { left: 4px; }
    .shp-carousel__next         { right: 4px; }

    .shp-lightbox__prev         { left: 4px; }
    .shp-lightbox__next         { right: 4px; }
}

/* ==========================================================================
   Responsive — 480px Extra Small
   ========================================================================== */

@media (max-width: 480px) {
    .shp-portfolio h1    { font-size: 1.75rem; }
    .shp-portfolio h2    { font-size: 1.5rem; }
    .shp-hero__title     { font-size: 1.75rem; }
    .shp-section__heading { font-size: 1.5rem; }
}

/* ==========================================================================
   Reduced Motion — disable all transitions and animations
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .shp-portfolio *,
    .shp-portfolio *::before,
    .shp-portfolio *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Carousel: suppress track slide transition (Task 8 JS checks this via
       matchMedia and skips auto-advance / uses instant transforms) */
    .shp-carousel__track {
        transition: none !important;
    }

    /* Lightbox: suppress opacity fade */
    .shp-lightbox {
        transition: none !important;
    }

    /* Before/after: no smooth drag animation */
    .shp-ba__after {
        transition: none !important;
    }

    /* Cards: no lift on hover */
    .shp-card:hover {
        transform: none;
    }

    .shp-gallery__item:hover .shp-gallery__img {
        transform: none;
    }
}

/* ==========================================================================
   Conversion CTAs — hero button, mid-page band, sticky pill
   ========================================================================== */

.shp-hero__cta {
    margin-top: 28px;
}

.shp-midcta {
    padding-top: 56px;
    padding-bottom: 56px;
    background-color: var(--shp-bg-alt);
}

.shp-midcta__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.shp-midcta__text {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: var(--shp-primary);
}

.shp-sticky-cta {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: inline-block;
    padding: 14px 28px;
    background-color: var(--shp-cta);
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    box-shadow: var(--shp-shadow-lg);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity var(--shp-transition), transform var(--shp-transition), background-color var(--shp-transition);
}

.shp-sticky-cta--visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.shp-sticky-cta:hover {
    background-color: var(--shp-accent);
    color: #ffffff;
}

@media (max-width: 768px) {
    .shp-sticky-cta {
        left: 16px;
        right: 16px;
        bottom: 16px;
        text-align: center;
    }
}

.shp-section__eyebrow {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--shp-gold);
    margin: 0 0 12px;
}

/* ==========================================================================
   Scroll reveal — only active under the JS-added .shp-reveal-on root class,
   so no-JS and prefers-reduced-motion always show content.
   ========================================================================== */

.shp-reveal-on .shp-section:not(.shp-hero) {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.shp-reveal-on .shp-section.shp-in-view {
    opacity: 1;
    transform: none;
}

/* Before/after highlight reel — hidden sliders + "Load more". */
.shp-ba-item--hidden {
    display: none;
}

.shp-ba-more-wrap {
    text-align: center;
    margin-top: 32px;
}

/* Phase image grid — show a few, reveal the rest on "Load more".
   Scoped under .shp-portfolio so it beats the `.shp-portfolio img { display:block }`
   reset (which otherwise keeps "hidden" phase images visible). */
.shp-portfolio .shp-phase__grid-img--hidden {
    display: none;
}

.shp-phase__more-wrap {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 4px;
}

/* Phase images open the lightbox (like the galleries). */
.shp-phase__img,
.shp-phase__grid-img {
    cursor: pointer;
}

/* Related links (services / pages) — a compact centered row at the bottom. */
.shp-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 32px;
}

.shp-links__link {
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--shp-primary);
    border-bottom: 1px solid var(--shp-gold);
    padding-bottom: 3px;
}

.shp-links__link:hover {
    color: var(--shp-accent);
}

/* ==========================================================================
   Portfolio overview — Featured spotlight + category sections
   ========================================================================== */

.shp-spotlight {
    margin-bottom: 64px;
}

/* Spotlight = a full-width editorial card. */
.shp-card--spotlight {
    max-width: none;
}
/* Editorial layout: image left, text right, vertically centered. */
.shp-card--spotlight .shp-card__link {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
    gap: 44px;
}
.shp-card--spotlight .shp-card__image-wrap {
    aspect-ratio: 3 / 2;
}
.shp-card--spotlight .shp-card__body {
    text-align: left;
    padding: 0;
}
.shp-card--spotlight .shp-card__title {
    font-size: 2rem;
}
.shp-card--spotlight .shp-cat__count,
.shp-cat__count {
    color: var(--shp-text-light);
    font-size: 0.7em;
    margin-left: 6px;
}

.shp-cat {
    margin-bottom: 56px;
}
.shp-cat:last-child {
    margin-bottom: 0;
}
.shp-cat__heading {
    font-size: 1.25rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shp-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--shp-border);
}

@media (max-width: 900px) {
    .shp-card--spotlight .shp-card__link { grid-template-columns: 1fr; gap: 20px; }
    .shp-card--spotlight .shp-card__body { text-align: center; }
    .shp-card--spotlight .shp-card__title { font-size: 1.5rem; }
}

/* Optional card highlights (shortcode highlights="true") — key facts + Learn more. */
.shp-card__highlights {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}
.shp-card__highlights li {
    position: relative;
    padding-left: 16px;
    font-size: 0.9rem;
    color: var(--shp-text);
    line-height: 1.7;
}
.shp-card__highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--shp-gold);
}
.shp-card__more {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
    color: var(--shp-accent);
}

/* Shortcode embed — transparent so it blends into the host page section. */
.shp-portfolio.shp-portfolio--embed {
    background-color: transparent;
}

/* Portfolio overview intro header. */
.shp-overview-header {
    text-align: center;
    padding-top: 24px;
    margin-bottom: 40px;
}
.shp-overview-header__title {
    font-size: 2.25rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--shp-primary);
}
.shp-overview-header__intro {
    max-width: 640px;
    margin: 16px auto 0;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--shp-text-light);
}
