/* =========================================================================
   MY BOARDS / DECKS STUDIO / COLLAGE STUDIO (boards.html, decks.html,
   collages.html)
   =========================================================================
   The same look as the redesigned board page (board_detail.css) and the
   landing page (home.css): each page sits in one white panel on a light
   grey background, with a left-aligned header (title, "@user", avatar on
   the right, compact outline buttons) and a calm grid of rounded covers
   with the name and count underneath.

   Linked from all three templates, scoped to body.studio-list-body.
   Every rule is prefixed "html body.studio-list-body main..." so it
   outranks the older layers in style.css without editing them. Only
   looks change - no markup is added, removed or reordered, so
   drag-to-reorder, the "..." menus, Sort/New/Export and the create
   modals all keep working as before. Collage Studio reuses the decks-*
   classes, so it's covered by the same rules as Decks Studio. */

html body.studio-list-body {
    background: #f7f7f7 !important;
}

html body.studio-list-body main.boards-page,
html body.studio-list-body main.decks-page {
    --sl-ink: #1f1f1f;
    --sl-muted: #8a8a8a;
    --sl-line: #ececec;
    --sl-line-strong: #d9d9d9;

    width: auto !important;
    max-width: 1320px !important;
    margin: 16px auto 56px !important;
    padding: 24px 24px 40px !important;
    border: 1px solid var(--sl-line) !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 1px 2px rgba(31, 31, 31, 0.04) !important;
    box-sizing: border-box !important;
}

/* -------------------------------------------------------------------
   Header: title and "@user" on the left; avatar, export and the action
   buttons on the right. The inner wrappers are flattened (display:
   contents) so everything lands on one shared grid.
   ------------------------------------------------------------------- */

html body.studio-list-body main .boards-owner-header,
html body.studio-list-body main .decks-owner-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    grid-template-areas:
        "title people actions"
        "meta  people actions" !important;
    align-items: center !important;
    column-gap: 14px !important;
    row-gap: 0 !important;
    width: auto !important;
    margin: 0 0 22px !important;
    padding: 0 0 20px !important;
    border-bottom: 1px solid var(--sl-line) !important;
    text-align: left !important;
}

/* Decks/Collage Studio have no action buttons in the header (their
   "Create" tile lives in the grid), so no empty third column there. */
html body.studio-list-body main .decks-owner-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
        "title people"
        "meta  people" !important;
}

html body.studio-list-body main .boards-owner-main,
html body.studio-list-body main .decks-owner-main {
    display: contents !important;
}

html body.studio-list-body main .boards-owner-title,
html body.studio-list-body main .decks-owner-title {
    grid-area: title !important;
    align-self: end !important;
    margin: 0 !important;
    color: var(--sl-ink) !important;
    font-family: var(--card-title-font) !important;
    font-size: 28px !important;
    font-weight: 400 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.2 !important;
    text-align: left !important;
}

html body.studio-list-body main .boards-owner-username,
html body.studio-list-body main .decks-owner-username {
    grid-area: meta !important;
    align-self: start !important;
    margin: 3px 0 0 !important;
    color: var(--sl-muted) !important;
    font-size: 13.5px !important;
    font-weight: 400 !important;
    text-align: left !important;
}

/* Avatar + export: a small avatar with a round export button tucked
   against it, like the avatars-and-add button on the board page. */
html body.studio-list-body main .boards-owner-people-row,
html body.studio-list-body main .decks-owner-people-row {
    grid-area: people !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
}

html body.studio-list-body main .boards-owner-avatar,
html body.studio-list-body main .decks-owner-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border: 2px solid #ffffff !important;
    box-sizing: border-box !important;
    font-size: 13px !important;
    font-weight: 600 !important;
}

html body.studio-list-body main .boards-owner-export-button,
html body.studio-list-body main .decks-owner-export-button {
    position: relative !important;
    z-index: 2 !important;
    flex: 0 0 36px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 0 0 -8px !important;
    padding: 0 !important;
    border: 1px solid var(--sl-line-strong) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 2px #ffffff !important;
    color: var(--sl-ink) !important;
    transform: none !important;
}

html body.studio-list-body main .boards-owner-export-button:hover,
html body.studio-list-body main .decks-owner-export-button:hover,
html body.studio-list-body main.boards-page .boards-owner-export-dropdown.is-open .boards-owner-export-button {
    border-color: #c2c2c2 !important;
    background: #f5f5f5 !important;
}

html body.studio-list-body main .boards-owner-export-button svg,
html body.studio-list-body main .decks-owner-export-button svg {
    width: 17px !important;
    height: 17px !important;
}

/* My Boards' Share / Sort / New: compact 8px-radius outline buttons with
   icon and label side by side, the same button as the board page's.
   "New" is the one filled, black button - the page's main action. */
html body.studio-list-body main .boards-owner-actions {
    grid-area: actions !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
}

/* New comes first, then Share and Sort - the same order as the board
   page's own buttons. Reordered with `order` so the markup (and the
   dropdowns' wiring) stays as it is. */
html body.studio-list-body main.boards-page .boards-owner-actions > .boards-owner-new-dropdown {
    order: -1 !important;
}

html body.studio-list-body main .boards-owner-actions > *,
html body.studio-list-body main .boards-owner-actions .board-tools-dropdown > .board-action-pill {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

/* boards.html's own inline <style> (which loads after this file) has
   hover / pressed / menu-open rules for these buttons that make them
   transparent and square and light up a pale square behind the icon.
   Every state is listed here, under the extra .boards-page class, so
   these win in all of them, not just at rest. */
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:hover,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:focus,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:active,
html body.studio-list-body main.boards-page .boards-owner-actions .board-tools-dropdown.is-open .board-action-pill {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    border: 1px solid var(--sl-line-strong) !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--sl-ink) !important;
    transform: none !important;
}

html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:hover,
html body.studio-list-body main.boards-page .boards-owner-actions .board-tools-dropdown.is-open .board-action-pill {
    border-color: #c2c2c2 !important;
    background: #f5f5f5 !important;
}

html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:focus-visible {
    outline: 2px solid var(--sl-ink) !important;
    outline-offset: 2px !important;
}

/* "New" is the one filled, black button - the page's main action -
   and stays black when hovered, pressed or open. */
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill.boards-owner-new-button,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill.boards-owner-new-button:focus,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill.boards-owner-new-button:active {
    border-color: var(--sl-ink) !important;
    background: var(--sl-ink) !important;
    color: #ffffff !important;
}

html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill.boards-owner-new-button:hover,
html body.studio-list-body main.boards-page .boards-owner-actions .board-tools-dropdown.is-open .board-action-pill.boards-owner-new-button {
    border-color: #3a3a3a !important;
    background: #3a3a3a !important;
    color: #ffffff !important;
}

/* The icon sits inline in the button in every state - no square behind
   it, no shrink on press. */
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill .board-action-pill-circle,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:hover .board-action-pill-circle,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:active .board-action-pill-circle,
html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill:focus-visible .board-action-pill-circle,
html body.studio-list-body main.boards-page .boards-owner-actions .board-tools-dropdown.is-open .board-action-pill .board-action-pill-circle {
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit !important;
    transform: none !important;
}

html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill-circle svg {
    width: 15px !important;
    height: 15px !important;
    color: inherit !important;
    stroke: currentColor !important;
}

html body.studio-list-body main.boards-page .boards-owner-actions .board-action-pill-label {
    margin: 0 !important;
    color: inherit !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Menus: exactly like the board page's. On desktop every menu (Export,
   New, Sort) opens 6px under its button, lined up with the button's
   right edge - the buttons sit on the right of the header, so that
   never runs off screen. Phones: see the max-width: 800px block below.
   Items are medium weight, like the board page's New / More menus. */
html body.studio-list-body main.boards-page .boards-owner-header .board-tools-dropdown {
    position: relative !important;
}

html body.studio-list-body main.boards-page .boards-owner-header .board-tools-dropdown-menu {
    top: calc(100% + 6px) !important;
    right: 0 !important;
    left: auto !important;
    margin: 0 !important;
    transform: none !important;
    translate: none !important;
}

html body.studio-list-body main.boards-page .boards-owner-header .board-tools-dropdown-menu .menu-delete-button,
html body.studio-list-body main.boards-page .boards-owner-header .board-tools-dropdown-menu a,
html body.studio-list-body main.boards-page .boards-owner-header .board-tools-dropdown-menu button {
    font-weight: 500 !important;
}

/* -------------------------------------------------------------------
   Grids
   ------------------------------------------------------------------- */

html body.studio-list-body main.boards-page .boards-grid,
html body.studio-list-body main.decks-page .decks-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 26px 18px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Decks are landscape, so fewer, wider columns read better. */
html body.studio-list-body main.decks-page #decksGrid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
}

/* -------------------------------------------------------------------
   Board tiles: the landing page's tile - a 16px-radius cover (its
   hairline border comes from style.css), then the name and count. A
   soft lift on hover.
   ------------------------------------------------------------------- */

html body.studio-list-body main.boards-page .board-cover-collage-wrap {
    border-radius: 16px !important;
    box-shadow: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

html body.studio-list-body main.boards-page .board-card:hover .board-cover-collage-wrap {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(31, 31, 31, 0.08) !important;
}

html body.studio-list-body main.boards-page .board-cover-collage {
    border-radius: 16px !important;
}

html body.studio-list-body main.boards-page .deckd-board-tile-title {
    margin: 10px 2px 0 !important;
    color: var(--sl-ink) !important;
    font-family: var(--card-title-font) !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    letter-spacing: -0.005em !important;
    line-height: 1.3 !important;
}

html body.studio-list-body main.boards-page .deckd-board-tile-count {
    margin: 2px 2px 0 !important;
    color: var(--sl-muted) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

/* -------------------------------------------------------------------
   Deck + collage cards: the same rounded cover and caption treatment.
   ------------------------------------------------------------------- */

/* The cover inside already has its own 16px radius and hairline
   border, so the wrapper only matches that radius for the hover lift. */
html body.studio-list-body main.decks-page .deck-card-cover-wrap {
    border-radius: 16px !important;
    box-shadow: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

html body.studio-list-body main.decks-page .deck-card:hover .deck-card-cover-wrap {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 24px rgba(31, 31, 31, 0.08) !important;
}

html body.studio-list-body main.decks-page .deck-card-title {
    margin: 10px 2px 0 !important;
    color: var(--sl-ink) !important;
    font-family: var(--card-title-font) !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    letter-spacing: -0.005em !important;
    line-height: 1.3 !important;
}

html body.studio-list-body main.decks-page .deck-card-count {
    margin: 2px 2px 0 !important;
    color: var(--sl-muted) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
}

/* "Create a deck" / "Create a collage": a soft grey tile with a plus,
   rather than a dashed box. */
html body.studio-list-body main.decks-page .deck-create-tile-box {
    border: 1px dashed var(--sl-line-strong) !important;
    border-radius: 16px !important;
    background: #fafafa !important;
    color: var(--sl-muted) !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

html body.studio-list-body main.decks-page .deck-create-tile:hover .deck-create-tile-box {
    border-color: #bdbdbd !important;
    background: #f3f3f3 !important;
    color: var(--sl-ink) !important;
}

html body.studio-list-body main.decks-page .deck-create-tile-label {
    margin: 10px 2px 0 !important;
    color: var(--sl-ink) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
}

/* -------------------------------------------------------------------
   Phones: full-width panel edges, header stacks (title + @user, then the
   avatar and buttons underneath), two columns of tiles.
   ------------------------------------------------------------------- */

@media (max-width: 700px) {
    html body.studio-list-body {
        background: #ffffff !important;
    }

    html body.studio-list-body main.boards-page,
    html body.studio-list-body main.decks-page {
        margin: 0 0 24px !important;
        padding: 18px 14px 32px !important;
        border-width: 0 0 1px !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    html body.studio-list-body main .boards-owner-header,
    html body.studio-list-body main .decks-owner-header {
        margin-bottom: 18px !important;
        padding-bottom: 16px !important;
    }

    html body.studio-list-body main .boards-owner-title,
    html body.studio-list-body main .decks-owner-title {
        font-size: 24px !important;
    }

    html body.studio-list-body main.boards-page .boards-grid,
    html body.studio-list-body main.decks-page .decks-grid,
    html body.studio-list-body main.decks-page #decksGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px 12px !important;
    }

    html body.studio-list-body main.boards-page .deckd-board-tile-title,
    html body.studio-list-body main.decks-page .deck-card-title,
    html body.studio-list-body main.decks-page .deck-create-tile-label {
        font-size: 14px !important;
    }
}

/* Up to 800px - the same breakpoint as the board page's header - the
   buttons drop onto their own row under the title, starting on the
   left, and each menu opens just under its own button, slid sideways
   only as far as it takes to stay on screen. boards.html's script
   (positionBoardsHeaderMenuOnMobile) works out that slide and sets
   --sl-menu-left, the same way the board page does. */
@media (max-width: 800px) {
    html body.studio-list-body main.boards-page .boards-owner-header {
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "title people"
            "meta  people"
            "actions actions" !important;
    }

    html body.studio-list-body main.boards-page .boards-owner-actions {
        justify-self: start !important;
        margin-top: 14px !important;
    }

    html body.studio-list-body main.boards-page .boards-owner-header .board-tools-dropdown-menu {
        right: auto !important;
        left: var(--sl-menu-left, 0px) !important;
        max-width: calc(100vw - 24px) !important;
        box-sizing: border-box !important;
    }
}
