/* =========================================
   PRACTICE PAGE - EDITORIAL LAYOUT
   ========================================= */

/* Main Container */
.horizontal-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    height: auto;
    overflow: visible;
    display: block;
    position: relative;
    padding: 150px 60px 100px; /* site-wide top-heading standard: text at 150px */
}

.panel.panel-1 {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 50px;
}

/* Visual space around both divider lines matches (74px above, 104px below) */
.panel.panel-2 {
    padding-top: 50px;
    padding-bottom: 74px;
}

.panel.panel-3 {
    padding-top: 104px;
}

/* Divider lines between the three groupings */
.line-white {
    width: 100%;
    height: 1px;
    background-color: var(--border-light);
}

.panel {
    width: 100%;
    min-height: auto; 
    display: flex;
    align-items: flex-start; 
    justify-content: space-between;
    padding: 75px 0;
    gap: 3.75rem;
    background-color: transparent;
    overflow: visible;
    margin-top: 0;
}

.practice-text-col,
.practice-image-col {
    flex: 1;
    width: 50%;
    position: relative;
}

/* =========================================
   IMAGE STYLING
   ========================================= */
.practice-image-col img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    border-radius: 2px;
}

/* =========================================
   TEXT STYLING
   ========================================= */
.practice-text-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0;
}

.practice-text-col h2 {
    font-family: var(--font-body, sans-serif);
    font-size: 1.05rem;
    font-weight: 400;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    line-height: 1.1;
    color: var(--text-main);
    margin-top: 0;
}

.practice-text-col p {
    font-family: var(--font-body, sans-serif);
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    max-width: none;
    text-align: justify;
}

.practice-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 3rem;
    list-style: none;
    padding: 0;
}

.practice-links li a {
    font-family: var(--font-heading, sans-serif);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-main);
    text-decoration: none;
    padding-bottom: 5px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.practice-links li a:hover {
    border-color: var(--text-main);
}

body:not(.dark-mode) .practice-links li a {
    font-weight: 600;
}

/* =========================================
   DESKTOP LAYOUT (> 992px) - ZIG ZAG
   ========================================= */
@media (min-width: 992px) {

    .panel:nth-of-type(odd) {
        flex-direction: row;
    }

    .panel:nth-of-type(even) {
        flex-direction: row-reverse;
    }

    /* Image top sits on the first text line's letter tops
       (h2 line + hairline + heading margin + glyph offset) */
    .practice-image-col {
        margin-top: calc(1.05rem * 1.1 + 25.6px);
    }

    /* Panels 1 & 2: image stretches so its bottom meets the last text element
       (100% minus that element's trailing margin) */
    .panel-1,
    .panel-2,
    .panel-3 {
        align-items: stretch;
    }

    /* About Us photo column matches the Ethos column below it (405px right rail);
       the slightly tighter gutter keeps "...and support." on one line */
    .panel.panel-1 {
        gap: 52px;
    }

    .panel-1 .practice-image-col {
        flex: 0 0 405px;
        width: auto;
    }

    /* Body text sized so the last line bottom-aligns with the photo */
    .panel-1 .practice-text-col p {
        font-size: 0.88rem;
        font-weight: 500;
    }

    .panel-1 .practice-image-col img {
        height: auto;
        aspect-ratio: auto;
    }

    /* Meet the Team: staff photo (1.5x its former size) with the studio
       artwork beside it, both under the heading */
    /* The photo stretches with the column (= Ethos text height at any window
       width): top at the Ethos glyph tops, bottom at the last line's glyphs
       (11px offsets the last paragraph's trailing margin + glyph inset) */
    .team-photos {
        display: flex;
        align-items: stretch;
        gap: 30px;
        flex: 1 1 auto;
        margin-top: 6px;
        margin-bottom: 11px;
        min-height: 0;
    }

    .team-photos a {
        display: block;
        width: 100%;
    }

    .team-photos img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        clip-path: inset(0 0 4px 0); /* bottom 4px cropped, position unchanged */
    }

    .panel-1 .practice-image-col img {
        clip-path: inset(0 0 4px 0); /* bottom 4px cropped, position unchanged */
    }
}

/* Clients & Collaborators: equal-cell wall of monochrome ink logos.
   Light mode shows them as dark marks; dark mode inverts them to white. */
.client-logos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 48px 56px;
    align-items: center;
    margin-top: 40px;
}

.client-logos img {
    display: block;
    margin: 0 auto;
    max-height: 52px;
    max-width: 130px;
    width: auto;
    height: auto;
    opacity: 0.92;
}

body.dark-mode .client-logos img {
    filter: invert(1);
    opacity: 0.95;
}

/* Per-logo size tweaks */
.client-logos img[src*="eos-hospitality"] {
    max-height: 62px;
}

/* Ethos sub-headings: quiet small-caps lead-ins in the site voice */
.ethos-sub {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-main);
    margin: 1.6rem 0 0.5rem;
}

.ethos-col h2 + .ethos-sub,
.panel-body > .ethos-sub:first-child {
    margin-top: 0;
}

/* The embedded team list only exists on mobile */
.team-embed {
    display: none;
}

/* "Meet the Team" heading links to the people page (like the photo) */
.team-col h2 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.team-col h2 a:hover {
    opacity: 0.7;
}

@media (min-width: 992px) {

    /* Ethos fills from the gutter to the right margin */
    .ethos-col {
        flex: 1;
    }

    /* Section order swapped on desktop: Meet the Team + Our Ethos first,
       About Us below. Paddings mirror so the top heading stays at 180px. */
    .horizontal-container {
        display: flex;
        flex-direction: column;
    }

    .panel.panel-2 {
        order: 1;
        padding-top: 0;
        padding-bottom: 50px;
    }

    .panel.panel-1 {
        order: 2;
        padding-top: 50px;
        padding-bottom: 50px;
        position: relative;
    }

    .panel.panel-3 {
        order: 3;
        padding-top: 50px;
        padding-bottom: 74px;
        position: relative;
    }

    /* About Us / Clients hairlines run the full panel width */
    .panel-1 .practice-text-col h2,
    .panel-3 .practice-text-col h2 {
        border-bottom: none;
    }

    .panel-1::after,
    .panel-3::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: calc(50px + 1.05rem * 1.1 + 9px); /* padding + h2 line + its 9px gap */
        height: 1px;
        background-color: var(--border-light);
    }

    /* Merged section: Meet the Team column hugs its photo, Ethos follows it.
       Gutter = vertical space between the About Us photo and the Ethos heading */
    .panel.panel-2 {
        flex-direction: row;
        justify-content: flex-start;
        gap: 28px; /* Ethos wide enough that Range holds 3 lines, Collaboration 2 */
    }

    .team-col {
        flex: 0 0 473px;
        width: auto;
    }

    .team-col h2 {
        flex-shrink: 0;
    }

    /* The accordion wrapper passes the column height through to the photo */
    .team-col .panel-body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* Ethos text matches the About Us text: same size/weight/gap */
    .ethos-col p {
        font-size: 0.88rem;
        font-weight: 500;
        margin-bottom: 0.66rem;
    }
}

/* About Us photo: whole image, natural proportions, no crop (all breakpoints) */
.panel-1 .practice-image-col img {
    aspect-ratio: auto;
    height: auto;
    object-fit: contain;
}

/* Tighter paragraph rhythm in About Us */
.panel-1 .practice-text-col p {
    margin-bottom: 1rem;
}

/* Desktop: gap tuned so the last text line's letter bottoms meet the photo bottom */
@media (min-width: 992px) {
    .panel-1 .practice-text-col p {
        margin-bottom: 0.96rem;
    }
}

/* =========================================
   MOBILE LAYOUT (< 991px) - STACKED
   ========================================= */
@media (max-width: 991px) {
    .horizontal-container {
        padding: 120px 20px 60px;
    }

    .panel,
    .panel.panel-1,
    .panel.panel-2,
    .panel.panel-3 {
        flex-direction: column-reverse !important;
        padding: 32px 0;
        gap: 24px;
    }

    /* Merged panel on mobile: Ethos rises above Meet the Team, so the order
       reads About Us / Ethos / Meet the Team. Gap matches the 64px between
       the About Us and Ethos headings so all three space equally. */
    .panel.panel-2 {
        flex-direction: column !important;
        gap: 64px;
    }

    .ethos-col {
        order: -1;
    }

    /* Meet the Team expands into the team list: single column, bios open */
    .team-embed {
        display: block;
        padding-top: 8px;
    }

    .team-embed .team-grid {
        display: flex;
        flex-direction: column;
        gap: 48px;
    }

    .team-embed .team-member {
        max-width: none;
    }

    .team-embed .team-bio {
        max-height: none;
        opacity: 1;
        overflow: visible;
        margin-top: 12px;
    }

    .practice-text-col,
    .practice-image-col {
        width: 100%;
        flex: none;
    }

    .practice-text-col h2 {
        font-size: 1.05rem;
        padding-bottom: 5px;
        margin-bottom: 6px;
        margin-top: 0;
    }

    .practice-image-col img {
        height: auto;
        max-height: 50vh;
        aspect-ratio: auto;
    }

    .practice-text-col p {
        max-width: 100%;
    }

    /* No pictures on the mobile practice page — text-only accordions */
    .practice-image-col,
    .team-photos {
        display: none !important;
    }

    /* Heading tap toggles the accordion; the link is desktop-only */
    .team-col h2 a {
        pointer-events: none;
    }

    /* Accordion: each heading opens its own section (see practice-accordion.js) */
    .practice-text-col h2 {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .panel-toggle-icon {
        font-size: 1.35rem;
        font-weight: 300;
        line-height: 1;
        letter-spacing: 0;
        transition: transform 0.3s ease;
    }

    .panel-body {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.5s ease, opacity 0.4s ease;
    }

    .practice-text-col.open .panel-body {
        max-height: 12000px; /* tall enough for the embedded team list */
        opacity: 1;
        transition: max-height 0.7s ease, opacity 0.5s ease 0.1s;
    }

    /* Section images tuck away with their text */
    .panel:not(.open) .practice-image-col {
        display: none;
    }
}

/* The accordion toggle only exists visually on mobile */
@media (min-width: 992px) {
    .panel-toggle-icon {
        display: none;
    }
}
