/*
Theme Name: David Peranic Blog Theme
Theme URI: https://davidperanic.com/
Author: Antigravity
Description: Standalone premium dark WordPress theme with teal glowing card grids, matching David Peranic's personal brand identity.
Version: 1.0
Text Domain: davidperanic-theme
*/

/* Core Design Tokens */
:root {
  --dp-bg-dark: #0A192F;         /* David's rich dark navy background */
  --dp-bg-card: #112240;         /* Card background */
  --dp-color-teal: #00D6C9;       /* Signature teal/turquoise */
  --dp-color-teal-glow: rgba(0, 214, 201, 0.45);
  --dp-color-teal-hover: #00ebd7;
  --dp-color-yellow: #FFC82C;     /* Secondary yellow/amber accent */
  --dp-color-yellow-glow: rgba(255, 200, 44, 0.45);
  --dp-text-white: #FFFFFF;
  --dp-text-gray: #94A3B8;       /* Slate-400 */
  --dp-text-light: #E2E8F0;      /* Slate-200 */
  --dp-font-family: 'Inter', sans-serif;
  --dp-max-width: 800px;
}

/* Force Dark Mode on Blog Pages */
body {
  background-color: var(--dp-bg-dark) !important;
  color: var(--dp-text-light) !important;
  font-family: var(--dp-font-family) !important;
  -webkit-font-smoothing: antialiased;
}

/* Base Link Reset */
a {
  color: var(--dp-text-white);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

a:hover {
  color: var(--dp-color-teal);
}

/* Selection Override */
::selection {
  background-color: var(--dp-color-teal);
  color: var(--dp-bg-dark);
}

/* WordPress Content Styles Integration */
main {
  background-color: var(--dp-bg-dark) !important;
  padding: 60px 0;
}

/* --- BLOG HERO --- */
.blog-hero {
  padding: 80px 0 50px;
  background: radial-gradient(circle at top right, rgba(0, 214, 201, 0.08), transparent 45%);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.blog-hero h1 {
  font-family: var(--dp-font-family);
  font-weight: 900;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: var(--dp-text-white);
  margin: 0 0 15px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.blog-hero h1 span {
  color: var(--dp-color-teal);
}

.blog-hero p {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--dp-text-gray);
  max-width: 650px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.6;
}

/* --- GRID LAYOUT --- */
.blog-container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  padding: 40px 0;
}

/* --- PREMIUM GLOWING CARDS --- */
.blog-card {
  background-color: var(--dp-bg-card);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid rgba(0, 214, 201, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Glow Effect on Hover */
.blog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 214, 201, 0.8);
  box-shadow: 0 0 25px var(--dp-color-teal-glow), 
              0 15px 40px rgba(0, 0, 0, 0.5);
}

.blog-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
  background-color: #050c18;
}

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

.blog-card:hover .blog-card-image img {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-meta {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dp-text-gray);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-card-meta a {
  color: var(--dp-color-yellow);
  text-decoration: none;
}

.blog-card-meta a:hover {
  text-decoration: underline;
}

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--dp-text-white);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-title a {
  color: var(--dp-text-white) !important;
  text-decoration: none;
}

.blog-card-title a:hover {
  color: var(--dp-color-teal-hover) !important;
}

.blog-card-excerpt {
  color: var(--dp-text-gray);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dp-color-teal) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  text-decoration: none;
}

.blog-card-link:hover {
  color: var(--dp-color-teal-hover) !important;
}

.blog-card-link .arrow {
  transition: transform 0.2s ease;
}

.blog-card-link:hover .arrow {
  transform: translateX(4px);
}

/* --- PAGINATION --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 50px;
  padding: 20px 0;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--dp-bg-card);
  color: var(--dp-text-gray) !important;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
  background-color: var(--dp-color-teal);
  color: var(--dp-bg-dark) !important;
  border-color: var(--dp-color-teal);
  box-shadow: 0 0 15px var(--dp-color-teal-glow);
}

/* --- SINGLE POST LAYOUT --- */
.single-post-container {
  max-width: var(--dp-max-width);
  margin: 0 auto;
  padding: 40px 20px;
}

.post-header {
  margin-bottom: 35px;
  text-align: left;
}

.post-header .post-meta {
  font-size: 0.875rem;
  color: var(--dp-text-gray);
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 15px;
}

.post-header .post-meta a {
  color: var(--dp-text-white);
}

.post-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--dp-text-white);
  margin: 0;
  letter-spacing: -0.01em;
}

.post-featured-image {
  margin-bottom: 45px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- POST CONTENT TYPOGRAPHY --- */
.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--dp-text-light);
}

.post-content p {
  margin-bottom: 1.8em;
}

.post-content h2, 
.post-content h3, 
.post-content h4 {
  color: var(--dp-text-white);
  font-weight: 700;
  margin-top: 2em;
  margin-bottom: 0.8em;
  line-height: 1.3;
}

.post-content h2 { font-size: 1.75rem; border-left: 4px solid var(--dp-color-teal); padding-left: 15px; }
.post-content h3 { font-size: 1.4rem; }

.post-content a {
  color: var(--dp-color-teal);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-content a:hover {
  color: var(--dp-color-teal-hover);
}

.post-content blockquote {
  margin: 2.5em 0;
  padding: 24px 30px;
  border-left: 4px solid var(--dp-color-teal);
  background: linear-gradient(90deg, rgba(0, 214, 201, 0.08) 0%, transparent 100%);
  border-radius: 0 16px 16px 0;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--dp-text-white);
  line-height: 1.6;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content ul,
.post-content ol {
  margin-bottom: 1.8em;
  padding-left: 25px;
}

.post-content li {
  margin-bottom: 0.6em;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2em 0;
}

/* Post Tags */
.post-tags {
  margin-top: 50px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-tags a {
  background-color: var(--dp-bg-card);
  color: var(--dp-text-gray) !important;
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.post-tags a:hover {
  background-color: var(--dp-color-teal);
  color: var(--dp-bg-dark) !important;
  border-color: var(--dp-color-teal);
}

/* --- POST NAVIGATION --- */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 20px;
}

.nav-box {
  flex: 1;
  background-color: var(--dp-bg-card);
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-decoration: none !important;
}

.nav-box:hover {
  border-color: var(--dp-color-teal);
  transform: translateY(-2px);
}

.nav-box-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--dp-text-gray);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  font-weight: 600;
}

.nav-box-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-box-title a {
  color: var(--dp-text-white) !important;
}

.nav-box-title a:hover {
  color: var(--dp-color-teal) !important;
}

.nav-box.prev-box {
  border-left: 4px solid var(--dp-color-yellow);
}

.nav-box.next-box {
  border-right: 4px solid var(--dp-color-teal);
  text-align: right;
}

/* --- COMMENTS AREA --- */
.comments-area {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--dp-text-white);
}

.comment-list {
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
}

.comment-body {
  background-color: var(--dp-bg-card);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid rgba(255, 255, 255, 0.15);
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.comment-author {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--dp-text-white);
}

.comment-metadata {
  font-size: 0.8rem;
  color: var(--dp-text-gray);
}

.comment-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--dp-text-light);
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* Comment Form */
.comment-respond {
  margin-top: 40px;
  background-color: var(--dp-bg-card);
  padding: 35px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.comment-respond h3 {
  margin-top: 0;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--dp-text-white);
}

.comment-notes {
  color: var(--dp-text-gray);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--dp-text-gray);
  font-size: 0.875rem;
  font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
  width: 100%;
  padding: 14px 18px;
  background-color: var(--dp-bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--dp-text-white);
  font-family: var(--dp-font-family);
  font-size: 0.95rem;
  transition: border-color 0.3s ease;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--dp-color-teal);
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--dp-text-gray);
}

.comment-form-cookies-consent input {
  margin-top: 4px;
}

.comment-form .submit {
  align-self: flex-start;
  background-color: var(--dp-color-teal);
  color: var(--dp-bg-dark);
  font-family: var(--dp-font-family);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 30px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 214, 201, 0.3);
  transition: all 0.3s ease;
}

.comment-form .submit:hover {
  background-color: var(--dp-color-teal-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--dp-color-teal-glow);
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1200px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .blog-container {
    padding: 0 15px;
  }
  .blog-hero {
    padding: 60px 0 40px;
  }
  .post-navigation {
    flex-direction: column;
    gap: 15px;
  }
  .comment-respond {
    padding: 20px;
  }
}
