/*
Theme Name: Cherry Cyrvor
Description: Thai-language digital security publication.
Version: 2.0
Text Domain: cyrvor
*/
:root {
  --ink: #101d39;
  --muted: #52617b;
  --blue: #1745ed;
  --blue-strong: #0d35cc;
  --dark: #111e3c;
  --paper: #f5f8ff;
  --white: #fff;
  --rule: #dce5f5;
  --gutter: clamp(18px, 4vw, 62px);
  color: var(--ink);
  background: var(--white);
  font-family: "Noto Sans Thai", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.64;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
p, h1, h2, h3 { margin: 0; }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #1745ed; outline-offset: 3px; }
.wrap { width: min(calc(100% - var(--gutter)*2), 1232px); margin-inline: auto; }
.top { background: var(--white); color: var(--ink); border-bottom: 1px solid #e9eef9; }
.bar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-weight: 800; font-size: 21px; letter-spacing: -.045em; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1; white-space: nowrap; }
.brand > span:last-child { color: var(--blue-strong); }
.brand-mark { display: inline-grid; place-items: center; background: var(--blue); color: var(--white); width: 35px; height: 35px; font-weight: 800; font-size: 21px; border-radius: 9px; margin-right: 3px; }
.bar nav { display: flex; gap: clamp(14px, 2.5vw, 34px); }
.bar nav a { font-weight: 650; color: #334361; text-decoration: none; padding-block: 10px; }
.bar nav a:hover { color: var(--blue); }
.lead { background: linear-gradient(122deg, #fff 42%, #f0f5ff 74%, #e9f1ff 100%); border-bottom: 1px solid #e7eefb; }
.lead-inner { min-height: 510px; display: grid; grid-template-columns: .99fr 1.1fr; gap: clamp(26px, 5vw, 82px); align-items: center; padding-block: clamp(36px, 4.5vw, 66px); }
.eyebrow, .label { font-size: 13px; line-height: 1.45; font-weight: 750; color: var(--blue-strong); }
.lead .eyebrow { margin-bottom: 19px; display: flex; gap: 9px; align-items: center; }
.lead .eyebrow::before { content: ""; background: var(--blue); width: 22px; height: 2px; }
.lead h1 { font-size: clamp(41px, 5.05vw, 73px); line-height: 1.19; letter-spacing: -.048em; margin: 0 0 19px; font-weight: 800; }
.lead h1 em { font-style: normal; color: var(--blue); }
.intro { color: var(--muted); font-size: clamp(15px, 1.42vw, 18px); max-width: 500px; }
.primary { margin-top: 28px; display: inline-flex; align-items: center; gap: 21px; color: var(--white); font-weight: 750; background: var(--blue); text-decoration: none; padding: 12px 18px; border-radius: 9px; box-shadow: 0 9px 22px #1745ed28; }
.primary:hover, .search button:hover { background: var(--blue-strong); }
.lead-photo { position: relative; margin: 0; overflow: hidden; border-radius: 18px; border: 1px solid #d4e2fe; box-shadow: 0 22px 44px #1745ed22; }
.lead-photo img { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; object-position: center; }
.lead-photo figcaption { color: #fff; position: absolute; inset: auto 0 0; padding: 28px 16px 13px; background: linear-gradient(0deg, #0a1b50ba, transparent); font-size: 14px; display: flex; justify-content: space-between; align-items: end; gap: 8px; }
.image-mark { position: absolute; right: 9px; bottom: 9px; padding: 4px 6px; border-radius: 4px; color: #f6f9ff; background: #0a2055d9; font: 700 clamp(7px, .66vw, 9px)/1.28 "Noto Sans Thai", sans-serif; letter-spacing: .056em; white-space: nowrap; user-select: none; pointer-events: none; }
.lead-photo .image-mark { position: static; }
.topics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); padding-block: 21px; gap: 12px; }
.topics a { color: var(--ink); background: var(--paper); min-height: 77px; padding: 14px 28px 13px 16px; border: 1px solid var(--rule); border-radius: 11px; position: relative; text-decoration: none; }
.topics a:hover { border-color: #8aa9ff; background: #edf3ff; }
.topics a strong, .topics a small { display: block; }
.topics a small { color: var(--muted); font-size: 12px; }
.topics a span { position: absolute; top: 17px; right: 16px; color: var(--blue); }
.library { padding-block: 36px 70px; }
.library-head { display: flex; justify-content: space-between; align-items: end; gap: 15px; margin-bottom: 21px; }
.library-head h1, .library-head h2 { font-size: clamp(30px, 3.5vw, 47px); letter-spacing: -.045em; line-height: 1.3; }
.label { margin-bottom: 7px; }
.search { display: flex; gap: 6px; padding: 4px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; align-items: center; }
.search input { border: 0; padding: 7px 8px; color: var(--ink); background: transparent; width: clamp(140px, 17vw, 240px); }
.search button { border: 0; border-radius: 7px; padding: 7px 12px; background: var(--blue); color: var(--white); cursor: pointer; }
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.entry { background: var(--white); border: 1px solid var(--rule); border-radius: 14px; overflow: clip; box-shadow: 0 4px 15px #253a7610; }
.entry:hover { border-color: #8facee; box-shadow: 0 12px 26px #263a8219; }
.entry-link { height: 100%; display: flex; flex-direction: column; text-decoration: none; }
.entry-link:focus-visible { outline-offset: -3px; }
.entry-cover { margin: 0; position: relative; background: #eaf1ff; }
.entry img { width: 100%; aspect-ratio: 16/9; height: auto; object-fit: cover; }
.entry-copy { padding: 19px; display: flex; flex: 1; flex-direction: column; }
.entry-copy .label { align-self: flex-start; padding: 4px 8px; margin-bottom: 9px; border-radius: 6px; background: #edf2ff; font-size: 11px; }
.entry h3 { line-height: 1.38; font-size: clamp(18px, 1.8vw, 24px); letter-spacing: -.02em; margin-bottom: 8px; }
.entry-copy > p:not(.label) { color: var(--muted); font-size: 14px; margin-bottom: 17px; }
.read { display: flex; justify-content: space-between; margin-top: auto; font-size: 13px; color: var(--blue-strong); font-weight: 750; padding-top: 10px; border-top: 1px solid var(--rule); }
.footer { background: var(--dark); color: var(--white); padding-block: 31px; }
.footer .brand > span:last-child { color: #adc0ff; }
.footer p { margin-top: 13px; color: #c6d5f5; max-width: 54ch; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.footer-inner > a { white-space: nowrap; color: #d9e3ff; text-underline-offset: 4px; }
.footer a:hover { color: var(--white); }
.reading { width: min(calc(100% - 44px), 790px); margin-inline: auto; }
.article-head { background: radial-gradient(ellipse at top right, #e0e9ff, #f7f9ff 70%); padding-block: 38px 40px; }
.back { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.article-head a { text-underline-offset: 4px; }
.article-head h1 { font-size: clamp(33px, 4.25vw, 58px); letter-spacing: -.04em; margin: 8px 0 16px; line-height: 1.28; }
.byline { margin-top: 23px; font-size: 14px; font-weight: 750; display: flex; gap: 6px; align-items: center; }
.byline .brand-mark { width: 26px; height: 26px; font-size: 17px; }
.article-cover { margin-block: 26px 0; position: relative; border-radius: 14px; overflow: clip; background: #eaf1ff; }
.article-cover img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.article-cover .image-mark { bottom: 12px; right: 12px; padding: 5px 8px; }
.prose { padding-block: 34px 64px; line-height: 1.9; font-size: 17px; }
.prose p, .prose ul, .prose ol { margin-block: 0 19px; }
.prose h2 { font-size: clamp(22px, 2.5vw, 29px); line-height: 1.4; margin: 28px 0 9px; }
.prose h2:first-child { margin-top: 0; }
.prose aside { padding: 15px 19px; margin-top: 28px; border: 1px solid #d1defa; border-radius: 9px; background: var(--paper); }
.prose aside p:last-child { margin-bottom: 0; }
.prose a { color: var(--blue-strong); text-underline-offset: 4px; overflow-wrap: anywhere; }
.pagination { margin-top: 24px; }
.nav-links { display: flex; gap: 12px; }
.sr-only,.screen-reader-text,.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { display: block; padding: 8px; background: var(--white); }
.glyph { width: 9px; height: 9px; display: inline-block; border: solid currentColor; border-width: 1.5px 1.5px 0 0; flex: none; }
.glyph-right { transform: rotate(45deg); }
.glyph-down { transform: translateY(-2px) rotate(135deg); }
.read .glyph { align-self: center; margin-right: 3px; }
@media (max-width: 900px) {
  .topics, .article-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .lead-inner { min-height: 0; gap: 24px; }
}
@media (max-width: 650px) {
  .bar { min-height: 62px; gap: 10px; }
  .bar .brand { font-size: 17px; gap: 4px; }
  .bar .brand-mark { width: 28px; height: 28px; font-size: 18px; margin-right: 1px; }
  .bar nav { gap: 10px; font-size: 12px; }
  .lead-inner { grid-template-columns: 1fr; }
  .lead .eyebrow { margin-bottom: 12px; }
  .lead-photo img { aspect-ratio: 4/3; object-position: center 35%; }
  .library { padding-top: 24px; }
  .library-head, .footer-inner { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
  .search input { flex: 1; min-width: 0; }
  .article-grid { grid-template-columns: 1fr; }
  .topics { gap: 8px; }
  .topics a { min-height: 69px; padding-left: 11px; }
}

.article-shortcut { display: inline-flex; gap: 12px; align-items: center; margin-top: 19px; padding: 8px 12px; border: 1px solid #c7d7ff; border-radius: 8px; color: var(--blue-strong); background: var(--white); font-weight: 750; font-size: 14px; text-decoration: none; }
.article-shortcut:hover { background: #eef3ff; }
.cyrvor-practice { margin-block: 34px 30px; padding-top: 8px; border-top: 2px solid var(--rule); }
.cyrvor-practice h2 { color: var(--blue-strong); scroll-margin-top: 22px; }
.cyrvor-practice h3 { margin: 29px 0 13px; font-size: clamp(20px, 2.1vw, 26px); line-height: 1.45; letter-spacing: -.025em; }
.cyrvor-practice p strong { color: #173b98; }
.cyrvor-inline-figure { position: relative; margin: 0 0 20px; border-radius: 12px; overflow: clip; background: #edf3ff; }
.cyrvor-inline-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; }
.cyrvor-inline-figure .image-mark { right: 12px; bottom: 12px; }
.cyrvor-practice ul { padding: 15px 19px 15px 42px; border: 1px solid #d0ddfa; border-radius: 10px; background: #f3f7ff; }
.cyrvor-practice li + li { margin-top: 6px; }
