/*
Theme Name: JavFin Grid
Theme URI: https://javfin037.com
Author: host-t1
Description: Dark, grid-based content theme with a search header, quick-filter bar, tag pills, a responsive thumbnail card grid, numbered pagination, and an SEO-friendly footer.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: novagrid
*/

/* ---------- Design tokens ---------- */
:root{
  --bg: #0c0e13;
  --bg-elevated: #14161f;
  --bg-card: #181b26;
  --border: #262a38;
  --text: #eef1f7;
  --text-muted: #9aa3b6;
  --text-faint: #6b7285;
  --accent: #ff3b5c;
  --accent-hover: #ff5c78;
  --accent-2: #22d3ee;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --maxw: 1320px;
  --header-h: 68px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:"Noto Sans Thai", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
a{ color:inherit; text-decoration:none; }
img{ max-width:100%; display:block; }
ul{ margin:0; padding:0; list-style:none; }
button{ font:inherit; cursor:pointer; }
.container{ max-width:var(--maxw); margin:0 auto; padding:0 20px; }
.screen-reader-text{
  position:absolute !important; width:1px; height:1px; overflow:hidden;
  clip:rect(1px,1px,1px,1px); white-space:nowrap;
}

/* ---------- Header ---------- */
.site-header{
  position:sticky; top:0; z-index:50;
  background:rgba(12,14,19,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
.site-header__inner{
  min-height:var(--header-h);
  display:flex; align-items:center; gap:24px;
  flex-wrap:wrap; padding:12px 0;
}
.site-branding{ display:flex; align-items:center; gap:10px; margin-right:auto; }
.site-branding img{ max-height:40px; width:auto; }
.site-title{ font-size:1.4rem; font-weight:800; letter-spacing:.2px; margin:0; }
.site-title a{ color:var(--text); }
.site-title span{ color:var(--accent); }
.site-description{ display:none; }

.main-navigation ul{ display:flex; flex-wrap:wrap; gap:4px; }
.main-navigation a{
  display:block; padding:8px 14px; border-radius:999px;
  color:var(--text-muted); font-size:.92rem; font-weight:600;
  transition:background .15s,color .15s;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a{
  background:var(--bg-card); color:var(--text);
}

.search-form{
  display:flex; align-items:stretch; flex:1 1 220px; max-width:320px;
  background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:999px; overflow:hidden;
}
.search-form__input{
  flex:1; background:transparent; border:0; outline:0;
  padding:10px 16px; color:var(--text); font-size:.92rem; min-width:0;
}
.search-form__input::placeholder{ color:var(--text-faint); }
.search-form__submit{
  background:var(--accent); border:0; color:#fff; padding:0 18px;
  font-weight:700; font-size:.85rem; white-space:nowrap;
  transition:background .15s;
}
.search-form__submit:hover{ background:var(--accent-hover); }

/* ---------- Page header / hero ---------- */
.page-header{ padding:28px 0 4px; }
.page-header__title{
  font-size:1.6rem; margin:0 0 18px; font-weight:800;
}
.page-header__title .accent{ color:var(--accent); }

/* ---------- Quick filter bar ---------- */
.quick-filters{
  display:flex; flex-wrap:wrap; gap:10px; margin-bottom:22px;
}
.quick-filters a{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px; border-radius:999px;
  background:var(--bg-card); border:1px solid var(--border);
  color:var(--text-muted); font-weight:700; font-size:.9rem;
  transition:border-color .15s,color .15s,background .15s;
}
.quick-filters a:hover{ color:var(--text); border-color:var(--accent); }
.quick-filters a.is-active{
  background:var(--accent); border-color:var(--accent); color:#fff;
}

/* ---------- Tag pills ---------- */
.tag-cloud{
  display:flex; flex-wrap:wrap; gap:8px; margin:0 0 28px;
}
.tag-cloud a{
  padding:6px 14px; border-radius:999px; font-size:.82rem !important;
  background:var(--bg-elevated); border:1px solid var(--border);
  color:var(--text-muted) !important;
  transition:background .15s,color .15s,border-color .15s;
}
.tag-cloud a:hover{
  background:rgba(255,59,92,.12); border-color:var(--accent);
  color:var(--accent) !important;
}

/* ---------- Card grid ---------- */
.card-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:20px;
  padding:4px 0 32px;
}
.card{
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  overflow:hidden;
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.card:hover{
  transform:translateY(-4px);
  border-color:var(--accent);
  box-shadow:0 12px 28px -14px rgba(255,59,92,.45);
}
.card__thumb{
  position:relative; display:block;
  aspect-ratio:16/9; background:var(--bg-elevated); overflow:hidden;
}
.card__thumb img{
  width:100%; height:100%; object-fit:cover;
  transition:transform .35s ease;
}
.card:hover .card__thumb img{ transform:scale(1.06); }
.card__thumb--placeholder{
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,var(--bg-elevated),#1d2130);
  color:var(--text-faint); font-size:.8rem;
}
.card__badge{
  position:absolute; right:8px; bottom:8px;
  background:rgba(0,0,0,.72); color:#fff;
  font-size:.72rem; font-weight:700;
  padding:3px 8px; border-radius:4px;
  letter-spacing:.3px;
}
.card__body{ padding:14px 16px 16px; }
.card__title{
  margin:0; font-size:.98rem; font-weight:700; line-height:1.4;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;
}
.card__title a{ color:var(--text); }
.card__title a:hover{ color:var(--accent); }
.card__meta{
  margin-top:8px; display:flex; gap:10px; align-items:center;
  color:var(--text-faint); font-size:.78rem;
}
.card__meta span{ display:inline-flex; align-items:center; gap:4px; }

/* ---------- Pagination ---------- */
.pagination{
  display:flex; justify-content:center; gap:8px; flex-wrap:wrap;
  padding:12px 0 48px;
}
.pagination a,
.pagination span{
  min-width:40px; height:40px; padding:0 10px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--radius-sm);
  background:var(--bg-card); border:1px solid var(--border);
  color:var(--text-muted); font-weight:700; font-size:.88rem;
}
.pagination a:hover{ border-color:var(--accent); color:var(--text); }
.pagination .current{ background:var(--accent); border-color:var(--accent); color:#fff; }

/* ---------- Single post ---------- */
.single-post{ padding:32px 0 60px; max-width:860px; margin:0 auto; }
.single-post__title{ font-size:1.6rem; font-weight:800; margin:0 0 14px; }
.single-post__meta{ color:var(--text-faint); font-size:.85rem; margin-bottom:20px; }
.single-post__thumb{ border-radius:var(--radius-lg); overflow:hidden; margin-bottom:24px; }
.single-post__content{ color:var(--text-muted); font-size:1rem; }
.single-post__content p{ margin:0 0 1.1em; }
.single-post__content a{ color:var(--accent-2); text-decoration:underline; }
.single-post__tags{ margin-top:28px; display:flex; flex-wrap:wrap; gap:8px; }

/* ---------- Footer ---------- */
.site-footer{
  border-top:1px solid var(--border);
  background:var(--bg-elevated);
  margin-top:20px;
}
.footer-widgets{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:28px; padding:40px 0;
}
.footer-widgets h2,
.footer-widgets h3{ font-size:1rem; margin:0 0 12px; color:var(--text); }
.footer-widgets p{ color:var(--text-faint); font-size:.85rem; line-height:1.7; margin:0 0 .8em; }
.footer-widgets a{ color:var(--accent-2); }
.site-footer__bottom{
  border-top:1px solid var(--border);
  padding:18px 0; text-align:center;
  color:var(--text-faint); font-size:.8rem;
}
.site-footer__bottom a{ color:var(--text-muted); font-weight:600; }

/* ---------- No results ---------- */
.no-results{ padding:60px 0; text-align:center; color:var(--text-muted); }

/* ---------- Responsive ---------- */
@media (max-width:782px){
  .site-header__inner{ gap:12px; }
  .main-navigation{ order:3; width:100%; }
  .main-navigation ul{ gap:2px; }
  .search-form{ flex:1 1 100%; max-width:none; order:2; }
  .card-grid{ grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:12px; }
  .card__body{ padding:10px 12px 12px; }
  .card__title{ font-size:.86rem; }
}
