/* ============================================
   Your Site About Computing - Modern Design
   ============================================ */

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

:root {
  --bg: #f0f4f8;
  --header-bg: #0f172a;
  --card-bg: #ffffff;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --tag-bg: #eff6ff;
  --tag-color: #1d4ed8;
  --footer-bg: #0f172a;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-sm: 5px;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

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

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

.site-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #f8fafc;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-logo:hover { color: #93c5fd; text-decoration: none; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
}

.main-nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

/* ---- Page Wrapper (2-col layout) ---- */
.page-wrapper {
  max-width: 1200px;
  margin: 36px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb .sep { color: #cbd5e1; font-size: 0.75rem; }

/* ---- Card ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 36px;
  margin-bottom: 28px;
}

/* ---- Post Header ---- */
.post-header { margin-bottom: 22px; }

.post-title {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.post-meta {
  font-size: 0.83rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 14px;
}

.post-meta a { color: var(--accent); font-weight: 500; }

/* ---- Featured Image ---- */
.post-thumbnail {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.post-thumbnail img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* ---- Share Buttons ---- */
.share-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.share-btn:hover { opacity: 0.87; text-decoration: none; transform: translateY(-1px); }
.share-btn.twitter { background: #1da1f2; color: #fff; }
.share-btn.facebook { background: #1877f2; color: #fff; }

/* ---- Ads ---- */
.ad-wrap {
  float: right;
  margin: 0 0 20px 24px;
  max-width: 336px;
}

/* ---- Entry / Article Body ---- */
.entry {
  font-size: 1rem;
  line-height: 1.75;
}

.entry h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.entry h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--text);
}

.entry p {
  margin-bottom: 16px;
  text-align: justify;
}

.entry ul, .entry ol {
  margin: 0 0 16px 26px;
}

.entry li { margin-bottom: 6px; }

.entry img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  margin: 12px 0;
  max-width: 100%;
  height: auto;
  display: inline;
}

.entry img.alignleft {
  float: left;
  margin: 4px 22px 16px 0;
}

.entry img.alignright {
  float: right;
  margin: 4px 0 16px 22px;
}

.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* ---- Post Tags ---- */
.post-tags {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.post-tags-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}

.post-tags ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.post-tags li a {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 4px 13px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  transition: background 0.15s, color 0.15s;
}

.post-tags li a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ---- Post Navigation ---- */
.post-nav-wrap {
  display: flex;
  justify-content: space-between;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.post-nav-link { display: flex; flex-direction: column; gap: 4px; max-width: 48%; }
.post-nav-link.next { text-align: right; margin-left: auto; }

.post-nav-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 600;
}

.post-nav-link a {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  line-height: 1.35;
}

/* ---- Related Posts ---- */
.related-posts { margin-top: 32px; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.related-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.1s;
}

.related-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.related-data { padding: 12px; }

.related-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}

.related-item a { text-decoration: none; }
.related-item:hover .related-title { color: var(--accent); }

/* ---- Sidebar ---- */
.sidebar-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 22px;
  margin-bottom: 24px;
}

.widget-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--accent);
}

.recent-posts-list { list-style: none; }

.recent-posts-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.recent-posts-list li:last-child { border-bottom: none; }

.recent-posts-list a {
  font-size: 0.875rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.45;
}

.recent-posts-list a:hover { color: var(--accent); text-decoration: none; }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-cloud a {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

.tag-cloud a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--footer-bg);
  color: #94a3b8;
  margin-top: 48px;
  padding: 52px 0 28px;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer-widget-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 18px;
  letter-spacing: 0.03em;
}

.subscribe-form p { margin-bottom: 14px; font-size: 0.9rem; line-height: 1.6; }

.subscribe-form input[type="email"] {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  background: #1e293b;
  color: #e2e8f0;
  font-size: 0.9rem;
  margin-bottom: 10px;
  outline: none;
  font-family: inherit;
}

.subscribe-form input[type="email"]:focus { border-color: var(--accent); }

.subscribe-form input[type="submit"] {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.subscribe-form input[type="submit"]:hover { background: var(--accent-hover); }

.footer-bottom {
  border-top: 1px solid #1e293b;
  margin-top: 36px;
  padding-top: 20px;
  font-size: 0.83rem;
}

.footer-bottom a { color: #64748b; }
.footer-bottom a:hover { color: #94a3b8; text-decoration: none; }

/* ---- Page / Archive layouts ---- */
.page-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.archive-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.posts-grid { display: grid; gap: 26px; }

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
  display: flex;
}

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

.post-card-thumb {
  flex-shrink: 0;
  width: 180px;
}

.post-card-thumb img {
  width: 180px;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-body { padding: 20px 22px; flex: 1; }

.post-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

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

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

.post-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  align-items: center;
}

.post-card-meta a { color: var(--accent); font-weight: 500; }

/* ---- Homepage hero ---- */
.home-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #0f4c8c 100%);
  color: #fff;
  padding: 72px 24px 56px;
  text-align: center;
}

.home-hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 18px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.home-hero p {
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ---- Privacy page ---- */
.privacy-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
}

.privacy-content p { margin-bottom: 14px; }

/* ---- Tag archive page ---- */
.tag-hero {
  background: var(--header-bg);
  color: #fff;
  padding: 48px 24px 40px;
  text-align: center;
}

.tag-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.tag-hero p { color: #94a3b8; font-size: 0.95rem; }

/* ---- Feed pages ---- */
.feed-page {
  max-width: 680px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
}

.feed-page h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.feed-page p { color: var(--text-muted); margin-bottom: 20px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }
  .post-card { flex-direction: column; }
  .post-card-thumb { width: 100%; }
  .post-card-thumb img { width: 100%; height: 200px; }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 14px 20px;
    gap: 10px;
  }
  .main-nav ul { flex-wrap: wrap; justify-content: center; }
  .post-title { font-size: 1.45rem; }
  .home-hero h1 { font-size: 1.8rem; }
  .card { padding: 20px; }
  .ad-wrap { float: none; margin: 0 auto 20px; display: block; text-align: center; }
}
