/* Global capsule button system aligned with existing project style */

:root {
    --capsule-bg: linear-gradient(135deg, var(--secondary-accent) 0%, #a48fff 100%);
    --capsule-border: rgba(140, 111, 255, 0.46);
    --capsule-shadow: 0 4px 14px rgba(2, 6, 23, 0.22);
    --capsule-hover-shadow: 0 8px 24px rgba(140, 111, 255, 0.42);
}

/* Apply one style to all action buttons across portfolio and blogspace */
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):not(.like-btn):not(.btn-delete) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 22px;
    border-radius: 999px;
    border: 1.5px solid var(--capsule-border);
    background: transparent !important;
    background-image: none !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-family: "Manrope", "Manrope", sans-serif;
    font-weight: 600;
    letter-spacing: 0.35px;
    line-height: 1;
    box-shadow: var(--capsule-shadow);
    transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease, background-color 0.2s ease, color 0.2s ease;
}

/* Hover stays purple with var(--bg-primary) text in both themes */
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):not(.like-btn):not(.btn-delete):hover {
    color: #ffffff !important;
    background: var(--capsule-bg) !important;
    background-image: var(--capsule-bg) !important;
    filter: brightness(1.06) saturate(1.05);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--capsule-hover-shadow);
}

/* Active state: transparent with theme-aware text color */
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active {
    background: transparent !important;
    background-image: none !important;
    border-color: rgba(140, 111, 255, 0.62) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-md);
    filter: none !important;
    transform: translateY(0) scale(0.98);
}

body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active {
    color: #1e293b !important;
}

body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):not(.like-btn):not(.btn-delete) {
    color: #1e293b !important;
}

/* Some frameworks apply .active class instead of :active pseudo-state */
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active {
    background: transparent !important;
    background-image: none !important;
    border-color: rgba(140, 111, 255, 0.62) !important;
    color: var(--text-primary) !important;
    filter: none !important;
}

body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):not(.like-btn):not(.btn-delete):hover {
    color: var(--bg-primary) !important;
}

body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active {
    color: #1e293b !important;
}

/* Neutralize bootstrap variant tokens so one system is applied */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-info,
.btn-outline-secondary {
    color: inherit;
    background-color: inherit;
    border-color: inherit;
}

/* Final active override layer for legacy selectors with !important */
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active,
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active {
    background: transparent !important;
    background-image: none !important;
    filter: none !important;
}

:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active,
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active,
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active .text,
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active .text {
    color: var(--bg-primary) !important;
}

/* Accessible focus: visible ring and subtle lift matching hover */
:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):focus {
    outline: none;
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-md);
}

:is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):focus-visible {
    outline: none;
    box-shadow: var(--shadow-md);
}

/* Ensure keyboard users see a clear focus ring for anchor-links that look like buttons */
a[class*="btn"]:focus-visible {
    box-shadow: var(--shadow-md);
}

body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active,
body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active,
body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]):active .text,
body.light :is(
    button,
    .btn,
    .action-btn,
    .capsule-btn,
    .view-cv-btn,
    .download-cv-btn,
    .br-learn-more-right,
    .subscribe-btn,
    .comment-button,
    .create-btn,
    .btn-update,
    .btn-delete,
    .btn-cancel,
    .view-project-btn,
    a[class*="btn"],
    input[type="submit"],
    input[type="button"],
    input[type="reset"]
):not(.sidebar-toggle-btn):not(.br-sidebar-toggle):not(.toolbar-btn):not(.carousel-control-prev):not(.carousel-control-next):not(.carousel-control-prev-icon):not(.carousel-control-next-icon):not([class*="unsub-"]).active .text {
    color: #1e293b !important;
}

/* Force Delete button to be red at all points, states, and themes */
.btn-delete,
body.light .btn-delete,
body.dark .btn-delete,
.btn-delete.active,
body.light .btn-delete.active,
body.dark .btn-delete.active {
    background: #ef4444 !important;
    background-image: none !important;
    border-color: #ef4444 !important;
    color: var(--bg-primary) !important;
    box-shadow: var(--shadow-md);
}

.btn-delete:hover,
body.light .btn-delete:hover,
body.dark .btn-delete:hover {
    background: #dc2626 !important;
    background-image: none !important;
    border-color: #dc2626 !important;
    color: var(--bg-primary) !important;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px) !important;
}

.btn-delete:active,
body.light .btn-delete:active,
body.dark .btn-delete:active {
    background: #b91c1c !important;
    background-image: none !important;
    border-color: #b91c1c !important;
    color: var(--bg-primary) !important;
    transform: translateY(0) !important;
}
