/*
Theme Name: PopmintchevLABS Modern
Theme URI: https://popmintchev.ucsd.edu
Description: A modern dark theme for PopmintchevLABS - Quantum X-ray Science and Technology
Author: Custom
Version: 1.0
Requires at least: 6.0
Tested up to: 6.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* ========================================
   CSS Variables & Base
   ======================================== */
:root {
  --color-bg: #0a0a0f;
  --color-bg-alt: #12121a;
  --color-bg-card: #1a1a25;
  --color-accent: #dc2a36;
  --color-accent-hover: #ff3344;
  --color-text: #c8c8d0;
  --color-text-bright: #ffffff;
  --color-text-muted: #7a7a8a;
  --color-border: rgba(255,255,255,0.08);
  --color-glass: rgba(255,255,255,0.04);
  --font-heading: 'Playfair Display', 'Prata', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1280px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-bright);
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.3rem; }

p { margin-bottom: 1.5em; }

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ========================================
   Layout
   ======================================== */
.site-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.content-area {
  flex: 1;
}

/* ========================================
   Header
   ======================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition);
}

.site-header.scrolled {
  background: rgba(10, 10, 15, 0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.site-logo a {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--color-text-bright);
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.3em 0.6em;
  background: var(--color-accent);
  transition: background var(--transition);
}

.site-logo a:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

/* Navigation */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 0;
}

.main-nav li {
  position: relative;
}

.main-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all var(--transition);
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
  color: var(--color-text-bright);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.main-nav a:hover::after,
.main-nav .current-menu-item > a::after {
  transform: scaleX(1);
}

/* Dropdown */
.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background: rgba(18, 18, 26, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.5rem 0;
  list-style: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.main-nav li:hover > .sub-menu {
  display: block;
  animation: fadeInDown 0.2s ease;
}

.main-nav .sub-menu a {
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.main-nav .sub-menu a::after { display: none; }

.main-nav .sub-menu a:hover {
  background: var(--color-glass);
  color: var(--color-accent);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-bright);
  margin: 5px 0;
  transition: all var(--transition);
}

/* ========================================
   Hero / Slideshow
   ======================================== */
.hero-slideshow {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-slideshow .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  background-size: cover;
  background-position: center;
}

.hero-slideshow .slide.active { opacity: 1; }

.hero-slideshow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10,10,15,0.3) 0%,
    rgba(10,10,15,0.1) 40%,
    rgba(10,10,15,0.6) 80%,
    rgba(10,10,15,1) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 15%;
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  padding: 0 2rem;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 400;
  margin-bottom: 0.5em;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}

.hero-content .tagline {
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 12px;
}

.hero-scroll-indicator::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
  animation: scrollDown 1.5s infinite;
}

@keyframes scrollDown {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(16px); }
}

/* Slide controls */
.slide-controls {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}

.slide-controls button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
}

.slide-controls button:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* Slide indicators */
.slide-indicators {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
}

.slide-indicators .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all var(--transition);
}

.slide-indicators .dot.active {
  background: var(--color-accent);
  transform: scale(1.3);
}

/* ========================================
   Gallery Grid (Homepage)
   ======================================== */
.section-title {
  text-align: center;
  padding: 5rem 0 3rem;
}

.section-title h2 {
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 1rem auto 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 0 0 5rem;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-bg-card);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.gallery-card .card-image {
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-card:hover .card-image img {
  transform: scale(1.08);
}

.gallery-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(10,10,15,0.9) 100%
  );
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
}

.gallery-card:hover .card-overlay { opacity: 1; }

.gallery-card .card-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.gallery-card .card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Static card title for no-hover devices */
.gallery-card .card-caption {
  padding: 1rem 1.2rem;
}

.gallery-card .card-caption a {
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 500;
  transition: color var(--transition);
}

.gallery-card:hover .card-caption a {
  color: var(--color-accent);
}

/* ========================================
   Page Content
   ======================================== */
.page-header {
  padding: 120px 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg-alt), var(--color-bg));
}

.page-header h1 {
  margin-bottom: 0.5em;
}

.page-content {
  padding: 3rem 0 5rem;
}

.page-content .entry-content {
  max-width: 900px;
  margin: 0 auto;
}

.page-content .entry-content img {
  border-radius: 4px;
  margin: 1.5em 0;
}

.page-content .entry-content h2,
.page-content .entry-content h3 {
  margin-top: 2em;
}

/* ========================================
   Posts / Blog
   ======================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  padding: 2rem 0 5rem;
}

.post-card {
  background: var(--color-bg-card);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(220, 42, 54, 0.3);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.post-card .post-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.post-card .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.post-card:hover .post-thumb img {
  transform: scale(1.05);
}

.post-card .post-info {
  padding: 1.5rem;
}

.post-card .post-date {
  font-size: 0.75rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5em;
}

.post-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5em;
}

.post-card h3 a {
  color: var(--color-text-bright);
}

.post-card h3 a:hover {
  color: var(--color-accent);
}

.post-card .post-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Single post */
.single-post-header {
  padding: 120px 0 2rem;
  text-align: center;
}

.single-post-header .post-meta {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: 1em;
}

.single-post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 4rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .footer-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-text-bright);
  margin-bottom: 0.5em;
}

.footer-brand .footer-tagline {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.footer-nav h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1em;
  color: var(--color-text);
}

.footer-nav ul {
  list-style: none;
}

.footer-nav li { margin-bottom: 0.5em; }

.footer-nav a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-nav a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ========================================
   Sidebar & Widgets
   ======================================== */
.widget {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--color-bg-card);
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.widget-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid var(--color-accent);
}

.widget ul { list-style: none; }
.widget li {
  padding: 0.4em 0;
  border-bottom: 1px solid var(--color-border);
}
.widget li:last-child { border: none; }
.widget a { color: var(--color-text); }
.widget a:hover { color: var(--color-accent); }

/* ========================================
   WordPress Defaults
   ======================================== */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin: 1em auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.85rem; color: var(--color-text-muted); padding: 0.5em 0; }

.wp-block-image { margin: 1.5em 0; }
.wp-block-image img { border-radius: 4px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1.5em 0; }
.gallery-item { margin: 0; }
.gallery-item img { border-radius: 4px; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem 0 4rem;
}

.pagination a,
.pagination .current {
  padding: 0.5em 1em;
  border: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text);
  transition: all var(--transition);
}

.pagination .current,
.pagination a:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Comments */
.comments-area { padding: 3rem 0; }
.comment-list { list-style: none; }
.comment-body {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--color-bg-card);
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.comment-author { font-weight: 600; margin-bottom: 0.5em; }
.comment-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 1em; }

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  border-radius: 4px;
  transition: border-color var(--transition);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

input[type="submit"],
button[type="submit"] {
  padding: 0.8rem 2rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background var(--transition);
  border-radius: 4px;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  background: var(--color-accent-hover);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 70px);
    background: #0a0a0f;
    padding: 1rem 1.5rem;
    overflow-y: auto;
    z-index: 9999;
  }

  .main-nav.active {
    display: block;
  }

  .main-nav ul {
    display: block;
    list-style: none;
  }

  .main-nav > ul > li {
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .main-nav li {
    display: block;
  }

  .main-nav a {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.9rem;
  }

  .main-nav a::after { display: none; }

  .main-nav .sub-menu {
    position: static;
    display: block;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0.3rem 1.2rem;
    min-width: 0;
  }

  .main-nav .sub-menu a {
    padding: 0.3rem 0;
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0.02em;
  }

  .gallery-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .posts-grid { grid-template-columns: 1fr; }
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle glow effect on accent elements */
.site-logo a {
  box-shadow: 0 0 30px rgba(220, 42, 54, 0.2);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-bg-card); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }
