/*
Theme Name:  Sentry Log
Theme URI:   https://example.com/sentry-log
Author:      Sentry Log
Author URI:  https://example.com
Description: A clean, minimalist WordPress theme for AI security blogs. Inspired by editorial clarity — white backgrounds, strong typography, focused content.
Version:     1.0.0
License:     GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sentry-log
Tags:        blog, minimal, clean, one-column, two-columns, custom-menu, featured-images
*/

/* ─────────────────────────────────────────
   VARIABLES
───────────────────────────────────────── */
:root {
  --white:       #ffffff;
  --bg:          #ffffff;
  --surface:     #f8f9fa;
  --border:      #e8eaed;
  --border-mid:  #dadce0;
  --accent:      #1a73e8;
  --accent-dark: #1558b0;
  --danger:      #d93025;
  --text:        #3c4043;
  --muted:       #80868b;
  --heading:     #1a1a1a;
  --sans:        'DM Sans', sans-serif;
  --serif:       'DM Serif Display', serif;
  --radius:      8px;
  --radius-pill: 100px;
  --max-width:   1160px;
  --nav-height:  75px;
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ─────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 32px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.site-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--heading);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-logo-mark svg {
  width: 16px;
  height: 16px;
  fill: white;
}

.site-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: -0.01em;
}

.site-title span {
  color: var(--accent);
}

/* Primary nav menu */
.primary-nav ul {
  display: flex;
  gap: 4px;
}

.primary-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.primary-nav a:hover,
.primary-nav .current-menu-item a,
.primary-nav .current_page_item a {
  color: var(--heading);
  background: var(--surface);
}

/* Nav search */
.nav-search {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-search:hover {
  color: var(--heading);
  background: var(--surface);
}

.nav-search svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--heading);
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ─────────────────────────────────────────
   CATEGORY FILTER PILLS
───────────────────────────────────────── */
.category-filters {
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filters::-webkit-scrollbar { display: none; }

.filters-inner {
  display: flex;
  gap: 8px;
  padding: 14px 0;
  white-space: nowrap;
}

.filter-pill {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--border-mid);
  color: var(--heading);
  background: var(--surface);
}

.filter-pill.active,
.filter-pill:focus {
  background: var(--heading);
  border-color: var(--heading);
  color: white;
}

/* ─────────────────────────────────────────
   HERO FEATURED POST
───────────────────────────────────────── */
.hero-section {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero-content {}

.hero-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.hero-title a { color: inherit; transition: color 0.15s; }
.hero-title a:hover { color: var(--accent); }

.hero-excerpt {
  font-size: 16px;
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 24px;
  font-weight: 300;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.hero-meta .author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
}

.hero-meta .meta-sep { color: var(--border-mid); }

.hero-image {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--surface);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hero-image:hover img { transform: scale(1.02); }

.hero-image .placeholder-img {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8f0fe 0%, #d2e3fc 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image .placeholder-img svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
}

/* ─────────────────────────────────────────
   SECTION HEADING
───────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 0 28px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--heading);
  letter-spacing: 0.03em;
}

.section-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s;
}

.section-link:hover { gap: 8px; }

/* ─────────────────────────────────────────
   POST GRID
───────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 48px;
}

.post-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.post-card-image {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--surface);
  margin-bottom: 16px;
  flex-shrink: 0;
}

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

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

.post-card-image .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category colors */
.placeholder-img.cat-research   { background: #e8f0fe; }
.placeholder-img.cat-threat     { background: #fce8e6; }
.placeholder-img.cat-tools      { background: #e6f4ea; }
.placeholder-img.cat-policy     { background: #fef7e0; }
.placeholder-img.cat-default    { background: var(--surface); }

.post-card-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.post-card-category.cat-threat  { color: var(--danger); }
.post-card-category.cat-tools   { color: #1e8e3e; }
.post-card-category.cat-policy  { color: #b06000; }

.post-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--heading);
  line-height: 1.3;
  margin-bottom: 10px;
  flex: 1;
}

.post-card-title a { color: inherit; transition: color 0.15s; }
.post-card-title a:hover { color: var(--accent); }

.post-card-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
}

.post-card-meta .author { font-weight: 500; }

/* ─────────────────────────────────────────
   LOAD MORE
───────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 0 64px;
}

.btn-load-more {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--heading);
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-pill);
  padding: 10px 28px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-load-more:hover {
  border-color: var(--heading);
  background: var(--surface);
}

/* WordPress pagination */
.posts-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 0 64px;
}

.posts-pagination .page-numbers {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.posts-pagination .page-numbers:hover,
.posts-pagination .page-numbers.current {
  color: var(--heading);
  border-color: var(--heading);
  background: var(--surface);
}

/* ─────────────────────────────────────────
   NEWSLETTER BANNER
───────────────────────────────────────── */
.newsletter-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 40px 0;
}

.newsletter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.newsletter-text h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--heading);
  margin-bottom: 6px;
}

.newsletter-text p {
  font-size: 14px;
  color: var(--muted);
}

.newsletter-form {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.newsletter-input {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background: white;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 10px 16px;
  width: 240px;
  outline: none;
  transition: border-color 0.15s;
}

.newsletter-input::placeholder { color: var(--muted); }
.newsletter-input:focus { border-color: var(--accent); }

.newsletter-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.newsletter-btn:hover { background: var(--accent-dark); }

/* ─────────────────────────────────────────
   FOOTER
───────────────────────────────────────── */
.site-footer {
  padding: 40px 0 0;
  border-top: 1px solid var(--border);
}

.footer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
}

.footer-brand .site-title { font-size: 14px; }

.footer-nav ul {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.15s;
}

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

.footer-social {
  display: flex;
  gap: 8px;
}

.social-link {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}

.social-link:hover {
  border-color: var(--heading);
  color: var(--heading);
}

.social-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.15s;
}

.footer-legal a:hover { color: var(--heading); }

/* ─────────────────────────────────────────
   SINGLE POST PAGE
───────────────────────────────────────── */
.single-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.single-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.single-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 400;
  color: var(--heading);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.single-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.single-hero-image {
  max-width: 920px;
  margin: 40px auto;
  border-radius: 12px;
  overflow: hidden;
}

.single-hero-image img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

/* Post content */
.post-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 0 64px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  font-family: var(--serif);
  color: var(--heading);
  margin: 2em 0 0.6em;
  line-height: 1.25;
  font-weight: 400;
}

.post-content h2 { font-size: 28px; }
.post-content h3 { font-size: 22px; }
.post-content h4 { font-size: 18px; }

.post-content p {
  margin-bottom: 1.5em;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(26,115,232,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.post-content a:hover { text-decoration-color: var(--accent); }

.post-content ul,
.post-content ol {
  margin: 0 0 1.5em 1.5em;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  font-weight: 300;
}

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

.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 2em 0;
  padding: 4px 0 4px 24px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
}

.post-content pre,
.post-content code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.post-content pre {
  padding: 20px 24px;
  overflow-x: auto;
  margin: 1.5em 0;
  line-height: 1.6;
}

.post-content code { padding: 2px 6px; }
.post-content pre code { background: none; border: none; padding: 0; }

.post-content img {
  border-radius: var(--radius);
  margin: 1.5em 0;
}

.post-content figure { margin: 2em 0; }

.post-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Post tags */
.post-tags {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 40px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.post-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  transition: all 0.15s;
}

.post-tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Related posts */
.related-posts {
  border-top: 1px solid var(--border);
  padding: 48px 0 64px;
}

.related-posts .section-label { margin-bottom: 24px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ─────────────────────────────────────────
   404 PAGE
───────────────────────────────────────── */
.error-404 {
  text-align: center;
  padding: 120px 0;
}

.error-404 .error-code {
  font-family: var(--serif);
  font-size: 120px;
  font-weight: 400;
  color: var(--border);
  line-height: 1;
  margin-bottom: 16px;
}

.error-404 h2 {
  font-family: var(--serif);
  font-size: 28px;
  color: var(--heading);
  margin-bottom: 12px;
}

.error-404 p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 32px;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  transition: background 0.15s;
}

.btn-home:hover { background: var(--accent-dark); }

/* ─────────────────────────────────────────
   SEARCH OVERLAY
───────────────────────────────────────── */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}

.search-overlay.active { display: flex; }

.search-overlay-inner { width: 100%; max-width: 600px; padding: 0 32px; }

.search-overlay-form {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--heading);
  gap: 12px;
  padding-bottom: 12px;
}

.search-overlay-input {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--heading);
  background: none;
  border: none;
  outline: none;
  flex: 1;
}

.search-overlay-input::placeholder { color: var(--border-mid); }

.search-overlay-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

/* ─────────────────────────────────────────
   ARCHIVE / CATEGORY PAGE
───────────────────────────────────────── */
.archive-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}

.archive-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.archive-title {
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--heading);
}

.archive-description {
  font-size: 15px;
  color: var(--muted);
  margin-top: 10px;
}

/* ─────────────────────────────────────────
   NO POSTS
───────────────────────────────────────── */
.no-posts {
  text-align: center;
  padding: 80px 0;
  color: var(--muted);
}

.no-posts svg {
  width: 48px;
  height: 48px;
  stroke: var(--border-mid);
  fill: none;
  margin: 0 auto 16px;
}

/* ─────────────────────────────────────────
   UTILITY
───────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { gap: 36px; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }

  .primary-nav { display: none; }
  .primary-nav.open { display: block; position: absolute; top: var(--nav-height); left: 0; right: 0; background: white; border-bottom: 1px solid var(--border); padding: 12px 20px; }
  .primary-nav.open ul { flex-direction: column; }
  .nav-toggle { display: flex; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { order: -1; }

  .posts-grid { grid-template-columns: 1fr; gap: 24px; }

  .newsletter-inner { flex-direction: column; text-align: center; }
  .newsletter-form { flex-direction: column; width: 100%; }
  .newsletter-input { width: 100%; }
  .newsletter-btn { width: 100%; }

  .footer-main { flex-direction: column; gap: 20px; text-align: center; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }

  .related-grid { grid-template-columns: 1fr; }

  .single-header { padding: 36px 0 28px; }
}

@media (max-width: 480px) {
  .filters-inner { padding: 10px 0; }
  .hero-section { padding: 36px 0 32px; }
  .hero-title { font-size: 26px; }
  .single-title { font-size: 26px; }
}

/* ── Logo sizing fix ── */
.nav-inner {
  height: auto;
  min-height: 75px;
  padding: 8px 0;
}

.custom-logo-link {
  display: flex;
  align-items: center;
}

.custom-logo {
  height: 60px !important;
  width: auto !important;
  max-width: 200px;
  object-fit: contain;
  display: block;
}