/*
Theme Name: SAIKOXIX Archive
Description: Trilingual photographic archive and authorial projects for SAIKOXIX.
Version: 0.10.7
Requires PHP: 7.4
Text Domain: saikoxix-archive
License: GPL-2.0-or-later
*/

:root {
    color-scheme: dark;
    --bg: #181a1a;
    --panel: #202322;
    --fg: #ebe9e3;
    --muted: #a8aaa6;
    --line: #3b3f3c;
    --accent: #d8cfb4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.65 Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, select {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}
button:focus-visible, a:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 6px;
}

header {
    max-width: 1720px;
    margin: auto;
    padding: 30px 4.5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-bottom: 1px solid var(--line);
}
.brand {
    flex: 0 0 auto;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: .22em;
}
nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 18px 30px;
}
nav a { white-space: nowrap; }
nav a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 7px;
}
.languages {
    display: flex;
    gap: 10px;
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: .12em;
}
.languages button { padding: 8px 0; color: var(--muted); }
.languages button[aria-pressed="true"] { color: var(--fg); border-bottom: 1px solid; }

main {
    max-width: 1600px;
    min-height: 70vh;
    margin: auto;
    padding: 66px 5% 110px;
}
.eyebrow {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .24em;
    text-transform: uppercase;
}
h1, h2 { font-family: Georgia, serif; font-weight: 400; }
h1 {
    margin: 16px 0 24px;
    font-size: clamp(44px, 6vw, 86px);
    line-height: 1.07;
    letter-spacing: -.025em;
}
h2 { margin: 12px 0 0; font-size: 30px; line-height: 1.2; }
.intro { max-width: 520px; color: var(--muted); white-space: pre-line; }
.preline { white-space: pre-line; }
.back { display: inline-block; color: var(--muted); font-size: 12px; }
.series-head { margin: 40px 0 65px; }
.series-head .intro { font-size: 17px; }
.empty-state {
    padding: 45px 0 100px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: Georgia, serif;
    font-size: 22px;
}

.home-page { padding-top: 35px; padding-bottom: 30px; }
.hero {
    min-height: 640px;
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 7%;
    align-items: center;
}
.hero-copy { padding: 40px 0; }
.hero h1 { max-width: 650px; font-size: clamp(56px, 7.5vw, 108px); letter-spacing: -.045em; }
.hero-intro { max-width: 330px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 15px 32px; margin-top: 35px; }
.hero-link { display: inline-block; padding: 9px 0; border-bottom: 1px solid var(--fg); }
.hero-link-muted { color: var(--muted); border-color: var(--line); }
.hero-visual { display: block; position: relative; justify-self: center; }
.hero-visual img {
    display: block;
    max-width: 100%;
    width: auto;
    height: min(73vh, 850px);
    object-fit: contain;
}
.hero-caption { display: block; padding-top: 12px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.home-note {
    margin: 45px 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-family: Georgia, serif;
    font-style: italic;
}
.home-paths {
    margin-top: 70px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: .7fr 1fr 1fr;
    gap: 32px;
}
.path-heading { max-width: 220px; font-family: Georgia, serif; font-size: 22px; }
.home-path { padding: 4px 0 28px; border-bottom: 1px solid var(--line); }
.home-path h2 { font-size: 42px; }
.home-path p { max-width: 380px; margin-bottom: 0; color: var(--muted); }
.home-path:hover h2 { color: var(--accent); }

.project-folders-heading { max-width: none; margin: -15px 0 28px; }
.project-folders { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.project-folder { display: block; }
.project-folder-cover {
    height: min(57vh, 610px);
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.project-folder-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .5s ease;
}
.project-folder:hover .project-folder-cover img { transform: scale(1.012); }
.project-folder-placeholder { color: var(--line); font-family: Georgia, serif; font-size: 70px; }
.project-folder-caption { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.project-folder-caption h2 { font-size: clamp(36px, 4vw, 56px); }
.project-folder-caption span { padding-top: 20px; color: var(--muted); font-size: 12px; }
.project-folder > p { max-width: 460px; margin: 15px 0 0; color: var(--muted); }

.project-list { display: grid; gap: 110px; }
.project-card {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
    gap: 6%;
    align-items: center;
}
.project-card:nth-child(even) { grid-template-columns: minmax(260px, .55fr) minmax(0, 1.45fr); }
.project-card:nth-child(even) .project-cover { order: 2; }
.project-cover {
    height: min(72vh, 760px);
    background: var(--panel);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .55s ease;
}
.project-card:hover .project-cover img { transform: scale(1.012); }
.project-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.project-caption h2 { font-size: clamp(34px, 4vw, 58px); }
.project-caption > span { padding-top: 27px; color: var(--muted); font-size: 12px; }
.card-intro {
    display: -webkit-box;
    max-width: 420px;
    margin-top: 20px;
    overflow: hidden;
    color: var(--muted);
    white-space: pre-line;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}
.project-head { max-width: 1000px; margin: 44px auto 80px; }
.project-head h1 { max-width: 900px; }
.statement {
    max-width: 780px;
    margin-top: 35px;
    color: #cbc9c3;
    font-family: Georgia, serif;
    font-size: clamp(18px, 2vw, 23px);
    line-height: 1.75;
    white-space: pre-line;
}
.project-count { margin-top: 35px; color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }

.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 42px 35px; }
.year-cover {
    height: 360px;
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.year-cover img { width: 100%; height: 100%; object-fit: contain; transition: transform .45s ease; }
.year-card:hover img { transform: scale(1.012); }
.year-caption { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.year-caption h2 { font-size: 48px; }
.year-caption span { color: var(--muted); font-size: 12px; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 60px 36px; }
.card:nth-child(even) { padding-top: 110px; }
.cover {
    height: 640px;
    background: var(--panel);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s ease; }
.card:hover img { transform: scale(1.015); }
.caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.caption span { padding-top: 21px; color: var(--muted); font-size: 12px; }
.caption .card-intro { -webkit-line-clamp: 3; }

.gallery {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
}
.gallery button { display: block; width: 100%; padding: 0; overflow: visible; background: transparent; }
.gallery img { display: block; width: 100%; height: auto; object-fit: contain; }

.doll-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 7%; margin-top: 45px; align-items: start; }
.doll-profile > img { width: 100%; height: auto; }
.related-link { display: block; margin-top: 14px; text-decoration: underline; text-underline-offset: 5px; }
.doll-cover { height: 500px; }

.about { max-width: 760px; margin: 40px auto 150px; }
.about p { color: var(--muted); font-size: 21px; }
.about a { border-bottom: 1px solid; }

footer {
    border-top: 1px solid var(--line);
    padding: 25px 5%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .12em;
}
dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    border: 0;
    background: #101111;
    color: white;
}
dialog::backdrop { background: #101111; }
.lightbox { height: 100%; padding: 65px; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.close { position: absolute; top: 15px; right: 24px; font-size: 30px; }
.prev, .next { position: absolute; top: 48%; padding: 15px; font-size: 28px; }
.prev { left: 4px; }
.next { right: 4px; }
.count { position: absolute; right: 0; bottom: 20px; left: 0; color: #aaa; font-size: 12px; text-align: center; }
.skip { position: absolute; left: -9999px; }
.skip:focus { top: 10px; left: 10px; z-index: 10; padding: 8px; background: black; }

html[lang="zh-Hans"] body { font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif; }
html[lang="zh-Hans"] h1,
html[lang="zh-Hans"] h2,
html[lang="zh-Hans"] .statement { font-family: "Songti SC", "SimSun", serif; }

@media (min-width: 1500px) {
    .cover { height: 780px; }
    .year-cover { height: 420px; }
}

@media (max-width: 1050px) {
    nav { gap: 15px 20px; font-size: 14px; }
    .year-grid { grid-template-columns: repeat(2, 1fr); }
    .home-paths { grid-template-columns: 1fr 1fr; }
    .path-heading { grid-column: 1 / -1; max-width: none; }
    .project-card,
    .project-card:nth-child(even) { grid-template-columns: 1.2fr .8fr; }
    .project-folder-cover { height: 480px; }
}

@media (max-width: 700px) {
    header { display: block; padding: 20px 6%; }
    .brand { font-size: 20px; }
    header nav { margin-top: 18px; gap: 12px 18px; font-size: 13px; }
    header nav .languages { flex-basis: 100%; margin-top: 4px; }
    main { padding: 42px 6% 70px; }
    h1 { font-size: 48px; }
    .series-head { margin: 35px 0 45px; }
    .home-page { padding-top: 25px; }
    .hero { min-height: 0; grid-template-columns: 1fr; gap: 30px; }
    .hero-copy { padding: 10px 0 0; }
    .hero h1 { margin-bottom: 18px; font-size: 56px; }
    .hero-intro { font-size: 16px; }
    .hero-actions { margin-top: 12px; }
    .hero-visual { width: 100%; }
    .hero-visual img { width: 100%; height: auto; }
    .home-paths { grid-template-columns: 1fr; margin-top: 45px; }
    .path-heading { grid-column: auto; }
    .home-path h2 { font-size: 36px; }
    .project-folders { grid-template-columns: 1fr; gap: 55px; }
    .project-folder-cover { height: auto; min-height: 180px; }
    .project-folder-cover img { height: auto; }
    .project-folder-caption h2 { font-size: 38px; }
    .project-list { gap: 70px; }
    .project-card,
    .project-card:nth-child(even) { display: grid; grid-template-columns: 1fr; gap: 24px; }
    .project-card:nth-child(even) .project-cover { order: 0; }
    .project-cover { width: 100%; height: auto; min-height: 0; }
    .project-cover img { height: auto; }
    .project-caption h2 { font-size: 34px; }
    .project-head { margin-bottom: 55px; }
    .statement { font-size: 18px; }
    .year-grid { grid-template-columns: 1fr; }
    .year-cover { height: auto; }
    .year-cover img { height: auto; }
    .cards { grid-template-columns: 1fr; gap: 42px; }
    .card:nth-child(even) { padding-top: 0; }
    .cover { height: auto; }
    .cover img { height: auto; }
    .caption h2 { font-size: 26px; }
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .doll-profile { grid-template-columns: 1fr; }
    .about p { font-size: 18px; }
    .lightbox { padding: 60px 38px; }
    .prev, .next { padding: 5px; }
    footer { font-size: 10px; }
}
