:root {
  --navy: #0f2742;
  --navy-2: #14365c;
  --gold: #c59b4a;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: rgba(15, 39, 66, 0.10);
  --shadow: 0 18px 45px rgba(15, 39, 66, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #edf1f5 100%);
  color: var(--text);
}

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

button,
input {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: var(--gold);
  font-weight: 800;
}

.brand small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 12px;
}

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

.nav-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.admin-btn {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(197, 155, 74, 0.14);
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.hero {
  padding: 54px 0 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 24px;
  align-items: stretch;
}

.eyebrow,
.section-kicker {
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  margin: 0 0 10px;
}

h1 {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.08;
}

h2 {
  color: var(--navy);
  margin: 0;
  font-size: 26px;
}

p {
  line-height: 1.65;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

.hero-card,
.admin-note,
.post-detail,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.hero-card {
  padding: 24px;
}

.hero-card strong {
  color: var(--navy);
  font-size: 20px;
}

.hero-card p {
  color: var(--muted);
}

.search-box {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  max-width: 680px;
}

.search-box input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
  background: #fff;
}

.search-box button {
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

.section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.result-count {
  color: var(--muted);
  font-size: 14px;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

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

.card {
  padding: 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(15, 39, 66, 0.14);
}

.card.large {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
}

.card.large .card-title,
.card.large .card-meta,
.card.large .card-excerpt {
  color: #fff;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(197, 155, 74, 0.14);
  color: var(--gold);
  font-weight: 700;
  font-size: 12px;
}

.card-title {
  margin: 0 0 10px;
  color: var(--navy);
  font-size: 19px;
  line-height: 1.35;
}

.card-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.post-detail {
  padding: 26px;
}

.post-detail h2 {
  font-size: 32px;
  line-height: 1.25;
  margin-bottom: 12px;
}

.post-content {
  color: #344054;
  font-size: 17px;
  line-height: 1.8;
}

.post-content ul {
  padding-left: 22px;
}

.detail-actions {
  margin-top: 18px;
}

.detail-actions button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
}

.empty-state {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.admin-note {
  padding: 24px;
  margin-top: 16px;
  margin-bottom: 34px;
}

.admin-note p {
  color: var(--muted);
  margin-bottom: 0;
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--navy);
}

.footer-inner p {
  color: var(--muted);
  margin: 6px 0 0;
}

.footer-contact {
  text-align: right;
  line-height: 1.7;
  font-weight: 700;
}

@media (max-width: 860px) {
  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .top-nav {
    justify-content: flex-start;
  }

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

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    padding: 13px 18px;
  }

  .section-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-contact {
    text-align: left;
  }
}

/* Mobile-first polish */
@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1120px);
  }

  .site-header {
    position: sticky;
    top: 0;
  }

  .header-inner {
    gap: 10px;
    padding: 10px 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    font-size: 12px;
  }

  .top-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    padding: 9px 13px;
    font-size: 15px;
  }

  .hero {
    padding: 30px 0 12px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.12;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-card {
    padding: 18px;
    border-radius: 20px;
  }

  .search-box {
    margin-top: 18px;
  }

  .section {
    padding: 22px 0;
  }

  h2 {
    font-size: 24px;
  }

  .card {
    padding: 18px;
    border-radius: 20px;
  }

  .card.large {
    min-height: 220px;
  }

  .card-title {
    font-size: 20px;
  }

  .card-excerpt {
    font-size: 16px;
  }

  .post-detail {
    padding: 20px;
    border-radius: 20px;
  }

  .post-detail h2 {
    font-size: 26px;
  }

  .post-content {
    font-size: 16px;
  }

  .footer-inner {
    gap: 8px;
  }

  .footer-contact {
    font-size: 16px;
  }
}
@media (max-width: 640px) {
  
}
@media (max-width: 640px) {
  
}

.admin-post-btn {
  padding: 10px 14px;
  border-radius: 999px;
  background: #c59b4a;
  color: #0f2742;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(197, 155, 74, 0.22);
}

@media (max-width: 640px) {
  .admin-post-btn {
    width: 100%;
    text-align: center;
    padding: 12px 14px;
  }
}

/* MOBILE FIRST PUBLIC NHAOHUE START */

/* Ưu tiên trải nghiệm điện thoại */
@media (max-width: 760px) {
  body {
    background: #f3f6f9;
  }

  .container {
    width: calc(100% - 24px);
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .header-inner {
    min-height: auto;
    padding: 10px 0;
    gap: 10px;
    align-items: stretch;
  }

  .brand {
    width: 100%;
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex: 0 0 auto;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand small {
    font-size: 12px;
  }

  .top-nav {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 8px;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 auto;
    padding: 9px 13px;
    font-size: 15px;
    white-space: nowrap;
  }

  .admin-post-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px 14px;
    margin-top: 2px;
  }

  .hero {
    padding: 24px 0 10px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .eyebrow,
  .section-kicker {
    font-size: 12px;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 0;
  }

  .hero-card {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-card strong {
    font-size: 18px;
  }

  .hero-card p {
    font-size: 15px;
    line-height: 1.55;
  }

  .search-box {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .search-box input {
    min-width: 0;
    padding: 13px 14px;
    border-radius: 15px;
    font-size: 15px;
  }

  .search-box button {
    padding: 0 15px;
    border-radius: 15px;
  }

  .section {
    padding: 20px 0;
  }

  .section-head {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }

  h2 {
    font-size: 24px;
    line-height: 1.25;
  }

  .featured-grid,
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    padding: 18px;
    border-radius: 20px;
  }

  .card.large {
    min-height: 210px;
  }

  .card-meta {
    gap: 7px;
    font-size: 13px;
    margin-bottom: 10px;
  }

  .badge {
    padding: 6px 10px;
    font-size: 12px;
  }

  .card-title {
    font-size: 20px;
    line-height: 1.35;
  }

  .card-excerpt {
    font-size: 16px;
    line-height: 1.55;
  }

  .post-detail {
    padding: 18px;
    border-radius: 20px;
  }

  .post-detail h2 {
    font-size: 26px;
    line-height: 1.25;
  }

  .post-content {
    font-size: 16px;
    line-height: 1.75;
  }

  .detail-actions button {
    width: 100%;
    padding: 13px 16px;
  }

  .site-footer {
    padding: 22px 0 86px;
  }

  .footer-inner {
    gap: 10px;
  }

  .footer-contact {
    text-align: left;
    font-size: 16px;
  }
}

/* Mobile nhỏ như iPhone SE */
@media (max-width: 390px) {
  h1 {
    font-size: 30px;
  }

  .nav-tab {
    font-size: 14px;
    padding: 8px 11px;
  }

  .card-title {
    font-size: 19px;
  }
}

/* MOBILE FIRST PUBLIC NHAOHUE END */


/* FIX: Nút admin phải luôn ẩn nếu còn thuộc tính hidden,
   kể cả khi CSS mobile có display:block */
.admin-post-btn[hidden] {
  display: none !important;
}

/* Admin button safety: hidden phải thắng mọi CSS desktop/mobile */
.admin-post-btn[hidden] {
  display: none !important;
}

/* COVER IMAGE START */
.card-cover {
  margin: -18px -18px 14px;
  height: 170px;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
  background: #eef2f6;
}

.card-cover img,
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Khi bài nổi bật có ảnh thì dùng nền trắng để đọc rõ hơn */
.card.large.has-cover {
  min-height: auto;
  justify-content: flex-start;
  background: #ffffff;
  color: var(--text);
}

.card.large.has-cover .card-title {
  color: var(--navy);
}

.card.large.has-cover .card-meta,
.card.large.has-cover .card-excerpt {
  color: var(--muted);
}

.card.large.has-cover .card-cover {
  height: 230px;
}

.detail-cover {
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 22px;
  background: #eef2f6;
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .card-cover {
    height: 185px;
    border-radius: 20px 20px 0 0;
  }

  .card.large.has-cover .card-cover {
    height: 205px;
  }

  .detail-cover {
    height: 220px;
    border-radius: 18px;
  }
}
/* COVER IMAGE END */

/* ATTACHMENTS START */
.document-badge {
  background: rgba(15, 39, 66, 0.08);
  color: var(--navy);
}

.attachment-list {
  margin-top: 22px;
  padding: 18px;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid rgba(15, 39, 66, 0.10);
}

.attachment-list h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 20px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(15, 39, 66, 0.10);
  margin-top: 8px;
  color: var(--navy);
  text-decoration: none;
}

.attachment-item strong {
  flex: 1;
}

.attachment-item em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

@media (max-width: 760px) {
  .attachment-list {
    padding: 14px;
    border-radius: 18px;
  }

  .attachment-item {
    align-items: flex-start;
    padding: 13px;
  }
}
/* ATTACHMENTS END */
