/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * Ancient Iberian Heritage Product Page V2
 * Cinematic archival design using Deep Emerald, Copper, and Parchment.
 */

:root,
body:has(.ibrv2-main),
.ibrv2-main {
    --color-deep-emerald: #0F2B28;
    --color-forest: #1E3D34;
    --color-midnight: #0B141B;
    --color-copper: #B87333;
    --color-sandstone: #C9B89A;
    --color-parchment: #F2E8D6;
    --color-obsidian: #060B0F;
    --color-aged-copper: #8F572A;
    --color-copper-glow: #D08A45;
    --color-mist: #D8CCB5;
    --color-stone: #6F6657;
    --font-display: "Trajan Pro", "Cinzel", "Cormorant Garamond", Georgia, serif;
    --font-body: "Alegreya Sans", "Alegreya", "Source Sans 3", system-ui, sans-serif;
    --border-subtle: 1px solid rgba(201, 184, 154, 0.22);
    --border-copper: 1px solid rgba(184, 115, 51, 0.55);
    --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.42);
    --shadow-copper-glow: 0 0 28px rgba(184, 115, 51, 0.24);
    --ease-ancient: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-ritual: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-base: 240ms;
    --motion-slow: 500ms;
    --motion-ritual: 900ms;
}

.ibrv2-main {
    position: relative;
    overflow-x: hidden;
    min-height: 100vh;
    background:
        radial-gradient(circle at 76% 8%, rgba(184, 115, 51, 0.16), transparent 30%),
        radial-gradient(circle at 18% 18%, rgba(30, 61, 52, 0.72), transparent 35%),
        linear-gradient(135deg, var(--color-midnight) 0%, var(--color-deep-emerald) 48%, var(--color-obsidian) 100%);
    color: var(--color-parchment);
    font-family: var(--font-body);
    line-height: 1.65;
}

body:has(.ibrv2-main) {
    background-color: #0B141B !important;
    background-image: none !important;
}

body:has(.ibrv2-main) #wrapper,
body:has(.ibrv2-main) #content-wrapper,
body:has(.ibrv2-main) #content-fluid,
body:has(.ibrv2-main) > div {
    background: transparent !important;
}

body:has(.ibrv2-main) footer {
    background-color: #0B141B !important;
}

.ibrv2-main::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image:
        linear-gradient(rgba(242, 232, 214, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(242, 232, 214, 0.14) 1px, transparent 1px);
    background-size: 48px 48px;
}

.ibrv2-main > * {
    position: relative;
    z-index: 1;
}

.ibrv2-main h1,
.ibrv2-main h2,
.ibrv2-main h3,
.ibrv2-main h4 {
    color: var(--color-parchment);
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ibrv2-main p {
    color: rgba(216, 204, 181, 0.88);
}

.ibrv2-main a {
    color: inherit;
}

.ibrv2-main a:focus-visible,
.ibrv2-main button:focus-visible,
.ibrv2-bento-card:focus-visible {
    outline: 2px solid var(--color-sandstone);
    outline-offset: 4px;
    box-shadow: 0 0 0 5px rgba(184, 115, 51, 0.22);
}

.ibrv2-skip-link {
    position: absolute;
    top: -48px;
    left: 16px;
    z-index: 10000;
    padding: 10px 16px;
    background: #F2E8D6;
    color: #0B141B;
    border-radius: 2px;
    font-weight: 700;
    transition: top var(--motion-base) var(--ease-ancient);
}

.ibrv2-skip-link:focus {
    top: 16px;
}

.ibrv2-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-aged-copper), var(--color-copper-glow));
    box-shadow: var(--shadow-copper-glow);
}

.ibrv2-page-nav {
    position: fixed;
    top: 50%;
    right: 22px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(-50%);
}

.ibrv2-nav-dot {
    position: relative;
    display: block;
    width: 11px;
    height: 11px;
    border: 1px solid rgba(201, 184, 154, 0.62);
    border-radius: 50%;
    background: rgba(15, 43, 40, 0.75);
    transition: all var(--motion-base) var(--ease-ancient);
}

.ibrv2-nav-dot::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: 22px;
    min-width: 140px;
    padding: 6px 10px;
    color: var(--color-parchment);
    background: rgba(6, 11, 15, 0.92);
    border: var(--border-subtle);
    border-radius: 2px;
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-align: right;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(8px);
    transition: all var(--motion-base) var(--ease-ancient);
}

.ibrv2-nav-dot:hover,
.ibrv2-nav-dot.active {
    border-color: var(--color-copper-glow);
    background: var(--color-copper);
    box-shadow: 0 0 0 6px rgba(184, 115, 51, 0.18);
}

.ibrv2-nav-dot:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.ibrv2-back-to-top {
    position: fixed;
    right: 24px;
    bottom: 26px;
    z-index: 1000;
    display: flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    color: var(--color-midnight);
    background: linear-gradient(180deg, var(--color-copper-glow), var(--color-copper));
    border: 1px solid rgba(242, 232, 214, 0.24);
    border-radius: 50%;
    box-shadow: var(--shadow-copper-glow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: all var(--motion-base) var(--ease-ancient);
}

.ibrv2-back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ibrv2-section {
    padding: clamp(80px, 10vw, 144px) 0;
}

.ibrv2-chapter-header {
    max-width: 880px;
    margin: 0 auto 56px;
}

.ibrv2-chapter-number,
.ibrv2-eyebrow {
    display: inline-block;
    color: var(--color-sandstone);
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.ibrv2-section-title {
    margin: 14px 0 18px;
    font-size: clamp(2rem, 4.5vw, 4rem);
    line-height: 1.08;
}

.ibrv2-section-subtitle,
.ibrv2-lede {
    max-width: 780px;
    margin-inline: auto;
    color: var(--color-mist);
    font-size: clamp(1.125rem, 2vw, 1.45rem);
    line-height: 1.72;
}

.ibrv2-ornamental-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
    color: var(--color-copper);
}

.ibrv2-ornamental-divider::before,
.ibrv2-ornamental-divider::after {
    content: "";
    width: 96px;
    height: 1px;
    background: rgba(184, 115, 51, 0.65);
}

.ibrv2-ornamental-divider span {
    width: 8px;
    height: 8px;
    border: 1px solid currentColor;
    transform: rotate(45deg);
}

.ibrv2-hero {
    position: relative;
    min-height: 92vh;
    overflow: hidden;
    background: var(--color-midnight);
}

.ibrv2-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.08;
    background-image:
        linear-gradient(rgba(242, 232, 214, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(242, 232, 214, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
}

.ibrv2-hero-bg,
.ibrv2-hero-bg-image,
.ibrv2-hero-overlay {
    position: absolute;
    inset: 0;
}

.ibrv2-hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.74) contrast(1.05) brightness(0.64);
    transform: scale(1.02);
}

.ibrv2-hero-overlay {
    background:
        radial-gradient(circle at 74% 22%, rgba(184, 115, 51, 0.22), transparent 30%),
        linear-gradient(90deg, rgba(11, 20, 27, 0.95) 0%, rgba(11, 20, 27, 0.68) 52%, rgba(11, 20, 27, 0.24) 100%),
        linear-gradient(0deg, rgba(6, 11, 15, 0.92) 0%, transparent 46%);
}

.ibrv2-hero-container {
    position: relative;
    z-index: 3;
}

.ibrv2-emblem {
    display: inline-flex;
    width: 74px;
    height: 74px;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    color: var(--color-copper-glow);
    background:
        radial-gradient(circle, rgba(184, 115, 51, 0.16), transparent 62%),
        rgba(15, 43, 40, 0.78);
    border: 1px solid rgba(184, 115, 51, 0.48);
    border-radius: 50%;
    box-shadow: var(--shadow-copper-glow);
    font-size: 1.7rem;
}

.ibrv2-hero-title {
    margin: 12px 0 18px;
    font-size: clamp(3.2rem, 8vw, 7rem);
    line-height: 0.9;
    letter-spacing: 0.18em;
}

.ibrv2-hero-title span,
.ibrv2-hero-title strong {
    display: block;
}

.ibrv2-hero-title strong {
    color: var(--color-copper-glow);
    font-weight: 500;
    text-shadow: 0 0 34px rgba(184, 115, 51, 0.28);
}

.ibrv2-hero-line {
    max-width: 760px;
    margin: 0 0 18px;
    color: var(--color-parchment);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.35rem, 2.6vw, 2.05rem);
    font-style: italic;
    line-height: 1.35;
}

.ibrv2-hero-lede {
    max-width: 720px;
    margin-bottom: 30px;
    color: var(--color-mist);
    font-size: clamp(1.05rem, 1.8vw, 1.22rem);
}

.ibrv2-stat-card {
    min-height: 104px;
    padding: 20px 18px;
    background:
        linear-gradient(180deg, rgba(30, 61, 52, 0.76), rgba(6, 11, 15, 0.76));
    border: var(--border-subtle);
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.ibrv2-stat-value {
    display: block;
    color: var(--color-parchment);
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    letter-spacing: 0.12em;
}

.ibrv2-stat-label {
    display: block;
    margin-top: 6px;
    color: var(--color-sandstone);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ibrv2-hero-price {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 28px 0 0;
    padding: 14px 18px;
    background: rgba(15, 43, 40, 0.72);
    border: var(--border-copper);
    border-radius: 999px;
    box-shadow: var(--shadow-copper-glow);
}

.ibrv2-hero-price span,
.ibrv2-hero-price small {
    color: var(--color-sandstone);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ibrv2-hero-price strong {
    color: var(--color-copper-glow);
    font-family: var(--font-display);
    font-size: 1.45rem;
    letter-spacing: 0.08em;
}

.ibrv2-hero-cta {
    margin-top: 30px;
}

.ibrv2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 14px 24px;
    border-radius: 2px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: all var(--motion-base) var(--ease-ancient);
}

.ibrv2-btn:hover {
    text-decoration: none;
    transform: translateY(-3px);
}

.ibrv2-btn-primary {
    color: var(--color-midnight);
    background: linear-gradient(180deg, var(--color-copper-glow) 0%, var(--color-copper) 100%);
    border: 1px solid rgba(242, 232, 214, 0.24);
    box-shadow: var(--shadow-copper-glow);
}

.ibrv2-btn-primary:hover {
    color: var(--color-midnight);
    box-shadow: 0 0 34px rgba(184, 115, 51, 0.36);
}

.ibrv2-btn-secondary {
    color: var(--color-parchment);
    background: rgba(15, 43, 40, 0.58);
    border: 1px solid rgba(201, 184, 154, 0.35);
}

.ibrv2-btn-secondary:hover {
    color: var(--color-parchment);
    border-color: rgba(184, 115, 51, 0.65);
    background: rgba(30, 61, 52, 0.78);
}

.ibrv2-trust-strip {
    margin-top: 26px;
}

.ibrv2-trust-strip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-sandstone);
    font-size: 0.86rem;
}

.ibrv2-trust-strip i,
.ibrv2-check-list i {
    color: var(--color-copper-glow);
}

.ibrv2-featured-match {
    position: relative;
    max-width: 400px;
    margin-left: auto;
    padding: 18px;
    background: linear-gradient(180deg, rgba(15, 43, 40, 0.86), rgba(6, 11, 15, 0.92));
    border: var(--border-copper);
    border-radius: 4px;
    box-shadow: var(--shadow-card);
}

.ibrv2-featured-ring {
    position: absolute;
    inset: -32px;
    border: 1px solid rgba(184, 115, 51, 0.2);
    border-radius: 50%;
    transform: rotate(-12deg);
}

.ibrv2-featured-match img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 3px;
    filter: saturate(0.88) contrast(1.05);
}

.ibrv2-featured-content {
    position: relative;
    margin-top: 18px;
}

.ibrv2-featured-badge,
.ibrv2-bento-badges span,
.ibrv2-bento-badges small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px 9px;
    color: var(--color-copper-glow);
    background: rgba(184, 115, 51, 0.12);
    border: 1px solid rgba(184, 115, 51, 0.32);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ibrv2-featured-content h2 {
    margin: 0 0 6px;
    font-size: 1.65rem;
}

.ibrv2-featured-content p,
.ibrv2-featured-content small {
    margin: 0;
    color: var(--color-sandstone);
}

.ibrv2-scroll-indicator {
    position: absolute;
    bottom: 28px;
    left: 50%;
    z-index: 4;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--color-sandstone);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.ibrv2-scroll-indicator:hover {
    color: var(--color-copper-glow);
    text-decoration: none;
}

.ibrv2-scroll-indicator i {
    animation: ibrv2-breathe 1.8s ease-in-out infinite;
}

.ibrv2-artifact-card {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 3vw, 34px);
    background:
        linear-gradient(180deg, rgba(30, 61, 52, 0.92), rgba(11, 20, 27, 0.96));
    border: 1px solid rgba(184, 115, 51, 0.28);
    border-radius: 4px;
    box-shadow: var(--shadow-card);
    transition: transform var(--motion-base) var(--ease-ancient), border-color var(--motion-base) var(--ease-ancient), box-shadow var(--motion-base) var(--ease-ancient);
}

/* Featured-card ribbon badge. Kept inside the card: overflow:hidden crops a negative top. */
.ibrv2-artifact-card:has(.prc-card-badge) {
    padding-top: 58px;
}

.ibrv2-artifact-card .prc-card-badge {
    position: absolute;
    top: 18px;
    right: 16px;
    max-width: calc(100% - 32px);
    z-index: 2;
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--color-copper-glow);
    color: var(--color-obsidian);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.ibrv2-artifact-card::after {
    content: "";
    position: absolute;
    right: -42px;
    bottom: -42px;
    width: 140px;
    height: 140px;
    border: 1px solid rgba(184, 115, 51, 0.14);
    border-radius: 50%;
    opacity: 0.78;
}

.ibrv2-artifact-card:hover {
    border-color: rgba(184, 115, 51, 0.55);
    box-shadow: 0 28px 88px rgba(0, 0, 0, 0.5), var(--shadow-copper-glow);
    transform: translateY(-4px);
}

.ibrv2-artifact-card > * {
    position: relative;
    z-index: 1;
}

.ibrv2-icon-halo {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    color: var(--color-copper-glow);
    background: rgba(6, 11, 15, 0.36);
    border: 1px solid rgba(201, 184, 154, 0.28);
    border-radius: 50%;
    font-size: 1.25rem;
}

.ibrv2-artifact-card h3 {
    margin: 0 0 14px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.ibrv2-artifact-card p {
    margin-bottom: 0;
}

.ibrv2-culture-card span {
    display: block;
    margin-bottom: 12px;
    color: var(--color-copper-glow);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ibrv2-culture-wide {
    display: flex;
    align-items: flex-start;
    gap: 22px;
}

.ibrv2-culture-wide .ibrv2-icon-halo {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.ibrv2-editorial-copy {
    max-width: 680px;
}

.ibrv2-editorial-copy p {
    font-size: 1.06rem;
}

.ibrv2-story-quote {
    margin: 34px 0 0;
    padding: 24px 0 24px 28px;
    border-left: 2px solid var(--color-copper);
}

.ibrv2-story-quote p {
    margin: 0;
    color: var(--color-parchment);
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(1.45rem, 3vw, 2.25rem);
    font-style: italic;
    line-height: 1.25;
}

.ibrv2-map-shell {
    position: relative;
    min-height: 560px;
    overflow: hidden;
    background: var(--color-obsidian);
    border: var(--border-copper);
    border-radius: 4px;
    box-shadow: var(--shadow-card);
}

/* Shared Panel Sample Map (live map + browse table). The old map-shell ::after
   gradient was for the static demo map and makes the table unreadable. */
.ibrv2-panel-map-wrap {
    margin-top: 8px;
}

.ibrv2-panel-map-wrap .psm-section {
    margin: 0;
}

.ibrv2-main .psm-theme-dark table.psm-table,
.ibrv2-main .psm-theme-dark .psm-table th,
.ibrv2-main .psm-theme-dark .psm-table td,
.ibrv2-main .psm-theme-dark .psm-table-name-text,
.ibrv2-main .psm-theme-dark .psm-table-loading,
.ibrv2-main .psm-theme-dark .psm-table-empty,
.ibrv2-main .psm-theme-dark .psm-table-page-status,
.ibrv2-main .psm-theme-dark .psm-table-heading {
    color: var(--color-parchment) !important;
}

.ibrv2-main .psm-theme-dark .psm-table-cell-id,
.ibrv2-main .psm-theme-dark .psm-subtitle,
.ibrv2-main .psm-theme-dark .psm-transparency-note,
.ibrv2-main .psm-theme-dark .psm-table-portrait-notice {
    color: var(--color-mist) !important;
}

.ibrv2-main .psm-theme-dark .psm-table thead th {
    color: var(--color-sandstone) !important;
}

.ibrv2-main .psm-theme-dark .psm-table-search {
    color: var(--color-parchment);
    background-color: rgba(11, 20, 27, 0.72);
    border-color: rgba(184, 115, 51, 0.32);
}

.ibrv2-map-preview-map {
    position: absolute;
    inset: 0;
    min-height: 560px;
    filter: saturate(0.78) contrast(1.08);
}

.ibrv2-map-shell::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(11, 20, 27, 0.9) 0%, rgba(11, 20, 27, 0.62) 42%, rgba(11, 20, 27, 0.12) 100%),
        linear-gradient(0deg, rgba(6, 11, 15, 0.72), transparent 42%);
}

.ibrv2-map-panel {
    position: relative;
    z-index: 2;
    width: min(100%, 460px);
    margin: 52px;
    padding: 34px;
    background: rgba(15, 43, 40, 0.9);
    border: var(--border-subtle);
    border-top: var(--border-copper);
    border-radius: 4px;
    backdrop-filter: blur(12px);
}

.ibrv2-map-panel h3 {
    margin: 10px 0 14px;
    font-size: 1.5rem;
}

.ibrv2-check-list {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    color: var(--color-mist);
}

.ibrv2-check-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.ibrv2-map-demo-marker {
    background: transparent;
    border: 0;
}

.ibrv2-map-marker-pin {
    width: 18px;
    height: 18px;
    background: var(--color-copper-glow);
    border: 2px solid var(--color-parchment);
    border-radius: 50% 50% 50% 0;
    box-shadow: 0 0 18px rgba(184, 115, 51, 0.6);
    transform: rotate(-45deg);
}

.ibrv2-bento-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 300px;
    gap: 18px;
}

.ibrv2-bento-card {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    background: var(--color-obsidian);
    border: 1px solid rgba(184, 115, 51, 0.28);
    border-radius: 4px;
    box-shadow: var(--shadow-card);
    cursor: default;
    transition: transform var(--motion-base) var(--ease-ancient), border-color var(--motion-base) var(--ease-ancient);
}

.ibrv2-bento-card:hover {
    border-color: rgba(184, 115, 51, 0.62);
    transform: translateY(-4px);
}

.ibrv2-bento-card img,
.ibrv2-bento-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ibrv2-bento-card img {
    object-fit: cover;
    /* The commissioned portraits frame the head in the upper third, so the
       default centred crop cuts the face off. Same framing as .aea2-face. */
    object-position: 50% 18%;
    filter: saturate(0.78) contrast(1.05);
    transition: transform var(--motion-slow) var(--ease-ancient);
}

.ibrv2-bento-card:hover img {
    transform: scale(1.04);
}

.ibrv2-bento-overlay {
    background:
        linear-gradient(0deg, rgba(6, 11, 15, 0.9) 0%, rgba(6, 11, 15, 0.62) 42%, transparent 80%),
        linear-gradient(90deg, rgba(15, 43, 40, 0.64), transparent);
}

.ibrv2-bento-content {
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    padding: 24px;
}

/* Every card keeps at least a third of the row so no portrait is squeezed into
   a sliver where the face no longer fits (see .aea2-face sizing). */
.ibrv2-bento-large {
    grid-column: span 3;
    grid-row: span 2;
}

.ibrv2-bento-medium {
    grid-column: span 3;
}

.ibrv2-bento-small {
    grid-column: span 2;
}

.ibrv2-bento-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ibrv2-bento-badges small {
    color: var(--color-sandstone);
    border-color: rgba(201, 184, 154, 0.24);
}

.ibrv2-bento-content h3 {
    margin: 0 0 8px;
    font-size: clamp(1.1rem, 2vw, 1.65rem);
}

.ibrv2-bento-content p,
.ibrv2-bento-content time {
    display: block;
    margin: 0 0 4px;
    color: var(--color-mist);
    font-size: 0.92rem;
}

.ibrv2-ancestors-footer {
    max-width: 760px;
    margin: 38px auto 0;
}

.ibrv2-ancestors-footer p:last-child {
    color: var(--color-sandstone);
}

.ibrv2-trust-panel {
    margin-top: 58px;
    padding: clamp(28px, 4vw, 48px);
    background:
        radial-gradient(circle at 16% 10%, rgba(184, 115, 51, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(15, 43, 40, 0.82), rgba(6, 11, 15, 0.9));
    border: var(--border-subtle);
    border-top: var(--border-copper);
    border-radius: 4px;
}

.ibrv2-trust-panel header {
    margin-bottom: 28px;
    text-align: center;
}

.ibrv2-trust-panel h3 {
    margin-top: 10px;
    font-size: clamp(1.5rem, 3vw, 2.35rem);
}

.ibrv2-trust-card {
    height: 100%;
    padding: 26px;
    text-align: center;
    background: rgba(6, 11, 15, 0.28);
    border: var(--border-subtle);
    border-radius: 4px;
}

.ibrv2-trust-card i {
    display: inline-flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    color: var(--color-copper-glow);
    border: 1px solid rgba(184, 115, 51, 0.35);
    border-radius: 50%;
}

.ibrv2-trust-card h4 {
    font-size: 1rem;
}

.ibrv2-preview-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.ibrv2-preview-heading i {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    color: var(--color-copper-glow);
    border: 1px solid rgba(201, 184, 154, 0.28);
    border-radius: 50%;
}

.ibrv2-preview-heading h3 {
    margin: 0;
    font-size: 1.14rem;
}

.ibrv2-region-demo {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
}

.ibrv2-region-demo > div {
    display: grid;
    grid-template-columns: 110px 1fr 48px;
    gap: 12px;
    align-items: center;
    color: var(--color-mist);
}

.ibrv2-region-demo div div {
    overflow: hidden;
    height: 8px;
    background: rgba(6, 11, 15, 0.54);
    border: 1px solid rgba(201, 184, 154, 0.16);
    border-radius: 999px;
}

.ibrv2-region-demo b {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--color-aged-copper), var(--color-copper-glow));
}

.ibrv2-region-demo strong {
    color: var(--color-copper-glow);
}

.ibrv2-chart-demo,
.ibrv2-haplo-demo,
.ibrv2-export-demo {
    display: flex;
    min-height: 150px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 22px;
    color: var(--color-sandstone);
    background: rgba(6, 11, 15, 0.36);
    border: 1px dashed rgba(201, 184, 154, 0.26);
    border-radius: 4px;
}

.ibrv2-chart-demo {
    flex-direction: column;
}

.ibrv2-chart-demo i {
    color: var(--color-copper-glow);
}

.ibrv2-haplo-demo,
.ibrv2-export-demo {
    align-items: stretch;
    flex-direction: column;
}

.ibrv2-haplo-demo span,
.ibrv2-export-demo span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(15, 43, 40, 0.62);
    border: var(--border-subtle);
    border-radius: 2px;
}

.ibrv2-haplo-demo b {
    color: var(--color-copper-glow);
}

.ibrv2-haplo-demo em {
    color: var(--color-sandstone);
    font-style: normal;
}

.ibrv2-export-demo i {
    color: var(--color-copper-glow);
}

/* Painted band behind the closing offer. Mirrors .aea2-pricing-section: the
   artwork is a ::before layer (no `filter`, which silently blanks a
   fixed-attachment background in Chromium/WebKit) with a scrim above it,
   rather than the partial's own low-opacity <img> which the Iberian palette
   washed out completely. */
.ibrv2-pricing-section {
    position: relative;
    background-color: transparent !important;
}

.ibrv2-pricing-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('/img/reports/ancestry/iberian/v2/section-story.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.ibrv2-pricing-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 50% 12%, rgba(184, 115, 51, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(6, 11, 15, 0.9), rgba(11, 20, 27, 0.66) 32%, rgba(11, 20, 27, 0.8) 68%, rgba(6, 11, 15, 0.95));
}

/* The partial's own background <img> would sit on top of the plate above. */
.ibrv2-pricing-section .rpc-pricing-bg {
    display: none;
}

@media (max-width: 480px) {
    .ibrv2-pricing-section::before {
        background-attachment: scroll;
    }
}

.ibrv2-main .rpc-pricing-eyebrow {
    color: var(--color-sandstone) !important;
    font-family: var(--font-display);
    letter-spacing: 0.24em;
}

.ibrv2-main .rpc-pricing-heading {
    color: var(--color-parchment) !important;
    font-family: var(--font-display);
    letter-spacing: 0.16em;
}

.ibrv2-main .rpc-pricing-lead,
.ibrv2-main .rpc-pricing-trust p,
.ibrv2-main .rpc-pricing-tagline {
    color: var(--color-mist) !important;
}

/* The shared partial ships these as unstyled text rows, so a bare background
   colour renders as edge-to-edge bars behind the text. Each needs its own
   padded, rounded card box. */
.ibrv2-main .rpc-pricing-offer {
    max-width: 420px;
    margin: 0 auto 2rem;
    padding: 26px 34px;
    background: rgba(15, 43, 40, 0.78);
    border: 1px solid rgba(184, 115, 51, 0.32);
    border-radius: 4px;
    box-shadow: var(--shadow-card);
}

.ibrv2-main .rpc-pricing-feature {
    padding: 11px 14px;
    background: rgba(15, 43, 40, 0.62);
    border: 1px solid rgba(184, 115, 51, 0.26);
    border-radius: 4px;
    color: var(--color-mist);
}

.ibrv2-main .rpc-pricing-alt-link {
    background: rgba(15, 43, 40, 0.72);
    border-color: rgba(184, 115, 51, 0.32);
}

.ibrv2-main .rpc-pricing-offer-amount,
.ibrv2-main .rpc-pricing-feature i,
.ibrv2-main .rpc-pricing-alt-price,
.ibrv2-main .rpc-pricing-trust-icons i {
    color: var(--color-copper-glow) !important;
}

.ibrv2-main .rpc-pricing-cta-btn {
    color: var(--color-midnight) !important;
    background: linear-gradient(180deg, var(--color-copper-glow), var(--color-copper)) !important;
    border: 1px solid rgba(242, 232, 214, 0.24) !important;
    box-shadow: var(--shadow-copper-glow) !important;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ibrv2-related-products {
    padding: clamp(72px, 9vw, 120px) 15px;
    background:
        radial-gradient(circle at 14% 12%, rgba(30, 61, 52, 0.72), transparent 30%),
        linear-gradient(180deg, var(--color-midnight), var(--color-obsidian));
}

.ibrv2-related-title {
    max-width: 1180px;
    margin: 0 auto 34px;
    color: var(--color-parchment);
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
}

.ibrv2-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    max-width: 1180px;
    margin: 0 auto;
}

.ibrv2-related-card {
    overflow: hidden;
    background: linear-gradient(180deg, rgba(30, 61, 52, 0.92), rgba(11, 20, 27, 0.96));
    border: 1px solid rgba(184, 115, 51, 0.26);
    border-radius: 4px;
    box-shadow: var(--shadow-card);
    transition: transform var(--motion-base) var(--ease-ancient), border-color var(--motion-base) var(--ease-ancient);
}

.ibrv2-related-card:hover {
    border-color: rgba(184, 115, 51, 0.58);
    transform: translateY(-4px);
}

.ibrv2-related-img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    filter: saturate(0.78) contrast(1.04);
}

.ibrv2-related-content {
    padding: 22px;
}

.ibrv2-related-content h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.ibrv2-related-content p {
    font-size: 0.95rem;
}

.ibrv2-related-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-copper-glow);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ibrv2-related-link:hover {
    color: var(--color-parchment);
    text-decoration: none;
}

.animate-fade-in,
.animate-fade-in-up {
    animation-duration: var(--motion-ritual);
    animation-fill-mode: both;
    animation-timing-function: var(--ease-ritual);
}

.animate-fade-in {
    animation-name: ibrv2-fade-in;
}

.animate-fade-in-up {
    animation-name: ibrv2-fade-in-up;
}

.delay-1 {
    animation-delay: 120ms;
}

.delay-2 {
    animation-delay: 240ms;
}

.delay-3 {
    animation-delay: 360ms;
}

.delay-4 {
    animation-delay: 520ms;
}

@keyframes ibrv2-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes ibrv2-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(28px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ibrv2-breathe {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(7px);
    }
}

@media (max-width: 1199.98px) {
    .ibrv2-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .ibrv2-page-nav {
        display: none;
    }

    .ibrv2-hero {
        min-height: 82vh;
    }

    .ibrv2-bento-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 280px;
    }

    .ibrv2-bento-card {
        min-height: 280px;
    }

    .ibrv2-bento-large,
    .ibrv2-bento-medium,
    .ibrv2-bento-small {
        grid-column: span 1;
        grid-row: span 1;
    }
}

@media (max-width: 767.98px) {
    .ibrv2-section {
        padding: 78px 0;
    }

    .ibrv2-hero-title {
        letter-spacing: 0.12em;
    }

    .ibrv2-hero-price {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        border-radius: 4px;
    }

    .ibrv2-btn {
        width: 100%;
    }

    .ibrv2-map-shell {
        min-height: 660px;
    }

    .ibrv2-map-preview-map {
        min-height: 660px;
    }

    .ibrv2-map-panel {
        width: auto;
        margin: 26px;
        padding: 24px;
    }

    .ibrv2-region-demo > div {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

@media (max-width: 575.98px) {
    .ibrv2-ornamental-divider::before,
    .ibrv2-ornamental-divider::after {
        width: 58px;
    }

    .ibrv2-culture-wide {
        display: block;
    }

    .ibrv2-culture-wide .ibrv2-icon-halo {
        margin-bottom: 22px;
    }

    .ibrv2-bento-grid,
    .ibrv2-related-grid {
        grid-template-columns: 1fr;
    }

    .ibrv2-back-to-top {
        right: 16px;
        bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ibrv2-main *,
    .ibrv2-main *::before,
    .ibrv2-main *::after,
    .animate-fade-in,
    .animate-fade-in-up {
        animation: none !important;
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

/* ==========================================================================
   Painted section plates
   Full-bleed commissioned illustrations behind a scrim. A section opts in with
   .ibrv2-plate and sets --ibrv2-plate to the image URL; --ibrv2-plate-top/mid/
   bottom tune the scrim so a brighter plate can be pushed further back without
   editing the gradient itself.

   Sections are already positioned by `.ibrv2-main > *`, and z-index: -1 is safe
   here because that same rule gives every section its own stacking context, so
   the plate can never slide behind the page ground.
   ========================================================================== */
.ibrv2-plate::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(180deg,
            rgba(11, 20, 27, var(--ibrv2-plate-top, 0.72)) 0%,
            rgba(11, 20, 27, var(--ibrv2-plate-mid, 0.82)) 52%,
            rgba(6, 11, 15, var(--ibrv2-plate-bottom, 0.94)) 100%),
        var(--ibrv2-plate);
    background-size: cover, cover;
    background-position: center top, center top;
    background-repeat: no-repeat, no-repeat;
    /* Do not add `filter` to this rule if background-attachment is ever changed
       to `fixed`: Chromium/WebKit can then fail to paint the background image
       entirely. The scrim above already handles the darkening. */
}

.ibrv2-story { --ibrv2-plate: url('/img/reports/ancestry/iberian/v2/section-story.webp'); }
.ibrv2-revelations { --ibrv2-plate: url('/img/reports/ancestry/iberian/v2/section-discover.webp'); }
.ibrv2-map-preview { --ibrv2-plate: url('/img/reports/ancestry/iberian/v2/section-map.webp'); }
.ibrv2-ancestors { --ibrv2-plate: url('/img/reports/ancestry/iberian/v2/section-faces.webp'); }
.ibrv2-science { --ibrv2-plate: url('/img/reports/ancestry/iberian/v2/section-science.webp'); }
.ibrv2-report-preview { --ibrv2-plate: url('/img/reports/ancestry/iberian/v2/section-preview.webp'); }

/* The map plate sits behind an opaque map shell, so only its margins show and
   it can stay lighter. The faces plate sits behind portrait cards that already
   carry a lot of detail, so it is pushed further back. */
.ibrv2-map-preview.ibrv2-plate::before {
    --ibrv2-plate-top: 0.66;
    --ibrv2-plate-mid: 0.78;
}

.ibrv2-ancestors.ibrv2-plate::before {
    --ibrv2-plate-top: 0.80;
    --ibrv2-plate-mid: 0.88;
}

@media (max-width: 860px) {
    /* A tall phone section would stretch a landscape plate; anchor it to the
       top at its natural aspect instead of stretching it to the section box. */
    .ibrv2-plate::before {
        background-size: cover, 190% auto;
    }
}

/* ==========================================================================
   Card artwork
   Each painted card panel is exposed through --ibrv2-card-art. The pseudo
   element carries the art *and* its legibility scrim as two background layers,
   because .ibrv2-artifact-card::after is already the decorative copper circle.
   ========================================================================== */
.ibrv2-culture-card,
.ibrv2-revelation-card,
.ibrv2-science-card,
.ibrv2-preview-card {
    isolation: isolate;
}

.ibrv2-culture-card::before,
.ibrv2-revelation-card::before,
.ibrv2-science-card::before,
.ibrv2-preview-card::before {
    content: "";
    position: absolute;
    inset: 0;
    /* Above the card's own gradient background, below both the ::after circle
       and the card content, which `.ibrv2-artifact-card > *` lifts to z-index 1. */
    z-index: -1;
    background-image:
        linear-gradient(180deg,
            rgba(11, 20, 27, var(--ibrv2-card-top, 0.52)) 0%,
            rgba(11, 20, 27, var(--ibrv2-card-mid, 0.74)) 46%,
            rgba(6, 11, 15, var(--ibrv2-card-bottom, 0.95)) 100%),
        var(--ibrv2-card-art, none);
    background-size: cover, cover;
    background-position: center, var(--ibrv2-card-art-pos, center top);
    background-repeat: no-repeat, no-repeat;
    opacity: var(--ibrv2-card-art-opacity, 1);
    transition: opacity var(--motion-base) var(--ease-ancient);
}

.ibrv2-culture-card:hover::before,
.ibrv2-revelation-card:hover::before,
.ibrv2-science-card:hover::before,
.ibrv2-preview-card:hover::before {
    --ibrv2-card-top: 0.42;
    --ibrv2-card-mid: 0.66;
}

/* Culture cards are the tallest panels and the art is the point of them, so
   they keep more of their own light than the denser text cards. */
.ibrv2-culture-card {
    --ibrv2-card-top: 0.40;
    --ibrv2-card-mid: 0.64;
    min-height: 260px;
}

/* The wide Roman & Medieval card is a landscape crop of a portrait panel, so
   anchor the art to the upper third where the composition sits. */
.ibrv2-culture-wide {
    --ibrv2-card-art-pos: center 28%;
}

/* Preview cards hold demo charts and bars that need a calmer ground. */
.ibrv2-preview-card {
    --ibrv2-card-top: 0.70;
    --ibrv2-card-mid: 0.86;
}

/* ========================================
   FAQ SECTION
   ======================================== */
.ibrv2-faq {
    background: linear-gradient(180deg, var(--color-midnight) 0%, var(--color-deep-emerald) 100%);
}

.ibrv2-faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.ibrv2-faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ibrv2-faq-item:last-child {
    border-bottom: none;
}

.ibrv2-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 24px 0;
    background: transparent;
    border: none;
    color: #F4EFE6;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ibrv2-faq-question:hover {
    color: var(--color-copper-glow);
}

.ibrv2-faq-icon {
    flex-shrink: 0;
    margin-left: 16px;
    color: var(--color-copper);
    transition: transform 0.4s ease;
}

.ibrv2-faq-item.active .ibrv2-faq-icon {
    transform: rotate(45deg);
}

.ibrv2-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ibrv2-faq-item.active .ibrv2-faq-answer {
    max-height: 500px;
}

.ibrv2-faq-answer-inner {
    padding: 0 0 24px;
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(244, 239, 230, 0.75);
}

@media (max-width: 768px) {
    .ibrv2-faq-question {
        font-size: 1rem;
        padding: 20px 0;
    }
}

@media print {
    .ibrv2-faq-answer {
        max-height: none !important;
    }
}

/* Regional Report Conversion Boost: theme this page's social-proof + score-teaser sections */
.ibrv2-main .rrsp-section {
    --rrsp-accent: var(--color-copper);
    --rrsp-bg: var(--color-deep-emerald);
}
.ibrv2-main .rrst-section {
    --rrst-accent: var(--color-copper);
    --rrst-bg: var(--color-deep-emerald);
}
