/*
Theme Name: KU99 Cinematic Guide
Theme URI: https://ku99.beer/
Author: ku99.beer
Description: A Bengali editorial information theme for ku99.beer.
Version: 1.0.1
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: ku99-cinematic
*/

:root {
  --bg: #0b0c0d;
  --bg-soft: #141618;
  --surface: #1b1d20;
  --surface-raised: #20231f;
  --gold: #f2c94c;
  --gold-deep: #d8a928;
  --text: #f5f5f2;
  --muted: #b9bab6;
  --line: #303236;
  --warning: #e1a64b;
  --focus: #ffe28a;
  --green: #0b6b4f;
  --cyan: #35c6d8;
  --content: 1240px;
  --reading: 820px;
  --radius-image: 18px;
  --radius-card: 14px;
  --shadow: 0 24px 64px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 94px; }
body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 85% 4%, rgba(11, 107, 79, .16), transparent 28rem),
    radial-gradient(circle at 14% 22%, rgba(242, 201, 76, .07), transparent 23rem),
    var(--bg);
  color: var(--text);
  font-family: "Noto Sans Bengali", "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--focus); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
p, ul, ol, blockquote { margin: 0 0 1.25rem; }
ul, ol { padding-inline-start: 1.35rem; }
li + li { margin-top: .45rem; }
h1, h2, h3 { margin: 0; color: var(--text); line-height: 1.18; letter-spacing: -.025em; }
h1 { max-width: 980px; font-size: clamp(2.35rem, 6vw, 4.75rem); font-weight: 800; }
h2 { margin-top: 0; font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 760; }
h3 { margin-top: 1.8rem; font-size: clamp(1.35rem, 2.6vw, 1.7rem); font-weight: 720; }
main { min-height: 65vh; }
.site-container { width: min(calc(100% - 48px), var(--content)); margin-inline: auto; }
.reading-width { width: min(100%, var(--reading)); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  z-index: 100000; top: 12px; left: 12px; width: auto; height: auto;
  padding: 12px 18px; clip: auto; background: var(--gold); color: #111; font-weight: 700;
}

.site-header {
  position: sticky; top: 0; z-index: 100;
  min-height: 70px;
  border-bottom: 1px solid rgba(242, 201, 76, .16);
  background: rgba(11, 12, 13, .88);
  backdrop-filter: blur(16px);
}
@supports not (backdrop-filter: blur(16px)) { .site-header { background: var(--bg); } }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.site-brand {
  display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 44px;
  color: var(--text); text-decoration: none;
}
.site-brand picture { display: block; width: 144px; height: 40px; line-height: 0; }
.site-logo { width: 144px; height: 40px; object-fit: contain; object-position: left center; }
.menu-toggle { display: none; min-width: 48px; min-height: 48px; padding: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 21px; height: 2px; margin-inline: auto; background: currentColor; transition: transform .18s ease, opacity .18s ease; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -7px; }
.menu-icon::after { top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }
.primary-menu, .footer-menu { margin: 0; padding: 0; list-style: none; }
.primary-menu { display: flex; align-items: center; gap: 10px; }
.primary-menu li { margin: 0; }
.primary-menu a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-size: .94rem; font-weight: 650; text-decoration: none; }
.primary-menu a:hover, .primary-menu .current-menu-item > a { background: var(--surface); color: var(--text); }

.article-header { padding: 88px 0 42px; }
.article-header .reading-width { margin-inline: 0; }
.article-kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px; color: var(--gold); font-size: .78rem; font-weight: 800; letter-spacing: .04em; }
.article-kicker::before { content: ""; width: 32px; height: 1px; background: currentColor; }
.article-lead { max-width: 900px; margin: 26px 0 0; color: #deded9; font-size: clamp(1.08rem, 2vw, 1.28rem); line-height: 1.72; }
.article-subtitle { max-width: 820px; margin-top: 18px; color: var(--muted); }
.edit-date { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 25px; color: var(--muted); font-size: .82rem; }
.article-body { padding-bottom: 92px; }
.article-body > section, .article-body > .content-section { width: min(100%, var(--reading)); margin: 0 auto; padding: 66px 0; border-top: 1px solid var(--line); }
.article-body > section:first-child { border-top: 0; }
.article-body section > h2 { margin-bottom: 24px; }
.article-body section > h2::before { content: ""; display: block; width: 44px; height: 3px; margin-bottom: 17px; border-radius: 2px; background: var(--gold); }
.article-body section p + h3 { margin-top: 2.2rem; }
.article-body .wide-section { width: 100%; }
.article-body .wide-section > :not(.wide-figure):not(.table-scroll) { width: min(100%, var(--reading)); margin-inline: auto; }
.wide-figure { width: 100%; margin: 38px auto 0; }
.wide-figure img { width: 100%; border: 1px solid rgba(242, 201, 76, .18); border-radius: var(--radius-image); box-shadow: var(--shadow); }
.wide-figure figcaption { width: min(100%, var(--reading)); margin: 12px auto 0; color: var(--muted); font-size: .82rem; }
.section-link { display: inline-flex; align-items: center; min-height: 48px; margin-top: 10px; padding: 11px 21px; border: 1px solid var(--gold-deep); border-radius: 999px; background: var(--gold); color: #15140d; font-weight: 800; text-decoration: none; }
.section-link:hover { background: var(--focus); color: #15140d; }
.section-link.secondary { background: transparent; color: var(--text); }

.toc { width: min(100%, var(--reading)); margin: 28px auto 66px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--bg-soft); }
.toc summary { min-height: 52px; padding: 14px 18px; color: var(--text); font-weight: 750; cursor: pointer; }
.toc ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; margin: 0; padding: 5px 22px 20px 40px; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--gold); }

.table-scroll { width: min(100%, var(--content)); margin: 30px auto; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--bg-soft); box-shadow: 0 16px 44px rgba(0, 0, 0, .2); -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .9rem; line-height: 1.55; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: start; }
th { background: rgba(242, 201, 76, .08); color: var(--gold); font-weight: 800; }
tr:last-child td { border-bottom: 0; }

.check-list { margin: 24px 0; padding: 0; list-style: none; counter-reset: checks; }
.check-list li { position: relative; min-height: 54px; margin: 0 0 14px; padding: 14px 16px 14px 56px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.check-list li::before { counter-increment: checks; content: counter(checks, bengali); position: absolute; inset-inline-start: 14px; top: 13px; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--gold); color: #15140d; font-size: .82rem; font-weight: 850; }
.notice { margin: 28px 0; padding: 20px 22px; border-inline-start: 4px solid var(--gold); border-radius: 0 12px 12px 0; background: var(--surface-raised); color: #dddeda; }
.notice.warning { border-color: var(--warning); }

.faq-list { display: grid; gap: 12px; margin-top: 28px; }
.faq-item { border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.faq-item summary { min-height: 58px; padding: 16px 50px 16px 18px; color: var(--text); font-weight: 750; cursor: pointer; position: relative; }
.faq-item summary::after { content: "+"; position: absolute; inset-inline-end: 18px; top: 13px; color: var(--gold); font-size: 1.5rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 18px 18px; color: var(--muted); }
.faq-answer p:last-child { margin-bottom: 0; }

.contact-form { margin-top: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-field { margin-bottom: 18px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; margin-bottom: 7px; color: var(--text); font-size: .9rem; font-weight: 750; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid #46494e; border-radius: 10px; background: #111315; color: var(--text); font: inherit; font-size: 1rem; }
.form-field textarea { min-height: 180px; resize: vertical; }
.form-help { color: var(--muted); font-size: .84rem; }
.form-submit { min-height: 50px; padding: 12px 24px; border: 0; border-radius: 999px; background: var(--gold); color: #15140d; font: inherit; font-weight: 850; cursor: pointer; }
.form-submit:hover { background: var(--focus); }
.form-message { margin: 0 0 22px; padding: 16px 18px; border: 1px solid var(--green); border-radius: 10px; background: rgba(11, 107, 79, .15); }
.form-message.error { border-color: var(--warning); background: rgba(225, 166, 75, .1); }
.form-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { border-top: 1px solid rgba(242, 201, 76, .28); background: #090a0b; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .9fr; gap: 52px; padding: 64px 0 38px; }
.footer-title { margin-bottom: 14px; font-size: 1.45rem; font-weight: 850; }
.footer-copy, .footer-note, .footer-contact { color: var(--muted); font-size: .86rem; }
.footer-heading { margin-bottom: 14px; color: var(--gold); font-size: .82rem; font-weight: 800; letter-spacing: .05em; }
.footer-menu li { margin: 0; }
.footer-menu a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); text-decoration: none; }
.footer-menu a:hover { color: var(--gold); }
.footer-bottom { padding: 20px 0 26px; border-top: 1px solid var(--line); color: #90918e; font-size: .78rem; }

.not-found { padding: 110px 0; text-align: center; }
.not-found h1 { margin-inline: auto; }
.not-found p { max-width: 620px; margin: 24px auto; color: var(--muted); }
.post-list { display: grid; gap: 18px; padding: 70px 0 90px; }
.post-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.post-card h2 { font-size: 1.55rem; }

@media (max-width: 767px) {
  html { scroll-padding-top: 78px; }
  body { font-size: 16px; }
  .site-container { width: min(calc(100% - 32px), var(--content)); }
  .site-header, .header-inner { min-height: 60px; }
  .site-brand picture, .site-logo { width: 126px; height: 35px; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .primary-navigation { position: absolute; inset: 60px 0 auto; display: none; padding: 12px 16px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .primary-navigation.is-open { display: block; }
  .primary-menu { display: grid; gap: 2px; }
  .primary-menu a { width: 100%; min-height: 48px; padding-inline: 14px; }
  .article-header { padding: 56px 0 32px; }
  h1 { font-size: clamp(2.25rem, 11vw, 3.3rem); }
  .article-body { padding-bottom: 56px; }
  .article-body > section, .article-body > .content-section { padding: 48px 0; }
  .wide-figure img { border-radius: 12px; }
  .toc { margin-bottom: 48px; }
  .toc ul { grid-template-columns: 1fr; }
  .table-scroll { border-radius: 10px; }
  table { min-width: 660px; font-size: .86rem; }
  th, td { padding: 13px 14px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .form-field.full { grid-column: auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; padding-top: 48px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .primary-navigation { position: absolute; inset: 70px 0 auto; display: none; padding: 14px 24px 20px; border-bottom: 1px solid var(--line); background: var(--bg); }
  .primary-navigation.is-open { display: block; }
  .primary-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .primary-menu a { width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

.site-bottom-cta {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99990;
  padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  pointer-events: none;
}
.site-bottom-cta__inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(calc(100vw - 32px), 520px);
  margin-inline: auto;
  padding: 8px;
  border: 1px solid rgba(242, 201, 76, .24);
  border-radius: 18px;
  background: rgba(11, 12, 13, .94);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .46);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}
@supports not (backdrop-filter: blur(16px)) {
  .site-bottom-cta__inner { background: #0b0c0d; }
}
.site-bottom-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 50px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.site-bottom-cta__button:hover { transform: translateY(-2px); }
.site-bottom-cta__login {
  border-color: #4a4d52;
  background: #202328;
  color: #f5f5f2;
}
.site-bottom-cta__login:hover { border-color: #6a6e75; background: #2a2e33; color: #fff; }
.site-bottom-cta__register {
  border-color: #f2c94c;
  background: #f2c94c;
  color: #15140d;
  box-shadow: 0 8px 22px rgba(242, 201, 76, .24);
}
.site-bottom-cta__register:hover { background: #ffe28a; color: #15140d; box-shadow: 0 10px 28px rgba(242, 201, 76, .34); }
.admin-bar .site-bottom-cta { bottom: 32px; }

@media (max-width: 782px) {
  .admin-bar .site-bottom-cta { bottom: 46px; }
}

@media (max-width: 420px) {
  .site-bottom-cta { padding-inline: 12px; }
  .site-bottom-cta__inner { width: min(calc(100vw - 24px), 520px); gap: 8px; padding: 7px; border-radius: 16px; }
  .site-bottom-cta__button { min-height: 48px; padding-inline: 12px; font-size: .95rem; }
}

body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }

@media (max-width: 420px) {
  body { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
}

.admin-bar { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }

@media (max-width: 782px) {
  .admin-bar { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
}
