/*
 * Bellencinista Notes Styles
 * FULL CLEAN BUILD — Corner Ribbon Wrap (true ribbon w/ folded tails)
 */

.bellencinista-notes {
    background: #fbf9f6;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;

    /* padding + width controlled by CSS variables (set inline via plugin settings) */
    padding: var(--bn-padding, 24px) calc(var(--bn-padding, 24px) + 4px);

    /* ✅ headroom for ribbon */
    padding-top: calc(var(--bn-padding, 24px) + 92px);

    margin: 4rem auto;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    position: relative;

    /* typography controlled by CSS variables */
    font-family: var(--bn-font-family, inherit);

    /* ✅ allow ribbon to hang out */
    overflow: visible;

    max-width: var(--bn-max-width, 80%);
    width: calc(100% - 2rem);
}

/* Floating effect */
.bellencinista-notes.floating {
    position: sticky;
    top: calc(100vh - 250px - 2rem);
    margin-left: auto;
    margin-right: auto;
    z-index: 999;
    max-width: var(--bn-float-max-width, 70%);
    width: auto;
}

/* paper-like texture */
.bellencinista-notes::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px);
    background-size: 100% 24px;
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
}

/* Base header styles (ribbon overrides below) */
.bellencinista-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.125rem;
    position: relative;
    z-index: 1;
}

.bellencinista-icon {
    font-size: 0.875rem;
    color: #a68a64;
}

.bellencinista-title {
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b5c48;
    margin: 0;
    font-weight: 600;
}

.bellencinista-body {
    position: relative;
    z-index: 1;
    font-size: var(--bn-font-size, 1rem);
}

.bellencinista-body p {
    font-size: inherit;
    line-height: 1.7;
    color: #2f2a25;
    margin: 0;
}

/* Variants */
.bellencinista-notes.style-margin {
    border-left: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    padding-left: 24px;
    box-shadow: none;
}

/* Notepad fold corner */
.bellencinista-notes.style-notepad::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 40px solid #fbf9f6;
    border-left: 40px solid transparent;
    box-shadow: -4px 4px 6px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.bellencinista-notes.style-notepad {
    overflow: visible;
}

/* Sticky note */
.bellencinista-notes.style-sticky {
    background: #fff9e7;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 6px;

    padding: 26px 30px;
    padding-top: calc(26px + 92px); /* ribbon headroom */

    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    overflow: visible;
}

.bellencinista-notes.style-sticky::before {
    content: none;
}

.bellencinista-notes.style-stationery {
    border: 1px dashed rgba(0, 0, 0, 0.1);
    border-radius: 0;
    box-shadow: none;

    padding: 32px 36px;
    padding-top: calc(32px + 92px); /* ribbon headroom */

    background: #fcfbfa;
}

/* Theme colors */
.bellencinista-notes.theme-terracotta .bellencinista-icon,
.bellencinista-notes.theme-terracotta .bellencinista-title { color: #b76e50; }
.bellencinista-notes.theme-terracotta .bellencinista-body p { color: #4a2f25; }

.bellencinista-notes.theme-glam .bellencinista-icon,
.bellencinista-notes.theme-glam .bellencinista-title { color: #a87aa5; }
.bellencinista-notes.theme-glam .bellencinista-body p { color: #3b2b3a; }

.bellencinista-notes.theme-high-contrast { background: #ffffff; border-color: rgba(0, 0, 0, 0.2); }
.bellencinista-notes.theme-high-contrast .bellencinista-icon,
.bellencinista-notes.theme-high-contrast .bellencinista-title { color: #111111; }
.bellencinista-notes.theme-high-contrast .bellencinista-body p { color: #222222; }

.bellencinista-notes.theme-spring .bellencinista-icon,
.bellencinista-notes.theme-spring .bellencinista-title { color: #6f9e64; }
.bellencinista-notes.theme-spring .bellencinista-body p { color: #3a4d36; }

.bellencinista-notes.theme-summer .bellencinista-icon,
.bellencinista-notes.theme-summer .bellencinista-title { color: #d4a351; }
.bellencinista-notes.theme-summer .bellencinista-body p { color: #4d4026; }

.bellencinista-notes.theme-autumn .bellencinista-icon,
.bellencinista-notes.theme-autumn .bellencinista-title { color: #c0653e; }
.bellencinista-notes.theme-autumn .bellencinista-body p { color: #4e3323; }

.bellencinista-notes.theme-winter .bellencinista-icon,
.bellencinista-notes.theme-winter .bellencinista-title { color: #6b92b9; }
.bellencinista-notes.theme-winter .bellencinista-body p { color: #2f415c; }

.bellencinista-notes.theme-pink .bellencinista-icon,
.bellencinista-notes.theme-pink .bellencinista-title { color: #d289a5; }
.bellencinista-notes.theme-pink .bellencinista-body p { color: #4a2837; }

.bellencinista-notes.theme-blue .bellencinista-icon,
.bellencinista-notes.theme-blue .bellencinista-title { color: #6e84c5; }
.bellencinista-notes.theme-blue .bellencinista-body p { color: #283869; }

.bellencinista-notes.theme-mint .bellencinista-icon,
.bellencinista-notes.theme-mint .bellencinista-title { color: #8fb2a7; }
.bellencinista-notes.theme-mint .bellencinista-body p { color: #28453b; }

/* Dark mode */
.bellencinista-notes.dark-mode {
    background: #2b2a28;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.bellencinista-notes.dark-mode::before {
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
}
.bellencinista-notes.dark-mode .bellencinista-icon { color: #c4b28c; }
.bellencinista-notes.dark-mode .bellencinista-title { color: #dcd4c7; }
.bellencinista-notes.dark-mode .bellencinista-body p { color: #dfd9d0; }

/* =========================================================
   Force body font-size to respect admin setting (theme-proof)
   ========================================================= */
.bellencinista-notes .bellencinista-body{
    font-size: var(--bn-font-size, 1rem) !important;
    line-height: 1.7 !important;
}
.bellencinista-notes .bellencinista-body p,
.bellencinista-notes .bellencinista-body span,
.bellencinista-notes .bellencinista-body a,
.bellencinista-notes .bellencinista-body li,
.bellencinista-notes .bellencinista-body em,
.bellencinista-notes .bellencinista-body strong{
    font-size: inherit !important;
    line-height: inherit !important;
}

/* =========================================================

   BELLENCINISTA NOTES — CORNER RIBBON (FINAL)
   - True ribbon: band + tails + corner fold shadow
   - Anchored to the top-left corner of the note
   - Subtle animation (respects reduced-motion)
   ========================================================= */

/* Allow ribbon to hang outside, and reserve headroom so it never hits body text */
.bellencinista-notes{
    overflow: visible !important;

    /* Extra headroom so content never collides with the ribbon */
    --bn-ribbon-pad-top: 132px;
    padding-top: calc(var(--bn-padding, 24px) + var(--bn-ribbon-pad-top)) !important;

    /* tweak knobs (snap to the TRUE top-left corner + wrap/overlap more) */
    --bn-ribbon-top: -52px;
    --bn-ribbon-left: -132px;
    --bn-ribbon-tilt: -16deg;

    --bn-ribbon-height: 60px;
    --bn-ribbon-radius: 14px;

    /* Ribbon finish (silvery-blue with a magenta sheen, semi-transparent) */
    --bn-ribbon-border: rgba(20, 18, 28, 0.22);
    --bn-ribbon-fill-top: rgba(165, 205, 255, 0.38); /* silvery blue */
    --bn-ribbon-fill-bot: rgba(255, 120, 205, 0.22); /* transparent magenta */
    --bn-ribbon-tail: rgba(185, 210, 255, 0.32);
}

/* Pin the header to the note corner */
.bellencinista-notes .bellencinista-header{
    position: absolute !important;
    top: var(--bn-ribbon-top) !important;
    left: var(--bn-ribbon-left) !important;

    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;

    margin: 0 !important;
    padding: 0 !important;

  transform: rotate(var(--bn-ribbon-tilt)) scale(var(--bn-ribbon-scale, 1)) !important;
    transform-origin: left top !important;

    z-index: 90 !important;
    pointer-events: none; /* purely decorative */
}

/* Wrap illusion: a soft “under fold” shadow that sits under the band near the corner */
.bellencinista-notes .bellencinista-header::before{
    content: "";
    position: absolute;
    left: 72px;
    top: calc(var(--bn-ribbon-height) - 8px);

    width: 44px;
    height: 26px;

    background: rgba(0,0,0,0.18);
    clip-path: polygon(0 0, 100% 0, 68% 100%, 0 100%);

    opacity: 0.28;
    filter: blur(0.15px);
    z-index: 0;
}

/* Optional vertical “post” (keeps your original vibe, but subtle) */
.bellencinista-notes .bellencinista-header::after{
    content: "";
    position: absolute;
    left: 12px;
    top: 22px;

    width: 10px;
    height: calc(var(--bn-ribbon-height) + 30px);

    border-radius: 10px;
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.12);

    box-shadow: 0 10px 18px rgba(0,0,0,0.10);
    z-index: 0;
}

/* Icon sits above the ribbon */
.bellencinista-notes .bellencinista-icon{
    position: relative !important;
    z-index: 2 !important;

    font-size: clamp(18px, 1.8vw, 26px) !important;
    color: #191412 !important;
    opacity: 0.95 !important;
    transform: translateY(-1px) !important;
}

/* The ribbon band */
.bellencinista-notes .bellencinista-title,
.bellencinista-notes .bellencinista-header h3{
    position: relative !important;
    z-index: 2 !important;

    display: inline-flex !important;
    align-items: center !important;

    height: var(--bn-ribbon-height) !important;
    padding: 0 56px !important;

    border-radius: var(--bn-ribbon-radius) !important;
    border: 2px solid var(--bn-ribbon-border) !important;

    background: linear-gradient(180deg, var(--bn-ribbon-fill-top), var(--bn-ribbon-fill-bot)) !important;

    color: #191412 !important;
    text-transform: uppercase !important;
    font-weight: 900 !important;
    letter-spacing: 0.22em !important;
    line-height: 1 !important;

  font-size: var(--bn-ribbon-text-size, clamp(18px, 1.7vw, 26px)) !important;

    margin: 0 !important;

    box-shadow:
        0 18px 34px rgba(0,0,0,0.16),
        inset 0 1px 0 rgba(255,255,255,0.70) !important;
}

/* Left tail (with V-cut) */
.bellencinista-notes .bellencinista-title::before,
.bellencinista-notes .bellencinista-header h3::before{
    content: "" !important;
    position: absolute !important;
    left: -56px !important;
    top: 0 !important;

    width: 58px !important;
    height: 100% !important;

    background: linear-gradient(180deg, var(--bn-ribbon-tail), rgba(224,224,224,0.98)) !important;
    border: 2px solid var(--bn-ribbon-border) !important;
    border-right: 0 !important;

    border-top-left-radius: 12px !important;
    border-bottom-left-radius: 12px !important;

    /* V-cut on the far-left end */
    clip-path: polygon(100% 0, 0 0, 22% 50%, 0 100%, 100% 100%) !important;

    box-shadow: 0 12px 22px rgba(0,0,0,0.12) !important;
}

/* Right tail (with V-cut) */
.bellencinista-notes .bellencinista-title::after,
.bellencinista-notes .bellencinista-header h3::after{
    content: "" !important;
    position: absolute !important;
    right: -56px !important;
    top: 0 !important;

    width: 58px !important;
    height: 100% !important;

    background: linear-gradient(180deg, var(--bn-ribbon-tail), rgba(224,224,224,0.98)) !important;
    border: 2px solid var(--bn-ribbon-border) !important;
    border-left: 0 !important;

    border-top-right-radius: 12px !important;
    border-bottom-right-radius: 12px !important;

    /* V-cut on the far-right end */
    clip-path: polygon(0 0, 100% 0, 78% 50%, 100% 100%, 0 100%) !important;

    filter: drop-shadow(0 10px 16px rgba(0,0,0,0.14)) !important;
}

/* ===============================
   Animation (premium + subtle)
   =============================== */

@keyframes bnRibbonIn{
    0%   { opacity: 0; transform: rotate(calc(var(--bn-ribbon-tilt) - 6deg)) translate(-14px, -10px) scale(calc(var(--bn-ribbon-scale, 1) * 0.97)); }
    100% { opacity: 1; transform: rotate(var(--bn-ribbon-tilt)) translate(0, 0) scale(var(--bn-ribbon-scale, 1)); }
}

@keyframes bnRibbonFloat{
    0%,100% { transform: rotate(var(--bn-ribbon-tilt)) translate(0, 0) scale(var(--bn-ribbon-scale, 1)); }
    50%     { transform: rotate(var(--bn-ribbon-tilt)) translate(0, -6px) scale(var(--bn-ribbon-scale, 1)); }
}

.bellencinista-notes .bellencinista-header{
    animation:
        bnRibbonIn 520ms cubic-bezier(.2,.8,.2,1) both,
        bnRibbonFloat 4.6s ease-in-out 700ms infinite;
}

@media (prefers-reduced-motion: reduce){
    .bellencinista-notes .bellencinista-header{ animation: none !important; }
}

/* Sticky note variant is rotated; keep ribbon hugging the corner */
.bellencinista-notes.style-sticky{
    /* More aggressive because the card itself is rotated */
    --bn-ribbon-top: -62px;
    --bn-ribbon-left: -156px;
    --bn-ribbon-tilt: -18deg;
}


/* =========================================================
   UPDATE — GLAM WRAPPED BOW RIBBON FOR NOTEPAD
   - Gives the notepad a luxe bow that feels wrapped around the card
   - Top band + side band create the wrapped illusion
   - Diagonal ribbon sits across the top-left like a tied gift ribbon
   ========================================================= */

.bellencinista-notes.style-notepad{
    --bn-wrap-top-height: 24px;
    --bn-wrap-side-width: 24px;
    --bn-bow-ribbon-width: 250px;
    --bn-bow-ribbon-height: 54px;
    --bn-bow-left: -14px;
    --bn-bow-top: 10px;
    --bn-bow-tilt: -16deg;

    padding-top: calc(var(--bn-padding, 24px) + 66px) !important;
}

.bellencinista-notes.style-notepad .bellencinista-header{
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 230px !important;
    height: 146px !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    transform-origin: top left !important;
    animation: none !important;
    z-index: 14 !important;
    filter: drop-shadow(0 8px 10px rgba(92, 52, 89, 0.14));
}

/* top wrap that appears to continue across the note */
.bellencinista-notes.style-notepad .bellencinista-header::before{
    content: "" !important;
    position: absolute !important;
    top: -8px !important;
    left: 34px !important;
    width: 176px !important;
    height: var(--bn-wrap-top-height) !important;
    border-radius: 14px !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.84) 0%, rgba(252,231,243,0.96) 26%, rgba(227,183,207,0.98) 100%) !important;
    border: 1px solid rgba(156, 104, 145, 0.28) !important;
    box-shadow:
        0 2px 0 rgba(255,255,255,0.72) inset,
        0 -2px 0 rgba(146,95,130,0.10) inset,
        0 6px 12px rgba(76, 37, 74, 0.08) !important;
    z-index: 1 !important;
}

/* side wrap tucking around the left edge */
.bellencinista-notes.style-notepad .bellencinista-header::after{
    content: "" !important;
    position: absolute !important;
    top: 20px !important;
    left: -9px !important;
    width: var(--bn-wrap-side-width) !important;
    height: 110px !important;
    border-radius: 14px !important;
    background:
        linear-gradient(90deg, rgba(213,165,191,0.95) 0%, rgba(247,223,236,0.98) 55%, rgba(255,255,255,0.92) 100%) !important;
    border: 1px solid rgba(156, 104, 145, 0.24) !important;
    box-shadow:
        2px 0 0 rgba(255,255,255,0.6) inset,
        -2px 0 0 rgba(140,82,122,0.08) inset,
        6px 8px 12px rgba(77,40,73,0.08) !important;
    z-index: 1 !important;
}

/* gem center / knot */
.bellencinista-notes.style-notepad .bellencinista-icon{
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 26px !important;
    left: 16px !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: 999px !important;
    color: #7f4c73 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    background:
        radial-gradient(circle at 32% 28%, rgba(255,255,255,0.98) 0 22%, rgba(251,231,241,0.96) 23%, rgba(223,175,202,0.97) 70%, rgba(176,112,155,0.98) 100%) !important;
    border: 1px solid rgba(137, 83, 127, 0.30) !important;
    box-shadow:
        0 3px 0 rgba(255,255,255,0.70) inset,
        0 -3px 0 rgba(133,80,121,0.10) inset,
        0 10px 16px rgba(85,42,82,0.18) !important;
    z-index: 5 !important;
}

/* diagonal bow ribbon */
.bellencinista-notes.style-notepad .bellencinista-title,
.bellencinista-notes.style-notepad .bellencinista-header h3{
    position: absolute !important;
    top: var(--bn-bow-top) !important;
    left: var(--bn-bow-left) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--bn-bow-ribbon-width) !important;
    height: var(--bn-bow-ribbon-height) !important;
    padding: 0 34px 0 56px !important;
    margin: 0 !important;
    overflow: visible !important;

    transform: rotate(var(--bn-bow-tilt)) !important;
    transform-origin: center center !important;

    border-radius: 14px !important;
    border: 1px solid rgba(140, 88, 129, 0.26) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(249,231,240,0.98) 17%, rgba(234,193,216,0.99) 52%, rgba(214,153,190,0.98) 100%) !important;
    color: #5f405b !important;

    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
    font-weight: 800 !important;
    font-size: clamp(12px, 1vw, 15px) !important;
    line-height: 1 !important;
    white-space: nowrap !important;

    box-shadow:
        0 18px 24px rgba(84,42,82,0.16),
        0 3px 0 rgba(255,255,255,0.72) inset,
        0 -3px 0 rgba(151,94,137,0.10) inset !important;
    z-index: 4 !important;
}

/* soft bow loops hugging the knot */
.bellencinista-notes.style-notepad .bellencinista-title::before,
.bellencinista-notes.style-notepad .bellencinista-header h3::before{
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 18px !important;
    width: 62px !important;
    height: 46px !important;
    transform: translateY(-50%) !important;
    border-radius: 50% 58% 50% 56% !important;
    background:
        radial-gradient(circle at 28% 26%, rgba(255,255,255,0.98) 0 16%, rgba(248,224,236,0.98) 17%, rgba(225,178,203,0.98) 68%, rgba(179,112,157,0.98) 100%) !important;
    box-shadow:
        34px 0 0 -2px rgba(232,186,210,0.96),
        34px 0 0 0 rgba(148,90,134,0.14),
        0 8px 14px rgba(90,43,82,0.10) !important;
    opacity: 0.97 !important;
    z-index: -1 !important;
}

/* ribbon tails dropping below for a glam tied-bow look */
.bellencinista-notes.style-notepad .bellencinista-title::after,
.bellencinista-notes.style-notepad .bellencinista-header h3::after{
    content: "" !important;
    position: absolute !important;
    left: 18px !important;
    top: calc(100% - 4px) !important;
    width: 56px !important;
    height: 50px !important;
    background:
        linear-gradient(180deg, rgba(232,186,210,0.98) 0%, rgba(199,131,178,0.98) 100%) !important;
    clip-path: polygon(0 0, 45% 0, 32% 100%, 0 74%) !important;
    filter: drop-shadow(16px 4px 0 rgba(225,175,201,0.98)) drop-shadow(16px 4px 0 rgba(146,90,133,0.14)) drop-shadow(0 10px 12px rgba(83,42,80,0.12)) !important;
    z-index: -2 !important;
}

@media (max-width: 767px){
    .bellencinista-notes.style-notepad{
        --bn-bow-ribbon-width: 220px;
        --bn-bow-ribbon-height: 48px;
        --bn-bow-left: -18px;
        --bn-bow-top: 10px;
        --bn-bow-tilt: -14deg;
        padding-top: calc(var(--bn-padding, 24px) + 58px) !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-header{
        width: 200px !important;
        height: 130px !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-header::before{
        width: 150px !important;
        left: 32px !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-header::after{
        height: 96px !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-icon{
        top: 23px !important;
        left: 14px !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-title,
    .bellencinista-notes.style-notepad .bellencinista-header h3{
        font-size: 11px !important;
        letter-spacing: 0.11em !important;
        padding-left: 50px !important;
        padding-right: 24px !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-title::before,
    .bellencinista-notes.style-notepad .bellencinista-header h3::before{
        width: 54px !important;
        height: 40px !important;
        left: 16px !important;
        box-shadow:
            28px 0 0 -2px rgba(232,186,210,0.96),
            28px 0 0 0 rgba(148,90,134,0.14),
            0 8px 12px rgba(90,43,82,0.10) !important;
    }

    .bellencinista-notes.style-notepad .bellencinista-title::after,
    .bellencinista-notes.style-notepad .bellencinista-header h3::after{
        width: 46px !important;
        height: 42px !important;
        left: 16px !important;
        filter: drop-shadow(14px 4px 0 rgba(225,175,201,0.98)) drop-shadow(14px 4px 0 rgba(146,90,133,0.14)) drop-shadow(0 8px 10px rgba(83,42,80,0.10)) !important;
    }
}
