/*
Theme Name:   Twenty Twenty-Five Child (Dave's Desk Edition)
Description:  Custom Main Hub Matrix with a point-and-click Immersive Article Reader.
Author:       Dave's Desk
Template:     twentytwentyfive
Version:      1.0.0
*/

/* ==========================================================================
   RESET & BASE STYLES (HOME HUB CANVAS)
   ========================================================================== */
* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #0a0a0a;
  color: white;
  overflow-x: hidden;
}

/* ==========================================================================
   SHARED BACKGROUNDS (HOME HUB CATEGORIES)
   ========================================================================== */
.bg-drones, .bg-evs, .bg-energy, .bg-smarthome {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.bg-drones { background-image: url('https://images.unsplash.com/photo-1473968512647-3e447244af8f?q=80&w=1600&auto=format&fit=crop'); }
.bg-evs { background-image: url('https://images.unsplash.com/photo-1605559424843-9e4c228bf1c2?q=80&w=1600&auto=format&fit=crop'); }
.bg-energy { background-image: url('https://images.unsplash.com/photo-1509391366360-2e959784a276?q=80&w=1600&auto=format&fit=crop'); }
.bg-smarthome { background-image: url('https://images.unsplash.com/photo-1558002038-1055907df827?q=80&w=1600&auto=format&fit=crop'); }

/* ==========================================================================
   MAIN INTRO HUB (Navigation Matrix)
   ========================================================================== */
.nav-hub {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 100px 24px 80px 24px;
  background: linear-gradient(135deg, #121212 0%, #050505 100%);
}

.brand-container {
  text-align: center;
  max-width: 800px;
  width: 100%;
  margin-bottom: 60px;
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: opacity, transform;
}

.brand-container h1 {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -2.5px;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 40%, rgba(255, 255, 255, 0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 20px;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 400;
}

body.scrolled .brand-container {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

/* Category Grid & Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1200px;
  width: 100%;
}

.category-grid > * {
  margin: 0 !important;
}

.category-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    width: 250px !important;
    height: 300px !important;
    min-width: 250px !important; /* Force width */
    min-height: 300px !important; /* Force height */
    flex-shrink: 0 !important;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    padding: 24px;
    text-decoration: none;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.6) 55%, rgba(0,0,0,0.92) 100%);
  z-index: 1;
  transition: background 0.3s ease;
}

.category-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.category-card:hover::before {
  background: linear-gradient(rgba(0,0,0,0.05), rgba(0,0,0,0.75));
}

.category-card .card-info {
  position: relative;
  z-index: 2;
}

.nav-hub .category-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #ffffff !important;
}

.category-card p {
  font-size: 0.8rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

/* ==========================================================================
   THE GRID MATRIX VIEWPORT (WordPress Core Query Loop Integration)
   ========================================================================== */
.category-view {
  min-height: 100vh;
  position: relative;
  padding: 80px 60px;
  display: flex;
  flex-direction: column;
}

.category-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(10,10,10,0.45), rgba(10,10,10,0.92));
  z-index: 1;
}

.view-header {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto 40px auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 20px;
}

.view-title h2 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.view-title p {
  font-size: 0.85rem;
  opacity: 0.4;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.back-btn {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 22px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.back-btn:hover {
  color: white;
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.35);
}

.article-grid {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.article-grid .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
  list-style-type: none;
}

.article-grid .wp-block-post-template > li,
.article-grid .wp-block-post-template > div {
  display: flex;
  height: 100%;
  margin: 0 !important;
}

.article-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(15, 15, 15, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
  width: 100%;
}

.article-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  opacity: 0.4;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.article-card h4 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.95);
}

.article-card p {
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.65);
}

.article-footer {
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 14px;
}

.article-meta {
  font-size: 0.75rem;
  opacity: 0.35;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-view, 
.wp-block-group {
  transform: none !important;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (HOME HUB ARCHITECTURE)
   ========================================================================== */
@media (max-width: 1150px) {
  .article-grid .wp-block-post-template { 
    grid-template-columns: repeat(2, 1fr); 
  }
}

@media (max-width: 768px) {
  .nav-hub { padding-top: 60px; }
  .brand-container h1 { font-size: 3.5rem; letter-spacing: -1.5px; }
  .article-grid .wp-block-post-template { grid-template-columns: 1fr; }
  .category-view { padding: 60px 24px; }
  .view-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  
  .category-view.bg-drones,
  .category-view.bg-evs,
  .category-view.bg-energy,
  .category-view.bg-smarthome { 
    background-attachment: scroll !important; 
  }
}

/* ==========================================================================
   SINGLE BLOG POST IMMERSIVE TYPOGRAPHY (ISOLATED TO ARTICLE PAGES ONLY)
   ========================================================================== */
body.single-post,
body.single-post .wp-site-blocks {
  background-color: #070708 !important;
  color: #e2e8f0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

body.single-post main.wp-block-group,
body.single-post .wp-block-post-content {
  max-width: 90% !important; 
  width: 90% !important;
  margin: 0 auto !important;
  padding: 40px 24px !important;
}

body.single-post h1.wp-block-post-title {
  font-size: 3.2rem !important;
  font-weight: 800 !important;
  letter-spacing: -1px !important;
  color: #ffffff !important;
  line-height: 1.15 !important;
  margin-top: 20px !important;
  margin-bottom: 24px !important;
}

body.single-post .wp-block-post-content h2 {
  font-size: 2.2rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px !important;
  color: #ffffff !important;
  margin-top: 48px !important;
  margin-bottom: 16px !important;
}

body.single-post .wp-block-post-content h3 {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  color: #f1f5f9 !important;
  margin-top: 32px !important;
  margin-bottom: 12px !important;
}

body.single-post .wp-block-post-content p {
  font-size: 1.15rem !important;
  line-height: 1.75 !important;
  color: #cbd5e1 !important;
  margin-bottom: 24px !important;
}

body.single-post .wp-block-post-content a {
  color: #38bdf8 !important;
  text-decoration: underline !important;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

body.single-post .wp-block-post-content a:hover {
  color: #7dd3fc !important;
}

body.single-post .wp-block-post-date,
body.single-post .wp-block-post-terms {
  font-size: 0.95rem !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

body.single-post .wp-block-query,
body.single-post .wp-block-query * {
  color: #e2e8f0 !important;
}

body.single-post .wp-block-query a {
  color: #ffffff !important;
  text-decoration: none !important;
}

body.single-post .wp-block-query a:hover {
  color: #38bdf8 !important;
  text-decoration: underline !important;
}

body.single-post figcaption,
body.single-post .wp-block-image figcaption {
  color: #ffffff !important;
}

/* ==========================================================================
   NARRATIVE PANEL (Post Styling)
   ========================================================================== */
.narrative-panel {
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 40px !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    background: rgba(10, 11, 12, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6) !important;
}

/* ==========================================================================
   POINT-AND-CLICK SIDEBAR VISUAL INTERFACE (ISOLATED TO ARTICLE PAGES)
   ========================================================================== */
body.single-post .reading-viewport {
    position: relative;
    z-index: 10;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px 120px 24px;
}

/* One-Click Glassy Panel Configuration */
body.single-post .is-style-glassy-panel {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10, 11, 12, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
}

/* One-Click Summary Card Bases */
body.single-post .is-style-summary-teal, 
body.single-post .is-style-summary-rose, 
body.single-post .is-style-summary-amber {
    background: rgba(7, 7, 8, 0.65) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 14px !important;
    padding: 24px !important;
    margin-bottom: 32px !important;
}

/* Sidebar Ambient Glowing Accent Options */
body.single-post .is-style-summary-teal { border-left: 4px solid #0d9488 !important; box-shadow: 0 10px 40px rgba(13, 148, 136, 0.2); }
body.single-post .is-style-summary-rose { border-left: 4px solid #e11d48 !important; box-shadow: 0 10px 40px rgba(225, 29, 72, 0.2); }
body.single-post .is-style-summary-amber { border-left: 4px solid #d97706 !important; box-shadow: 0 10px 40px rgba(217, 119, 6, 0.2); }

/* ==========================================================================
   DYNAMIC SCROLL ENGINE COMPONENTS
   ========================================================================== */
#scroll-progress {
    position: fixed;
    top: 0; left: 0; height: 3px; width: 0%; z-index: 100;
    background-color: #2dd4bf;
    transition: width 0.1s ease-out, background-color 0.4s ease;
}

.bg-track-image {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover !important;
    background-position: center !important;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.bg-track-image.active { 
    opacity: 0.65; 
}

.bg-overlay-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(circle at center, rgba(7,7,8,0.3) 0%, rgba(7,7,8,0.85) 70%, #070708 100%);
    pointer-events: none;
}
/* Remove standard list styling */
.dynamic-category-grid {
    list-style: none !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
}

/* Turn each list item into your custom card */
.dynamic-category-grid li {
    width: 250px !important;
    height: 300px !important;
    flex-shrink: 0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.04) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding: 24px !important;
    transition: transform 0.4s ease !important;
}

/* Style the links inside the list items */
.dynamic-category-grid li a {
    color: white !important;
    text-decoration: none !important;
    font-weight: bold !important;
}