@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1d1d1f;
    --accent-color: #0071e3;
    --accent-hover: #0077ed;
    --text-color: #1d1d1f;
    --text-secondary: #86868b;
    --bg-color: #fbfbfd;
    --bg-gradient: linear-gradient(180deg, #f5f7fa 0%, #c3cfe2 85%, #c3cfe2 100%);
    --header-bg: rgba(255, 255, 255, 0.50);
    --content-bg: #ffffff;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.12);
    --font-main: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
    --spacing-unit: 20px;
    --border-radius: 18px;
    --site-bg: var(--bg-color);
    --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 768px) {
    :root {
        --bg-gradient: #c3cfe2; /* Flatten gradient on mobile to avoid banding */
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Ensure root/background are consistent to avoid white gaps on mobile when address bar hides/shows */
html {
    background-color: #c3cfe2; /* Match the bottom of the gradient */
    min-height: 100%;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    /* Samsung Internet fix */
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
}

body {
    min-height: 100vh;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* Samsung Internet optimization */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    isolation: isolate;
}

/* Fixed background layer to prevent mobile scroll issues */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-gradient);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
    /* Samsung Internet specific fixes */
    -webkit-transform: translate3d(0,0,0);
    transform: translate3d(0,0,0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
    image-rendering: -webkit-optimize-contrast;
}

@media (max-width: 768px) {
    body::before {
        background: #c3cfe2;
        background-image: none;
        /* Force solid color on mobile to prevent banding */
        will-change: auto;
    }
}

#page {
    background: transparent;
    min-height: 100vh;
    /* Samsung Internet layer optimization */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    position: relative;
    z-index: 1;
}

/* Ensure menu toggle is always on top and receives pointer events */
#menu-toggle {
    position: fixed !important;
    top: 12px !important;
    right: 16px !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer !important;
}

.site-header {
    z-index: 99998;
    pointer-events: auto;
}

/* Style for the cloned top-layer toggle created by JS */
#menu-toggle-clone,
.menu-toggle-clone {
    position: fixed !important;
    top: 12px !important;
    right: 16px !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
    background: var(--primary-color) !important;
    color: #fff !important;
    border-radius: 12px !important;
    padding: 0.6rem 1rem !important;
    font-weight: 700 !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
}

/* Hide the clone on wider screens where original toggle is in layout */
@media (min-width: 769px) {
    #menu-toggle-clone, .menu-toggle-clone { display: none !important; }
}

body {
    font-family: var(--font-main);
    background: transparent;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}

a:hover {
    text-decoration: none;
    color: var(--accent-hover);
}

/* Layout */
.site {
    display: flex;
    flex-direction: column;
    /* Use dynamic vh via --vh to avoid mobile 100vh issues; fallbacks included */
    min-height: calc(var(--vh, 1vh) * 100);
    min-height: 100dvh;
    min-height: 100vh;
    position: relative;
}

.site-content-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-unit);
    gap: var(--spacing-unit);
    width: 100%;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.2s;
}

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

/* Header */
.site-header {
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 20000;
    transition: var(--transition-fast);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.site-header.scrolled {
    background: rgba(255, 255, 255, 0.50);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.site-header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

/* Ensure the menu toggle and header accept pointer events and stay above overlays */
.site-header-wrapper {
    z-index: 99997;
    pointer-events: auto;
}
.site-menu {
    pointer-events: auto;
    z-index: 99996; /* menu dropdown stays below header toggle */
}

.site-branding {
    display: flex;
    flex-direction: column;
}


.site-title {
    font-family: 'SF Pro Display', -apple-system, 'Poppins', BlinkMacSystemFont, sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0;
    transition: var(--transition-fast);
}

@keyframes slideInLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.site-title a {
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-fast);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-title a:hover {
    transform: scale(1.05);
}

.site-description {
    /* removed: site description moved/disabled */
    display: none !important;
}

.site-description a {
    color: inherit;
    text-decoration: none;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
    transition: var(--transition-fast);
    border-radius: 12px;
    display: inline-block;
    position: relative;
}

.main-navigation a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    transform: translateX(-50%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-navigation a:hover {
    color: var(--accent-color);
    background: rgba(0, 113, 227, 0.05);
    transform: translateY(-2px);
}

.main-navigation a:hover::before {
    width: 80%;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none !important;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    transition: var(--transition-fast);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.menu-toggle:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.menu-toggle:active {
    transform: scale(0.98);
}

/* Main Content Area */
.content-area {
    flex: 2;
    min-width: 300px;
}

.site-main article {
    background: var(--content-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.site-main article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.entry-title a {
    color: var(--primary-color);
    transition: var(--transition-fast);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% auto;
    display: inline-block;
}

.entry-title a:hover {
    background-position: right center;
    transform: translateX(5px);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1.5rem 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.entry-content blockquote {
    border: none;
    padding: 0;
    margin: 1rem 0;
    font-style: normal;
    color: var(--text-color);
    background: transparent;
    text-align: left;
}

.entry-content blockquote p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.entry-content blockquote p + p {
    margin-top: 0.65rem;
}

/* Sidebar */
.widget-area {
    flex: 1;
    min-width: 250px;
}

.widget {
    background: var(--content-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.widget-title {
    font-size: 1.3rem;
    font-weight: 700;
    border-bottom: none;
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    border-radius: 3px;
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #1d1d1f 0%, #2d2d2f 100%);
    color: #f5f5f7;
    padding: 3rem 0;
    margin-top: auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.site-info a {
    color: #86868b;
    transition: var(--transition-fast);
}

.site-info a:hover {
    color: #f5f5f7;
}

/* Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .fade-in-section {
        transform: translateY(20px);
        transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-in-section {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Parallax Effect */
.parallax {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-toggle {
        display: block !important;
    }

    .site-menu {
        display: none;
        position: absolute;
        top: calc(100% + 15px);
        left: var(--spacing-unit);
        right: var(--spacing-unit);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: saturate(180%) blur(10px);
        -webkit-backdrop-filter: saturate(180%) blur(10px);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        border-radius: 18px;
        border: 1px solid rgba(0, 0, 0, 0.05);
        animation: menuSlideDown 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        transform-origin: top center;
    }

    @keyframes menuSlideDown {
        from {
            opacity: 0;
            transform: scale(0.95) translateY(-10px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    .site-menu.toggled-on {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0.2rem;
    }

    .main-navigation li {
        border-bottom: none;
    }

    .main-navigation a {
        display: block;
        padding: 0.9rem 1.2rem;
        border-radius: 16px;
        background: transparent;
        margin-bottom: 0;
        color: var(--text-color);
        font-weight: 500;
        font-size: 1rem;
        transition: all 0.2s ease;
    }

    .main-navigation a:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--accent-color);
        transform: none;
    }

    .main-navigation a::before {
        display: none;
    }

    .site-content-wrapper {
        flex-direction: column;
    }

    .content-area,
    .widget-area {
        min-width: 100%;
        width: 100%;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .entry-title {
        font-size: 1.8rem;
    }

    .site-main article {
        padding: 1.5rem;
    }

    .widget {
        padding: 1.5rem;
    }

    /* Make the mobile menu toggle reliably clickable: place above other elements */
    #menu-toggle {
        position: fixed !important;
        top: 12px !important;
        right: 16px !important;
        z-index: 999999 !important;
        pointer-events: auto !important;
        box-shadow: 0 6px 18px rgba(0,0,0,0.2);
        cursor: pointer !important;
    }

    /* Keep header full-width underneath the fixed toggle to avoid layout shifts */
    .site-header {
        z-index: 99998;
    }
}

/* ==========================================
   Advanced Apple-style Animations
   ========================================== */

/* Notification Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Button Ripple Effect */
.button, button, input[type="submit"] {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3);
}

/* Ensure button text is always readable and centered */
.button {
    color: #ffffff !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    padding: 0.8rem 1.4rem !important;
    text-align: center !important;
    z-index: 2 !important;
}

.button::after {
    pointer-events: none;
}

/* Remove the underline/progress-bar effect for buttons inside .entry-content */
.entry-content a.button::after,
.button::before,
.button::after {
    display: none !important;
    opacity: 0 !important;
    transform: none !important;
}

/* If you prefer a subtle underline on hover instead, uncomment below and adjust color/height */
/* .entry-content a.button::after {
    display: block !important;
    content: '';
    position: absolute;
    bottom: 8px;
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    transform: none;
    opacity: 1;
} */

.button:hover, button:hover, input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 113, 227, 0.4);
}

.button::after, button::after, input[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:active::after, button:active::after, input[type="submit"]:active::after {
    width: 300px;
    height: 300px;
}

/* Card Stacking Animation */
.widget:nth-child(1) {
    animation-delay: 0.1s;
}

.widget:nth-child(2) {
    animation-delay: 0.2s;
}

.widget:nth-child(3) {
    animation-delay: 0.3s;
}

/* Link Underline Animation */
.entry-content a {
    position: relative;
    display: inline-block;
    color: var(--accent-color);
    font-weight: 600;
}

.entry-content a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.entry-content a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hide underline/progress-bar for links that contain images (modern browsers)
   Fallback: images inside links are block-level so underline won't overlap image */
.entry-content a:has(img)::after {
    display: none;
}

.entry-content a img {
    display: block;
    width: 100%;
    height: auto;
}

/* Floating Animation for Icons/Images */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.widget img {
    border-radius: 12px;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Ensure all content images are responsive and won't overflow their containers */
.entry-content img,
.entry-content a img,
.widget img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Glow Effect on Hover */
.glow {
    transition: var(--transition-fast);
}

.glow:hover {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6),
                0 0 40px rgba(102, 126, 234, 0.4),
                0 0 60px rgba(102, 126, 234, 0.2);
}

/* Gradient Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animated {
    background: linear-gradient(270deg, #667eea, #764ba2, #f093fb);
    background-size: 600% 600%;
    animation: gradientShift 8s ease infinite;
}

/* Text Gradient Animation */
@keyframes textGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient {
    background: linear-gradient(270deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 5s ease infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Scale In Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.5s ease-out;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 2s infinite;
}

/* Rotate In Animation */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-200deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

.rotate-in {
    animation: rotateIn 0.6s ease-out;
}

/* Typography Animations */
.entry-content p {
    animation: fadeInUp 0.8s ease-out;
}

/* Hover Lift Effect */
.hover-lift {
    transition: var(--transition-fast);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

/* Smooth Page Transitions */
.page-transition {
    animation: fadeInUp 0.6s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Selection Color */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--primary-color);
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--primary-color);
}

/* Pinned badge for top posts */
.post-badge {
    display: inline-block;
    margin-left: 0.6rem;
    padding: 0.18rem 0.6rem;
    font-size: 0.85rem;
    line-height: 1;
    color: #fff;
    background: linear-gradient(90deg, #ff7a18 0%, #ff5c8a 100%);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(255,92,138,0.18);
    font-weight: 700;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .post-badge { font-size: 0.78rem; padding: 0.12rem 0.45rem; margin-left: 0.4rem; }

    .site-main article {
        padding: 1.2rem;
    }

    .site-content-wrapper {
        padding: 0.8rem;
    }
}

/* Article & Sidebar refinements */
.entry-content {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 0.25rem;
    font-size: 1rem;
    color: var(--text-color);
}

.entry-content h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    color: var(--primary-color);
}

.entry-content ul,
.entry-content ol {
    margin: 0.5rem 0 1rem 1.25rem;
    padding-left: 0.5rem;
}

.entry-content li {
    margin: 0.45rem 0;
    line-height: 1.6;
}

.entry-content p {
    margin: 0.6rem 0;
}

.wpa-about {
    display: block;
    background: linear-gradient(180deg, rgba(102,126,234,0.05), rgba(118,75,162,0.02));
    border: 1px solid rgba(102,126,234,0.08);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.45;
}

.wpa-about a {
    color: var(--accent-color);
    font-weight: 700;
}

.wpmrec {
    margin-top: 1rem;
}

/* Make ad container less intrusive on mobile */
@media (max-width: 768px) {
    .entry-content {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .site-content-wrapper {
        padding: 1rem;
    }

    .wpa-about {
        font-size: 0.92rem;
        padding: 0.7rem 0.9rem;
    }
}

/* Small utility: subtle divider between sections */
.entry-content hr {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06), rgba(0,0,0,0.03));
    margin: 1.25rem 0;
}

/* Feature image styling for articles */
.feature-figure {
    display: block;
    max-width: 880px;
    margin: 1rem auto 0.75rem auto;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feature-figure figcaption {
    margin-top: 0.45rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.entry-feature-image {
    width: 100%;
    max-width: 880px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    display: block;
    margin: 0 auto;
}

/* Code Copy Button */
.code-block-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.code-block-wrapper pre {
    background: #f4f4f4;
    padding: 12px;
    overflow-x: auto;
    font-size: 0.9em;
    border-radius: 8px;
    margin: 0;
}

.code-block-wrapper code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    z-index: 10;
}

.code-block-wrapper:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Remove default blue focus ring but provide accessible focus-visible styling */
.code-copy-btn:focus {
    outline: none;
}

.code-copy-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16);
    border-radius: 6px;
}

/* Remove inner focus border for Firefox */
.code-copy-btn::-moz-focus-inner {
    border: 0;
}

/* Remove tap highlight on touch devices */
.code-copy-btn {
    -webkit-tap-highlight-color: transparent;
}

/* Restyled copy button to match site theme */
.code-copy-btn {
    background: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 0;
    font-size: 0.85rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.code-copy-btn:active {
    transform: translateY(1px) scale(0.995);
    background: rgba(0, 0, 0, 0.95) !important;
}

.code-copy-btn:focus {
    background: rgba(0, 0, 0, 0.75) !important;
}

/* Toast that appears after copy */
.code-copied-toast {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    z-index: 11;
}

.code-copied-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hide the original copy button visually but keep it focusable when toast shows */
.code-copy-btn.hidden-while-toast {
    opacity: 0;
    pointer-events: none;
}
.code-copied-toast {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981; /* Green */
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    display: none;
    z-index: 11;
    animation: fadeIn 0.2s;
}

