/* ==========================================================================
   ModelPolas - custom styles
   Tailwind (via the Play CDN) handles almost everything. This file holds the
   few things that are easier as plain CSS: the hero video treatment, the polas
   gallery/card system, and the full-screen image carousel.
   ========================================================================== */

:root {
    color-scheme: light;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* Clamp text to a fixed number of lines (used for the profile bio). */
.clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Hero background video
   Desaturated (black & white) only — no exposure/brightness adjustments.
   -------------------------------------------------------------------------- */
.hero-video {
    filter: grayscale(100%);
}

/* ==========================================================================
   Polas - gallery & cards
   ========================================================================== */

/* -- Natural-ratio masonry gallery (public profile) -----------------------
   Photos keep their real aspect ratio so nothing is cropped; the layout flows
   into 2/3 columns like a contact sheet. */
.pola-masonry {
    columns: 2;
    column-gap: 0.75rem;
}

@media (min-width: 640px) {
    .pola-masonry { columns: 3; }
}

/* Children must not break across columns and get a bottom gap. */
.pola-masonry > * {
    break-inside: avoid;
    margin-bottom: 0.75rem;
}

.pola-tile {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 3px;
    overflow: hidden;
    background: #f2f2f2;
    cursor: zoom-in;
}

.pola-tile img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.pola-tile:hover img {
    transform: scale(1.03);
}

/* Keep the focus ring subtle (a thin black ring, only for keyboard users). */
.pola-tile:focus {
    outline: none;
}

.pola-tile:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* Small "01" index shown on hover. */
.pola-tile__index {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    padding: 0.15rem 0.45rem;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.25s;
}

.pola-tile:hover .pola-tile__index {
    opacity: 1;
}

/* -- Model card (home & search grids) ------------------------------------ */
.model-card {
    display: block;
}

.model-card__media {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 3px;
    background: #f2f2f2;
}

.model-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.model-card:hover .model-card__media img {
    transform: scale(1.05);
}

.model-card__meta {
    margin-top: 0.6rem;
}

.model-card__handle {
    font-weight: 500;
}

.model-card:hover .model-card__handle {
    text-decoration: underline;
}

.model-card__sub {
    font-size: 0.75rem;
    color: #737373;
}

/* -- Small fixed thumbnail (dashboard & admin lists) --------------------- */
.pola-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 3px;
    background: #f2f2f2;
}

.pola-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Rows in the measurements list (label on the left, value on the right) */
.measurement-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e5e5e5;
    padding: 0.5rem 0;
}

/* ==========================================================================
   Carousel (full-screen image viewer)
   Built and controlled by assets/js/app.js. Hidden by default; `.is-open`
   reveals it as a flex column: stage on top, thumbnail strip at the bottom.
   ========================================================================== */
.carousel {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.96);
    display: none;
    flex-direction: column;
    z-index: 60;
    /* Vertical scroll gestures pass through; we only handle horizontal swipes. */
    touch-action: pan-y;
}

.carousel.is-open {
    display: flex;
}

/* The area that holds the image and the prev/next buttons */
.carousel__stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}

.carousel__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* Previous / next arrow buttons */
.carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.carousel__btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.carousel__btn--prev { left: 10px; }
.carousel__btn--next { right: 10px; }

/* Close (×) button */
.carousel__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    cursor: pointer;
}

/* Bottom bar: counter + scrollable thumbnail strip */
.carousel__footer {
    padding: 10px 12px 16px;
    text-align: center;
}

.carousel__counter {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    letter-spacing: 0.15em;
}

.carousel__thumbs {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-bottom: 4px;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: thin;
}

.carousel__thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 58px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 2px;
    overflow: hidden;
    background: #222;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s, border-color 0.2s;
}

.carousel__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel__thumb.is-active {
    opacity: 1;
    border-color: #fff;
}

/* Larger controls on bigger screens */
@media (min-width: 640px) {
    .carousel__btn { width: 52px; height: 52px; font-size: 32px; }
    .carousel__btn--prev { left: 24px; }
    .carousel__btn--next { right: 24px; }
    .carousel__close { top: 20px; right: 24px; }
    .carousel__thumbs { justify-content: center; }
}

/* ==========================================================================
   CMS content (rendered markdown)
   ========================================================================== */
.cms-content {
    color: #333;
    line-height: 1.7;
}

.cms-content h1 { font-size: 1.75rem; font-weight: 600; margin: 2rem 0 1rem; }
.cms-content h2 { font-size: 1.35rem; font-weight: 600; margin: 1.75rem 0 0.75rem; }
.cms-content h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.cms-content p { margin: 0 0 1rem; }
.cms-content ul,
.cms-content ol { margin: 0 0 1rem 1.25rem; }
.cms-content ul { list-style: disc; }
.cms-content ol { list-style: decimal; }
.cms-content li { margin: 0.25rem 0; }
.cms-content a { color: #111; text-decoration: underline; }
.cms-content blockquote { border-left: 3px solid #ddd; padding-left: 1rem; color: #666; margin: 1rem 0; }
.cms-content code { background: #f5f5f5; padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
.cms-content pre { background: #111; color: #eee; padding: 1rem; overflow: auto; border-radius: 4px; }
.cms-content pre code { background: transparent; color: inherit; }
.cms-content img { max-width: 100%; height: auto; }

