/*
Theme Name: Gramma89 Nocturne
Description: ธีมนิตยสารออนไลน์ภาษาไทยของ gramma89.lol
Version: 1.0.0
Author: Gramma89
Text Domain: gramma89-nocturne
License: GNU General Public License v2 or later
*/

:root {
    --ink: #161521;
    --night: #101017;
    --indigo: #211f32;
    --muted: #585565;
    --grape: #543e77;
    --lilac: #d8c7ff;
    --paper: #edeaf0;
    --white: #fbf9fc;
    --line: #c9c5ce;
    --gutter: clamp(24px, 5.5vw, 90px);
    --space: clamp(56px, 6.6vw, 106px);
    --wide: 1300px;
    --body-font: "Fahkwang", "Leelawadee UI", Tahoma, Arial, sans-serif;
    --display: "Archivo Black", "Arial Black", "Arial", sans-serif;
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 16px/1.72 var(--body-font);
    text-rendering: optimizeLegibility;
}
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3, summary { overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.37; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
::selection { background: var(--lilac); color: var(--night); }
:focus-visible { outline: 3px solid #8453bc; outline-offset: 4px; }
.cover :focus-visible, .mast :focus-visible, .journal :focus-visible, .closing :focus-visible { outline-color: #dfcaff; }
.frame { width: min(calc(100% - 2 * var(--gutter)), var(--wide)); margin-inline: auto; }
.screen-reader-text, .skip:not(:focus) {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10000; padding: 12px; background: white; }
.mast {
    position: relative;
    z-index: 2;
    color: #fcfaff;
    background: var(--night);
    border-bottom: 1px solid #393643;
}
.mast-inner, .mast-actions, .wordmark, .main-menu ul, .cover-actions, .section-head, .colophon {
    display: flex;
    align-items: center;
}
.mast-inner { min-height: 73px; justify-content: space-between; gap: 24px; }
.wordmark { flex: none; gap: 10px; color: #fcfaff; }
.wordmark .symbol { width: 36px; height: 36px; }
.wordmark span {
    font: 850 clamp(1.27rem, 2.1vw, 2.12rem)/1 var(--display);
    letter-spacing: -.065em;
    text-transform: uppercase;
}
.main-menu ul, .closing nav ul { margin: 0; padding: 0; list-style: none; }
.main-menu ul { flex-wrap: wrap; gap: 0 clamp(18px, 2.7vw, 44px); }
.main-menu a, .desk-login { display: inline-flex; align-items: center; min-height: 44px; font-size: .92rem; }
.mast-actions { flex: none; gap: clamp(14px, 2vw, 30px); }
.mast .action { min-height: 43px; }
.main-menu .drawer-login, .nav-toggle { display: none; }
.main-menu a:hover, .desk-login:hover, .text-link:hover, .closing nav a:hover { text-decoration: underline; text-underline-offset: .25em; }
.action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .88em;
    min-height: 46px;
    max-width: 100%;
    padding: .62em 1.35em;
    border: 1px solid transparent;
    font-size: .97rem;
    font-weight: 650;
    line-height: 1.45;
    text-align: center;
}
.action span, .text-link span, .record-title > span, .member-link b { font: 400 1.1em/1 Arial, sans-serif; }
.ink-action { color: white; background: var(--indigo); }
.ink-action:hover { background: #464057; }
.mast .ink-action, .lilac-action { color: var(--ink); background: var(--lilac); }
.mast .ink-action:hover, .lilac-action:hover { background: #ebe1ff; }
.outline-action { color: #faf9ff; background: rgba(21,19,32,.66); border-color: #c4bcd5; }
.outline-action:hover { background: #3d364e; }

.cover { position: relative; isolation: isolate; overflow: hidden; color: #faf9ff; background: var(--night); }
.cover-art, .cover-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-art { z-index: -2; }
.cover-art img { object-fit: cover; object-position: 58% 52%; }
.cover::before {
    position: absolute; z-index: -1; content: ""; inset: 0;
    background: linear-gradient(90deg,rgba(12,11,22,.83),rgba(17,14,29,.62) 36%,rgba(16,14,25,.12) 61%,transparent 76%);
}
.cover-inner {
    display: grid; align-items: center;
    min-height: clamp(470px, 40.5vw, 665px);
    padding-block: clamp(40px, 5vw, 80px);
}
.cover-copy { width: min(55%, 760px); }
.cover-copy h1 { font-size: clamp(1.6rem, 2.5vw, 2.6rem); font-weight: 550; }
.cover-brand {
    display: block;
    margin-left: -.055em;
    font: 900 clamp(4.2rem, 7.75vw, 8.7rem)/.96 var(--display);
    letter-spacing: -.089em;
    white-space: nowrap;
}
.cover-brand > span { color: var(--lilac); letter-spacing: -.095em; }
.cover-subjects { display: block; margin-top: .64em; font-size: clamp(1.4rem, 2.14vw, 2.28rem); }
.cover-copy p { margin-top: .82rem; max-width: 33rem; color: #e7e3ef; font-size: clamp(1rem, 1.2vw, 1.15rem); }
.cover-actions { flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }
.section-title { font-size: clamp(1.78rem, 3.15vw, 3.25rem); font-weight: 620; }

.guides, .faq-section {
    display: grid;
    grid-template-columns: minmax(205px,.7fr) minmax(0,2.1fr);
    gap: clamp(28px, 5.2vw, 88px);
    align-items: start;
}
.guides { padding-block: var(--space); }
.guides-intro { padding-top: 18px; border-top: 3px solid var(--ink); }
.guides-intro p { margin-top: .85em; max-width: 31ch; color: var(--muted); }
.record-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(24px, 3vw, 48px) clamp(16px, 2vw, 32px); }
.record-card { min-width: 0; display: block; }
.record-image { position: relative; overflow: hidden; background: var(--indigo); }
.record-image img { width: 100%; aspect-ratio: 1.85; object-fit: cover; transition: transform .3s ease; }
.record-card:hover img { transform: scale(1.025); }
.record-tag {
    position: absolute; left: 12px; bottom: 11px;
    padding: 2px 10px; background: #171620; color: #f8f4ff;
    font-weight: 600; font-size: .84rem;
}
.record-title, .member-link { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.record-title { margin-top: 12px; }
.record-title h3 { font-size: clamp(1.2rem, 1.7vw, 1.65rem); }
.record-title > span { color: var(--grape); }
.record-card p { color: var(--muted); font-size: .95rem; margin-top: .35em; }
.record-card:hover h3, .member-link:hover strong, .read-body h2 a:hover, .read-body h3 a:hover {
    text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.journal { background: var(--indigo); color: var(--white); padding-block: var(--space); }
.section-head { justify-content: space-between; gap: 18px; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid #575267; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; gap: .7em; color: var(--grape); font-weight: 600; }
.journal .text-link, .journal .read-meta { color: var(--lilac); }
.journal .read-body p { color: #d2cddb; }
.read-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(18px,2.4vw,38px); }
.read-card { min-width: 0; }
.read-cover { display: block; overflow: hidden; background: #a8a4b2; }
.read-cover img { width: 100%; aspect-ratio: 1.77; object-fit: cover; }
.read-body { padding-top: 14px; }
.read-meta, .article-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--grape); font-size: .84rem; }
.read-meta span { font-weight: 600; }
.read-body h2, .read-body h3 { margin: .46em 0; font-size: clamp(1.18rem,1.61vw,1.62rem); }
.read-body p { color: var(--muted); font-size: .95rem; }
.member-section {
    display: grid;
    grid-template-columns: minmax(0,.96fr) minmax(0,1.04fr);
    align-items: center;
    gap: clamp(25px,6.4vw,100px);
    padding-block: var(--space);
}
.member-photo img { width: 100%; aspect-ratio: 1.62; object-fit: cover; }
.member-copy h2 { margin-bottom: .45em; }
.member-link { align-items: center; min-height: 73px; padding: 15px 0; border-top: 1px solid var(--line); }
.member-link:last-child { border-bottom: 1px solid var(--line); }
.member-link strong, .member-link small { display: block; }
.member-link strong { font-size: 1.08rem; }
.member-link small { margin-top: .18rem; color: var(--muted); font-size: .9rem; }
.member-link b { color: var(--grape); }
.faq-section { border-top: 1px solid var(--line); padding-block: var(--space); }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 60px; padding-block: 14px; list-style: none; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 1.45rem/1 Arial,sans-serif; color: var(--grape); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 1.15em; color: var(--muted); }
.faq a, .prose a:not(.action), .crumb a, .article-byline a { text-decoration: underline; text-underline-offset: .2em; color: var(--grape); }

.inner-head { background: #ded9e8; padding-block: clamp(36px,5vw,80px); border-bottom: 1px solid var(--line); }
.inner-head h1 { max-width: 23em; font-size: clamp(1.95rem,3.85vw,4rem); }
.inner-head p { max-width: 45rem; margin-top: .85em; color: var(--muted); font-size: clamp(1rem,1.4vw,1.2rem); }
.crumb { display: flex; flex-wrap: wrap; gap: .65em; margin-bottom: 19px; font-size: .87rem; color: var(--muted); }
.article-byline { margin-bottom: .7em; }
.reading { display: grid; grid-template-columns: minmax(0,1.8fr) minmax(0,.86fr); gap: clamp(32px,6vw,92px); align-items: start; padding-block: var(--space); }
.prose { min-width: 0; overflow-wrap: anywhere; font-size: clamp(1.02rem,1.2vw,1.13rem); line-height: 1.86; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .3em; }
.prose h2, .prose h3 { margin: 1.45em 0 .6em; }
.prose h2 { font-size: clamp(1.42rem,2.2vw,2.18rem); }
.prose h3 { font-size: clamp(1.2rem,1.65vw,1.65rem); }
.prose > :first-child { margin-top: 0; }
.prose table { display: block; width: max-content; max-width: 100%; overflow-x: auto; margin: 1.15em 0; border-collapse: collapse; }
.prose caption { text-align: start; font-weight: 600; margin-bottom: .45em; }
.prose td, .prose th { border: 1px solid var(--line); padding: .56em .8em; text-align: start; }
.prose th { background: #e0dce9; }
.prose blockquote { padding: .65em 1em; border-left: 3px solid var(--grape); background: var(--white); }
.reading-side { border: 1px solid var(--line); background: var(--white); }
.reading-side img { width: 100%; aspect-ratio: 1.5; object-fit: cover; }
.reading-side .text-link { padding: 16px 20px; }
.outbound { margin-bottom: 1.6em; border-left: 3px solid var(--grape); padding: clamp(18px,2vw,30px); background: #e1dbea; }
.outbound p { margin: .6em 0 0; color: var(--muted); font-size: .92rem; }
.post-links { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.archive-body, .missing { padding-block: var(--space); }
.archive-intro { max-width: 48rem; margin-bottom: clamp(25px,4vw,58px); }
.missing p, .missing .action { margin-top: 15px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.pagination .page-numbers { border: 1px solid var(--line); padding: 5px 10px; }
.pagination .current { color: white; background: var(--indigo); }
.closing { background: var(--night); color: #f7f3ff; padding-top: clamp(45px,5.4vw,84px); }
.closing-grid { display: grid; grid-template-columns: 1.35fr .73fr 1fr; gap: clamp(26px,4.4vw,72px); }
.closing-brand p { max-width: 34ch; margin-top: .9rem; color: #c9c5d2; }
.closing .wordmark span { font-size: clamp(1.95rem,3.6vw,3.6rem); }
.closing nav h2 { margin-bottom: .65em; font-size: 1.06rem; }
.closing nav a { display: inline-block; padding-block: .2em; color: #e4e0ed; font-size: .94rem; }
.colophon { flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; margin-top: 40px; padding-block: 20px; border-top: 1px solid #403d4a; color: #c8c2d5; font-size: .83rem; }

@media (max-width: 1000px) {
    .guides, .faq-section { grid-template-columns: minmax(175px,.7fr) minmax(0,1.9fr); gap: 28px; }
    .record-image img { aspect-ratio: 1.5; }
    .cover-copy { width: 62%; }
}
@media (max-width: 860px) {
    .mast-inner { display: grid; grid-template-columns: auto 1fr; min-height: 64px; gap: 0 9px; }
    .mast-actions { justify-self: end; grid-column: 2; grid-row: 1; gap: 8px; }
    .main-menu { grid-column: 1 / -1; grid-row: 2; width: 100%; }
    .main-menu .drawer-login { display: inline-flex; }
    .mast-actions .desk-login { display: none; }
    .nav-ready .main-menu { display: none; }
    .nav-ready .menu-open .main-menu { display: block; padding-block: 10px; border-top: 1px solid #585364; }
    .nav-ready .nav-toggle {
        display: inline-grid;
        place-content: center;
        gap: 5px;
        width: 43px;
        height: 43px;
        color: #f6f3fa;
        background: transparent;
        border: 1px solid #82798e;
    }
    .nav-toggle span { width: 17px; height: 2px; background: currentColor; }
    .menu-open .nav-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
    .menu-open .nav-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
    .guides { grid-template-columns: minmax(0,1fr); gap: 22px; }
    .guides-intro { border-top: 0; padding: 0; }
    .wide-only { display: none; }
    .guides-intro p { max-width: none; margin-top: .45em; }
    .record-image img { aspect-ratio: 1.75; }
    .reading { gap: 25px; }
}
@media (max-width: 680px) {
    :root { --gutter: clamp(16px,4.9vw,30px); --space: 49px; }
    .mast-inner { min-height: 60px; }
    .wordmark { gap: 7px; }
    .wordmark .symbol { width: 29px; height: 29px; }
    .wordmark span { font-size: 1.18rem; }
    .mast .action { min-height: 42px; padding-inline: .83em; gap: .4em; font-size: .85rem; }
    .cover-inner { align-items: end; min-height: clamp(570px,119vw,710px); padding-top: clamp(216px,53vw,350px); padding-bottom: clamp(26px,5vw,42px); }
    .cover-art img { object-position: center 40%; }
    .cover::before { background: linear-gradient(180deg,transparent 27%,rgba(14,12,24,.03) 36%,rgba(14,12,24,.65) 57%,rgba(14,12,24,.94) 86%); }
    .cover-copy { width: 100%; max-width: 35rem; }
    .cover-brand { font-size: clamp(3rem,12.2vw,5rem); }
    .cover-subjects { margin-top: .48em; font-size: clamp(1.3rem,4.7vw,1.9rem); }
    .cover-copy p { margin-top: .68rem; font-size: .96rem; }
    .cover-actions { gap: 8px; margin-top: 1.15rem; }
    .cover-actions .action { min-height: 44px; padding: .55em .8em; font-size: .9rem; gap: .4em; }
    .section-title { font-size: clamp(1.58rem,5.8vw,2.3rem); }
    .record-grid { gap: 23px 14px; }
    .record-image img { aspect-ratio: 1.29; }
    .record-tag { left: 6px; bottom: 6px; padding: 1px 6px; font-size: .76rem; }
    .record-title { gap: 5px; margin-top: 9px; align-items: start; }
    .record-title h3 { font-size: clamp(1.1rem,3.8vw,1.35rem); }
    .record-title > span { font-size: .9rem; line-height: 1.55; }
    .record-card p { font-size: .88rem; }
    .section-head { padding-bottom: 14px; margin-bottom: 18px; gap: 8px; }
    .section-head .text-link { font-size: .85rem; }
    .journal .read-grid, .read-grid, .member-section, .faq-section, .reading { grid-template-columns: minmax(0,1fr); }
    .read-grid { gap: 25px; }
    .read-body { padding-top: 10px; }
    .member-section, .faq-section, .reading { gap: 24px; }
    .member-photo img { aspect-ratio: 2.05; }
    .member-link { min-height: 65px; }
    .closing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 16px; }
    .closing-brand { grid-column: 1 / -1; }
    .closing .wordmark span { font-size: 1.9rem; }
    .closing-brand p { max-width: none; }
    .colophon { margin-top: 26px; }
}
@media (max-width: 360px) {
    :root { --gutter: 13px; }
    .wordmark { gap: 4px; }
    .wordmark .symbol { width: 25px; height: 25px; }
    .wordmark span { font-size: 1.05rem; }
    .mast .action { padding-inline: .55em; font-size: .8rem; }
    .nav-ready .nav-toggle { width: 38px; height: 41px; }
    .cover-actions .action { font-size: .83rem; padding-inline: .55em; }
    .record-grid { gap: 19px 11px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; }
}
