/* Aesthetic Enhancements for arjankc.com.np */

:root {
    --primary-red: #d63031;
    --hover-red: #e74c3c;
    --glass-bg: rgba(245, 246, 247, 0.7);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 15px 35px rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent horizontal scroll without creating a scroll container */
html,
body {
    overflow-x: clip;
}

/* Sidebar */
#sidebar {
    background: #f5f6f7 !important;
}

/*
 * Desktop: keep the sidebar in normal document flow so it scrolls with the page.
 * (A nested 100vh scroller felt detached; sticky would also clip this tall menu.)
 */
@media screen and (min-width: 1281px) {
    #sidebar {
        position: relative;
        top: auto;
        align-self: stretch;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    #sidebar > .inner {
        position: relative;
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* Hero Section Enhancements */
#banner h1 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

#banner .image.object img {
    border-radius: 1rem;
    box-shadow: var(--shadow-medium);
    transition: var(--transition-smooth);
}

/* Typography Refinements */
body {
    line-height: 1.8;
}

#main p {
    margin-bottom: 1.5em;
}

/* Service Cards */
.features article {
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    height: 100%;
}

.features article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: rgba(214, 48, 49, 0.1);
}

.features article .icon {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    color: var(--primary-red);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.5em;
    width: 3.5em;
}

.features article .icon:after {
    height: 3em !important;
    width: 3em !important;
    margin: -1.5em 0 0 -1.5em !important;
}

.features article .icon:before {
    font-size: 1.25rem !important;
}

/* 3-Column Grid for Services */
#services .features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    margin: 0;
}

#services .features article {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

/* Resource Grid Refinement */
.resource-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 1.5rem;
    width: 100% !important;
    margin: 0 !important;
}

.resource-grid article {
    width: 100% !important;
    margin: 0 !important;
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
}

.resource-grid article .icon {
    margin-bottom: 0 !important;
    margin-right: 1.5rem !important;
    height: 3em !important;
    width: 3em !important;
}

.resource-grid article .icon:after {
    height: 2.2em !important;
    width: 2.2em !important;
    margin: -1.1em 0 0 -1.1em !important;
}

.resource-grid article h3 {
    margin-bottom: 0.25rem !important;
    font-size: 1rem !important;
}

.resource-grid article p {
    font-size: 0.9rem !important;
    margin-bottom: 0 !important;
}

/* Resource and Insight Cards */
.posts article,
#student-resources article {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.posts article:hover,
#student-resources article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.posts article .image,
#student-resources article .image {
    display: block;
    overflow: hidden;
    background: #f3f4f6;
    aspect-ratio: 16 / 9;
    border-radius: 0.5rem;
}

.posts article .image picture,
#student-resources article .image picture {
    display: block;
    width: 100%;
    height: 100%;
}

.posts article .image img,
#student-resources article .image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.posts article:hover .image img {
    transform: scale(1.05);
}

#results .result-stat {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 0.35em;
    color: var(--primary-red, #d63031);
    letter-spacing: -0.03em;
}

#main #results .posts article {
    position: relative;
}

#main #results .posts article h3 a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Make posts grid responsive */
.posts {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    margin: 0 !important;
    width: 100% !important;
}

.posts article {
    width: 100% !important;
    margin: 0 !important;
    position: relative !important;
}

.posts article:before,
.posts article:after {
    display: none !important;
}


/* Button Modernization */
.button {
    border-radius: 0.5rem !important;
    text-transform: none;
    font-weight: 600;
    transition: var(--transition-smooth) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(214, 48, 49, 0.2);
}

.button.primary {
    background-image: linear-gradient(135deg, #d63031, #e74c3c);
    border: none;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Feature and Resource Card Clickability (Stretched Link) */
#main .features article {
    position: relative !important;
    cursor: pointer !important;
}

#main .features article h3 a::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 10 !important;
    display: block !important;
}

/* Ensure secondary links (if any) are clickable above the overlay */
#main .features article a:not(h3 a) {
    position: relative !important;
    z-index: 11 !important;
}

/* Sidebar mini-posts enhancements */
#sidebar .mini-posts article .image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: block;
    background: #3d3560;
}

#sidebar .mini-posts article .image picture {
    display: block;
    width: 100%;
    height: 100%;
}

#sidebar .mini-posts article .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

#sidebar .mini-posts article:hover .image img {
    transform: scale(1.05);
}

/* Entrance Animations — one-shot on page load only
   Applied only when <body> has the .page-loaded class.
   Prevents mobile browsers from re-triggering on scroll repaints. */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Default state: visible and settled — NO animation */
section {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Remove all animation for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    body:not(.page-loaded) section {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* --- Accessibility & UX utilities --- */

.visually-hidden,
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.25rem;
    background: var(--primary-red, #d63031);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0 0 0.35em 0.35em;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.button:focus-visible,
.pill-links a:focus-visible,
#sidebar .toggle:focus-visible,
#header .icons a:focus-visible,
a.icon:focus-visible {
    outline: 2px solid var(--primary-red, #d63031);
    outline-offset: 2px;
}

body {
    color: #5f6a72;
}

.hero-actions {
    margin-top: 0.5rem;
}

/* Sidebar nav: collapsed by default, no red focus rings */
#menu > ul > li > ul {
    display: none;
}

#menu > ul > li > .opener.active + ul {
    display: block;
}

#menu a,
#menu button.opener {
    border-bottom: none !important;
    box-shadow: none !important;
    outline: none;
    text-decoration: none;
}

#menu button.opener {
    appearance: none;
    -webkit-appearance: none;
    background: none !important;
    border: none !important;
    border-radius: 0;
    color: inherit !important;
    display: block;
    font: inherit;
    font-size: 0.9em;
    font-weight: 400;
    height: auto;
    letter-spacing: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0.625em 0;
    text-align: left;
    text-transform: uppercase;
    white-space: normal;
    width: 100%;
}

#menu button.opener:hover {
    color: #d63031 !important;
}

#menu a:focus,
#menu a:focus-visible,
#menu button.opener:focus,
#menu button.opener:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Sidebar drawer: hamburger only on tablet/mobile */
@media screen and (max-width: 1280px) {
    #sidebar.inactive .toggle {
        left: 0;
        position: fixed;
    }
}

@media screen and (min-width: 1281px) {
    #sidebar .toggle {
        display: none;
    }
}

/* Keep mobile menu toggle visible during preload */
body.is-preload #sidebar .toggle {
    display: block;
}

@media screen and (max-width: 736px) {
    .pill-links a {
        min-height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.75em 1.25em !important;
    }
}

/* Hero must paint immediately — hiding #banner until JS ran was failing LCP */
body:not(.page-loaded) #banner,
body:not(.page-loaded) section:not(#banner) {
    opacity: 1;
    transform: none;
    animation: none;
}

/* Reserve space so late images and ads do not shift the layout (CLS) */
img {
    max-width: 100%;
    height: auto;
}

ins.adsbygoogle {
    display: block;
    min-height: 280px;
}

.ad-slot,
.ad-slot-mid,
.ad-slot-auto {
    min-height: 280px;
}