/* =============================================================================
   NB SECTION HEADERS  -  experiment started 2026-11-24
   -----------------------------------------------------------------------------
   Softens the shared card section headers (.card-border-area) while keeping a
   raised / beveled look.

   Title headers stay as a standalone bubbled .card-border-area (Face / QR title).

   Section headers that sit above a body are wrapped with that body in
   .card-section (see TradingCard_*.razor). The wrapper owns the outer border so
   header + body read as one piece: square join between them, shared sides.

   Also in this file (same experiment / same rollback):
     - sections leave only ~2px of green on each side
     - restore the interior rounded bottom of the green card face
     - compact Pictures tile control bars + scroll when there are many images
     - keep section-header height stable when entering edit mode

   ROLLBACK (any one of these):
     1. Delete the line marked "NB-SECTION-HEADERS" (the <link> to this file) in
        wwwroot/index.html, env/dev/index.html and env/prod/index.html, then
        redeploy. This file can then be deleted too. The .card-section wrappers
        in the .razor files are inert without this CSS.
     2. git revert <the commit that added this>.

   The original rules in wwwroot/css/app.css are left untouched.
   ============================================================================= */

/* ---- Standalone title bubble (NOT inside .card-section) -------------------- */
.card-border-area {
    border: 2px solid #2f3f3d !important;          /* was 3px black */
    border-radius: 14px !important;                /* was 20px */
    box-sizing: border-box !important;            /* width+padding must not overflow/clip the right side */
    overflow: hidden !important;                  /* was overflow:auto — scrollbar shifted text off-center */
    text-align: center !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-image:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.42) 0%,
            rgba(255, 255, 255, 0.10) 45%,
            rgba(0, 0, 0, 0.06) 100%
        ),
        url("/img/tradecard_bg1.png") !important;
    background-repeat: no-repeat, repeat !important;
    background-size: 100% 100%, auto !important;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.70),
        inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

/* Keep label text centered; ellipsis instead of overflow/scroll */
.card-border-area .transparent-input2 {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-border-area::before {
    border: 1px solid rgba(255, 255, 255, 0.50) !important;
    border-right-color: rgba(0, 0, 0, 0.12) !important;
    border-bottom-color: rgba(0, 0, 0, 0.14) !important;
    border-radius: 10px !important;
    top: 3px !important;
    left: 3px !important;
    right: 3px !important;
    bottom: 3px !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* ---- Joined header + body -------------------------------------------------- */
.card-section {
    display: flex;
    flex-direction: column;
    /* parent .card-background* already has padding: 2px → 2px green each side */
    width: 100%;
    margin: 0 0 8px;
    box-sizing: border-box;
    overflow: hidden;                             /* clip only inside the section chrome */
    border: 2px solid #2f3f3d;
    /* Top corners only — bottom stays square so sections can sit over the green's
       interior black curve without looking "rounded off" to match it. */
    border-radius: 14px 14px 0 0;
    background-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.20);
}

/* Face Features / Notes: section should fill remaining card height */
.card-section:has(.descDiv-flex),
.card-section:has(.descDiv) {
    flex: 1 1 auto;
    min-height: 0;
}

/* Header strip inside a joined section: no outer chrome, only a bottom rule.
   Top corners are rounded on the header itself (not via parent overflow clip),
   so Images can keep overflow:visible for scrolling and still look rounded. */
.card-section > .card-border-area {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-block: 4px !important;
    padding-inline: 8px !important;
    border: none !important;
    border-bottom: 1px solid rgba(47, 63, 61, 0.35) !important;
    border-radius: 12px 12px 0 0 !important;      /* match section top; was 0 (square) */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.70);
    overflow: hidden !important;
    line-height: 1.3 !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

.card-section > .card-border-area::before {
    display: none !important;                     /* inner ring only on standalone titles */
}

/* Body pieces lose their own border so the wrapper's border is the only edge */
.card-section > .condition-table,
.card-section > .descDiv,
.card-section > .descDiv-flex {
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    box-shadow: none !important;
    box-sizing: border-box;
}

.card-section > .descDiv-flex,
.card-section > .descDiv {
    flex: 1 1 auto;
    min-height: 0;
}

/* Pictures page: tile grid is the body */
.card-section > .k-tilelayout {
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}

/* QR page: "Scan For More Info" + code */
.card-section > .card-centered-section-qr {
    margin: 0 !important;
    padding: 4px 0 8px;
}

/* ---- Edit mode: keep header height stable --------------------------------- */
/* Collectible Edit uses a readonly TelerikTextArea (Rounded.Full); ModuleEdit
   uses a TextBox. Both are taller than the plain .transparent-input2 div used
   in view mode. Squash them to the same line box. */
.card-border-area .k-textarea,
.card-border-area .k-textbox,
.card-border-area .k-input {
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding-block: 0 !important;
    padding-inline: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: rgba(0, 0, 0, 1) !important;
    text-align: center !important;
}

.card-border-area .k-input-inner,
.card-border-area .k-input-values,
.card-border-area textarea.k-input-inner,
.card-border-area input.k-input-inner {
    min-height: 0 !important;
    height: 1.3em !important;
    max-height: 1.3em !important;
    padding-block: 0 !important;
    padding-inline: 0 !important;
    line-height: 1.3 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    resize: none !important;
    text-align: center !important;
    background: transparent !important;
}

/* Telerik wraps the input; don't let its layout shove the text sideways */
.card-border-area .k-textarea,
.card-border-area .k-textbox {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Rounded.Full adds a tall pill — flatten it inside headers */
.card-border-area .k-rounded-full,
.card-border-area .k-textarea.k-rounded-full {
    border-radius: 0 !important;
}

/* ---- Interior rounded black frame at bottom of green face ----------------- */
/* .card-background* already has border-bottom-*-radius: 8%. That rounds the
   GREEN FILL only, so the black card border shows as an interior curve.
   Do NOT set overflow:hidden here — that would clip sections to the curve and
   "round them off". Sections stay square-bottomed and sit overtop the green/curve.
   The fade underlay (.card-container::before in app.css) uses the same 8% radius
   so square green never peeks out past the curve. */
.card-background,
.card-background-flex,
.card-background-flex-qr {
    overflow: visible;
    border-bottom-left-radius: 8%;
    border-bottom-right-radius: 8%;
}

/* ---- Pictures: compact control bars + scroll when many images ------------- */
/* Overlay the per-tile button bar on the image instead of stacking above it,
   so images keep their RowHeight. Scroll the green face when there are more. */
.card-background:has(.image-grid-layout) {
    overflow-x: hidden;
    overflow-y: auto;                             /* scroll exception for Images */
}

/* TileLayout was growing the section past the card (theme padding + columns),
   so the Images header ran off the right and its top-right curve vanished. */
.card-section:has(.image-grid-layout) {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;                           /* was visible — that let the grid widen the header */
    overflow-y: visible;
    max-height: none;
    box-sizing: border-box;
}

.image-grid-layout.k-tilelayout {
    flex: 1 1 auto;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;                        /* theme default is spacing-4 on all sides */
    min-width: 0 !important;
}

.image-grid-layout .k-tilelayout-item .k-card {
    position: relative;
    overflow: hidden;
}

/* Control bar overlays the top of the image */
.image-grid-layout .k-tilelayout-item-header,
.image-grid-layout .k-card-header {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    min-height: 0 !important;
    padding-block: 1px !important;
    padding-inline: 4px !important;
    background-color: rgba(94, 147, 161, 0.88) !important;
    border: none !important;
    box-shadow: none !important;
}

.image-grid-layout .k-card-header .k-button,
.image-grid-layout .k-tilelayout-item-header .k-button {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    padding: 0 !important;
}

.image-grid-layout .k-card .k-card-body,
.image-grid-layout .k-tilelayout-item-body {
    padding-block: 0 !important;
    padding-inline: 0 !important;
}

/* Edit-mode drop zone: less vertical room so more of the grid shows */
.card-background > div[id^="TCPhotosDropZoneRef"] {
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    overflow: hidden;
}
