/*
 * jdnx.css: light-touch overrides that align jnan.co with jdnayak.com.
 * Loaded after screen.css / screen.edited.css; hand-written, no build step.
 * Tokens mirror jdnayak.com: Inter, primary blue, frosted glass, pill shapes.
 */
:root {
    --jd-primary: rgb(1 97 239);
    --jd-secondary: rgb(1 84 207);
    --jd-text: rgb(16 16 16);
    --jd-font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --jd-glass-blur: blur(24px) saturate(1.5);
    --jd-glass-light: rgba(255, 255, 255, 0.6);
    --jd-glass-light-border: rgba(229, 231, 235, 0.6);
    --jd-glass-dark: rgba(255, 255, 255, 0.12);
    --jd-glass-dark-border: rgba(255, 255, 255, 0.22);
    --jd-shadow: 0 0.375rem 1.5rem rgba(140, 152, 164, 0.18);
    --jd-radius: 16px;
    --jd-pill: 9999px;
}

/* ---------- Typography: Inter everywhere, like jdnayak.com ---------- */
body,
.post-card-excerpt,
.post-full-content,
.post-full-content h5,
.post-full-content h6,
.post-full-content table,
.site-header-content .author-meta,
.subscribe-overlay-description,
.pagination {
    font-family: var(--jd-font);
}
.post-full-content {
    font-size: 1.9rem;
    line-height: 1.7em;
    color: var(--jd-text);
}
.post-full-title,
.post-card-title,
.site-title {
    letter-spacing: -0.02em;
}

/* ---------- Primary colour ---------- */
a {
    color: var(--jd-primary);
}
.post-full-content a {
    color: var(--jd-primary);
    box-shadow: none;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.post-full-content a:hover {
    color: var(--jd-secondary);
}
.pagination a,
.newer-posts:hover,
.older-posts:hover {
    color: var(--jd-primary);
}
.progress::-webkit-progress-value { background-color: var(--jd-primary); }
.progress::-moz-progress-bar      { background-color: var(--jd-primary); }
.progress { color: var(--jd-primary); }

/* ---------- Site nav: frosted glass pill over the dark/cover header ---------- */
.site-nav .nav {
    margin-left: 0;
    padding: 0 6px;
    background: var(--jd-glass-dark);
    -webkit-backdrop-filter: var(--jd-glass-blur);
    backdrop-filter: var(--jd-glass-blur);
    border: 1px solid var(--jd-glass-dark-border);
    border-radius: var(--jd-pill);
}
.site-nav .nav li a {
    padding: 9px 14px;
    border-radius: var(--jd-pill);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.site-nav .nav li a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.14);
}
.social-link {
    border-radius: var(--jd-pill);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}
.social-link:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ---------- Floating header (post pages, on scroll): frosted glass pill ---------- */
.floating-header {
    top: 12px;
    right: 16px;
    left: 16px;
    margin: 0 auto;
    max-width: 1040px;
    height: 56px;
    overflow: hidden;
    background: var(--jd-glass-light);
    -webkit-backdrop-filter: var(--jd-glass-blur);
    backdrop-filter: var(--jd-glass-blur);
    border: 1px solid var(--jd-glass-light-border);
    border-radius: var(--jd-pill);
    box-shadow: var(--jd-shadow);
    transform: translate3d(0, -150%, 0);
}
.floating-active {
    transform: translate3d(0, 0, 0);
}
.floating-header .progress {
    bottom: 0;
}
@media (max-width: 500px) {
    .floating-header {
        top: 8px;
        right: 8px;
        left: 8px;
        height: 50px;
    }
}

/* ---------- Cards: softer, rounder ---------- */
.post-card,
.read-next-card {
    border-radius: var(--jd-radius);
}
.post-card {
    box-shadow: var(--jd-shadow);
}
.post-card:hover {
    box-shadow: 0 0.75rem 2rem rgba(140, 152, 164, 0.28);
}
.post-full-image,
.post-full-content pre,
.post-full-content img {
    border-radius: var(--jd-radius);
}

/* ---------- Pill-shaped buttons and chips ---------- */
.author-card-button,
.read-next-card-footer a,
.newer-posts,
.older-posts,
.subscribe-button,
.subscribe-form button,
.subscribe-form .subscribe-email {
    border-radius: var(--jd-pill);
}
.author-card-button:hover {
    color: #fff;
    border-color: var(--jd-primary);
    background: var(--jd-primary);
}
.read-next-card-footer a {
    display: inline-block;
    padding: 8px 18px;
    background: var(--jd-glass-dark);
    -webkit-backdrop-filter: var(--jd-glass-blur);
    backdrop-filter: var(--jd-glass-blur);
    border: 1px solid var(--jd-glass-dark-border);
}
.subscribe-form button {
    background: var(--jd-primary);
    border: 0;
    box-shadow: none;
    text-shadow: none;
}
.subscribe-form button:hover {
    background: var(--jd-secondary);
}

/* ---------- Fixes for the pill floating header and mobile ---------- */
/* Share buttons: round, inset chips instead of full-height blocks the pill curve clips. */
.floating-header-share {
    gap: 6px;
    padding-right: 10px;
}
.floating-header-share a {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: var(--jd-pill);
}
.floating-header-logo {
    margin-left: 24px;
}
/* Progress bar: inset so the rounded ends don't cut it. */
.floating-header .progress {
    left: 28px;
    right: auto;
    width: calc(100% - 56px);
    border-radius: 2px;
}
/* Narrow screens: the nav scrolls sideways, so a single pill would always look cut off.
   Keep the pill hover on each link and drop the container pill. */
@media (max-width: 700px) {
    .site-nav .nav {
        margin-left: -12px;
        padding: 0;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border: 0;
    }
}
/* Phones: the long site name crowds out the post title, so show the title only. */
@media (max-width: 500px) {
    .floating-header-logo,
    .floating-header-divider {
        display: none;
    }
    .floating-header-title {
        visibility: visible; /* Casper hides it below 800px; we hid the logo instead */
        margin-left: 20px;
    }
    .floating-header-share a {
        width: 32px;
        height: 32px;
        line-height: 32px;
    }
}

/* ---------- Remaining Casper light-blue accents -> primary ---------- */
.post-full-meta-date,
.post-full-content h5,
.footnote-backref {
    color: var(--jd-primary);
}
.post-full-content blockquote {
    border-left-color: var(--jd-primary);
}

/* ---------- X (formerly Twitter) and LinkedIn share buttons ---------- */
.floating-header-share-x,
.floating-header-share-li {
    color: #fff;
    text-align: center;
    transition: all 500ms cubic-bezier(0.19, 1, 0.22, 1);
}
.floating-header-share-x  { background: #000; }
.floating-header-share-li { background: #0a66c2; }
.floating-header-share-fb { background: #0866ff; } /* Facebook's 2023 brand blue */
.floating-header-share-x svg { height: 14px; }

/* ---------- Floating JDNayak.com promo card (bottom right) ---------- */
.jd-promo {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900; /* below the floating header (1000) */
    width: 280px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.88); /* opaque enough to stay legible over the dark footer */
    -webkit-backdrop-filter: var(--jd-glass-blur);
    backdrop-filter: var(--jd-glass-blur);
    border: 1px solid var(--jd-glass-light-border);
    border-radius: 20px;
    box-shadow: 0 0.75rem 2.25rem rgba(39, 44, 49, 0.18);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.jd-promo[hidden] { display: none; }
.jd-promo.jd-promo-in {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.jd-promo-link {
    display: block;
    color: var(--jd-text);
    text-decoration: none;
}
.jd-promo-thumb {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 13px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}
.jd-promo-link:hover .jd-promo-thumb {
    transform: scale(1.02);
}
.jd-promo-text {
    display: block;
    padding: 10px 6px 4px;
    font-family: var(--jd-font);
    font-size: 1.35rem;
    line-height: 1.4;
    font-weight: 500;
}
.jd-promo-text strong {
    color: var(--jd-primary);
    font-weight: 700;
}
.jd-promo-close {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    color: var(--jd-text);
    background: #fff;
    border: 1px solid var(--jd-glass-light-border);
    border-radius: var(--jd-pill);
    box-shadow: 0 2px 8px rgba(39, 44, 49, 0.18);
}
.jd-promo-close:hover {
    color: #fff;
    background: var(--jd-primary);
    border-color: var(--jd-primary);
}
.jd-promo-close svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
}
@media (max-width: 500px) {
    .jd-promo {
        right: 18px;
        bottom: 12px;
        width: 200px;
        padding: 6px;
        border-radius: 16px;
    }
    .jd-promo-thumb { border-radius: 11px; }
    .jd-promo-text { font-size: 1.2rem; padding: 8px 4px 2px; }
    .jd-promo-close { width: 32px; height: 32px; top: -12px; right: -8px; }
    /* 2. While the card is open, leave room under the footer so it never hides it */
    .jd-promo-open .site-footer { padding-bottom: 220px; }
}
@media (prefers-reduced-motion: reduce) {
    .jd-promo, .jd-promo-thumb { transition: none; }
}

/* ---------- Home: nav at the top of the header, like jdnayak.com ---------- */
@media (min-width: 900px) {
    .home-template .site-nav {
        top: 0; /* Casper lifts the bottom-placed nav by -70px; it now sits at the top */
    }
}
