/*
Theme Name: Quyên đây
Theme URI: https://quyenday.com
Author: Quyên
Description: Theme riêng cho blog Quyên đây — phong cách cắt dán tạp chí, menu trượt bên trái trên điện thoại.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: quyenday
*/

:root {
  --paper: #f7f3ec;
  --paper-2: #f1ebe1;
  --card: #fffdf9;
  --ink: #2c2a27;
  --muted: #6b645c;
  --soft: #948b80;
  --line: #e2dacb;
  --brown: #7a4a35;
  --rose: #e07b6a;
  --amber: #e9a23b;
  --sage: #8c9a86;
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.screen-reader-text, .skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--line); }
.head-top { position: relative; display: flex; align-items: center; justify-content: center; padding: 22px 0 14px; }
.brand { text-align: center; }
.logo { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 44px; line-height: 1; color: var(--brown); letter-spacing: -0.01em; }
.logo .dot { color: var(--rose); font-style: normal; }
.slogan { margin: 6px 0 0; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.head-tools { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; gap: 6px; }
.head-tools a, .head-tools button, .menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; background: none; border-radius: 50%; color: var(--muted); cursor: pointer;
}
.head-tools a:hover, .head-tools button:hover, .menu-btn:hover { background: var(--paper-2); color: var(--ink); }
.menu-btn { display: none; position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--ink); }

.site-nav { border-top: 1px solid var(--line); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 30px; }
.site-nav a { display: block; padding: 12px 0 10px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a.is-active { color: var(--ink); font-weight: 500; border-color: var(--ink); }

.search-panel { display: none; border-top: 1px solid var(--line); padding: 14px 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.search-form input[type=search] {
  flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
}
.search-form button { font: inherit; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer; }

/* ---------- Collage ---------- */
.collage { position: relative; margin: 0; padding: 18px 10px 26px 14px; }
.collage-photo {
  position: relative; aspect-ratio: 4 / 3; background: var(--sage); overflow: hidden;
  clip-path: polygon(0 2%, 3% 0, 46% 1.5%, 70% 0, 97% 1%, 100% 6%, 99% 52%, 100% 93%, 95% 100%, 60% 98.5%, 28% 100%, 2% 98%, 0.5% 60%);
}
.collage-photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) contrast(1.02); }
.collage-photo.is-blank { background: repeating-linear-gradient(0deg, var(--paper-2) 0 27px, var(--line) 27px 28px); }
.v1 .collage-photo { background-color: #b9b19f; }
.v2 .collage-photo { background-color: #a7b2b8; }
.tape { position: absolute; width: 92px; height: 26px; background: rgba(244, 192, 209, 0.85); z-index: 2; }
.tape.t-a { left: 26px; top: 6px; transform: rotate(-7deg); }
.tape.t-b { right: 20px; bottom: 12px; transform: rotate(12deg); background: rgba(159, 225, 203, 0.85); }
.tape.dots { background-color: #f0c9a0; background-image: radial-gradient(var(--rose) 2px, transparent 2.2px); background-size: 9px 9px; }
.spark { position: absolute; z-index: 3; width: 58px; height: 58px; color: var(--amber); }
.spark path { fill: currentColor; }
.spark.s-tl { left: -8px; top: -6px; }
.spark.s-tr { right: 0; top: -10px; width: 46px; height: 46px; }
.squiggle { position: absolute; z-index: 3; width: 70px; height: 50px; stroke: #6fa9c9; fill: none; stroke-width: 4; stroke-linecap: round; }
.squiggle.q-bl { left: -6px; bottom: 6px; }
.squiggle.q-tr { right: -4px; top: 10px; stroke: #1d9e75; }
.collage-note {
  position: absolute; z-index: 4; right: 6%; top: 24%; max-width: 54%;
  background: #fff; padding: 6px 10px; font-family: var(--mono); font-size: 16px; line-height: 1.35; color: var(--ink);
}
.collage-type {
  position: absolute; z-index: 4; right: 4%; top: 46%; width: 42%; margin: 0;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.55; color: var(--ink); text-align: justify;
  background: rgba(255, 253, 249, 0.82); padding: 6px 8px;
}
.collage-dots { position: absolute; z-index: 4; right: 12%; bottom: 8px; display: flex; gap: 8px; }
.collage-dots i { width: 20px; height: 20px; border-radius: 50%; background: #f4a3a3; border: 2px solid #c0504d; }
.collage.is-small { padding: 10px 6px 14px 8px; }
.collage.is-small .collage-note { font-size: 12px; top: 12%; padding: 3px 6px; }
.collage.is-small .collage-type, .collage.is-small .collage-dots { display: none; }
.collage.is-small .spark { width: 34px; height: 34px; }
.collage.is-small .tape { width: 56px; height: 16px; }
.collage.is-small .squiggle { width: 44px; height: 32px; stroke-width: 3; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; padding: 44px 0 40px; border-bottom: 1px solid var(--line); }
.hero-text { text-align: center; padding: 0 12px; }
.hero-text h2 { font-size: 46px; margin-bottom: 14px; }
.hero-text h2 a:hover { color: var(--brown); }
.hero-sub { font-size: 18px; color: var(--muted); margin: 0 0 14px; }
.meta { font-size: 12px; color: var(--soft); letter-spacing: 0.06em; text-transform: uppercase; }
.meta span + span::before { content: '·'; margin: 0 7px; }

.home-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 48px; padding: 36px 0 64px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.sec-head h2 { font-size: 30px; }
.sec-head a { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.sec-head a:hover { color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.card h3 { font-size: 23px; margin: 8px 0 6px; }
.card a:hover h3 { color: var(--brown); }
.card-sub { margin: 0 0 6px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.more-list { list-style: none; margin: 40px 0 0; padding: 0; border-top: 1px solid var(--line); }
.more-list li { border-bottom: 1px solid var(--line); }
.more-list a { display: grid; grid-template-columns: 110px 1fr; gap: 18px; padding: 16px 0; align-items: baseline; }
.more-list time { font-size: 12px; color: var(--soft); letter-spacing: 0.05em; }
.more-list strong { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.more-list a:hover strong { color: var(--brown); }

.home-aside { font-size: 14px; color: var(--muted); }
.aside-me { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.aside-me img, .avatar-ph { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--sage); }
.aside-me strong { font-family: var(--serif); font-size: 22px; color: var(--ink); font-weight: 600; }
.aside-me p { margin: 0; line-height: 1.6; }
.aside-me a.text-link { color: var(--brown); font-weight: 500; }
.aside-block { padding: 18px 0; border-bottom: 1px solid var(--line); }
.aside-block h3 { font-size: 19px; color: var(--ink); margin-bottom: 8px; }
.aside-block ul { list-style: none; margin: 0; padding: 0; }
.aside-block li { display: flex; justify-content: space-between; padding: 4px 0; }
.aside-block li a:hover { color: var(--ink); }
.socials { display: flex; gap: 8px; }
.socials a { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); }
.socials a:hover { background: var(--paper-2); }

/* ---------- Single ---------- */
.post-head { max-width: 760px; margin: 0 auto; text-align: center; padding: 52px 0 26px; }
.post-cat { display: inline-block; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brown); margin-bottom: 14px; }
.post-head h1 { font-size: 52px; margin-bottom: 14px; }
.post-sub { font-size: 19px; color: var(--muted); margin: 0 0 16px; }
.post-cover { max-width: 820px; margin: 0 auto 34px; }
.prose { max-width: 680px; margin: 0 auto; font-size: 18px; line-height: 1.85; }
.prose > * { margin: 0 0 1.3em; }
.prose h2 { font-size: 32px; margin: 1.6em 0 0.5em; }
.prose h3 { font-size: 25px; margin: 1.4em 0 0.4em; }
.prose a { color: var(--brown); text-decoration: underline; text-decoration-color: var(--rose); text-underline-offset: 3px; }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--rose); font-family: var(--serif); font-style: italic; font-size: 23px; line-height: 1.5; color: var(--brown); }
.prose blockquote p { margin: 0; }
.prose img, .prose figure { margin-left: auto; margin-right: auto; }
.prose figcaption { font-size: 13px; color: var(--soft); text-align: center; margin-top: 6px; }
.prose hr { border: 0; text-align: center; margin: 2.4em 0; }
.prose hr::after { content: '~ ~ ~'; color: var(--rose); letter-spacing: 0.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose iframe { max-width: 100%; }
.post-tags { max-width: 680px; margin: 26px auto 0; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { font-size: 13px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.post-tags a:hover { color: var(--ink); background: var(--paper-2); }
.related { border-top: 1px solid var(--line); margin-top: 56px; padding: 36px 0 20px; }

/* ---------- Archive / page ---------- */
.archive-head { text-align: center; padding: 48px 0 30px; }
.archive-head h1 { font-size: 46px; }
.archive-head p { color: var(--muted); margin: 8px auto 0; max-width: 560px; }
.archive-grid { padding-bottom: 40px; }
.archive-grid .cards { row-gap: 40px; }
.pagination { display: flex; justify-content: center; gap: 6px; padding: 10px 0 60px; }
.pagination .page-numbers { min-width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chips a { font-size: 13px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.chips a:hover { color: var(--ink); background: var(--paper-2); }
.year-list { max-width: 760px; margin: 0 auto; padding-bottom: 64px; }
.year-list h2 { font-size: 15px; font-family: var(--sans); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 26px 0 8px; border-bottom: 1px solid var(--line); }
.year-list ul { list-style: none; margin: 0; padding: 0; }
.year-list li a { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: baseline; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.year-list time { font-size: 13px; color: var(--soft); }
.year-list strong { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.year-list a:hover strong { color: var(--brown); }
.empty { text-align: center; color: var(--muted); padding: 30px 0 70px; font-style: italic; }

/* ---------- Comments ---------- */
.comments { max-width: 680px; margin: 40px auto 0; padding-top: 30px; border-top: 1px solid var(--line); }
.comments h2 { font-size: 30px; margin-bottom: 6px; }
.comments h2 span { color: var(--soft); font-weight: 500; }
.comments-empty { color: var(--muted); font-style: italic; margin: 0 0 8px; }
.comment-list { list-style: none; padding: 0; margin: 10px 0 10px; }
.comment-list .children { list-style: none; padding-left: 22px; margin-left: 15px; border-left: 2px solid var(--line); }
.comment-body { padding: 16px 0 14px; border-bottom: 1px dashed var(--line); }
.comment-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.comment-initial { width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 16px; color: var(--brown); }
.by-quyen > .comment-body .comment-initial { background: var(--rose); border-color: var(--rose); color: #fff; }
.comment-head strong { font-weight: 500; font-size: 15px; }
.comment-badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #fbe4df; color: #993c1d; }
.comment-head time { font-size: 12px; color: var(--soft); margin-left: auto; }
.comment-text { font-size: 16px; line-height: 1.7; padding-left: 40px; }
.comment-text p { margin: 6px 0; }
.comment-wait { font-size: 13px; color: #993c1d; padding-left: 40px; margin: 6px 0 0; }
.reply { padding-left: 40px; }
.reply a { font-size: 13px; color: var(--brown); font-weight: 500; }
.comment-respond { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; }
.comment-reply-title { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 10px; }
.comment-reply-title small { margin-left: 10px; font-family: var(--sans); font-size: 13px; font-weight: 400; }
.comment-reply-title small a { color: var(--soft); }
.comment-form p { margin: 0 0 12px; }
.comment-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.comment-form input[type=text], .comment-form textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
}
.comment-form textarea { resize: vertical; min-height: 110px; }
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid #f4c0d1; border-color: var(--rose); }
.comment-form .form-submit { margin: 4px 0 0; }
.comment-form .submit { font: inherit; padding: 10px 22px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; cursor: pointer; }
.comment-form .submit:hover { background: var(--brown); }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.comment-form-cookies-consent label { margin: 0; }
.comment-navigation { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; }

/* ---------- Footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 30px 0 40px; text-align: center; color: var(--muted); font-size: 13px; }
.site-foot .logo { font-size: 28px; }
.site-foot p { margin: 8px 0 0; }
.site-foot .socials { justify-content: center; margin-top: 14px; }

/* ---------- Drawer (mobile) ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(44, 42, 39, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 40; }
.drawer {
  position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, 340px); background: var(--paper-2); z-index: 50;
  transform: translateX(-102%); transition: transform 0.28s ease; overflow-y: auto; padding: 18px 16px 30px;
  border-right: 1px solid var(--line); visibility: hidden;
}
body.drawer-open .drawer { transform: none; visibility: visible; }
body.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }
.drawer-me { display: flex; align-items: center; gap: 12px; }
.drawer-me img, .drawer-me .avatar-ph { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.drawer-me div { flex: 1; min-width: 0; }
.drawer-me strong { display: block; font-size: 16px; font-weight: 500; }
.drawer-me span { display: block; font-size: 12.5px; color: var(--muted); }
.drawer-close { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.drawer-close .icon { width: 16px; height: 16px; }
.drawer-nav { list-style: none; margin: 20px 0 0; padding: 0; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; color: #444038; }
.drawer-nav a.is-active { background: var(--card); color: var(--ink); font-weight: 500; }
.drawer-nav .count { margin-left: auto; font-size: 12px; color: var(--soft); }
.drawer-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); margin: 22px 12px 6px; }
.drawer-links a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; font-size: 15px; color: #444038; }
.drawer-links .arrow { margin-left: auto; width: 14px; height: 14px; }
.drawer-pin { display: block; background: var(--card); border-radius: 14px; padding: 12px; margin-top: 18px; }
.drawer-pin .collage { padding: 4px 2px 6px; }
.drawer-pin b { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; font-size: 14px; margin-top: 6px; }
.drawer-cats { list-style: none; margin: 0; padding: 0; }
.drawer-cats a { display: flex; justify-content: space-between; padding: 7px 12px; font-size: 14.5px; color: #444038; }
.drawer-cats span { font-size: 12px; color: var(--soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .home-body { grid-template-columns: 1fr; }
  .home-aside { display: none; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 18px; }
  .head-top { padding: 12px 0; }
  .logo { font-size: 26px; }
  .slogan, .site-nav, .head-tools .hide-sm { display: none; }
  .menu-btn { display: inline-flex; }
  .hero { grid-template-columns: 1fr; gap: 18px; padding: 22px 0 30px; }
  .hero-text { text-align: left; padding: 0; }
  .hero-text h2 { font-size: 32px; }
  .hero-sub { font-size: 16px; }
  .cards { grid-template-columns: 1fr; gap: 26px; }
  .card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
  .card .collage { padding: 4px 2px 6px; }
  .card h3 { font-size: 20px; margin-top: 2px; }
  .card-sub { display: none; }
  .more-list a { grid-template-columns: 1fr; gap: 2px; }
  .post-head { text-align: left; padding: 30px 0 18px; }
  .post-head h1 { font-size: 34px; }
  .post-sub { font-size: 17px; }
  .prose { font-size: 17px; }
  .archive-head { padding: 32px 0 20px; }
  .archive-head h1 { font-size: 34px; }
  .collage-type { display: none; }
  .collage-note { font-size: 13px; }
  .collage-dots i { width: 14px; height: 14px; }
}
@media (min-width: 901px) {
  .drawer, .drawer-overlay { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-overlay { transition: none; }
}
