/*
Theme Name: Meedee Riviera
Description: ธีมบรรณาธิการภาษาไทยสำหรับ meedee.website
Author: Meedee
Version: 1.0.0
Text Domain: meedee-riviera
License: GNU General Public License v2 or later
*/

:root {
    --ink: #122e2b;
    --sea: #103e3d;
    --deep: #0a2b2c;
    --mint: #cde8d7;
    --copper: #955b35;
    --paper: #faf8ee;
    --white: #fffdf5;
    --tide: #e4eee6;
    --muted: #4c6058;
    --line: #becbc0;
    --wide: 1310px;
    --gutter: clamp(22px,5.6vw,90px);
    --space: clamp(56px,6.8vw,104px);
    --sans: 'Fahkwang','Leelawadee UI',Tahoma,Arial,sans-serif;
    --display: 'Instrument Serif','Baskervville',Georgia,'Times New Roman',serif;
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 400 16px/1.7 var(--sans);
    text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3, summary { overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.35; }
.frame { width: min(calc(100% - var(--gutter) * 2),var(--wide)); margin-inline: auto; }
.screen-reader-text, .skip:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip:focus { position: fixed; z-index: 10000; top: 8px; left: 8px; padding: 10px 14px; background: white; }
:focus-visible { outline: 3px solid #a65626; outline-offset: 4px; }
.cover :focus-visible, .member-copy :focus-visible, .closing :focus-visible { outline-color: #f7d6aa; }
::selection { background: #c7ddd0; color: var(--deep); }

/* A light masthead with a small arch monogram. */
.mast { position: relative; z-index: 10; background: var(--white); border-bottom: 1px solid var(--line); }
.mast-inner, .mast-actions, .main-menu ul, .wordmark, .cover-actions, .section-head, .colophon {
    display: flex;
    align-items: center;
}
.mast-inner { min-height: 74px; gap: 20px; justify-content: space-between; }
.wordmark { flex-shrink: 0; gap: 9px; color: var(--sea); }
.wordmark span { font: 500 2.25rem/.95 var(--display); letter-spacing: -.075em; }
.wordmark .symbol { width: 33px; height: 33px; }
.main-menu { margin-inline: auto; }
.main-menu ul, .closing nav ul { padding: 0; margin: 0; list-style: none; }
.main-menu ul { flex-wrap: wrap; gap: 0 clamp(15px,2.5vw,40px); }
.main-menu a, .desk-login { display: inline-flex; align-items: center; min-height: 44px; font-size: .94rem; }
.main-menu a:hover, .desk-login:hover, .text-link:hover, .closing nav a:hover {
    text-decoration: underline;
    text-underline-offset: .24em;
}
.mast-actions { flex: none; gap: clamp(12px,1.5vw,24px); }
.main-menu .drawer-login, .nav-toggle { display: none; }
.action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .85em;
    min-height: 47px;
    max-width: 100%;
    padding: .59em 1.28em;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: .96rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
}
.action span, .text-link span, .member-link b, .subject-title > span, .quick-nav a span:last-child {
    font: 400 1.1em/1 Arial,sans-serif;
}
.ink-action { background: var(--sea); color: white; }
.ink-action:hover { background: #205452; }
.spring-action { color: #102f2d; background: #d6edda; }
.spring-action:hover { background: #edffef; }
.glass-action { color: #fffdf2; border-color: #c2d6c8; background: rgba(9,40,40,.66); }
.glass-action:hover { background: #234b47; }

/* The two cover images are composed for the actual reading positions. */
.cover { position: relative; isolation: isolate; overflow: hidden; color: #fff9e5; background: var(--deep); }
.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: 57% 52%; }
.cover::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, rgba(6,34,35,.9), rgba(8,38,38,.72) 31%, rgba(7,36,36,.2) 56%, transparent 78%);
}
.cover-inner {
    display: grid;
    align-items: center;
    min-height: clamp(480px,43vw,680px);
    padding-block: clamp(45px,5.1vw,82px);
}
.cover-copy { width: min(51%,650px); }
.cover-copy h1 { font-size: clamp(1.75rem,2.5vw,2.6rem); font-weight: 500; }
.cover-brand {
    display: block;
    margin: -.13em 0 .12em -.04em;
    color: #fff5d9;
    font: italic 400 clamp(5.8rem,10.7vw,11rem)/.94 var(--display);
    letter-spacing: -.09em;
}
.cover-subjects { display: block; font-size: clamp(1.45rem,2.15vw,2.3rem); line-height: 1.4; }
.cover-copy p { max-width: 34rem; margin-top: 1.05rem; color: #edf1de; font-size: clamp(1rem,1.19vw,1.14rem); line-height: 1.8; }
.cover-actions { flex-wrap: wrap; gap: 11px; margin-top: 1.55rem; }
.quick-nav { background: var(--mint); border-bottom: 1px solid #abd0bd; }
.quick-nav > .frame { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); }
.quick-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 63px;
    padding-inline: clamp(10px,2vw,31px);
    border-inline-start: 1px solid #a4c2af;
    font-weight: 600;
    color: #183f38;
}
.quick-nav a:last-child { border-inline-end: 1px solid #a4c2af; }
.quick-nav a:hover { background: #badbc8; }
.quick-nav a span:last-child { color: #345447; }

/* The category gallery uses the arched silhouette of the cover architecture. */
.guidebooks, .journal, .member-section { padding-block: var(--space); }
.section-title {
    color: var(--ink);
    font-size: clamp(1.8rem,3.25vw,3.3rem);
    font-weight: 580;
    line-height: 1.4;
}
.section-head { justify-content: space-between; align-items: end; gap: 18px; }
.subject-grid, .read-grid {
    display: grid;
    gap: clamp(18px,2.2vw,36px);
}
.subject-grid { grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: clamp(22px,2.3vw,38px); }
.subject { display: block; min-width: 0; }
.subject-image { overflow: hidden; border-radius: 48% 48% 4px 4px / 29% 29% 4px 4px; background: #d0ddd3; }
.subject-image img {
    width: 100%;
    aspect-ratio: 1.06;
    object-fit: cover;
    transition: transform .3s ease;
}
.subject:hover img { transform: scale(1.025); }
.subject-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-block: 15px 5px;
}
.subject-title h3 { font-size: clamp(1.35rem,2.05vw,2.05rem); font-weight: 600; }
.subject-title > span { color: var(--copper); }
.subject p { color: var(--muted); font-size: .94rem; line-height: 1.65; }
.subject:hover h3, .read-body a:hover, .member-link:hover strong { text-decoration: underline; text-underline-offset: .24em; text-decoration-thickness: 1px; }
.journal { background: var(--tide); border-block: 1px solid #c8d7cb; }
.journal .section-head { padding-bottom: clamp(18px,2vw,28px); border-bottom: 1px solid #a8bcb0; }
.text-link {
    display: inline-flex;
    align-items: center;
    gap: .65em;
    min-height: 42px;
    color: #24544b;
    font-weight: 600;
}
.journal-picks {
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
    gap: 20px clamp(24px,4vw,65px);
    margin-top: clamp(22px,2.3vw,34px);
}
.read-card { min-width: 0; }
.read-cover { display: block; overflow: hidden; border-radius: 4px; background: #b6c9bb; }
.read-cover img { width: 100%; aspect-ratio: 1.75; object-fit: cover; }
.read-body { padding-top: 14px; }
.read-meta, .article-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: .83rem; }
.read-meta span { color: #6f422b; font-weight: 600; }
.read-meta time::before { content: "·"; margin-right: 10px; }
.read-body h2, .read-body h3 { margin: .4em 0; font-size: clamp(1.16rem,1.55vw,1.55rem); }
.read-body p { color: var(--muted); font-size: .94rem; line-height: 1.7; }
.journal-picks > .read-card:first-child { grid-row: span 2; }
.journal-picks > .read-card:first-child h3 { font-size: clamp(1.4rem,2.2vw,2.15rem); }
.journal-picks > .read-card:not(:first-child) {
    display: grid;
    grid-template-columns: minmax(110px,.8fr) minmax(0,1.25fr);
    align-items: start;
    gap: clamp(13px,1.6vw,26px);
    padding-bottom: 18px;
    border-bottom: 1px solid #b9cbbf;
}
.journal-picks > .read-card:not(:first-child) .read-cover img { aspect-ratio: 1.22; }
.journal-picks > .read-card:not(:first-child) .read-body { padding-top: 0; }
.journal-picks > .read-card:not(:first-child) h3 { font-size: clamp(1.12rem,1.45vw,1.4rem); }
.read-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }

/* Member guides and frequently asked questions. */
.member-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,.95fr);
    background: var(--sea);
    color: var(--white);
    border-radius: 7px;
    overflow: hidden;
}
.member-copy { align-self: center; padding: clamp(27px,4.3vw,68px); }
.member-copy .section-title { margin-bottom: 20px; color: #edf7e5; }
.member-photo img { width: 100%; height: 100%; min-height: 310px; object-fit: cover; }
.member-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 65px;
    padding-block: 13px;
    border-top: 1px solid #668580;
}
.member-link:last-child { border-bottom: 1px solid #668580; }
.member-link strong { display: block; font-size: 1.16rem; font-weight: 600; }
.member-link small { display: block; margin-top: 2px; color: #d3e6da; font-size: .93rem; }
.member-link b { color: #e5c3a4; font-size: 1.3rem; }
.faq-section {
    display: grid;
    grid-template-columns: minmax(0,.76fr) minmax(0,1.25fr);
    gap: clamp(25px,5vw,80px);
    padding-bottom: var(--space);
}
.faq-section .text-link { margin-top: 8px; }
.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;
    font-weight: 600;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { flex: none; content: "+"; font: 400 1.6rem/1 var(--display); color: var(--copper); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 1.1em; color: var(--muted); }

/* Guides, archives and individual articles */
.inner-head { padding-block: clamp(34px,5.8vw,88px); background: var(--tide); border-bottom: 1px solid var(--line); }
.inner-head h1 { max-width: 26em; margin: .17em 0; font-size: clamp(2rem,3.7vw,3.8rem); font-weight: 600; }
.inner-head p { max-width: 46rem; margin-top: .75em; color: #3c5750; font-size: clamp(1rem,1.35vw,1.2rem); }
.crumb { display: flex; flex-wrap: wrap; align-items: baseline; gap: .65em; margin-bottom: 19px; font-size: .86rem; color: var(--muted); overflow-wrap: anywhere; }
.crumb a, .article-byline a, .prose a:not(.action) { color: #175347; text-decoration: underline; text-underline-offset: .18em; }
.article-byline { margin-bottom: 10px; }
.reading {
    display: grid;
    grid-template-columns: minmax(0,1.85fr) minmax(0,.92fr);
    align-items: start;
    gap: clamp(24px,6.6vw,98px);
    padding-block: var(--space);
}
.prose { min-width: 0; overflow-wrap: anywhere; font-size: clamp(1rem,1.2vw,1.12rem); line-height: 1.9; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.15em; }
.prose h2, .prose h3 { margin: 1.4em 0 .53em; }
.prose h2 { font-size: clamp(1.4rem,2.1vw,2.1rem); }
.prose h3 { font-size: clamp(1.17rem,1.5vw,1.5rem); }
.prose ol, .prose ul { padding-inline-start: 1.5em; }
.prose li + li { margin-top: .3em; }
.prose blockquote { padding: 1em 1.4em; border-inline-start: 3px solid var(--copper); background: var(--tide); }
.prose table { display: block; max-width: 100%; overflow-x: auto; margin: 1.1em 0; border-collapse: collapse; }
.prose th, .prose td { padding: .55em .76em; border: 1px solid var(--line); text-align: start; }
.prose th { background: var(--tide); }
.prose figure { max-width: 100%; margin-block: 1em; }
.reading-side { border-bottom: 1px solid var(--line); }
.reading-side img { width: 100%; aspect-ratio: 1.4; object-fit: cover; border-radius: 4px; }
.reading-side .text-link { padding: 12px 0; }
.outbound { padding: clamp(17px,2vw,30px); margin: 0 0 1.5em; border-inline-start: 3px solid var(--copper); background: #e3ede3; }
.outbound p { margin: 10px 0 0; color: var(--muted); font-size: .94rem; }
.post-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 1.4em; padding-block: 18px; border-top: 1px solid var(--line); }
.archive-body, .missing { padding-block: var(--space); }
.archive-intro { max-width: 48rem; margin-bottom: clamp(28px,4vw,58px); }
.missing h1 { font-size: clamp(2.1rem,4vw,4.5rem); }
.missing .action, .missing p { margin-top: 14px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.pagination .page-numbers { border: 1px solid var(--line); padding: 4px 11px; }
.pagination .current { background: var(--sea); color: white; }

/* The colophon shares its palette with the masthead insignia. */
.closing { padding-top: clamp(48px,5.4vw,80px); background: var(--deep); color: #f2f6e5; }
.closing-grid { display: grid; grid-template-columns: 1.45fr .75fr 1fr; gap: clamp(24px,4.5vw,76px); }
.closing .wordmark { color: var(--mint); }
.closing .wordmark span { font: italic 400 clamp(2.6rem,5vw,4.8rem)/1 var(--display); letter-spacing: -.1em; }
.closing .symbol { width: 39px; height: 39px; }
.closing-brand p { max-width: 35ch; margin-top: 14px; color: #c8dcce; }
.closing nav h2 { margin-bottom: .65em; font-size: 1.05rem; }
.closing nav a { display: inline-block; padding-block: .18em; color: #d8e9d8; font-size: .94rem; }
.colophon { justify-content: space-between; flex-wrap: wrap; gap: 4px 15px; margin-top: 40px; padding-block: 21px; color: #c6dacc; border-top: 1px solid #446463; font-size: .84rem; }

@media (max-width: 1000px) {
    .cover-copy { width: 59%; }
    .subject-grid { gap: 17px; }
    .subject-title h3 { font-size: 1.55rem; }
    .journal-picks { gap: 17px 25px; }
    .journal-picks > .read-card:not(:first-child) { grid-template-columns: minmax(90px,.63fr) minmax(0,1fr); }
}
@media (max-width: 860px) {
    .mast-inner {
        display: grid;
        grid-template-columns: auto 1fr;
        min-height: 63px;
        gap: 0 8px;
    }
    .mast-actions { justify-self: end; grid-column: 2; grid-row: 1; gap: 10px; }
    .main-menu { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; }
    .main-menu ul { gap: 0 18px; }
    .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; margin-top: 4px; padding-block: 8px; border-top: 1px solid var(--line); }
    .nav-ready .nav-toggle {
        display: inline-grid;
        place-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        background: transparent;
        color: var(--sea);
        border: 1px solid #9db7ac;
        border-radius: 3px;
    }
    .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); }
    .subject-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px 21px; }
    .subject-image img { aspect-ratio: 1.45; }
    .subject-image { border-radius: 48% 48% 4px 4px / 34% 34% 4px 4px; }
    .journal-picks > .read-card:not(:first-child) .read-body p { display: none; }
    .member-copy { padding: 27px; }
    .reading { grid-template-columns: minmax(0,1.6fr) minmax(0,.85fr); gap: 27px; }
}
@media (max-width: 680px) {
    :root { --gutter: clamp(16px,4.8vw,30px); --space: 48px; }
    .wordmark { gap: 6px; }
    .wordmark span { font-size: 2.05rem; }
    .wordmark .symbol { width: 29px; height: 29px; }
    .mast .action { min-height: 43px; font-size: .9rem; gap: .6em; padding-inline: 1em; }
    .mast-inner { min-height: 60px; }
    .cover-inner {
        min-height: clamp(550px,120vw,690px);
        align-items: end;
        padding-top: clamp(205px,51vw,339px);
        padding-bottom: clamp(24px,6.5vw,43px);
    }
    .cover-art img { object-position: center 42%; }
    .cover::before {
        background: linear-gradient(180deg,transparent 15%, rgba(6,32,33,.04) 33%, rgba(6,32,33,.62) 56%,rgba(6,32,33,.94) 83%);
    }
    .cover-copy { width: 100%; max-width: 32rem; }
    .cover-brand { font-size: clamp(5.2rem,17vw,7.8rem); }
    .cover-subjects { font-size: clamp(1.35rem,4.65vw,1.8rem); }
    .cover-copy p { margin-top: .65rem; font-size: .97rem; }
    .cover-actions { gap: 8px; margin-top: 1.05rem; }
    .cover-actions .action { min-height: 44px; padding: .55em .85em; font-size: .9rem; gap: .35em; }
    .quick-nav > .frame { width: 100%; }
    .quick-nav a { min-height: 52px; justify-content: center; gap: 5px; padding-inline: 4px; font-size: .9rem; }
    .quick-nav a span:last-child { font-size: .82rem; }
    .quick-nav a:first-child { border-inline-start: 0; }
    .quick-nav a:last-child { border-inline-end: 0; }
    .section-title { font-size: clamp(1.65rem,5.25vw,2.1rem); }
    .subject-grid { gap: 24px 15px; margin-top: 19px; }
    .subject-image img { aspect-ratio: 1.04; }
    .subject-title { padding-block: 10px 3px; }
    .subject-title h3 { font-size: 1.35rem; }
    .subject p { font-size: .9rem; }
    .journal-picks, .read-grid, .member-layout, .faq-section, .reading { grid-template-columns: minmax(0,1fr); }
    .journal-picks { gap: 18px; }
    .journal-picks > .read-card:first-child { grid-row: auto; }
    .journal-picks > .read-card:not(:first-child) { grid-template-columns: minmax(90px,.7fr) minmax(0,1.24fr); gap: 15px; }
    .journal-picks > .read-card:not(:first-child) .read-cover img { aspect-ratio: 1.3; }
    .section-head .text-link { font-size: .88rem; }
    .member-photo { grid-row: 1; }
    .member-photo img { height: auto; min-height: 0; aspect-ratio: 2.04; }
    .member-copy { padding: 24px 20px; }
    .faq-section, .reading { gap: 23px; }
    .reading-side img { aspect-ratio: 1.85; }
    .inner-head h1 { font-size: clamp(1.86rem,6.2vw,2.5rem); }
    .closing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px 18px; }
    .closing-brand { grid-column: 1 / -1; }
    .closing .symbol { width: 36px; height: 36px; }
    .colophon { margin-top: 25px; padding-block: 16px; }
}
@media (max-width: 360px) {
    :root { --gutter: 14px; }
    .mast-actions { gap: 6px; }
    .mast .action { padding-inline: .78em; font-size: .84rem; }
    .cover-actions .action { padding-inline: .72em; font-size: .85rem; }
    .journal-picks > .read-card:not(:first-child) { grid-template-columns: 92px minmax(0,1fr); gap: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; }
}
