/* main page styles */
/* div.content { max-width: 75%; margin: 0 auto; padding: 1rem; line-height: 1.6; font-size: 1rem; } */

/* contact page styles */
.contact { max-width: 720px; margin: 0 auto; padding: 1rem; }
.contact-list { list-style: none; padding: 0; margin: 0 0 1rem 0; }
.contact-list li { margin: 0.5rem 0; }
.contact-list a { color: inherit; text-decoration: underline; }

/* external index links\ */
.external-indexes { 
    max-width: 880px;
    margin: 1.5rem auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1.5rem;
}
.external-indexes h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}
.external-links { 
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}
.external-links li { margin: 0; }
.external-links a { 
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
    border: 1px solid rgba(11,102,195,0.12);
    color: #0b66c3;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(11,102,195,0.04);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.external-links a:hover, .external-links a:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(11,102,195,0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f0f8ff 100%);
    outline: none;
}
.external-links a:focus { box-shadow: 0 0 0 3px rgba(11,102,195,0.08); }
.external-links a small {
    display: block;
    font-weight: 400;
    font-size: 0.8rem;
    color: #254e7a;
    opacity: 0.9;
}

/* stack on very small screens - switch to an "Olympic rings" layout */
@media (max-width: 520px) {
    .external-indexes {
        display: block;
        padding: 0.5rem 1rem;
        width: 90%;
    }
    /* turn the list into a positioned canvas */
 	.external-links {
        display: block;
        position: relative;
        width: min(340px, 92%);
        height: 200px;
        margin: 0.75rem auto;
        padding: 0;
    }
 	.external-links li {
        list-style: none;
        position: absolute;
        width: 88px;
        height: 88px;
        margin: 0;
    }
 	/* .external-links a { display: flex; width: 100%; height: 100%; padding: 0; align-items: center; justify-content: center; text-align: center; box-shadow: none; } */

    /* Top row: three rings */
    .external-links li:nth-child(1) { left: 0%; top: 0; }
    .external-links li:nth-child(2) { left: 50%; top: 0; transform: translateX(-50%); }
    .external-links li:nth-child(3) { left: 100%; top: 0; transform: translateX(-100%); }

    /* Bottom row: two rings centered between the top three */
    .external-links li:nth-child(4) { left: 33.3%; top: 46%; transform: translateX(-50%); }
    .external-links li:nth-child(5) { left: 66.6%; top: 46%; transform: translateX(-50%); }

    /* If there are extra items, fall back to stacked flow below the ring layout */
    .external-links li:nth-child(n+6) {
        position: static;
        width: 100%;
        height: auto;
        margin-top: 0.5rem;
    }

    /* ensure internal images scale nicely inside circular anchors */
    .external-links a img { width: 56%; height: auto; display: block; margin: 0; }
}

/* small screens */
@media (max-width: 640px) {
	.publication-item { padding: 0.6rem 0.8rem; }
	.pub-title { font-size: 1rem; }
}

h3 {
    margin-bottom: 0.25rem;
}

/* icon-specific styles for external index logos */
.external-links a img { width: 44px; height: 44px; display: block; margin: 0 auto; }
.external-links a { padding: 0.4rem; }

/* light-mode specific styles for external index logos */
[data-theme="light"] .external-links a {
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
    border: 2px solid rgba(11,102,195,0.12);
    color: #0b66c3;
    box-shadow: 0 6px 18px rgba(11,102,195,0.04);
}

/* accessible visually-hidden text */
.visually-hidden {
	position: absolute !important;
	height: 1px; width: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
	border: 0; padding: 0; margin: -1px;
}

/* footer styles */
.footer { margin-top: 3rem; padding: 1.25rem 0; background: transparent; border-top: 1px solid rgba(0,0,0,0.06); box-sizing: border-box; }
.footer__inner { max-width: 960px; margin: 0 auto; padding: 0 1rem; box-sizing: border-box; width: 100%; }
.footer__content { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; justify-content: center; font-size: 0.95rem; overflow-wrap: anywhere; word-break: break-word; }
.footer__content a { color: inherit; text-decoration: underline; }

@media (max-width: 640px) {
  .footer__content { flex-direction: column; gap: 0.45rem; }
}

/* affiliation logos */
.display-grid-fallback {
	display: block;
}

.affiliation-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 24px;
    justify-items: center;
    align-items: center;
    margin-top: 20px;
    max-width: min(960px, 90%);
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.affiliation-container img {
    display: block;
    width: 100%;
    max-width: 140px;
    height: auto;
    object-fit: contain;
    max-width: 100%;
}

/* theme-specific rules for light and dark modes */
[data-theme="light"] .footer__content span {
	color: #272323; /* darker gray for body text on light theme */
	border-top-color: rgba(206, 36, 36, 0.06);
}

[data-theme="light"] .footer__content a {
	color: #0b66c3; /* link color on light theme */
}

[data-theme="dark"] .footer {
	color: #cfcfcf; /* soft light text for dark theme */
	border-top-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .footer__content a {
	color: #9ec6ff; /* accessible link color on dark theme */
}

[data-theme="light"] .affiliation-container img.need_dark {
	background-color: black;
}

[data-theme="dark"] .affiliation-container img.need_light {
	background-color: white;
}

/* TODO: make in-paragraph links pop and hover */
/* TODO: improve card styling */

/* dark mode styles for the project card */
/* container for the featured card */
[data-theme="dark"] .project-card {
    background: #1a1c23;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    margin: 20px auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    width: 100%;
    max-width: 720px;
    display: block;
}

[data-theme="dark"] .project-card:hover {
    transform: translateY(-4px);
    border-color: #58a6ff;
    box-shadow: 0 8px 30px rgba(88, 166, 255, 0.1);
}

/* header styling */
[data-theme="dark"] .card-header h3 {
    margin-top: 0;
    color: #f0f6fc;
    font-size: 1.5rem;
}

/* technical tags */
[data-theme="dark"] .tag {
    display: inline-block;
    background: #21262d;
    color: #58a6ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #30363d;
    margin-right: 5px;
    margin-bottom: 10px;
}

/* body and bullets */
[data-theme="dark"] .card-body p {
    color: #8b949e;
    line-height: 1.6;
}

[data-theme="dark"] .card-body ul {
    list-style-type: "→ ";
    padding-left: 20px;
    color: #c9d1d9;
}

/* action button */
[data-theme="dark"] .btn {
    display: inline-block;
    margin-top: 15px;
    color: #ffffff;
    background-color: #237586;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

[data-theme="dark"] .btn:hover {
    background-color: #2e5da0;
    transition-duration: 0.5s;
}

/* light mode styles for the project card */
[data-theme="light"] .project-card {
    background: #c1c8df;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 24px;
    margin: 20px auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    width: 100%;
    max-width: 720px;
    display: block;
}

[data-theme="light"] .project-card:hover {
    transform: translateY(-4px);
    border-color: #58a6ff;
    box-shadow: 0 8px 30px rgba(88, 166, 255, 0.1);
}

/* header styling */
[data-theme="light"] .card-header h3 {
    margin-top: 0;
    color: #222;
    font-size: 1.5rem;
}

/* technical tags */
[data-theme="light"] .tag {
    display: inline-block;
    background: #8d9aac;
    color: #222;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #8d9aac;
    margin-right: 5px;
    margin-bottom: 10px;
}

/* body and bullets */
[data-theme="light"] .card-body p {
    color: #222;
    line-height: 1.6;
}

[data-theme="light"] .card-body ul {
    list-style-type: "→ ";
    padding-left: 20px;
    color: #222;
}

/* action button */
[data-theme="light"] .btn {
    display: inline-block;
    margin-top: 15px;
    color: #222;
    background-color: #8d9aac;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

[data-theme="light"] .btn:hover {
    background-color: #2e5da0;
    transition-duration: 0.5s;
}

.contact-list img {
    margin-bottom: 10px;
    width: 50px;
    height: 50px;
}

[data-theme="dark"] .contact-list img {
    filter: invert();
}
.elevator-pitch {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem;
    line-height: 1.6;
    font-size: 1rem;
    line-height: 200%;
}

/* Hide raw PGP block on small screens; keep download link visible */
@media (max-width: 640px) {
    .pgp-blob { display: none; }
    .contact details pre { white-space: normal; overflow: visible; }
    .contact details pre strong a { display: inline-block; margin-top: 0.25rem; }
}

/* hide the desktop elevator pitch on mobile, and show the mobile version instead */
@media (min-width: 640px) {
    .mobile { display: none; }   
}
@media (max-width: 640px) {
    .desktop { display: none; }
}

/* resume page styles */
.content .resume {
    align-items: center;
    display: flex;
    flex-direction: column;
}

.content .resume p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.content .resume a[href*=".pdf"] {
    display: inline-block;
    background-color: #fe5186;
    color: white !important;
    text-decoration: none !important;
    padding: 1rem 2.5rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.content .resume a[href*=".pdf"]:hover {
    background-color: #af3157;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}