/*
Theme Name: Awesome Theme
Theme URI: https://www.tholth.com
Author: Your Name
Author URI: https://www.tholth.com
Description: A custom WordPress theme with a fullscreen video background and modern design.
Version: 1.4
Requires at least: 5.8
Tested up to: 6.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: awesome
Tags: full-width-template, video-header, custom-background, news, magazine
*/

/* ========================================
   RESET
======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #0d0d0d; color: #e0e0e0; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ========================================
   VIDEO BACKGROUND SECTION
======================================== */
.video-section {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#bg-video {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%; min-height: 100%;
  width: auto; height: auto;
  z-index: 0;
  object-fit: cover;
}

.video-fallback {
  position: absolute;
  inset: 0;
  background: url('assets/images/fallback.jpg') center/cover no-repeat;
  z-index: 0;
}

/* Dark gradient overlay over video */
.video-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.55) 0%,
      rgba(0,0,0,0.35) 40%,
      rgba(0,0,0,0.70) 80%,
      rgba(0,0,0,0.90) 100%);
  z-index: 1;
}

/* ========================================
   SITE HEADER (on top of video)
======================================== */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo-mark {
  width: 36px; height: 36px;
  background: #c8102e;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #fff;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 6px 14px;
  transition: background 0.2s;
}

.header-search:hover { background: rgba(255,255,255,0.2); }

.header-search input {
  background: none; border: none; outline: none;
  color: #fff; font-size: 13px; width: 160px;
}

.header-search input::placeholder { color: rgba(255,255,255,0.6); }

.header-search svg { color: rgba(255,255,255,0.7); flex-shrink: 0; }

/* ========================================
   HERO TITLE (on video)
======================================== */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  margin-top: -60px; /* pull up slightly from center */
}

.hero-content h1 {
  font-size: clamp(3rem, 9vw, 7rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 4px 32px rgba(0,0,0,0.5);
  margin-bottom: 10px;
}

.hero-content h1 span { color: #e8192f; }

.hero-tagline {
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  color: rgba(255,255,255,0.75);
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 400;
}

/* ========================================
   CATEGORY OVERLAY BOARD (on video, bottom)
======================================== */
.category-board {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 3;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0 24px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}

.category-board::-webkit-scrollbar { display: none; }

.category-board a,
.category-board button {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  padding: 16px 18px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: none;
  border-left: none; border-right: none; border-top: none;
  font-family: inherit;
}

.category-board a:hover,
.category-board button:hover,
.category-board a.active,
.category-board button.active {
  color: #fff;
  border-bottom-color: #e8192f;
  background: rgba(255,255,255,0.06);
}

.category-board a .cat-count,
.category-board button .cat-count {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  letter-spacing: 0;
}

/* ========================================
   POSTS SECTION
======================================== */
.posts-section {
  background: #111;
  padding: 48px 0 64px;
}

.posts-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.posts-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.posts-header h2::before {
  content: '';
  display: block;
  width: 4px; height: 18px;
  background: #e8192f;
  border-radius: 2px;
}

.posts-header .category-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-left: 4px;
}

.view-all-link {
  font-size: 12px;
  font-weight: 600;
  color: #e8192f;
  letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 4px;
  transition: opacity 0.2s;
}
.view-all-link:hover { opacity: 0.8; }
.view-all-link::after { content: '→'; }

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ========================================
   POST CARD
======================================== */
.post-card {
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-color: rgba(232,25,47,0.25);
}

.post-card:focus-visible {
  outline: 2px solid #e8192f;
  outline-offset: 2px;
}

.post-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.06);
}

.post-card__thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.15);
  font-size: 2rem;
}

.post-card__cat-badge {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: #e8192f;
  padding: 3px 8px;
  border-radius: 2px;
}

.post-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card__title {
  font-size: 0.97rem;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.post-card:hover .post-card__title { color: #fff; }

.post-card__excerpt {
  font-size: 0.825rem;
  color: rgba(224,224,224,0.55);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: rgba(224,224,224,0.4);
}

.post-card__read {
  font-size: 11px;
  font-weight: 600;
  color: #e8192f;
  display: flex; align-items: center; gap: 4px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}

.post-card__read::after { content: '→'; }

.post-card:hover .post-card__read {
  opacity: 1;
  transform: translateX(0);
}

/* ========================================
   POST MODAL OVERLAY
======================================== */
.post-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 1000;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.2s ease;
}

.post-modal-backdrop.open {
  display: flex;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.post-modal {
  background: #161616;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modal-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.post-modal__close {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 0;
  background: linear-gradient(to bottom, #161616 70%, transparent);
}

.post-modal__close button {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.post-modal__close button:hover {
  background: #e8192f;
  color: #fff;
}

.post-modal__hero {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  margin-top: -40px; /* overlap with sticky close bar */
}

.post-modal__body {
  padding: 24px 30px 36px;
}

.post-modal__cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #e8192f;
  margin-bottom: 12px;
}

.post-modal__title {
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 14px;
}

.post-modal__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: rgba(224,224,224,0.45);
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.post-modal__meta-sep { color: rgba(255,255,255,0.15); }

.post-modal__content {
  font-size: 1rem;
  line-height: 1.85;
  color: rgba(224,224,224,0.82);
}

.post-modal__content p { margin-bottom: 1.2em; }

.post-modal__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 30px;
  gap: 16px;
  color: rgba(255,255,255,0.4);
  font-size: 13px;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #e8192f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.post-modal__open-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: #e8192f;
  padding: 12px 24px;
  border-radius: 6px;
  transition: background 0.2s;
}
.post-modal__open-link:hover { background: #b50e27; color: #fff; }
.post-modal__open-link::after { content: '↗'; }

/* ========================================
   LOAD MORE / PAGINATION
======================================== */
.load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.btn-load-more {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 13px 36px;
  border-radius: 4px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-load-more:hover {
  color: #fff;
  border-color: #e8192f;
  background: rgba(232,25,47,0.08);
}

.btn-load-more:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ========================================
   FOOTER
======================================== */
.site-footer {
  background: #0a0a0a;
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 36px 24px 24px;
  text-align: center;
}

.site-footer__name {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.site-footer__tagline {
  font-size: 12px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 24px;
}

.site-footer__links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 24px;
}

.site-footer__links a {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
}
.site-footer__links a:hover { color: #e8192f; }

.site-footer__copy {
  font-size: 11px;
  color: rgba(255,255,255,0.2);
}

/* ========================================
   NO POSTS MESSAGE
======================================== */
.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: rgba(255,255,255,0.3);
  font-size: 14px;
}

/* ========================================
   LOADING STATE
======================================== */
.posts-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 12px;
  color: rgba(255,255,255,0.3);
  font-size: 13px;
}

/* ========================================
   CARD SKELETON (while loading)
======================================== */
.post-card--skeleton {
  pointer-events: none;
}

.skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 3px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
  .site-header { padding: 14px 16px; }
  .header-search { display: none; }
  .hero-content h1 { letter-spacing: -1px; }
  .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .posts-container { padding: 0 14px; }
  .post-modal__body { padding: 18px 20px 28px; }
  .category-board { padding: 0 10px; }
  .category-board a,
  .category-board button { padding: 14px 12px; font-size: 11px; }
}

@media (max-width: 480px) {
  .posts-grid { grid-template-columns: 1fr; }
  .post-modal { border-radius: 10px 10px 0 0; align-self: flex-end; max-height: 95vh; }
  .post-modal-backdrop { align-items: flex-end; padding: 0; }
}
