/*
Theme Name: Maney Blog
Theme URI: https://maney.vn/blog/
Author: Maney
Author URI: https://maney.vn/
Description: Giao diện WordPress nhẹ, responsive và tối ưu nội dung dài cho Maney Blog.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: maney-blog
*/

:root {
  --maney-bg: #050607;
  --maney-surface: #0b0e0f;
  --maney-surface-soft: #111516;
  --maney-text: #f5f7f2;
  --maney-muted: #a4ada2;
  --maney-line: rgba(255, 255, 255, 0.11);
  --maney-primary: #c6ff00;
  --maney-primary-hover: #d4ff3f;
  --maney-primary-text: #111500;
  --maney-max: 1180px;
  --maney-reading: 760px;
  --maney-radius: 22px;
  --maney-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--maney-bg);
  color: var(--maney-text);
  font-family: "Be Vietnam Pro", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body.admin-bar .site-header {
  top: 32px;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(198, 255, 0, 0.72);
  outline-offset: 3px;
}

.screen-reader-text {
  position: absolute;
  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: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  background: #fff;
  color: #111;
}

.site-wrap {
  width: min(calc(100% - 40px), var(--maney-max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid var(--maney-line);
  background: rgba(3, 4, 4, 0.92);
  backdrop-filter: blur(18px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 78px;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-brand img {
  display: block;
  width: 138px;
}

.site-brand__section {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--maney-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.site-nav a,
.menu-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  transition: 180ms ease;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  border-color: var(--maney-line);
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
}

.button,
.wp-element-button,
.wp-block-button__link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border: 1px solid rgba(198, 255, 0, 0.35);
  border-radius: 9px;
  background: var(--maney-primary);
  color: var(--maney-primary-text);
  font-weight: 850;
  line-height: 1.2;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.button:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
  background: var(--maney-primary-hover);
  box-shadow: 0 0 32px rgba(198, 255, 0, 0.18);
  transform: translateY(-1px);
}

.button--ghost {
  border-color: var(--maney-line);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.menu-toggle {
  display: none;
  padding: 0 13px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.blog-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 84px 0 68px;
  border-bottom: 1px solid var(--maney-line);
  background:
    radial-gradient(circle at 70% 15%, rgba(198, 255, 0, 0.14), transparent 34%),
    radial-gradient(circle at 15% 80%, rgba(255, 255, 255, 0.055), transparent 38%),
    linear-gradient(180deg, #080a0a, #050607);
}

.blog-hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px);
  background-size: 42px 42px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--maney-primary);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.blog-hero h1,
.archive-hero h1,
.article-title {
  margin: 0;
  font-size: clamp(40px, 6.2vw, 74px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.blog-hero__intro {
  max-width: 760px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 650;
  line-height: 1.65;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.category-pills a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 15px;
  border: 1px solid var(--maney-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 750;
  transition: 180ms ease;
}

.category-pills a:hover {
  border-color: rgba(198, 255, 0, 0.42);
  color: var(--maney-primary);
}

.blog-main {
  padding: 70px 0 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 45px);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.featured-post {
  display: grid;
  overflow: hidden;
  margin-bottom: 64px;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  border: 1px solid var(--maney-line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.02));
  box-shadow: var(--maney-shadow);
}

.featured-post__media {
  position: relative;
  min-height: 430px;
  background: var(--maney-surface-soft);
}

.featured-post__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-post__placeholder,
.post-card__placeholder {
  display: grid;
  height: 100%;
  min-height: inherit;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(198,255,0,.16), transparent 30%),
    linear-gradient(145deg, #111616, #070909);
  color: rgba(198, 255, 0, 0.72);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.featured-post__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(30px, 5vw, 58px);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 15px;
  color: var(--maney-muted);
  font-size: 13px;
  font-weight: 700;
}

.post-meta a,
.post-category {
  color: var(--maney-primary);
  font-weight: 850;
}

.featured-post h2 {
  margin: 18px 0 0;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.featured-post h2 a:hover,
.post-card h2 a:hover,
.related-card h3 a:hover {
  color: var(--maney-primary);
}

.featured-post__excerpt {
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
  line-height: 1.75;
}

.featured-post .button {
  align-self: flex-start;
  margin-top: 28px;
}

.posts-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-card {
  overflow: hidden;
  border: 1px solid var(--maney-line);
  border-radius: var(--maney-radius);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.post-card:hover {
  border-color: rgba(198, 255, 0, 0.28);
  box-shadow: 0 22px 60px rgba(0,0,0,.3);
  transform: translateY(-3px);
}

.post-card__media {
  display: block;
  height: 220px;
  overflow: hidden;
  background: var(--maney-surface-soft);
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.post-card:hover .post-card__media img {
  transform: scale(1.035);
}

.post-card__content {
  padding: 23px;
}

.post-card h2 {
  margin: 13px 0 0;
  font-size: 22px;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.post-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 14px 0 0;
  color: rgba(255,255,255,.64);
  font-size: 15px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.empty-state {
  padding: 64px 28px;
  border: 1px dashed rgba(198, 255, 0, 0.25);
  border-radius: 24px;
  background: rgba(255,255,255,.025);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 30px;
}

.empty-state p {
  margin: 12px 0 0;
  color: var(--maney-muted);
}

.pagination {
  margin-top: 48px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pagination .page-numbers {
  display: grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--maney-line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  font-weight: 800;
}

.pagination .current,
.pagination a:hover {
  border-color: var(--maney-primary);
  background: var(--maney-primary);
  color: var(--maney-primary-text);
}

.archive-hero {
  padding: 64px 0 44px;
  border-bottom: 1px solid var(--maney-line);
  background: radial-gradient(circle at 70% 10%, rgba(198,255,0,.11), transparent 34%);
}

.archive-hero h1 {
  font-size: clamp(36px, 5vw, 60px);
}

.archive-description {
  max-width: 720px;
  margin-top: 18px;
  color: var(--maney-muted);
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--maney-muted);
  font-size: 14px;
  font-weight: 700;
}

.breadcrumb a:hover {
  color: var(--maney-primary);
}

.article-header {
  padding: 62px 0 42px;
  text-align: center;
}

.article-header .breadcrumb {
  justify-content: center;
}

.article-title {
  max-width: 1040px;
  margin-inline: auto;
  font-size: clamp(38px, 6vw, 66px);
}

.article-deck {
  max-width: 820px;
  margin: 24px auto 0;
  color: rgba(255,255,255,.7);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.65;
}

.article-header .post-meta {
  justify-content: center;
  margin-top: 24px;
}

.article-featured {
  overflow: hidden;
  max-width: 1180px;
  max-height: 680px;
  margin: 0 auto 54px;
  border: 1px solid var(--maney-line);
  border-radius: 28px;
  background: var(--maney-surface);
  box-shadow: var(--maney-shadow);
}

.article-featured img {
  display: block;
  width: 100%;
  max-height: 680px;
  object-fit: cover;
}

.article-layout {
  display: grid;
  align-items: start;
  gap: 54px;
  grid-template-columns: minmax(0, var(--maney-reading)) minmax(220px, 280px);
  justify-content: center;
}

.article-content {
  min-width: 0;
  color: rgba(255,255,255,.84);
  font-size: 18px;
  line-height: 1.86;
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  scroll-margin-top: 110px;
  color: #fff;
  letter-spacing: -0.028em;
  line-height: 1.25;
}

.article-content h2 {
  margin: 2.25em 0 0.72em;
  font-size: clamp(29px, 4vw, 39px);
}

.article-content h3 {
  margin: 1.8em 0 0.65em;
  font-size: clamp(23px, 3vw, 29px);
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content figure,
.article-content table {
  margin-top: 0;
  margin-bottom: 1.55em;
}

.article-content a:not(.button):not(.wp-block-button__link) {
  color: var(--maney-primary);
  text-decoration: underline;
  text-decoration-color: rgba(198,255,0,.42);
  text-underline-offset: 3px;
}

.article-content ul,
.article-content ol {
  padding-left: 1.45em;
}

.article-content li + li {
  margin-top: 0.5em;
}

.article-content blockquote {
  padding: 22px 26px;
  border-left: 4px solid var(--maney-primary);
  border-radius: 0 14px 14px 0;
  background: rgba(198,255,0,.07);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}

.article-content figure img {
  display: block;
  width: 100%;
  border-radius: 16px;
}

.article-content figcaption {
  margin-top: 9px;
  color: var(--maney-muted);
  font-size: 14px;
  text-align: center;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.article-content th,
.article-content td {
  padding: 13px 14px;
  border: 1px solid var(--maney-line);
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background: rgba(198,255,0,.09);
  color: #fff;
}

.article-aside {
  position: sticky;
  top: 106px;
}

.toc-card {
  padding: 22px;
  border: 1px solid var(--maney-line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}

.toc-card__title {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.maney-toc-list {
  display: grid;
  gap: 11px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.maney-toc-list a {
  display: block;
  color: var(--maney-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.maney-toc-list a:hover,
.maney-toc-list a.is-active {
  color: var(--maney-primary);
}

.maney-toc-list .toc-level-3 {
  padding-left: 14px;
}

.article-cta {
  position: relative;
  overflow: hidden;
  margin-top: 52px;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid rgba(198,255,0,.25);
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 20%, rgba(198,255,0,.18), transparent 32%),
    linear-gradient(145deg, rgba(198,255,0,.09), rgba(255,255,255,.035));
}

.article-cta h2 {
  max-width: 600px;
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
}

.article-cta p {
  max-width: 630px;
  margin: 15px 0 24px;
  color: rgba(255,255,255,.7);
}

.article-footer {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--maney-line);
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.share-row__label {
  margin-right: 4px;
  color: var(--maney-muted);
  font-size: 14px;
  font-weight: 800;
}

.share-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid var(--maney-line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.share-button:hover {
  border-color: rgba(198,255,0,.35);
  color: var(--maney-primary);
}

.related-posts {
  margin-top: 72px;
  padding-top: 54px;
  border-top: 1px solid var(--maney-line);
}

.related-posts h2 {
  margin: 0 0 26px;
  font-size: 34px;
}

.related-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-card {
  padding: 22px;
  border: 1px solid var(--maney-line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}

.related-card h3 {
  margin: 10px 0 0;
  font-size: 19px;
  line-height: 1.4;
}

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--maney-line);
  background: #030404;
}

.site-footer__inner {
  display: grid;
  align-items: start;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.site-footer img {
  width: 145px;
}

.site-footer p {
  max-width: 540px;
  margin: 15px 0 0;
  color: rgba(255,255,255,.5);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
  color: rgba(255,255,255,.58);
  font-size: 14px;
  font-weight: 750;
}

.footer-links a:hover {
  color: var(--maney-primary);
}

.site-footer__legal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.075);
  color: rgba(255,255,255,.38);
  font-size: 13px;
}

@media (max-width: 980px) {
  .site-header__inner {
    grid-template-columns: 1fr auto;
  }

  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    padding: 14px 20px 18px;
    border-bottom: 1px solid var(--maney-line);
    background: #050607;
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    justify-content: flex-start;
  }

  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post__media {
    min-height: 360px;
  }

  .posts-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: minmax(0, var(--maney-reading));
  }

  .article-aside {
    position: static;
    order: -1;
  }

  .toc-card {
    padding: 0;
  }

  .toc-card__title {
    display: block;
    padding: 17px 20px;
    cursor: pointer;
  }

  .maney-toc-list {
    padding: 0 20px 20px;
  }
}

@media (max-width: 700px) {
  body.admin-bar .site-header {
    top: 46px;
  }

  .site-wrap {
    width: min(calc(100% - 28px), var(--maney-max));
  }

  .site-header__inner {
    min-height: 68px;
  }

  .site-brand img {
    width: 112px;
  }

  .site-brand__section {
    font-size: 11px;
  }

  .blog-hero {
    padding: 58px 0 48px;
  }

  .blog-main {
    padding: 48px 0 72px;
  }

  .featured-post__media {
    min-height: 250px;
  }

  .posts-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .post-card__media {
    height: 230px;
  }

  .article-header {
    padding: 44px 0 30px;
    text-align: left;
  }

  .article-header .breadcrumb,
  .article-header .post-meta {
    justify-content: flex-start;
  }

  .article-featured {
    margin-bottom: 36px;
    border-radius: 18px;
  }

  .article-content {
    font-size: 17px;
    line-height: 1.8;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
