/* Swaxilep — plain white, single-column theme */

:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #6b6b6b;
    --faint: #9a9a9a;
    --line: #ebebeb;
    --soft: #f6f6f5;
    --accent: #111111;
    --link: #1d4ed8;
    --danger: #b42318;
    --ok: #067647;
    --radius: 10px;
    --font: "Inter", -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

.wrap {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ───────── Header ───────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    height: 60px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 14px; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 500; }

.lang-switch { display: flex; gap: 2px; }
.lang-switch button {
    border: 0;
    background: none;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--faint);
    cursor: pointer;
    border-radius: 4px;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { color: var(--text); background: var(--soft); }

@media (max-width: 560px) {
    .header-inner { gap: 12px; }
    .nav { gap: 14px; }
}

/* ───────── Page ───────── */
.page { flex: 1; padding: 56px 0 72px; }
.page-head { margin-bottom: 32px; }
.page-head h1 { font-size: 28px; }
.page-head p { margin-top: 6px; color: var(--muted); }
.back { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.back:hover { color: var(--text); }

@media (max-width: 560px) {
    .page { padding: 36px 0 56px; }
}

/* ───────── Buttons & links ───────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #cfcfcf; background: var(--soft); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #333; border-color: #333; }
.btn-sm { min-height: 30px; padding: 4px 12px; font-size: 13px; }
.btn-danger { color: var(--danger); }

.text-link { color: var(--muted); font-size: 14px; }
.text-link:hover { color: var(--text); }

.link-btn {
    border: 0;
    background: none;
    padding: 0;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}
.link-btn:hover { color: var(--text); }

/* ───────── Profile ───────── */
.intro { display: flex; gap: 24px; align-items: center; }
.intro-photo {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.intro h1 { font-size: 30px; letter-spacing: -0.02em; }
.intro h1 small { font-weight: 400; color: var(--faint); font-size: 20px; }
.intro-headline { font-size: 17px; margin-top: 2px; }
.intro-sub { color: var(--muted); }
.intro-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

@media (max-width: 560px) {
    .intro { flex-direction: column; align-items: flex-start; gap: 16px; }
    .intro-photo { width: 88px; height: 88px; }
    .intro h1 { font-size: 26px; }
}

/* Resume-style sections: label on the left, content on the right */
.section {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 24px;
    padding: 40px 0 0;
    margin-top: 40px;
    border-top: 1px solid var(--line);
}
.section > h2 {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    padding-top: 2px;
}
.section-body { min-width: 0; }
.section-foot { margin-top: 16px; }

@media (max-width: 640px) {
    .section { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 28px; margin-top: 28px; }
}

.prose p + p { margin-top: 14px; }

.entries { display: grid; gap: 22px; }
.entry h3 { font-size: 15px; }
.entry .muted { font-size: 14px; }
.entry-text { margin-top: 6px; }

.skills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.skills li {
    padding: 3px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
}

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.contact-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.contact-list span { color: var(--muted); }
.contact-list a { overflow-wrap: anywhere; }
.contact-list a:hover { text-decoration: underline; }

/* Compact post rows on the profile */
.post-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.post-rows a { display: block; }
.post-rows a:hover strong { text-decoration: underline; }
.post-rows .excerpt {
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.status { color: var(--muted); }

/* ───────── Posts ───────── */
.feed { display: grid; }
.post { padding: 32px 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.feed .post:first-child { border-top: 0; padding-top: 0; }
.post-meta { color: var(--muted); font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.post-meta a:hover { color: var(--text); }
.post-title { font-size: 20px; letter-spacing: -0.015em; }
.post-title a:hover { text-decoration: underline; }
.post-full .post-title { font-size: 28px; }
.post-image img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.post-foot { display: flex; gap: 16px; align-items: center; }

.post-tweet .twitter-tweet { margin: 0 !important; }
.tweet-fallback {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}

.rich { overflow-wrap: anywhere; }
.rich > * + * { margin-top: 12px; }
.rich a { color: var(--link); }
.rich a:hover { text-decoration: underline; }
.rich h3 { font-size: 18px; }
.rich h4 { font-size: 16px; }
.rich ul { padding-left: 20px; margin-bottom: 0; }
.rich code { background: var(--soft); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.post-body.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-body.is-clamped > * + * { margin-top: 0; }

.badge {
    display: inline-block;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
}

/* ───────── Forms ───────── */
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
@media (max-width: 560px) { .panel { padding: 18px; } }
.panel-title { font-size: 17px; margin-bottom: 16px; }

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.field-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; }
.field-label span:last-child:not(:first-child) { color: var(--faint); font-weight: 400; }
.hint { color: var(--faint); font-size: 12px; }
.input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: var(--bg);
    font-size: 14px;
}
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.55; }

.form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}
.form-error { color: var(--danger); margin-top: 10px; font-size: 14px; }
.form-ok { color: var(--ok); font-size: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.sent h2 { font-size: 16px; }
.sent p { color: var(--muted); margin-top: 2px; }

/* ───────── Notes ───────── */
.notes-head { display: flex; justify-content: space-between; align-items: baseline; margin: 48px 0 8px; }
.notes-head h2 { font-size: 17px; }
.note-list { list-style: none; margin: 0; padding: 0; }
.note { padding: 20px 0; border-top: 1px solid var(--line); }
.note-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.note-name { font-weight: 600; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.note-reply {
    margin-top: 12px;
    padding-left: 14px;
    border-left: 2px solid var(--line);
}
.note-gif { max-width: 220px; border-radius: 8px; margin-top: 8px; }

/* ───────── Admin ───────── */
.admin-stack { display: grid; gap: 20px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
    border: 0;
    background: none;
    padding: 10px 0;
    margin-bottom: -1px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 16px; cursor: pointer; font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.image-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.image-row .input { flex: 1; min-width: 200px; }
.image-preview { margin-top: 8px; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list > li { padding: 16px 0; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.admin-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-note textarea.input { min-height: 64px; }

/* ───────── Footer ───────── */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    padding-bottom: 28px;
    color: var(--faint);
    font-size: 13px;
}

.link-card {
    display: grid;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.link-card:hover { background: var(--soft); }
.link-card span { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.input-date { max-width: 220px; }

/* Latest posts on the profile: the post photo sits behind the text, fading out towards the top */
.post-rows { gap: 10px; }
.post-row {
    position: relative;
    overflow: hidden;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.post-row:hover { border-color: #d4d4d4; }
.post-row.has-image { display: flex; align-items: flex-end; min-height: 136px; }
.row-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}
.row-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.9) 55%, #fff 100%);
}
.row-content { position: relative; display: grid; gap: 2px; }
.post-row .post-meta { font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
    .row-bg { transition: transform 0.5s ease; }
    .post-row:hover .row-bg { transform: scale(1.04); }
}

/* Posts page: list / grid switch */
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.view-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.view-switch button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}
.view-switch button:hover { color: var(--text); }
.view-switch button[aria-pressed="true"] { background: var(--soft); color: var(--text); font-weight: 500; }
.view-switch svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.tile:hover { border-color: #d4d4d4; }
.tile:hover strong { text-decoration: underline; }
.tile-image { aspect-ratio: 4 / 3; background: var(--soft); overflow: hidden; }
.tile-image img { width: 100%; height: 100%; object-fit: cover; }
.tile-text { display: flex; padding: 14px; }
.tile-text span {
    color: var(--muted);
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tile-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.tile .excerpt {
    color: var(--muted);
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.badge-pin { background: #fff3e0; }

/* Profile content comes from the database; hidden for a moment on a first visit until it arrives */
.page.is-loading .wrap { visibility: hidden; }

/* Admin → Profile tab */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair > .field + .field { margin-top: 0; }
.pair-item { position: relative; display: block; }
.pair-tag {
    position: absolute;
    top: 9px;
    right: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--faint);
    pointer-events: none;
}
.pair-item .input { padding-right: 34px; }
@media (max-width: 560px) { .pair { grid-template-columns: 1fr; } }

.items { display: grid; gap: 12px; margin-bottom: 14px; }
.item { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; background: #fcfcfc; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.item .field + .field, .item .field:first-child { margin-top: 0; }
.item .field + .field { margin-top: 10px; }
.section-hint { margin: -8px 0 14px; }
.photo-preview { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

.save-bar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--line);
}
