/*
Theme Name: Crivata Blog
Theme URI: https://crivata.com
Author: Crivata
Author URI: https://crivata.com
Description: Official blog theme for Crivata - matching the main marketing website design.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crivata-blog
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #FF7A1A;
  --primary-hover: #e06a10;
  --charcoal: #121212;
  --warm-sand: #FFCA8A;
  --soft-grey: #EEEEEE;
  --bg-light: #FAFAFA;
  --text-primary: #121212;
  --text-secondary: #696969;
  --text-muted: #737373;
  --border-grey: #E6E6E6;
  --marketing-bg: #f5f3f0;
  --marketing-dark: #1a1a1a;
  --white: #FFFFFF;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background-color: var(--marketing-bg);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-grey);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo img {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  object-fit: cover;
}

.site-logo .logo-text {
  display: flex;
  flex-direction: column;
}

.site-logo .logo-name {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.site-logo .logo-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s, background-color 0.2s;
}

.main-nav a:hover {
  color: var(--text-primary);
}

.main-nav a.active {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Social Icons */
.social-icons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-icons a {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.social-icons a:hover {
  color: var(--primary);
}

.social-icons svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--white);
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

.mobile-menu-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-nav {
  display: none;
  padding: 1rem 0 0.5rem;
  border-top: 1px solid var(--border-grey);
  margin-top: 1rem;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.mobile-nav a:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.03);
}

@media (max-width: 768px) {
  .main-nav,
  .social-icons.desktop-only {
    display: none;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .header-inner {
    flex-wrap: wrap;
  }
  .mobile-nav.open {
    width: 100%;
  }
}

/* ===== BLOG LAYOUT ===== */
.site-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
}

@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
}

/* Blog page title */
.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* ===== POST CARDS ===== */
.post-card {
  background-color: var(--white);
  border: 1px solid var(--border-grey);
  border-radius: 0.625rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.post-card .post-thumbnail {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

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

.post-card .post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-card .post-category {
  background-color: rgba(255, 122, 26, 0.1);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.post-card .post-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-card .post-title a {
  color: var(--text-primary);
}

.post-card .post-title a:hover {
  color: var(--primary);
}

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

.post-card .read-more {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.post-card .read-more:hover {
  color: var(--primary-hover);
}

.post-card .read-more svg {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
}

.post-card .read-more:hover svg {
  transform: translateX(3px);
}

/* ===== SINGLE POST ===== */
.single-post-header {
  margin-bottom: 2rem;
}

.single-post-header .post-category {
  background-color: rgba(255, 122, 26, 0.1);
  color: var(--primary);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 1rem;
}

.single-post-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.single-post-header .post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.single-post-featured-image {
  width: 100%;
  border-radius: 0.625rem;
  margin-bottom: 2rem;
  max-height: 500px;
  object-fit: cover;
}

/* Post Content Prose */
.post-body {
  background-color: var(--white);
  border: 1px solid var(--border-grey);
  border-radius: 0.625rem;
  padding: 2.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.post-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.post-body h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-body h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.post-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.post-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background-color: rgba(255, 122, 26, 0.05);
  border-radius: 0 0.375rem 0.375rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-body img {
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.post-body a {
  color: var(--primary);
  text-decoration: underline;
}

.post-body a:hover {
  color: var(--primary-hover);
}

.post-body pre,
.post-body code {
  background-color: var(--soft-grey);
  border-radius: 0.375rem;
  font-family: Menlo, monospace;
  font-size: 0.875rem;
}

.post-body code {
  padding: 0.15rem 0.4rem;
}

.post-body pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-body pre code {
  padding: 0;
  background: none;
}

/* ===== SIDEBAR ===== */
.sidebar .widget {
  background-color: var(--white);
  border: 1px solid var(--border-grey);
  border-radius: 0.625rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sidebar .widget-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
}

.sidebar .widget ul {
  list-style: none;
  padding: 0;
}

.sidebar .widget ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--soft-grey);
}

.sidebar .widget ul li:last-child {
  border-bottom: none;
}

.sidebar .widget ul li a {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sidebar .widget ul li a:hover {
  color: var(--primary);
}

/* Search widget */
.search-form {
  display: flex;
}

.search-form input[type="search"] {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-grey);
  border-right: none;
  border-radius: 0.375rem 0 0 0.375rem;
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
}

.search-form input[type="search"]:focus {
  border-color: var(--primary);
}

.search-form button {
  padding: 0.5rem 1rem;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 0 0.375rem 0.375rem 0;
  cursor: pointer;
  font-size: 0.875rem;
}

.search-form button:hover {
  background-color: var(--primary-hover);
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-grey);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--white);
  transition: all 0.2s;
}

.pagination .page-numbers:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-numbers.current {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ===== COMMENTS ===== */
.comments-area {
  margin-top: 3rem;
  background-color: var(--white);
  border: 1px solid var(--border-grey);
  border-radius: 0.625rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.comments-title {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

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

.comment-body {
  padding: 1rem 0;
  border-bottom: 1px solid var(--soft-grey);
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.comment-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-grey);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  outline: none;
}

.comment-respond input:focus,
.comment-respond textarea:focus {
  border-color: var(--primary);
}

.comment-respond .submit {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.comment-respond .submit:hover {
  background-color: var(--primary-hover);
}

/* ===== FOOTER ===== */
.site-footer {
  background-color: var(--marketing-dark);
  color: #f2f2f2;
  border-top: 1px solid #333;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

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

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-col .footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-col .footer-logo img {
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  object-fit: cover;
}

.footer-col .footer-logo span {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--white);
}

.footer-col p {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--white);
  font-size: 1rem;
}

.footer-col nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-col nav a {
  font-size: 0.875rem;
  color: #999;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid #444;
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: #777;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-social a {
  color: #999;
  transition: color 0.2s;
  display: flex;
}

.footer-social a:hover {
  color: var(--primary);
}

.footer-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ===== 404 PAGE ===== */
.error-404 {
  text-align: center;
  padding: 5rem 1rem;
}

.error-404 h1 {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.error-404 p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ===== POST NAVIGATION ===== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-grey);
}

.post-navigation a {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
}

.post-navigation a:hover {
  color: var(--primary-hover);
}

/* ===== ARCHIVE HEADER ===== */
.archive-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.archive-header h1 {
  font-size: 2rem;
}

.archive-header .archive-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }
  .single-post-header h1 {
    font-size: 1.75rem;
  }
  .post-body {
    padding: 1.5rem;
  }
  .site-content {
    padding: 2rem 1rem;
  }
}
