/* CM Board — Portfolio Grid + Single Pages */
/* Scoped to body.cm-board-active */

:root {
    --cmb-bg: #ffffff;
    --cmb-bg-alt: #f8f8f8;
    --cmb-text: #1a1a1a;
    --cmb-text-muted: #888;
    --cmb-accent: #1a1a1a;
    --cmb-border: #e5e5e5;
    --cmb-radius: 4px;
    --cmb-container: 1280px;
    --cmb-gap: 20px;
}

/* ── Container ── */
.cm-board-container {
    max-width: var(--cmb-container);
    margin: 0 auto;
    padding: 0 20px;
}

.cm-board-wrap {
    padding-top: 10px;
    padding-bottom: 40px;
    background: var(--cmb-bg);
    min-height: 60vh;
}

/* ── Page Title (H1) ── */
.cm-board-page-title {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cmb-text);
    text-align: center;
    margin: 0 0 8px;
}

/* ── Filter Bar ── */
.cm-board-filter {
    margin-bottom: 20px;
}

.cm-board-filter__bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--cmb-border);
}

.cm-board-filter__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cmb-text-muted);
    background: transparent;
    border: 1px solid var(--cmb-border);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.cm-board-filter__btn:hover,
.cm-board-filter__btn.active {
    color: var(--cmb-text);
    border-color: var(--cmb-text);
    background: var(--cmb-bg);
    text-decoration: none;
}

.cm-board-filter__count {
    font-size: 11px;
    opacity: 0.6;
}

/* ── Grid ── */
.cm-board-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--cmb-gap);
}

.cm-board-card {
    display: block;
    text-decoration: none;
    color: var(--cmb-text);
    transition: transform 0.2s;
}

.cm-board-card:hover {
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--cmb-text);
}

.cm-board-card--hidden {
    display: none;
}

.cm-board-card__img {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--cmb-bg-alt);
    margin-bottom: 10px;
}

.cm-board-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cm-board-card:hover .cm-board-card__img img {
    transform: scale(1.03);
}

.cm-board-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--cmb-text-muted);
    background: var(--cmb-bg-alt);
}

.cm-board-card__info {
    padding: 2px 0;
}

.cm-board-card__name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
    letter-spacing: 0.02em;
}

.cm-board-card__measures {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--cmb-text-muted);
    letter-spacing: 0.03em;
}

.cm-board-card__measures--us {
    font-size: 10px;
    color: #aaa;
    margin-top: 1px;
}

.cm-board-card__measure {
    white-space: nowrap;
}

/* ── Load More ── */
.cm-board-loadmore {
    text-align: center;
    margin-top: 40px;
}

.cm-board-btn {
    display: inline-block;
    padding: 12px 36px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fff;
    background: var(--cmb-accent);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
}

.cm-board-btn:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

/* ══════════════════════════════════════════
   SINGLE PAGE — Sedcard Layout
   ══════════════════════════════════════════ */

.cm-board-single {
    padding-top: 20px;
}

/* Back link */
.cm-board-single__back {
    display: inline-block;
    font-size: 13px;
    color: var(--cmb-text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    letter-spacing: 0.03em;
}

.cm-board-single__back:hover {
    color: var(--cmb-text);
    text-decoration: none;
}

/* Header: Name + Links */
.cm-board-single__header {
    text-align: center;
    margin-bottom: 24px;
}

.cm-board-single__name {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 44px;
    font-weight: 400;
    letter-spacing: 0.01em;
    margin: 0 0 6px;
    color: var(--cmb-text);
}

.cm-board-single__links {
    font-size: 13px;
    color: var(--cmb-text-muted);
    letter-spacing: 0.03em;
}

.cm-board-single__links a {
    color: var(--cmb-text-muted);
    text-decoration: none;
}

.cm-board-single__links a:hover {
    color: var(--cmb-text);
}

.cm-board-single__sep {
    margin: 0 6px;
    opacity: 0.5;
}

/* ── Measurements (horizontal table) ── */
.cm-board-single__measures {
    max-width: 860px;
    margin: 0 auto 36px;
}

.cm-board-single__measures-table {
    width: 100%;
    border-collapse: collapse;
    border: none !important;
}

.cm-board-single__measures-table th,
.cm-board-single__measures-table td {
    border: none !important;
    background: transparent !important;
}

.cm-board-single__measures-table th {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: #111;
    padding: 8px 20px 6px 0;
    text-align: left;
}

.cm-board-single__measures-table td {
    font-size: 12px;
    font-weight: 400;
    padding: 4px 20px 4px 0;
    color: #111;
}

.cm-board-single__measures-us td {
    font-size: 11px;
    font-weight: 400;
    color: #555;
}

.cm-board-single__measure-extra {
    margin-top: 14px;
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--cmb-text-muted);
    letter-spacing: 0.02em;
}


/* ── Booking CTA ── */
.cm-board-single__booking {
    font-size: 12px;
    color: #444;
    margin-top: 8px;
    letter-spacing: 0.02em;
}
.cm-board-single__booking a {
    color: #111;
    text-decoration: none;
    font-weight: 500;
}
.cm-board-single__booking a:hover { text-decoration: underline; }
/* ── Top 2 Images ── */
.cm-board-single__top-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

.cm-board-single__top-images .cm-board-gallery__item {
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 2/3;
}

.cm-board-single__top-images .cm-board-gallery__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s;
}

.cm-board-single__top-images .cm-board-gallery__item:hover .cm-board-gallery__img {
    transform: scale(1.02);
}

/* ── Video Section ── */
.cm-board-single__video-section {
    margin-bottom: 40px;
}

.cm-board-single__video {
    margin-bottom: 16px;
}

.cm-board-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.cm-board-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cm-board-single__firstname {
    font-size: 80px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cmb-text);
    text-align: center;
    margin: 24px 0 40px;
    line-height: 1;
}

/* ── Gallery Grid (remaining images) ── */
.cm-board-single__gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.cm-board-gallery__item {
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 2/3;
}

.cm-board-gallery__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s;
}

.cm-board-gallery__item:hover .cm-board-gallery__img {
    transform: scale(1.03);
}

/* ══════════════════════════════════════════
   DISCOVER (Related Models)
   ══════════════════════════════════════════ */

.cm-board-discover {
    padding: 60px 0 20px;
    margin-top: 40px;
}

.cm-board-discover__title {
    font-size: 96px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--cmb-text);
    text-align: center;
    margin: 0 0 36px;
    line-height: 1;
}

.cm-board-discover__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.cm-board-discover__card {
    display: block;
    text-decoration: none;
    color: var(--cmb-text);
    transition: transform 0.2s;
}

.cm-board-discover__card:hover {
    transform: translateY(-3px);
    text-decoration: none;
    color: var(--cmb-text);
}

.cm-board-discover__img {
    aspect-ratio: 2/3;
    overflow: hidden;
    margin-bottom: 10px;
    background: var(--cmb-bg-alt);
}

.cm-board-discover__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.cm-board-discover__card:hover .cm-board-discover__img img {
    transform: scale(1.03);
}

.cm-board-discover__name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.cm-board-discover__size {
    display: block;
    font-size: 12px;
    color: var(--cmb-text-muted);
}

/* ══════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════ */

.cm-board-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.cm-board-lightbox.active {
    opacity: 1;
}

.cm-board-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
}

.cm-board-lightbox__close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    z-index: 100000;
}

.cm-board-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    z-index: 100000;
}

.cm-board-lightbox__nav--prev { left: 10px; }
.cm-board-lightbox__nav--next { right: 10px; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 1024px) {
    .cm-board-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .cm-board-discover__title {
        font-size: 72px;
    }
    .cm-board-discover__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .cm-board-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .cm-board-single__name {
        font-size: 30px;
    }
    .cm-board-single__top-images {
        gap: 10px;
    }
    .cm-board-single__gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .cm-board-single__firstname {
        font-size: 44px;
    }
    .cm-board-discover__title {
        font-size: 48px;
    }
    .cm-board-discover__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    .cm-board-filter__bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }
    .cm-board-filter__btn {
        flex-shrink: 0;
    }
    .cm-board-single__measures-table th {
        font-size: 10px;
        padding-right: 8px;
    }
    .cm-board-single__measures-table td {
        font-size: 12px;
        padding-right: 8px;
    }
}

@media (max-width: 480px) {
    .cm-board-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cm-board-card__name {
        font-size: 12px;
    }
    .cm-board-card__measures {
        font-size: 10px;
    }
    .cm-board-single__name {
        font-size: 26px;
    }
    .cm-board-single__top-images {
        grid-template-columns: 1fr;
    }
    .cm-board-single__firstname {
        font-size: 32px;
    }
    .cm-board-discover__title {
        font-size: 36px;
    }
    .cm-board-discover__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════
   Sedcard Generator
═══════════════════════════════════════ */
.cm-sedcard {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cm-sedcard[hidden] { display: none; }

.cm-sedcard__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.6);
}

.cm-sedcard__shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    background: #f2f2f2;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.45);
}

/* ── Top bar ── */
.cm-sedcard__bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    height: 56px;
    background: #1a1a1a;
    color: #fff;
    flex-shrink: 0;
}

.cm-sedcard__title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-right: auto;
}

.cm-sedcard__layouts {
    display: flex;
    gap: 4px;
}

.cm-sedcard__layout-btn {
    width: 36px;
    height: 28px;
    border: 1px solid rgba(255,255,255,.3);
    background: transparent;
    color: rgba(255,255,255,.6);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all .15s;
    border-radius: 2px;
}
.cm-sedcard__layout-btn:hover { border-color: #fff; color: #fff; }
.cm-sedcard__layout-btn.active { background: #fff; color: #1a1a1a; border-color: #fff; }

.cm-sedcard__print-btn {
    padding: 0 18px;
    height: 32px;
    background: #fff;
    color: #1a1a1a;
    border: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity .15s;
    border-radius: 2px;
}
.cm-sedcard__print-btn:hover { opacity: .85; }

.cm-sedcard__close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color .15s;
}
.cm-sedcard__close:hover { color: #fff; }

/* ── Body ── */
.cm-sedcard__body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Left strip ── */
.cm-sedcard__strip {
    width: 150px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    align-content: start;
}

.cm-sedcard__thumb {
    cursor: grab;
    border-radius: 2px;
    overflow: hidden;
    aspect-ratio: 2/3;
    background: #eee;
    transition: opacity .15s, box-shadow .15s;
}
.cm-sedcard__thumb:active { cursor: grabbing; }
.cm-sedcard__thumb.dragging { opacity: .4; }
.cm-sedcard__thumb:hover { box-shadow: 0 0 0 2px #1a1a1a; }
.cm-sedcard__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* ── Stage (right panel) ── */
.cm-sedcard__stage {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    justify-content: center;
}

.cm-sedcard__pages {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    padding-bottom: 20px;
}

/* ── A4 page preview (fixed pixel = A4 proportions, no scaling needed) ── */
.cm-sedcard__page {
    background: #fff;
    box-shadow: 0 4px 24px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    width: 420px;
    min-height: 594px;
    padding: 28px 32px;
    gap: 12px;
    flex-shrink: 0;
}
.cm-sedcard__page--landscape {
    width: 594px;
    min-height: 420px;
}

.cm-sedcard__page-logo {
    text-align: center;
    flex-shrink: 0;
}
.cm-sedcard__page-logo img {
    height: 22px;
    display: inline-block;
}

/* Grid: flex:1 for most layouts; 3-cols uses aspect-ratio to constrain height */
.cm-sedcard__page-grid {
    flex: 1;
    display: grid;
    gap: 8px;
    min-height: 0;
}
.cm-sedcard__page-grid--3-cols {
    grid-template-columns: 1fr 1fr 1fr;
    flex: 0 0 auto;
    align-items: start;
    align-content: center;
    margin: auto 0;
}
.cm-sedcard__page-grid--6-land { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
.cm-sedcard__page-grid--1-big  { grid-template-columns: 1fr; }
.cm-sedcard__page-grid--4-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

/* Slot aspect ratios for constrained layouts */
.cm-sedcard__page-grid--3-cols .cm-sedcard__slot { aspect-ratio: 2/3; }
.cm-sedcard__page-grid--6-land .cm-sedcard__slot { aspect-ratio: 2/3; }
.cm-sedcard__page-grid--4-grid .cm-sedcard__slot { aspect-ratio: 3/4; }

.cm-sedcard__page-footer {
    text-align: center;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 7px;
    color: #777;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

/* ── Slots ── */
.cm-sedcard__slot {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    border: 1.5px dashed #d0d0d0;
    border-radius: 1px;
    transition: border-color .15s, background .15s;
    cursor: default;
    min-height: 60px;
}
.cm-sedcard__slot.over {
    border-color: #1a1a1a;
    background: #f0f0f0;
}
.cm-sedcard__slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cm-sedcard__slot-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 28px;
    font-weight: 300;
    pointer-events: none;
}
.cm-sedcard__slot-clear {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
    padding: 0;
}
.cm-sedcard__slot:hover .cm-sedcard__slot-clear { opacity: 1; }

.cm-sedcard-trigger { cursor: pointer; }

/* ── Sedcard Mobile ── */
@media (max-width: 700px) {
    .cm-sedcard { padding: 0; align-items: stretch; }
    .cm-sedcard__shell { height: 100%; max-width: 100%; border-radius: 0; }
    .cm-sedcard__body { flex-direction: column-reverse; }

    /* Stage: scrollable, fills available height */
    .cm-sedcard__stage {
        flex: 1;
        overflow-y: auto;
        padding: 16px 12px;
        min-height: 0;
    }

    /* Strip: horizontal scrollbar at the bottom */
    .cm-sedcard__strip {
        width: 100%;
        height: 110px;
        flex-shrink: 0;
        border-right: none;
        border-top: 1px solid #e0e0e0;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 10px;
        display: flex;
        flex-direction: row;
        gap: 6px;
        align-content: unset;
    }
    .cm-sedcard__thumb {
        flex-shrink: 0;
        width: 62px;
        height: 93px;
        aspect-ratio: unset;
    }

    /* Smaller page preview on mobile */
    .cm-sedcard__page {
        width: calc(100vw - 48px);
        min-height: auto;
        padding: 16px 18px;
    }
    .cm-sedcard__page--landscape {
        width: calc(100vw - 48px);
        min-height: auto;
    }

    .cm-sedcard__bar {
        gap: 10px;
        padding: 0 14px;
        height: 50px;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    .cm-sedcard__title { display: none; }
}
