/*
Theme Name: Untilted — Carnet de nuit
Description: Un carnet personnel sombre, sobre et libre. Textes courts dans le fil, lectures longues et images facultatives.
Version: 1.1.2
Requires at least: 6.6
Requires PHP: 8.2
Text Domain: untilted
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

@font-face {
    font-family: 'Untilted Hand';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('assets/fonts/caveat.woff2') format('woff2'), url('assets/fonts/caveat.ttf') format('truetype');
}

:root {
    --ut-ground: #111310;
    --ut-ink: #e8e1d5;
    --ut-muted: #a9a69e;
    --ut-accent: #c3a286;
    --ut-line: #383b33;
    --ut-field: #191c17;
    --ut-serif: Georgia, 'Times New Roman', serif;
    --ut-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --ut-hand: 'Untilted Hand', 'Segoe Print', 'Bradley Hand', cursive;
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ut-ground); scroll-behavior: smooth; }
body.ut-site {
    margin: 0;
    background: var(--ut-ground);
    color: var(--ut-ink);
    font: 400 16px/1.7 var(--ut-sans);
    overflow-wrap: anywhere;
    -webkit-text-size-adjust: 100%;
    min-width: 0;
    isolation: isolate;
}
body.ut-site::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .17;
    background-image: repeating-radial-gradient(circle at 17% 34%, transparent 0, #9b927514 .7px, transparent 1.3px, transparent 4px);
    background-size: 9px 13px;
}
p, h1, h2, h3, h4, figure { margin: 0; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--ut-accent); }
a, button, input, textarea, summary { -webkit-tap-highlight-color: #c3a28635; }
:focus-visible { outline: 2px solid var(--ut-accent); outline-offset: 5px; }
::selection { background: var(--ut-accent); color: var(--ut-ground); }
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; }
button, input, textarea, select { font: inherit; }
input, textarea, select { border-radius: 0; }
button, input[type='submit'], summary { cursor: pointer; }
button:disabled, input:disabled { cursor: default; opacity: .6; }
.ut-skip-link { position: fixed; top: 10px; left: 15px; padding: 10px 16px; background: var(--ut-ink); color: var(--ut-ground); transform: translateY(calc(-100% - 20px)); z-index: 100000; }
.ut-skip-link:focus { transform: none; }
.screen-reader-text { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; position: absolute; white-space: nowrap; }
.screen-reader-text:focus { clip-path: none; width: auto; height: auto; overflow: visible; position: static; }

.ut-header, .ut-main, .ut-footer { position: relative; z-index: 1; }
.ut-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 4%; border-bottom: 1px solid var(--ut-line); }
.ut-brand { font: italic 38px/1 var(--ut-serif); letter-spacing: -.055em; white-space: nowrap; text-decoration: none; }
.ut-brand-word { position: relative; display: inline-block; padding-bottom: 6px; }
.ut-brand-word::after { content: ''; position: absolute; left: 27%; right: -1px; bottom: 0; height: 1px; background: var(--ut-accent); transform: rotate(-4deg); opacity: .75; }
.ut-brand-dot { color: var(--ut-accent); }
.ut-nav { display: flex; align-items: center; justify-content: flex-end; gap: 28px; flex-wrap: wrap; }
.ut-nav a { color: var(--ut-muted); font-size: 13px; text-decoration: none; padding: 8px 0; }
.ut-nav a[aria-current='page'], .ut-nav a:hover { color: var(--ut-ink); }
.ut-main { max-width: 980px; margin: 0 auto; padding: 0 46px; }
.ut-hero { position: relative; padding: 76px 0 58px; }
.ut-meta { font: 400 11px/1.7 'Courier New', monospace; letter-spacing: .075em; text-transform: uppercase; color: var(--ut-muted); }
.ut-hero .ut-meta { margin-bottom: 26px; }
.ut-title { max-width: 830px; font: 400 clamp(43px, 5.3vw, 66px)/1.12 var(--ut-serif); letter-spacing: -.045em; }
.ut-intro { max-width: 520px; margin-top: 28px; font-size: 15px; color: var(--ut-muted); line-height: 1.9; }
.ut-hand, .ut-signature { font: 400 27px/1.25 var(--ut-hand); color: var(--ut-accent); }
.ut-margin-note { display: block; width: max-content; max-width: 100%; margin: 28px 0 0 auto; transform: rotate(-4deg); }
.ut-hero-with-photo { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 55px; align-items: center; }
.ut-hero-copy { min-width: 0; }
.ut-hero-with-photo .ut-title { font-size: clamp(43px, 4.9vw, 62px); }
.ut-hero-actions { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-top: 29px; }
.ut-hero-photo { position: relative; margin: 9px 8px 22px 3px; transform: rotate(3deg); }
.ut-hero-photo::before { content: ''; position: absolute; width: 61px; height: 15px; left: calc(50% - 30px); top: -7px; z-index: 1; background: #b9ac8e65; transform: rotate(-8deg); }
.ut-hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; padding: 6px; background: #262820; filter: saturate(.58) brightness(.88); }
.ut-hero-photo figcaption { text-align: right; font-size: 30px; margin: 17px 1px 0; transform: rotate(-6deg); }
.ut-feed { scroll-margin-top: 26px; }
.ut-feed-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 19px 0; border-bottom: 1px solid var(--ut-line); position: relative; }
.ut-feed-heading::before { content: ''; position: absolute; height: 1px; top: 0; left: 0; right: 0; background: var(--ut-line); transform: rotate(-.16deg); }
.ut-feed-heading h2 { font: 400 14px/1.6 var(--ut-sans); }
.ut-post { padding: 37px 0 33px; border-bottom: 1px solid var(--ut-line); }
.ut-post-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 17px; }
.ut-post-title { font: 400 34px/1.2 var(--ut-serif); letter-spacing: -.025em; margin-bottom: 20px; }
.ut-post-title a { text-decoration: none; }
.ut-post-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-top: 25px; }
.ut-post-bottom .ut-signature { margin: 0; }
.ut-prose { font: 400 21px/1.75 var(--ut-serif); }
.ut-prose > * + * { margin-top: 1em; }
.ut-prose h2, .ut-prose h3, .ut-prose h4 { font-family: var(--ut-serif); font-weight: 400; line-height: 1.3; margin-top: 1.5em; }
.ut-prose h2 { font-size: 1.55em; }
.ut-prose h3 { font-size: 1.3em; }
.ut-prose h4 { font-size: 1.1em; }
.ut-prose a { color: var(--ut-accent); }
.ut-prose ul, .ut-prose ol { padding-left: 1.4em; }
.ut-prose li + li { margin-top: .3em; }
.ut-prose blockquote { margin: 1.5em 0; padding: .3em 0 .3em 1.2em; border-left: 1px solid var(--ut-accent); color: var(--ut-ink); font-style: italic; }
.ut-prose pre { white-space: pre-wrap; font-size: .8em; background: var(--ut-field); padding: 18px; overflow-wrap: anywhere; }
.ut-prose code { font-size: .8em; }
.ut-prose table { border-collapse: collapse; width: 100%; }
.ut-prose td, .ut-prose th { border-bottom: 1px solid var(--ut-line); padding: 10px; text-align: left; }
.ut-prose .wp-block-table { overflow-x: auto; }
.ut-prose .wp-block-image img { display: block; }
.ut-prose .wp-block-image figcaption { font: 400 14px/1.6 var(--ut-sans); color: var(--ut-muted); margin-top: 10px; }
.ut-prose .wp-block-separator { border: none; border-top: 1px solid var(--ut-line); margin-top: 2em; margin-bottom: 2em; }
.ut-prose .wp-block-quote { border-left: 1px solid var(--ut-accent); }
.ut-prose .wp-block-pullquote { padding: 1.5em 0; }
.ut-prose .wp-block-pullquote blockquote { border: 0; padding: 0; margin: 0; }
.ut-prose .wp-block-verse { font: inherit; background: none; padding: 0; white-space: pre-wrap; }
.ut-prose .alignwide { width: 100%; }
.ut-prose .alignfull { width: 100%; margin-left: 0; margin-right: 0; }
.ut-prose .wp-element-button, .ut-prose .wp-block-button__link { color: var(--ut-ground); background: var(--ut-ink); border-radius: 0; font: 400 15px/1.6 var(--ut-sans); }
.ut-fragment-text { font-size: 29px; line-height: 1.45; }
.ut-fragment-text > p + p { margin-top: .8em; }
.ut-fragment .ut-post-title { font-size: 27px; color: var(--ut-muted); }
.ut-excerpt-layout.ut-with-photo { display: grid; grid-template-columns: minmax(0, 1fr) 265px; gap: 35px; align-items: start; }
.ut-photo { transform: rotate(1deg); position: relative; margin: 8px 4px 6px; }
.ut-photo::before { content: ''; width: 60px; height: 15px; position: absolute; top: -8px; left: calc(50% - 30px); background: #aaa28d65; transform: rotate(-5deg); z-index: 1; pointer-events: none; }
.ut-photo img { display: block; width: 100%; height: auto; object-fit: cover; }
.ut-excerpt-layout .ut-photo img { aspect-ratio: 4 / 3; }
.ut-photo figcaption { margin-top: 10px; color: var(--ut-muted); font: 400 18px/1.4 var(--ut-hand); text-align: right; }
.ut-fragment > .ut-photo { max-width: 600px; margin-top: 30px; }
.ut-text-link { display: inline-block; padding: 6px 0 3px; font-size: 13px; border-bottom: 1px solid var(--ut-accent); text-decoration: none; }
.ut-quiet-link, .comment-reply-link { font-size: 12px; color: var(--ut-muted); text-decoration: none; display: inline-block; padding: 7px 0; }
.ut-footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; max-width: 980px; margin: 35px auto 0; padding: 27px 46px 40px; }
.ut-footer p { color: var(--ut-muted); font-size: 12px; }
.ut-footer a { text-decoration: none; }
.ut-footer .ut-hand { font-size: 23px; transform: rotate(-3deg); }
.ut-reading { max-width: 710px; margin: 0 auto; padding: 40px 0 30px; }
.ut-back { display: inline-block; color: var(--ut-muted); font-size: 13px; padding: 7px 0; margin-bottom: 30px; text-decoration: none; }
.ut-page-title { font: 400 clamp(36px, 4.5vw, 53px)/1.16 var(--ut-serif); letter-spacing: -.035em; margin: 16px 0 33px; }
.ut-reading > .ut-photo { margin: 0 4px 38px; }
.ut-reading > .ut-photo img { max-height: 540px; }
.ut-reading > .ut-signature { margin-top: 32px; }
.ut-archive-header { padding: 60px 0 20px; }
.ut-empty { padding: 65px 0 70px; }
.ut-empty h2 { font: 400 34px/1.3 var(--ut-serif); margin-bottom: 18px; letter-spacing: -.02em; }
.ut-empty p { max-width: 550px; color: var(--ut-muted); font-size: 15px; }
.ut-empty .ut-text-link { margin-top: 25px; }
.ut-carnet-intention { max-width: 700px; padding: 48px 0 36px; }
.ut-carnet-intention > .ut-meta { margin-bottom: 17px; font-size: 11px; }
.ut-carnet-intention > p:not(.ut-meta):not(.ut-signature) { font: 400 20px/1.85 var(--ut-serif); color: var(--ut-ink); max-width: 630px; }
.ut-carnet-intention > .ut-signature { font: 400 28px/1.25 var(--ut-hand); color: var(--ut-accent); margin-top: 25px; }
.ut-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 25px; }
.ut-empty-actions .ut-quiet-link { border-bottom: 1px solid var(--ut-line); }
.ut-letter-heading { position: relative; }
.ut-letter-heading .ut-page-title { margin-bottom: 17px; }
.ut-letter-annotation { display: block; text-align: right; margin-bottom: 39px; transform: rotate(-3deg); }
.ut-origin-note { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; border-top: 1px solid var(--ut-line); border-bottom: 1px solid var(--ut-line); padding: 20px 0 22px; margin: 0 0 32px; }
.ut-origin-note .ut-meta { text-transform: none; }
.ut-origin-note .ut-hand { font-size: 32px; }
.ut-origin-arrow { color: var(--ut-muted); font-size: 18px; }
.ut-letter-body { margin-top: 36px; padding-top: 25px; border-top: 1px solid var(--ut-line); }
.ut-letter-recipient { color: var(--ut-muted); font: 400 14px/1.7 var(--ut-sans); }
.ut-letter-recipient .ut-hand { display: inline-block; font-size: 32px; margin-left: 5px; transform: rotate(-3deg); }
.ut-neighbor-posts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding-top: 30px; margin-top: 43px; border-top: 1px solid var(--ut-line); }
.ut-neighbor { display: block; text-decoration: none; }
.ut-neighbor-next { grid-column: 2; text-align: right; }
.ut-neighbor-title { display: block; font: 400 23px/1.5 var(--ut-serif); margin-top: 12px; }
.ut-reading-end { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; border-top: 1px solid var(--ut-line); padding-top: 28px; margin-top: 35px; }
.ut-reading-end .ut-hand { font-size: 25px; transform: rotate(-3deg); }
.navigation.pagination, .navigation.comment-navigation { padding: 28px 0 10px; font-size: 14px; }
.nav-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; align-items: center; }
.nav-links a { padding: 6px; text-decoration: none; }
.nav-links .current { color: var(--ut-accent); text-decoration: underline; text-underline-offset: .35em; }
.ut-part-pages { font-family: var(--ut-sans); font-size: 14px; padding: 20px 0; }

.ut-comments { border-top: 1px solid var(--ut-line); margin-top: 45px; padding-top: 32px; scroll-margin-top: 20px; }
.ut-section-title, .comment-reply-title { font: 400 29px/1.3 var(--ut-serif); margin-bottom: 22px; }
.ut-comment-list { list-style: none; padding: 0; margin: 0 0 42px; }
.ut-comment-list .children { list-style: none; margin: 10px 0 0 18px; padding-left: 18px; border-left: 1px solid var(--ut-line); }
.ut-comment { padding: 23px 0; border-bottom: 1px solid var(--ut-line); }
.ut-comment .ut-comment { border: 0; padding-bottom: 0; }
.ut-comment-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; margin-bottom: 12px; color: var(--ut-muted); }
.ut-comment-author { color: var(--ut-ink); }
.ut-comment-meta a { text-decoration: none; }
.ut-comment-content { font-size: 19px; }
.ut-comment .comment-reply-link { margin-top: 12px; }
.ut-form-note, .ut-notice, .comment-awaiting-moderation { font: 400 13px/1.7 var(--ut-sans); color: var(--ut-muted); margin: 14px 0; }
.ut-notice, .comment-awaiting-moderation { border-left: 2px solid var(--ut-accent); padding-left: 15px; }
.ut-optional { font-weight: 400; color: var(--ut-muted); }
.comment-reply-title small { font: 400 12px/1.6 var(--ut-sans); display: block; margin-top: 12px; }
.ut-comments label, .ut-contact label, .post-password-form label { display: block; font: 400 13px/1.6 var(--ut-sans); margin: 22px 0 9px; color: var(--ut-muted); }
.ut-comments input:not([type='hidden']), .ut-comments textarea,
.ut-contact input:not([type='hidden']):not([type='submit']):not([type='checkbox']), .ut-contact textarea,
.post-password-form input[type='password'] {
    display: block; width: 100%; min-width: 0; padding: 13px 14px; background: var(--ut-field); border: 1px solid var(--ut-line); color: var(--ut-ink); font: 400 16px/1.6 var(--ut-sans);
}
.ut-comments textarea, .ut-contact textarea { resize: vertical; min-height: 150px; }
.ut-comments .form-submit { margin-top: 23px; }
.ut-comments input[type='submit'], .ut-contact input[type='submit'], .ut-contact button, .post-password-form input[type='submit'], .ut-submit {
    width: auto; display: inline-block; padding: 12px 21px; margin-top: 18px; color: var(--ut-ink); background: transparent; border: 1px solid var(--ut-line); font: 400 14px/1.6 var(--ut-sans); cursor: pointer;
}
.ut-comments input[type='submit']:hover, .ut-contact input[type='submit']:hover, .ut-contact button:hover { border-color: var(--ut-accent); color: var(--ut-accent); }
.ut-contact form { margin-top: 30px; }
.ut-contact .untilted-contact-note, .ut-contact .untilted-contact-form small { display: block; font: 400 13px/1.7 var(--ut-sans); color: var(--ut-muted); margin-top: 12px; }
.ut-contact .untilted-contact-status { font: 400 14px/1.7 var(--ut-sans); }
.ut-contact .untilted-contact-status.is-pending { color: var(--ut-muted); border-left-color: var(--ut-line); }
.ut-contact .untilted-contact-status.is-success { border-left-color: var(--ut-accent); }
.ut-contact .untilted-contact-status.is-error { border-left-color: #c59a85; }
.ut-contact .untilted-contact-submit:disabled { cursor: wait; color: var(--ut-muted); border-color: var(--ut-line); opacity: .7; }
.ut-contact input[readonly], .ut-contact textarea[readonly] { opacity: .75; }
.ut-contact [role='status'], .ut-contact [role='alert'] { margin: 24px 0; padding: 18px 20px; border-left: 2px solid var(--ut-accent); background: var(--ut-field); font-size: 14px; }
.ut-contact [hidden] { display: none !important; }
.post-password-form p + p { margin-top: 20px; }
.ut-comments #respond { scroll-margin-top: 25px; }

@media (max-width: 760px) {
    .ut-header { padding: 24px 25px; }
    .ut-main { padding: 0 28px; }
    .ut-hero { padding-top: 56px; }
    .ut-title { font-size: clamp(41px, 7vw, 54px); }
    .ut-hero-with-photo { grid-template-columns: minmax(0, 1fr) 180px; gap: 32px; }
    .ut-hero-with-photo .ut-title { font-size: 43px; }
    .ut-hero-actions { gap: 13px 23px; }
    .ut-excerpt-layout.ut-with-photo { grid-template-columns: minmax(0, 1fr) 210px; gap: 24px; }
    .ut-footer { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 590px) {
    .ut-header { padding: 22px 24px; flex-wrap: wrap; gap: 20px; }
    .ut-brand { font-size: 34px; }
    .ut-nav { gap: 22px; justify-content: flex-start; }
    .ut-nav a { font-size: 12px; }
    .ut-main { padding: 0 25px; }
    .ut-hero { padding: 48px 0 43px; }
    .ut-hero .ut-meta { margin-bottom: 24px; }
    .ut-title { font-size: 44px; }
    .ut-hero-with-photo { display: block; }
    .ut-hero-with-photo .ut-title { font-size: 44px; }
    .ut-hero-photo { width: min(86%, 310px); margin: 39px auto 16px; transform: rotate(2deg); }
    .ut-hero-photo img { aspect-ratio: 16 / 9; }
    .ut-hero-photo figcaption { font-size: 29px; margin-top: 13px; }
    .ut-intro { font-size: 14px; }
    .ut-hand { font-size: 25px; }
    .ut-margin-note { margin-top: 26px; }
    .ut-feed-heading .ut-meta { display: none; }
    .ut-post { padding: 30px 0; }
    .ut-post-title { font-size: 30px; }
    .ut-fragment .ut-fragment-text { font-size: 26px; }
    .ut-prose { font-size: 20px; }
    .ut-excerpt-layout.ut-with-photo { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .ut-excerpt-layout .ut-photo { margin-left: 4px; margin-right: 4px; }
    .ut-excerpt-layout .ut-photo img { max-height: 270px; }
    .ut-footer { padding: 22px 25px 35px; align-items: flex-start; flex-wrap: wrap; margin-top: 20px; }
    .ut-footer .ut-hand { font-size: 22px; }
    .ut-page-title { font-size: 39px; }
    .ut-reading { padding-top: 26px; }
    .ut-letter-annotation { margin-bottom: 31px; }
    .ut-carnet-intention { padding-top: 37px; }
    .ut-carnet-intention h2 { font-size: 30px; }
    .ut-carnet-intention > p:not(.ut-meta):not(.ut-signature) { font-size: 19px; }
    .ut-neighbor-posts { gap: 22px; }
    .ut-neighbor-title { font-size: 20px; }
    .ut-reading-end { gap: 18px; }
    .ut-comments .children { margin-left: 8px; padding-left: 10px; }
    .ut-prose .wp-block-columns { flex-wrap: wrap !important; }
}
@media (max-width: 380px) {
    .ut-nav { width: 100%; }
    .ut-title { font-size: 39px; }
    .ut-hero-with-photo .ut-title { font-size: 39px; }
    .ut-page-title { font-size: 35px; }
    .ut-post-bottom { align-items: flex-start; }
}
@media (pointer: coarse) {
    .ut-nav a, .ut-text-link, .ut-quiet-link, .ut-back, .comment-reply-link { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
