/* ===================================================
   Web22 2026 — WP overrides only.
   Design styles ở tokens.css / layout.css / palette.css / home.css ...
   File này CHỈ chứa: WP admin bar offset, .alignwide,
   comments, gallery, search-form, mobile menu, skip-link...
   =================================================== */

/* 1. SKIP LINK */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
  padding: 8px 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}

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

/* 2. ADMIN BAR — đẩy header sticky xuống cho khớp */
.admin-bar .site-top { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-top { top: 46px; }
}

/* 3. SCROLL LOCK khi mobile menu / search palette mở */
body.w22-no-scroll {
  overflow: hidden;
  /* iOS Safari */
  position: relative;
}

/* 4. MOBILE MENU DRAWER */
.menu-burger {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-elev);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
@media (max-width: 980px) {
  .menu-burger { display: inline-flex; }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
  overflow-y: auto;
  padding: 80px 24px 40px;
}
.mobile-menu.open {
  visibility: visible;
  opacity: 1;
}
.mobile-menu__inner {
  max-width: 600px;
  margin: 0 auto;
}
.mobile-nav__list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.mobile-nav__list li a {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.mobile-nav__list li a:hover { color: var(--accent-ink); }
@media (min-width: 981px) {
  .mobile-menu { display: none; }
}

/* 5. SEARCH PALETTE (cmd+K dialog) */
#searchPalette {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.sp-backdrop {
  position: absolute; inset: 0;
  background: rgba(14,15,12,.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sp-panel {
  position: relative;
  width: min(560px, calc(100% - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.sp-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}
.sp-input input {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
}
.sp-section {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}
.sp-section h6 {
  margin: 6px 8px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}
.sp-section a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
}
.sp-section a:hover { background: var(--bg-soft); }
.sp-foot {
  display: flex; gap: 16px;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  background: var(--bg-soft);
}
.sp-foot .kbd { margin-right: 4px; }

/* 6. .rise — chỉ hiển thị sau khi observer add .is-revealed
       (nếu reduced motion: bỏ animation hẳn) */
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; opacity: 1; }
}

/* 7. WP wide / full alignments */
.alignwide  { max-width: 1240px; margin-inline: auto; }
.alignfull  { max-width: 100%; width: 100%; }
.aligncenter{ margin-inline: auto; text-align: center; }
.alignleft  { float: left;  margin-right: 1.25rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 1.25rem;  margin-bottom: 1rem; }

/* 8. WP Gallery + Captions */
.wp-block-image figcaption,
.wp-caption-text {
  font-size: 12.5px;
  color: var(--ink-4);
  margin-top: 6px;
  font-family: var(--font-mono);
}

/* 9. WP Block embed responsive */
.wp-block-embed iframe { max-width: 100%; }
.wp-block-embed__wrapper { aspect-ratio: 16/9; overflow: hidden; border-radius: var(--r-3); }

/* 10. Comments — basic */
.comments-area {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.comment-list { list-style: none; padding: 0; margin: 0 0 32px; }
.comment-list .comment { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-author { font-weight: 500; }
.comment-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-4); }
.comment-respond textarea,
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-elev);
  font-family: var(--font-body);
  font-size: 14px;
}

/* 11. WP Search form fallback */
.search-form {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.search-form .search-field {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-elev);
  font-size: 14px;
}
.search-form .search-submit {
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: var(--r-2);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

/* 12. .nav-links pagination */
.nav-links {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
}
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  background: var(--bg-elev);
}
.nav-links .page-numbers.current {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.nav-links .page-numbers:hover:not(.current) { border-color: var(--line-strong); color: var(--ink); }

/* 13. Form status (contact form AJAX) */
.form-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: var(--font-mono);
}
.form-status.sending { background: var(--bg-soft); color: var(--ink-3); }
.form-status.success { background: rgba(22,163,74,.08); color: var(--signal); border: 1px solid rgba(22,163,74,.18); }
.form-status.error   { background: rgba(220,38,38,.06); color: var(--danger); border: 1px solid rgba(220,38,38,.16); }

/* 14. Editor body offset (when admin bar visible) */
.has-w22-no-scroll { overflow: hidden; }
