/**
 * Main Styles for jianwang.me
 */

/* ==========================================================================
   Custom Properties
   ========================================================================== */

:root {
    --font-heading: "Libre Baskerville", Georgia, serif;
    --font-body: "Inter", system-ui, sans-serif;
    --color-link: #4885ed;
    --color-text: #111;
    --color-muted: #999;
    --color-border: #e8e8e8;
    --spacing: 30px;
}

/* ==========================================================================
   Base Elements
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
}

a {
    color: var(--color-link);
    text-decoration: none;
    text-underline-offset: 0.2em;
}

a:hover,
a:focus {
    color: var(--color-text);
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

h1,
h2 {
    font-family: var(--font-heading);
    text-wrap: balance;
}

h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    line-height: 1.3;
}

ul,
ol {
    margin-left: var(--spacing);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: -0.75rem;
}

.col-sm-6 {
    padding-inline: 0.75rem;
    flex: 0 0 100%;
}

@media (min-width: 576px) {
    .col-sm-6 {
        flex: 0 0 50%;
    }
}

.page-content {
    padding: var(--spacing) 0;
}

.wrapper {
    max-width: 800px;
    margin-inline: auto;
    padding-inline: clamp(15px, 4vw, var(--spacing));
}

/* ==========================================================================
   Components
   ========================================================================== */

.profile {
    margin-bottom: var(--spacing);
}

.profile-photo {
    width: 320px;
    border-radius: 7px;
}

@media (max-width: 600px) {
    .profile-photo {
        width: 100%;
        max-width: 320px;
        margin-bottom: 1rem;
    }
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.social-links a:not(:last-child)::after {
    content: "·";
    margin-left: 0.75em;
    color: var(--color-muted);
    text-decoration: none;
    display: inline-block;
}

.wrapper > section {
    margin-top: var(--spacing);
}

.wrapper > section li {
    margin-bottom: 0.5rem;
}

.wrapper > section li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
    .page-content {
        padding: 0;
    }

    a {
        color: var(--color-text);
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.75em;
        color: var(--color-muted);
        word-break: break-all;
    }

    :is(a[href^="mailto:"], a[href$=".pdf"])::after {
        content: "";
    }
}
