/* "Diamond Information" table on the single-diamond detail page - layout
   follows the client's reference design: a heading, a one-sentence
   summary, then a two-column label/value list. Deliberately square
   throughout (no border-radius). */

/* Isolates the whole detail page from the active theme's global CSS - see
   the matching block at the top of search-app.css for why `all: revert`
   is used here and why it must stay the first rule in this file. Scoped to
   .nivoda-diamond-detail, the page template's own wrapper (see
   single-diamond.php) around everything get_header()/get_footer() don't
   already own.

   The inquiry trigger button is excluded here: its styling lives in the
   separate inquiry-modal.css (shared with the search cards), which this
   revert - matching by element, not by source file - would otherwise wipe
   out just as happily as an actual theme rule. The exclusion is wrapped in
   :where(), which always contributes zero specificity regardless of what's
   inside it - a bare :not() here would instead have made this selector
   MORE specific than almost every rule below it meant to build the actual
   design back up (each :not() clause adds its argument's specificity,
   same as an extra class), so this revert would have ended up beating
   nearly all of them instead of just the inquiry button - which is
   exactly what happened before this fix. */
.nivoda-diamond-detail,
.nivoda-diamond-detail *:where(:not(.nivoda-diamond-detail-inquiry)) {
    all: revert;
    box-sizing: border-box;
}

.nivoda-diamond-detail {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1c2d4a;
}

/* ---------- Top-level layout: media left, info right ---------- */

.nivoda-diamond-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 640px) {
    /* Info column (title/chips/price/CTA) drops below the image/gallery
       instead of squeezing into a half-width column on narrow screens. */
    .nivoda-diamond-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Right column: title, chips, price, CTA ---------- */

.nivoda-diamond-title {
    margin: 0 0 0.75rem;
    font-size: 1.5rem;
    line-height: 1.3;
    color: #1c2d4a;
}

.nivoda-diamond-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.nivoda-diamond-price-vat {
    display: inline-block;
    margin-left: 0.4rem;
    font-weight: 400;
    font-size: 0.35em;
    color: #78859c;
}

.nivoda-diamond-chip {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 0;
    background: #cfdbf0;
    color: #1c2d4a;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---------- Image gallery (thumbnail rail + main view) ---------- */

.nivoda-diamond-gallery {
    display: flex;
    gap: 0.75rem;
}

.nivoda-diamond-gallery-thumbs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 0 0 72px;
}

.nivoda-diamond-gallery-thumb {
    /* Explicit border-box: this class is shared by a <button> (Foto/360°)
       and an <a> (PDF) - without it, the browser's UA stylesheet gives
       buttons border-box by default but leaves anchors at the CSS default
       content-box, so the PDF tile would render a few pixels larger than
       the others (72px + this 2px border added on top, rather than
       included in it). */
    box-sizing: border-box;
    position: relative;
    display: block;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid #e2e5ea;
    border-radius: 0;
    background-color: #f2f5fa;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    font: inherit;
}

.nivoda-diamond-gallery-thumb.is-active {
    border-color: #1c2d4a;
}

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

/* Sits on top of the thumb's background photo (the 360° thumb reuses the
   plain photo as its background - see single-diamond.php) as a small
   label bar, rather than filling/hiding the whole tile. */
.nivoda-diamond-gallery-thumb-icon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    padding: 0.2rem 0;
    background: rgba(28, 45, 74, 0.85);
    color: #fff;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.nivoda-diamond-gallery-main {
    position: relative;
    flex: 1;
    min-width: 0;
    aspect-ratio: 1 / 1;
    background: #f2f2f2;
    overflow: hidden;
}

.nivoda-diamond-gallery-main img,
.nivoda-diamond-gallery-main iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.nivoda-diamond-gallery-main img {
    object-fit: cover;
}

/* Shown on top of the still-visible previous photo while the 360° iframe's
   own page loads (see swapMain() in diamond-detail.js) - a brief spinner
   reads as "loading" instead of the embed just sitting there unresponsive
   for however long that takes. */
.nivoda-diamond-gallery-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.25rem;
    height: 2.25rem;
    margin: -1.125rem 0 0 -1.125rem;
    border: 3px solid rgba(28, 45, 74, 0.15);
    border-top-color: rgba(28, 45, 74, 0.6);
    border-radius: 50%;
    animation: nivoda-diamond-gallery-spin 0.8s linear infinite;
}

@keyframes nivoda-diamond-gallery-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .nivoda-diamond-gallery {
        flex-direction: column-reverse;
    }

    .nivoda-diamond-gallery-thumbs {
        flex-direction: row;
        flex: 0 0 auto;
    }
}

.nivoda-diamond-facts {
    margin-top: 2rem;
    border: 1px solid #e2e5ea;
    border-radius: 0;
    background: #fff;
    padding: 1.5rem;
}

.nivoda-diamond-info-title {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    color: #1c2d4a;
}

.nivoda-diamond-info-description {
    margin: 0 0 1.25rem;
    color: #667;
    font-size: 0.92rem;
    line-height: 1.5;
}

.nivoda-diamond-info-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2.5rem;
}

.nivoda-diamond-info-col {
    display: flex;
    flex-direction: column;
}

.nivoda-diamond-info-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #edf0f4;
    font-size: 0.9rem;
}

.nivoda-diamond-info-row:last-child {
    border-bottom: 0;
}

.nivoda-diamond-info-label {
    color: #78859c;
}

.nivoda-diamond-info-value {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    color: #24344f;
    font-weight: 600;
    text-align: right;
}

/* ---------- Facts-table value indicators (see DiamondFactsView) ----------
   Deliberately monochrome (light track/dot = lower on the scale, dark
   #1c2d4a = higher) rather than a red/green good-bad coding - grade and
   color/clarity preference is often a budget tradeoff, not a defect, so
   nothing here should read as a warning. */

.nivoda-scale-bar {
    position: relative;
    flex: none;
    display: inline-block;
    width: 44px;
    height: 4px;
    /* Extra gap on top of .nivoda-diamond-info-value's own 0.4rem flex
       gap - the marker sits close to the bar's right edge, which read as
       crowding the value text right after it. */
    margin-right: 0.5rem;
    background: linear-gradient(to right, #dfe3e8, #1c2d4a);
}

.nivoda-scale-bar-marker {
    position: absolute;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    background: #fff;
    border: 2px solid #1c2d4a;
    transform: translateY(-50%);
}

.nivoda-grade-dots {
    display: inline-flex;
    flex: none;
    gap: 3px;
}

.nivoda-grade-dot {
    width: 6px;
    height: 6px;
    background: #dfe3e8;
}

.nivoda-grade-dot.is-filled {
    background: #1c2d4a;
}

@media (max-width: 640px) {
    .nivoda-diamond-info-columns {
        grid-template-columns: 1fr;
    }
}
