/* TNC FlipBook 3D — Block editor styles */

/* ── Shared ────────────────────────────────────────────────────────────────── */
.tncfb-block-wrap {
    position: relative;
}
.tncfb-block-placeholder {
    padding: 24px;
    text-align: center;
}
.tncfb-block-placeholder .components-placeholder__label {
    font-weight: 600;
}
.tncfb-block-placeholder .components-placeholder__instructions {
    margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   EMBED BLOCK — WordPress-style dashed placeholder
   ═══════════════════════════════════════════════════════════════════════════════ */
.tncfb-embed-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 4px dashed #c3c4c7;
    border-radius: 4px;
    background: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   INSERTER PREVIEW ILLUSTRATION — browser chrome + book spread
   ═══════════════════════════════════════════════════════════════════════════════ */
.tncfb-block-preview-illustration {
    padding: 16px;
    background: linear-gradient(135deg, #0a1628 0%, #0f2d35 100%);
    border-radius: 8px;
    pointer-events: none;
}
.tncfb-bp-window {
    background: #e8eaf0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.tncfb-bp-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #2d3140;
}
.tncfb-bp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.tncfb-bp-dot-r { background: #ff5f57; }
.tncfb-bp-dot-y { background: #febc2e; }
.tncfb-bp-dot-g { background: #28c840; }
.tncfb-bp-url {
    flex: 1;
    margin-left: 12px;
    padding: 4px 12px;
    background: #1e2230;
    border-radius: 4px;
    color: #a8b0c0;
    font-size: 11px;
    text-align: center;
    font-family: -apple-system, sans-serif;
}
.tncfb-bp-stage {
    padding: 24px;
    background: #e8eaf0;
}
.tncfb-bp-book {
    display: flex;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    min-height: 200px;
}
.tncfb-bp-page {
    flex: 1;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tncfb-bp-page + .tncfb-bp-page {
    border-left: 1px solid #f0f1f5;
}
.tncfb-bp-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}
.tncfb-bp-row-end { margin-top: auto; margin-bottom: 0; }
.tncfb-bp-fig {
    flex: 1;
    padding: 16px 8px;
    border-radius: 4px;
    color: #6b7384;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.05em;
    font-family: -apple-system, sans-serif;
}
.tncfb-bp-fig-wide { padding: 22px 8px; }
.tncfb-bp-fig-amber { background: #e6c89a; }
.tncfb-bp-fig-slate { background: #d8dde8; }
.tncfb-bp-fig-green { background: #b8c9a3; }
.tncfb-bp-h {
    font-size: 9px;
    font-weight: 700;
    color: #2a3340;
    letter-spacing: 0.08em;
    margin-top: 4px;
}
.tncfb-bp-h-2 { margin-top: 10px; }
.tncfb-bp-line {
    height: 3px;
    background: #d8dde8;
    border-radius: 2px;
}
.tncfb-bp-line-short { width: 60%; }
.tncfb-bp-spacer { flex: 1; }

/* Page-flow blocks (header + body lines around the book/cover) */
.tncfb-bp-page-h {
    width: 35%;
    height: 8px;
    background: #c4cad6;
    border-radius: 2px;
    margin-bottom: 10px;
}
.tncfb-bp-page-line {
    height: 4px;
    background: #d8dde8;
    border-radius: 2px;
    margin-bottom: 6px;
}
.tncfb-bp-page-line-short { width: 70%; }
.tncfb-bp-page-line-mt { margin-top: 16px; }

/* Link variant — text link + popup overlay */
.tncfb-bp-stage-link { position: relative; }
.tncfb-bp-textlink {
    display: inline-block;
    color: #0055d4;
    font-size: 11px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    margin: 4px 0 8px;
    font-family: -apple-system, sans-serif;
}
.tncfb-bp-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.tncfb-bp-popup {
    width: 78%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    padding: 4px;
}
.tncfb-bp-popup .tncfb-bp-book {
    box-shadow: none;
    min-height: 150px;
}
.tncfb-bp-popup .tncfb-bp-page { padding: 12px; }

/* Image-link variant — cover with hover overlay */
.tncfb-bp-cover {
    position: relative;
    width: 60%;
    margin: 4px 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.tncfb-bp-cover-art {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #e6c89a 0%, #d8dde8 60%, #b8c9a3 100%);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tncfb-bp-cover-h {
    width: 60%;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
}
.tncfb-bp-cover-h-sub { width: 40%; height: 4px; }
.tncfb-bp-cover-fig {
    margin-top: auto;
    width: 70%;
    height: 26px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 3px;
}
.tncfb-bp-cover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tncfb-bp-cover-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.tncfb-bp-cover-icon::before,
.tncfb-bp-cover-icon::after {
    content: '';
    position: absolute;
    top: 14px;
    width: 8px;
    height: 20px;
    background: #0055d4;
    border-radius: 1px;
}
.tncfb-bp-cover-icon::before { left: 14px; transform: skewY(-8deg); }
.tncfb-bp-cover-icon::after  { right: 14px; transform: skewY(8deg); background: #1d4551; }

/* Icon */
.tncfb-embed-card-icon {
    margin-bottom: 12px;
}
.tncfb-embed-card-icon .dashicons,
.tncfb-embed-card-icon img {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #3858e9;
    display: inline-block;
    object-fit: contain;
}

/* Title */
.tncfb-embed-card-title {
    font-size: 20px;
    font-weight: 400;
    color: #1e1e1e;
    margin-bottom: 4px;
    text-align: center;
}

/* Dimensions */
.tncfb-embed-card-meta {
    font-size: 13px;
    color: #757575;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   LINK BLOCK — realistic link / button preview
   ═══════════════════════════════════════════════════════════════════════════════ */
.tncfb-link-preview-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Text link style */
.tncfb-link-text-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
}
.tncfb-link-text-preview .tncfb-link-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #4a9eff;
    flex-shrink: 0;
    object-fit: contain;
}
.tncfb-link-text-inner {
    color: #4a9eff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(74, 158, 255, 0.4);
    cursor: text;
    font-size: inherit;
    line-height: 1.6;
}
.tncfb-link-text-inner:focus {
    text-decoration-color: #4a9eff;
    outline: none;
}

/* Button style */
.tncfb-link-button-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #4a9eff 0%, #3b82f6 100%);
    color: #fff;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: text;
    font-size: inherit;
    line-height: 1.5;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
    width: fit-content;
    transition: box-shadow 0.2s;
}
.tncfb-link-button-preview:hover {
    box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
}
.tncfb-link-button-preview .tncfb-link-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    object-fit: contain;
}
.tncfb-link-button-text {
    color: #fff;
    cursor: text;
}
.tncfb-link-button-text:focus {
    outline: none;
}

/* Badge below link/button */
.tncfb-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
    width: fit-content;
}
.tncfb-link-badge-sep {
    margin: 0 2px;
    color: #cbd5e1;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   IMAGE LINK BLOCK — image with overlay and badge
   ═══════════════════════════════════════════════════════════════════════════════ */
.tncfb-image-link-figure {
    position: relative;
    margin: 0;
    line-height: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.tncfb-image-link-figure img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Center overlay — book icon circle */
.tncfb-image-link-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.25s;
    pointer-events: none;
}
.tncfb-image-link-figure:hover .tncfb-image-link-overlay {
    background: rgba(0, 0, 0, 0.3);
}
.tncfb-image-link-overlay .dashicons,
.tncfb-image-link-overlay img {
    width: 48px;
    height: 48px;
    font-size: 48px;
    color: #fff;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.25s, transform 0.25s;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    object-fit: contain;
}
.tncfb-image-link-figure:hover .tncfb-image-link-overlay .dashicons,
.tncfb-image-link-figure:hover .tncfb-image-link-overlay img {
    opacity: 1;
    transform: scale(1);
}

/* Bottom badge bar */
.tncfb-image-link-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 12px;
    line-height: 1;
    pointer-events: none;
}
.tncfb-image-link-badge-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tncfb-image-link-badge-mode {
    flex-shrink: 0;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    background: rgba(74, 158, 255, 0.9);
    border-radius: 3px;
    font-weight: 600;
}
