@import "./styles.css";

#sections > section {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 768px) {
    #sections > section {
        padding-top: 2.75rem;
        padding-bottom: 2.75rem;
    }
}

#mainNav {
    background-color: #fff7e8;
}

/* #d1a963 beige */
:root {
    --h-title-color: #d1a963;
    --top-section-overlay: 0.52;
    --skeleton-base: #f5f7fa;
    --skeleton-highlight: #f5f7fa;
}

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem; /* 16px */
    font-weight: 400;
    line-height: 1.6;
    background: #ffebeb;
}

.header {
    border-bottom: solid 2px var(--bs-blue);
    z-index: 10000;
}

.page-skeleton {
    position: fixed;
    top: 25rem;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 8000;
    overflow: auto;
    background: #fff7e8;
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    padding-top: 2.4rem;
    transition: opacity 280ms ease, visibility 280ms ease;
}

.site-ready .page-skeleton {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-block {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    border-radius: 4px;
    background: var(--skeleton-base);
}

.skeleton-block::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
    animation: skeleton-shimmer 1450ms ease-in-out infinite;
}

.skeleton-section {
    padding: 4rem 0;
}

.skeleton-section-light {
    background: linear-gradient(45deg, #f0fff4, #ffffff);
}

.skeleton-section-gray {
    background: linear-gradient(45deg, #f0fff4, #f1f1f1);
}

.skeleton-section-title {
    width: 42%;
    height: 2rem;
    margin-bottom: 2rem;
}

.skeleton-line {
    height: 1.1rem;
    margin-bottom: 1rem;
}

.skeleton-line-long {
    width: 100%;
}

.skeleton-line:not(.skeleton-line-long):not(.skeleton-line-short) {
    width: 88%;
}

.skeleton-line-short {
    width: 68%;
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

.bg-bottom {
    background-color: var(--h-title-color);
}

.top-section {
    position: relative;
    min-height: 27rem;
    padding: 6rem 0 1.5rem;
    overflow: hidden;
    background-color: #18202a;
}
/* Content stays above the background and overlay */
.top-section .top-section-content {
    position: relative;
    z-index: 2;
}

.top-section .top-section-content .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
#avatar {
    position: relative; /* Add this line; keep all your other #avatar properties */
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    border: 7px solid white;
    border-radius: 84%;
    overflow: hidden;
    margin: 0 0 1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Leave this existing rule unchanged: it preserves your first photo's appearance */
#avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
}

/* Place only the second photo over the first */
#avatar .avatar-hover {
    position: absolute;
    inset: 0;
    z-index: 1;
    transform: none; /* Don't apply the first photo's zoom to this one */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#avatar:hover .avatar-hover {
    opacity: 1;
}
/* My name */
#top-section-bg-text {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
}


.top-section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-position: center;
    background-size: cover;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 1200ms ease, transform 7000ms ease;
}

.top-section-bg-active {
    opacity: 1;
    transform: scale(1);
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, calc(var(--top-section-overlay) + 0.12)), rgba(0, 0, 0, var(--top-section-overlay))),
        linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.36));
}

.site-loading .top-section:before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.24), rgba(222, 227, 234, 0.2)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(222, 227, 234, 0.16));
}

.site-loading .top-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: skeleton-shimmer 1450ms ease-in-out infinite;
}

section header h2 {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    color: var(--h-title-color);
    font-size: 1.8rem;
    line-height: 1.3;
}

section .main-body {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.8;
    text-align: justify;
}

outreach .main-body h1,
outreach .main-body h2,
outreach .main-body h3,
outreach .main-body h4,
outreach .main-body h5,
outreach .main-body h6 {
    text-align: left;
}

#home .main-body {
    text-align: center;
}

/* Tighter spacing in the Home text */
#home .main-body p {
    margin: 0;
}

#home .main-body h4 {
    margin: 0.75rem 0 2px;
}

#home .main-body {
    line-height: 1.4;
}

/* Content column: 80% of the viewport on large screens (10% whitespace
   each side), capped at 1200px for readability on very wide screens.
   Bootstrap's own caps are 960/1140/1320px at lg/xl/xxl. */
@media (min-width: 992px) {
    .container {
        max-width: min(1150px, 80vw);
    }
}

/*  */
.bg-gradient-primary-to-secondary-light {
    background: linear-gradient(45deg, #f9f2e6, #f1f1f1) !important;
}

.bg-gradient-primary-to-secondary-gray {
    background: linear-gradient(45deg, #fff7e8, #ffffff) !important;
}



.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: cover;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

/* Phones: one column */
.projects-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Tablets and larger: two columns */
@media (min-width: 768px) {
    .projects-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

/* Each entire box is a link */
.project-box {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 320px;
    overflow: hidden;
    border-radius: 12px;
    background: #333; /* Fallback if image doesn't load */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    color: white;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.project-box:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 3px;
}

/* Put the image behind everything else */
.project-box img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark overlay so white text remains readable */
.project-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.1)
    );
}

/* Put the text above the image and overlay */
.project-title {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
}

.project-title h3 {
    margin: 0 0 0.75rem;
    color: white;
    font-size: 1.25rem;
    line-height: 1.4;
}

.project-box .project-info {
    display: block;
    padding: 0;
    margin: 0 0 1rem;
    color: white;
    line-height: 1.5;
}

.project-box .btn-link {
    display: inline-block;
    margin: 0;
    color: white;
    font-weight: 600;
}

.white-bg img {
    background-color: white;
}
/* Generally naming this white bg so I can use it anytime I have a clear bg png  */
/* finish  */

/* Circular social buttons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: white;
    border-radius: 50%;
    color: #2c3e50;
    font-size: 1.3rem;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
    color: #3498db;
    transform: translateY(-3px);
}

.scholar-icon {
    display: block;
    width: 24px;
    height: 24px;
    background-color: currentColor;
    -webkit-mask: url("../assets/img/google-scholar.svg") center / contain no-repeat;
    mask: url("../assets/img/google-scholar.svg") center / contain no-repeat;
}

/* Larger screens */
@media (min-width: 768px) {
    .top-section {
        min-height: 32rem;
        padding: 7rem 0 2rem;
    }

    #avatar {
        width: 180px;
        height: 180px;
    }

    #top-section-bg-text {
        font-size: 2.5rem;
    }
}


@media (prefers-reduced-motion: reduce) {
    .top-section-bg {
        transition: none;
        transform: none;
    }

    .page-skeleton {
        transition: none;
    }

    .skeleton-block::after {
        animation: none;
    }
}



/* Make the Projects section comfortable on narrow screens */
@media (max-width: 575px) {
    /* Reduce the left and right space around the section */
    #projects .container {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    /* One card per row */
    #projects .projects-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Slightly shorter image-background cards */
    #projects .project-box {
        min-height: 260px;
    }

    #projects .project-title {
        padding: 1rem;
    }

    #projects .project-title h3 {
        font-size: 1.1rem;
        line-height: 1.35;
    }

    #projects .project-info {
        font-size: 0.9rem;
        line-height: 1.5;
        text-align: justify;
        hyphens: auto;
    }

    #projects .btn-link {
        font-size: 0.9rem;
    }
}



/* Mobile: name on the left, MENU and moon together on the right */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    order: 2;
}

#navbarResponsive {
    order: 3;
}

/* Desktop: name, navigation links, then moon at the far right */
@media (min-width: 992px) {
    #navbarResponsive {
        order: 2;
        flex-grow: 1;
    }

    .nav-controls {
        order: 3;
        margin-left: 0.75rem;
    }
}
.news-carousel {
    max-width: 800px;
}

.news-item {
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.news-item[hidden] {
    display: none !important;
}

.news-item h3 {
    margin: 0.5rem 0;
    font-size: 1.25rem;
}

.news-type {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.news-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.news-preview {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: transparent; /* Use the news-item's background */
    color: inherit;
    text-decoration: none;
}

.news-preview img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.news-item-content {
    padding: 1.5rem;
}

.news-controls button {
    border: 1px solid currentColor;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.theme-toggle {
    border: 1px solid currentColor;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

html[data-theme="dark"] body {
    background-color: #171923;
    color: #f4f4f5;
}

html[data-theme="dark"] #sections section {
    background: #202331 !important;
    color: #f4f4f5;
}

html[data-theme="dark"] #mainNav {
    background: #171923 !important;
}

html[data-theme="dark"] #mainNav a,
html[data-theme="dark"] #mainNav .theme-toggle {
    color: #f4f4f5 !important;
}

html[data-theme="dark"] #sections h2,
html[data-theme="dark"] #sections p {
    color: #f4f4f5;
}

html[data-theme="dark"] .news-item {
    background: #292d3d;
    color: #f4f4f5;
}


@media (max-width: 991px) {
    html[data-theme="dark"] body {
        background-color: #171923 !important;
        color: #f4f4f5 !important;
    }

    html[data-theme="dark"] #mainNav {
        background-color: #171923 !important;
    }

    html[data-theme="dark"] #navbarResponsive {
        background-color: #171923 !important;
    }

    html[data-theme="dark"] #sections section {
        background: #202331 !important;
        color: #f4f4f5 !important;
    }

    html[data-theme="dark"] #sections h2,
    html[data-theme="dark"] #sections p {
        color: #f4f4f5 !important;
    }
}
/* Give all sections more room on mobile only */
@media (max-width: 767px) {
    #sections > section > .container {
        max-width: none;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}


/* Service & Outreach entries */
#outreach .outreach-entry {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    padding: 1.25rem 0;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

#outreach .outreach-logo {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: white;
    border-radius: 8px;
}

#outreach .outreach-details,
#outreach .outreach-details p {
    text-align: left;
}

#outreach .outreach-details h3 {
    margin: 0;
}

#outreach .outreach-details h4 {
    margin: 0.25rem 0;
}

#outreach .outreach-date {
    margin: 0.25rem 0 0.75rem;
    font-style: italic;
}

@media (max-width: 575px) {
    #outreach .outreach-entry {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 0.75rem;
    }

    #outreach .outreach-logo {
        width: 48px;
        height: 48px;
    }
}