/*
Theme Name: DocPolish
Theme URI: https://www.docpolish.io
Description: Official DocPolish blog theme — navy, gold, privacy-first.
Version: 1.0.0
Author: DocPolish
*/

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --navy:       #0d1b3e;
  --navy-mid:   #162548;
  --navy-light: #1e3160;
  --gold:       #f0c040;
  --gold-dark:  #c9961a;
  --white:      #ffffff;
  --off-white:  #f7f8fc;
  --text:       #1a2744;
  --text-muted: #5a6782;
  --border:     #e2e6f0;
  --radius:     8px;
  --max-w:      1160px;
  --font:       'Inter', 'Segoe UI', system-ui, sans-serif;
  --bg:         #f7f8fc;
  --gold-soft:  #f5e3a8;
}

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

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

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ── Header ───────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-branding:hover { text-decoration: none; }

.site-branding .logo-mark {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.site-branding .site-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.site-branding .site-tagline {
  font-size: 0.7rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-top: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.site-nav .btn-cta {
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  padding: 7px 16px;
}

.site-nav .btn-cta:hover {
  background: #f5ce55;
  color: var(--navy);
}

/* ── Hero / page header ───────────────────────────────────────────────────── */
.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 56px 0 48px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.page-hero h1 span { color: var(--gold); }

.page-hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  margin: 0 auto;
}

/* ── Blog grid ────────────────────────────────────────────────────────────── */
.blog-main {
  padding: 48px 0 80px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

/* ── Post card ────────────────────────────────────────────────────────────── */
.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
  box-shadow: 0 8px 32px rgba(13,27,62,0.12);
  transform: translateY(-2px);
}

.post-card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--navy-mid);
}

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

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

.post-card-thumb .thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.post-card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.post-card-tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(240,192,64,0.12);
  color: var(--gold-dark);
  padding: 2px 8px;
  border-radius: 4px;
}

.post-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
  color: var(--text);
}

.post-card h2 a:hover { color: var(--navy-light); text-decoration: none; }

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.read-more {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.15s, color 0.15s;
}

.read-more:hover { color: var(--gold-dark); gap: 8px; text-decoration: none; }
.read-more::after { content: '→'; }

/* ── Single post ──────────────────────────────────────────────────────────── */
.single-hero {
  background: var(--navy);
  padding: 48px 0 0;
}

.single-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.single-hero .post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.single-hero .post-meta a {
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.single-hero .post-meta .sep { color: rgba(255,255,255,0.3); }
.single-hero .post-meta .date { color: rgba(255,255,255,0.6); font-size: 0.8rem; }

.single-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
}

.single-hero .post-excerpt {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  max-width: 640px;
}

.single-featured-img {
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.single-featured-img img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.single-content-wrap {
  background: var(--white);
  border-radius: 0 0 12px 12px;
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 40px 48px 48px;
  box-shadow: 0 4px 24px rgba(13,27,62,0.08);
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-weight: 700;
  color: var(--navy);
  margin: 1.8em 0 0.6em;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.entry-content h2 { font-size: 1.45rem; }
.entry-content h3 { font-size: 1.2rem; }
.entry-content h4 { font-size: 1.05rem; }

.entry-content p { margin-bottom: 1.2em; }

.entry-content a { color: var(--navy-light); text-decoration: underline; }
.entry-content a:hover { color: var(--gold-dark); }

.entry-content ul,
.entry-content ol {
  margin: 0.8em 0 1.2em 1.6em;
}

.entry-content li { margin-bottom: 0.4em; }

.entry-content blockquote {
  border-left: 4px solid var(--gold);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: rgba(240,192,64,0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.entry-content pre,
.entry-content code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.88em;
}

.entry-content pre {
  background: var(--navy);
  color: #e8eaf0;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5em 0;
}

.entry-content code {
  background: rgba(13,27,62,0.07);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.entry-content th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
}

.entry-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.entry-content tr:nth-child(even) td { background: var(--off-white); }

/* ── Post tags ────────────────────────────────────────────────────────────── */
.post-tags {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags .tag-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
  align-self: center;
}

.post-tags a {
  background: var(--off-white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  transition: background 0.15s, color 0.15s;
}

.post-tags a:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  text-decoration: none;
}

/* ── Back nav ─────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 32px;
  transition: color 0.15s;
}

.back-link::before { content: '←'; }
.back-link:hover { color: var(--navy); text-decoration: none; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.pagination a,
.pagination .current {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--white);
  transition: background 0.15s, color 0.15s;
}

.pagination a:hover { background: var(--navy); color: var(--white); border-color: var(--navy); text-decoration: none; }
.pagination .current { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 40px 0;
  text-align: center;
  font-size: 0.85rem;
  border-top: 2px solid var(--gold);
}

.site-footer a { color: var(--gold); }
.site-footer a:hover { color: #f5ce55; }

.site-footer .footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* ── Article CTA banner ───────────────────────────────────────────────────── */
.polish-cta {
  background: var(--navy);
  border-top: 2px solid var(--gold);
  padding: 56px 0;
}

.polish-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}

.polish-cta-text h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}

.polish-cta-text p {
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  line-height: 1.6;
}

.btn-cta-lg {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  flex-shrink: 0;
}

.btn-cta-lg:hover {
  background: #f5ce55;
  transform: translateY(-1px);
  text-decoration: none;
}

@media (max-width: 700px) {
  .polish-cta-inner { flex-direction: column; align-items: flex-start; }
  .btn-cta-lg { width: 100%; text-align: center; }
}

/* ── No-posts state ───────────────────────────────────────────────────────── */
.no-posts {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.no-posts h2 { font-size: 1.5rem; margin-bottom: 8px; color: var(--text); }

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gold-soft);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Share bar ───────────────────────────────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.share-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all .2s ease;
  cursor: pointer;
}
.share-btn:hover { background: var(--gold-soft); border-color: var(--gold); }
.share-x:hover { background: #000; color: #fff; border-color: #000; }
.share-li:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.share-fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; }

/* ── Related posts ─────────────────────────────────────────────────────────── */
.related-posts {
  background: var(--bg);
  padding: 48px 0 64px;
}
.related-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 24px;
}

/* ── Footer grid ─────────────────────────────────────────────────────────── */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 32px;
  padding: 48px 0 32px;
}
.footer-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.footer-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.footer-brand p { color: var(--text-muted); font-size: .9rem; margin-top: 4px; }
.footer-links h4,
.footer-newsletter h4 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.footer-links a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  margin-bottom: 8px;
  transition: color .2s;
}
.footer-links a:hover { color: var(--gold); }
.footer-newsletter p { color: var(--text-muted); font-size: .9rem; margin-bottom: 12px; }
.newsletter-form {
  display: flex;
  gap: 8px;
}
.newsletter-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
}
.newsletter-form button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: opacity .2s;
}
.newsletter-form button:hover { opacity: .85; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid #2a3a5e;
  font-size: .85rem;
  color: #8a9bb8;
}
.footer-social a {
  color: #8a9bb8;
  text-decoration: none;
  margin-left: 16px;
  font-size: .85rem;
  transition: color .2s;
}
.footer-social a:hover { color: var(--gold); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .single-content-wrap { padding: 28px 22px 36px; }
  .single-hero-inner { padding: 0 20px 32px; }
  .site-nav .btn-cta { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .share-bar { gap: 8px; }
}
