/*
Theme Name: Sorithya Cinema
Theme URI: https://professorsorithya.com/blog/
Author: Professor Chet Sorithya
Description: Teaching journal for Google Flow. Matches the Professor Chet Sorithya homepage. Khmer first, English under it.
Version: 1.0.0
Text Domain: sorithya-cinema
*/

:root {
  --ink: #0c0a08;
  --paper: #f4eee4;
  --muted: #9a8f80;
  --gold: #e8b86d;
  --gold-2: #c4923a;
  --line: rgba(232, 184, 109, 0.22);
  --card: #16110c;
  --sans: Outfit, "Siemreap", ui-sans-serif, system-ui, sans-serif;
  --km: "Siemreap", "Khmer OS Siemreap", Outfit, sans-serif;
  --orbit-idle: #0c0a08;
  --orbit-hover: #1a140c;
  --orbit-lang: #1a140c;
}
html.pf-light {
  --ink: #f6f1e7;
  --paper: #1f1a14;
  --muted: #655d51;
  --gold: #8a5a10;
  --gold-2: #a8721a;
  --line: rgba(180, 118, 26, 0.3);
  --card: #fffdf7;
  --orbit-idle: #f6f1e7;
  --orbit-hover: #efe8da;
  --orbit-lang: #fffdf7;
}
html.pf-light header.nav { background: rgba(246, 241, 231, 0.9); }
html.pf-light nav.links a,
html.pf-light nav.links a.google-orbit { color: #8a5a10; }
html.pf-light nav.links a:hover,
html.pf-light nav.links a.google-orbit:hover { color: #5c3d0a; }
html.pf-light .lang {
  background: #fffdf7;
  color: #8a5a10;
  border-color: rgba(138, 90, 16, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--paper);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% -10%, #e8b86d24, transparent 42%),
    radial-gradient(circle at 100% 0%, #3b2a1222, transparent 36%),
    var(--ink);
  min-height: 100vh;
}
html[lang="km"] body { font-family: var(--km); }
a { color: inherit; }
img { max-width: 100%; display: block; height: auto; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

header.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(12, 10, 8, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--gold);
}
.brand b { display: block; font-size: 14px; letter-spacing: 0.02em; }
.brand .role { display: block; font-size: 11px; color: var(--gold); letter-spacing: 0.16em; text-transform: uppercase; }
html[lang="km"] .brand .role { letter-spacing: 0.04em; text-transform: none; }
nav.links { display: flex; gap: 8px; align-items: center; font-size: 14px; }
nav.links a { text-decoration: none; color: #d8cbb8; }
nav.links a:hover,
nav.links a.is-current { color: var(--gold); }
.actions { display: flex; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; border-radius: 999px; padding: 10px 16px;
  font-size: 13px; font-weight: 600; border: 1px solid transparent;
}
.btn-gold { background: linear-gradient(180deg, #f0c98a, var(--gold-2)); color: #1a140c; }
.btn-line { border-color: var(--line); color: var(--paper); background: transparent; }
.lang {
  border: 1px solid var(--line); background: #1a140c; color: var(--gold);
  border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.menu-btn { display: none; }

.google-orbit { position: relative; isolation: isolate; overflow: hidden; border-radius: 999px; }
.google-orbit-clip {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none;
}
.google-orbit-spin {
  position: absolute; inset: -90%;
  background: conic-gradient(from 0deg, transparent 0 54%, #4285f4 60%, #ea4335 70%, #fbbc05 80%, #34a853 90%, #4285f4 96%, transparent 100%);
  opacity: 0;
  animation: google-orbit-rotate 1.6s linear infinite;
  animation-play-state: paused;
}
.google-orbit:hover .google-orbit-spin,
.google-orbit:focus-visible .google-orbit-spin { opacity: 1; animation-play-state: running; }
.google-orbit-fill {
  position: absolute; inset: 2px; border-radius: inherit;
  background: var(--orbit-fill, var(--orbit-idle, #0c0a08));
  opacity: 0;
}
.google-orbit:hover .google-orbit-fill,
.google-orbit:focus-visible .google-orbit-fill { opacity: 1; }
.google-orbit > :not(.google-orbit-clip) { position: relative; z-index: 2; }
nav.links a.google-orbit { padding: 8px 14px; }
nav.links a.google-orbit:hover { --orbit-fill: var(--orbit-hover); }
@keyframes google-orbit-rotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .google-orbit-spin {
    animation: none !important; opacity: 1;
    background: conic-gradient(#4285f4, #ea4335, #fbbc05, #34a853, #4285f4);
  }
}

.en-only { display: none; }
html[lang="en"] .en-only { display: inline; }
html[lang="en"] .km-only { display: none; }
.block-en { display: none; }
html[lang="en"] .block-en { display: block; }
html[lang="en"] .block-km { display: none; }
html[lang="en"] .inline-en { display: inline; }
html[lang="en"] .inline-km { display: none; }
.inline-en { display: none; }
.inline-km { display: inline; }

.kicker {
  color: var(--gold); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; margin: 0 0 14px;
}
html[lang="km"] .kicker { letter-spacing: 0.06em; text-transform: none; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.12; margin: 0 0 16px; font-weight: 650; }
h2 { font-size: clamp(22px, 3vw, 32px); margin: 0 0 10px; }
.lead { font-size: 18px; line-height: 1.65; color: #cfc3b2; margin: 0 0 28px; max-width: 640px; }
.tag { color: var(--gold); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 10px; }
html[lang="km"] .tag { letter-spacing: 0.04em; text-transform: none; }
.card {
  background: linear-gradient(180deg, #1b1510, #120e0b);
  border: 1px solid var(--line); border-radius: 24px; padding: 22px;
}
html.pf-light .card {
  background: linear-gradient(180deg, #fffdf7, #f4eee4);
}

.blog-hero { padding: 48px 0 12px; }
.blog-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin: 8px 0 28px;
}
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topics a {
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px;
  font-size: 12px; color: #eadcc8; text-decoration: none;
}
.topics a.is-current, .topics a:hover { color: var(--gold); border-color: var(--gold); }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
  border: 1px solid var(--line); background: #14100c; color: var(--paper);
  border-radius: 999px; padding: 10px 14px; min-width: 180px; font: inherit;
}
html.pf-light .search-form input[type="search"] { background: #fffdf7; color: #1f1a14; }
.search-form button { cursor: pointer; }

.post-grid { display: grid; gap: 16px; grid-template-columns: 1fr; padding-bottom: 64px; }
@media (min-width: 760px) {
  .post-grid { grid-template-columns: 1fr 1fr; }
}
.post-card { text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-height: 100%; }
.post-card h2 a { text-decoration: none; }
.post-card p { margin: 0; color: #c4b8a6; line-height: 1.6; font-size: 15px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.post-card .more { color: var(--gold); font-size: 13px; font-weight: 600; margin-top: auto; }

.empty {
  border: 1px dashed var(--line); border-radius: 24px; padding: 48px 24px;
  text-align: center; color: var(--muted); margin-bottom: 64px;
}

.entry { padding: 36px 0 24px; max-width: 760px; }
.entry .post-meta { margin-bottom: 18px; }
.entry .content { font-size: 17px; line-height: 1.75; color: #cfc3b2; }
.entry .content > *:first-child { margin-top: 0; }
.entry .content a { color: var(--gold); }
.entry .content h2, .entry .content h3 { color: var(--paper); margin: 1.6em 0 0.5em; }
.entry .content pre,
.entry .content code {
  font-family: ui-monospace, "IBM Plex Mono", monospace;
  background: #14100c; border: 1px solid var(--line); border-radius: 14px;
}
.entry .content pre { padding: 16px; overflow: auto; white-space: pre-wrap; }
.entry .content code { padding: 0.1em 0.35em; }
.entry .content pre code { border: 0; padding: 0; background: transparent; }
.entry .content ul { padding-left: 1.2em; }
.entry .content li { margin: 0.35em 0; }

.post-cta {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 48px;
}
.pager {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 72px; color: var(--muted);
}
.pager a { color: var(--gold); text-decoration: none; }
.pager ul { display: flex; gap: 10px; list-style: none; padding: 0; margin: 0; }

.screen-reader-text {
  border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}

footer {
  border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px;
}
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { color: var(--gold); text-decoration: none; }

@media (max-width: 860px) {
  nav.links { display: none; }
  .menu-btn { display: inline-flex; }
  nav.links.open {
    display: flex; flex-direction: column; position: absolute; inset: 72px 16px auto;
    background: #16110c; border: 1px solid var(--line); border-radius: 18px; padding: 14px;
    z-index: 30;
  }
  html.pf-light nav.links.open { background: #fffdf7; }
  .nav-row { flex-wrap: wrap; }
}
