/* ==========================================================================
   Rooted Security Blog Theme
   Ghost 6 compatible theme matching rootedsecurity.io design system
   ========================================================================== */

/* Base Reset & Box Sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables - Matching Rooted Security Design System */
:root {
  --primary: #1a5276;
  --primary-dark: #0e3b59;
  --secondary: #2e86c1;
  --accent: #3498db;
  --text: #333333;
  --text-light: #666666;
  --background: #f8f9fa;
  --white: #ffffff;
  --light-gray: #f1f2f4;
  --gray: #e9ecef;
  --border: #dee2e6;
  --radius: 6px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
  --podcast-accent: #f0f7ff;
  --podcast-border: #bdd7ee;
}

/* Base Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--primary-dark);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  margin-top: 2rem;
}

h4 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

p, ul, ol {
  margin-bottom: 1.5rem;
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

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

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

strong {
  font-weight: 600;
}

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

/* Site Wrapper */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: var(--primary);
  padding: 1.25rem 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-image {
  height: 42px;
  width: auto;
  max-width: 100%;
}

.site-title {
  font-size: 1.5rem;
  margin: 0;
}

.site-title a {
  color: var(--white);
}

.site-title a:hover {
  color: var(--white);
  opacity: 0.9;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.site-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
}

.site-nav a:hover {
  color: var(--white);
}

.site-nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--white);
  transition: var(--transition);
}

.site-nav a:hover::after {
  width: 100%;
}

/* Main Content */
.site-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Homepage Container */
.homepage-container {
  max-width: 100%;
}

/* Site Intro */
.site-intro {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.site-intro h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.site-intro p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 0;
}

/* Section Titles */
.section-title {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* Featured Post */
.featured-post-section {
  margin-bottom: 4rem;
}

.featured-post {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

.featured-post:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.featured-post-link {
  display: block;
  color: inherit;
}

.featured-post-image {
  width: 100%;
  height: 400px;
  overflow: hidden;
}

.featured-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.featured-post:hover .featured-post-image img {
  transform: scale(1.05);
}

.featured-post-content {
  padding: 2.5rem;
}

.featured-post-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light-gray);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.featured-post-tag.podcast-tag {
  background: var(--podcast-accent);
  color: var(--primary-dark);
}

.featured-post-tag svg {
  width: 16px;
  height: 16px;
}

.featured-post-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.featured-post-excerpt {
  font-size: 1.125rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.featured-post-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.featured-post-reading-time::before {
  content: '•';
  margin-right: 0.5rem;
}

/* Post Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Post Card */
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.post-card-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.post-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-tag {
  display: inline-block;
  background: var(--light-gray);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--primary-dark);
  line-height: 1.4;
}

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

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-light);
  padding-top: 1rem;
  border-top: 1px solid var(--gray);
}

.post-card-reading-time::before {
  content: '•';
  margin-right: 0.5rem;
}

/* Podcast Card Styles */
.podcast-card {
  border: 2px solid var(--podcast-border);
  background: linear-gradient(to bottom, var(--podcast-accent) 0%, var(--white) 15%);
}

.podcast-card .post-card-image {
  position: relative;
}

.podcast-card .podcast-placeholder {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.podcast-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-dark);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.podcast-badge svg {
  width: 20px;
  height: 20px;
}

.podcast-card .post-card-tag.podcast-tag {
  background: var(--primary-dark);
  color: var(--white);
}

/* No Posts Message */
.no-posts {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.no-posts p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin: 0;
}

/* Post Template */
.post-template,
.page-template {
  max-width: 900px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 3rem;
}

.post-header,
.page-header {
  margin-bottom: 2.5rem;
}

.post-tag {
  display: inline-block;
  background: var(--light-gray);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.post-title,
.page-title {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.post-excerpt,
.page-excerpt {
  font-size: 1.25rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post-meta-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-image {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.author-name {
  font-weight: 600;
  color: var(--text);
}

.post-reading-time {
  color: var(--text-light);
  font-size: 0.9rem;
}

.post-feature-image,
.page-feature-image {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
}

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

.post-feature-image figcaption,
.page-feature-image figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
  padding: 1rem;
  background: var(--light-gray);
}

/* Post Content */
.post-content,
.page-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text);
}

.post-content h2,
.page-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.post-content h3,
.page-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-content img,
.page-content img {
  border-radius: var(--radius);
  margin: 2rem 0;
}

.post-content blockquote,
.page-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--text-light);
}

.post-content code,
.page-content code {
  background: var(--light-gray);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.post-content pre,
.page-content pre {
  background: var(--light-gray);
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 2rem 0;
}

.post-content pre code,
.page-content pre code {
  background: none;
  padding: 0;
}

/* Podcast Template Specific */
.podcast-template .post-header {
  background: linear-gradient(to bottom, var(--podcast-accent) 0%, transparent 100%);
  padding: 2rem;
  margin: -3rem -3rem 2.5rem -3rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.podcast-badge-large {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--primary-dark);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.podcast-badge-large svg {
  width: 24px;
  height: 24px;
}

.podcast-template .post-tag.podcast-tag {
  background: var(--primary-dark);
  color: var(--white);
}

/* Post Footer */
.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.tags-label {
  font-weight: 600;
  color: var(--text);
}

.tag-link {
  background: var(--light-gray);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
}

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

/* Related Posts */
.related-posts {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  padding: 0.75rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius);
  color: var(--primary);
  font-weight: 500;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.pagination a:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.pagination .page-number {
  color: var(--text-light);
}

/* Footer */
.site-footer {
  background: var(--light-gray);
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-light);
}

.footer-content p {
  margin: 0;
  font-size: 0.9rem;
}

.footer-nav {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

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

@media (max-width: 768px) {
  .site-header {
    padding: 1.5rem 1rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1.25rem;
  }

  .header-logo {
    flex-direction: column;
    text-align: center;
  }

  .site-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .site-main {
    padding: 2rem 1rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .featured-post-image {
    height: 250px;
  }

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

  .featured-post-title {
    font-size: 1.75rem;
  }

  .featured-post-excerpt {
    font-size: 1rem;
  }

  .post-template,
  .page-template {
    padding: 2rem 1.5rem;
  }

  .post-title,
  .page-title {
    font-size: 2rem;
  }

  .post-excerpt,
  .page-excerpt {
    font-size: 1.1rem;
  }

  .post-content,
  .page-content {
    font-size: 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .site-nav {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .site-main {
    padding: 1.5rem 1rem;
  }

  .site-intro {
    padding: 1.5rem;
  }

  .featured-post-image {
    height: 200px;
  }

  .post-template,
  .page-template {
    padding: 1.5rem 1rem;
  }

  .podcast-template .post-header {
    margin: -1.5rem -1rem 2rem -1rem;
    padding: 1.5rem 1rem;
  }
}

/* Ghost-specific adjustments */
.kg-card {
  margin: 2rem 0;
}

.kg-embed-card {
  display: flex;
  justify-content: center;
}

.kg-image-card img {
  border-radius: var(--radius);
}

.kg-gallery-card {
  margin: 2rem 0;
}

.kg-gallery-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kg-gallery-row {
  display: flex;
  gap: 0.5rem;
}

.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.kg-bookmark-card {
  background: var(--light-gray);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.kg-bookmark-card:hover {
  box-shadow: var(--shadow);
}

.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: var(--text);
}

.kg-bookmark-content {
  flex: 1;
  padding: 1.5rem;
}

.kg-bookmark-title {
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.kg-bookmark-description {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.kg-bookmark-thumbnail {
  min-width: 200px;
  max-width: 200px;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Audio/Video Cards */
.kg-audio-card,
.kg-video-card {
  margin: 2rem 0;
}

.kg-audio-player,
.kg-video-player {
  border-radius: var(--radius);
  overflow: hidden;
}
