:root {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --card: #ffffff;
  --border: #e2e8f0;
  --accent: #0ea5a4;
  --accent-hover: #0d9488;
  --transition: all .3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font: 16px/1.6 Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Layout */
.container {
  display: flex;
  max-width: 1000px;
  margin: 40px auto;
  gap: 20px;
  padding: 0 20px;
}
.main { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* Post header */
.post-header img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 20px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 20px;
}
.meta i { margin-right: 6px; }

.post-title {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 20px;
}

.post-content { margin-bottom: 30px; }
.post-content p { margin-bottom: 1rem; color: var(--text); }

/* Tags */
.post-tags { margin-bottom: 15px; }
.post-tags span { font-weight: bold; margin-right: 10px; }
.post-tags a { margin-right: 8px; color: var(--muted); }

/* Share */
.share-buttons {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 10px;
  margin-bottom: 40px;
}
.share-buttons span {
  font-weight: bold; margin-right: 8px; color: var(--text);
}
.share-buttons a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: #fff; transition: var(--transition);
}
.share-buttons a:hover { transform: translateY(-2px); }
.share-buttons a.fb { background: #3b5998; }
.share-buttons a.twitter { background: #1da1f2; }
.share-buttons a.linkedin { background: #0077b5; }
.share-buttons a.reddit { background: #ff4500; }
.share-buttons a.pinterest { background: #bd081c; }
.share-buttons a.whatsapp { background: #25d366; }
.share-buttons a.telegram { background: #0088cc; }
.share-buttons a.mail { background: var(--border); color: var(--text); }
.share-buttons i { font-size: 1rem; line-height: 1; }

/* Comment form */
.comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 40px;
}
.comment-form h4 { color: var(--accent); margin-bottom: 15px; }
.comment-form input,
.comment-form textarea {
  width: 100%; padding: 10px;
  background: #ffffff; color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px; margin-bottom: 15px;
}
.comment-form button {
  padding: 10px 20px; border: 1px solid var(--accent);
  background: var(--accent); color: #ffffff;
  border-radius: 4px; cursor: pointer; transition: var(--transition);
}
.comment-form button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Comments */
.comments-section { margin-bottom: 40px; }
.comments-section h2 { color: var(--accent); font-size: 1.5rem; margin-bottom: 20px; }
.comment-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px; margin-bottom: 20px;
}
.comment-author {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.comment-author img {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
}
.author-meta strong { color: var(--accent); }
.author-meta span { color: var(--muted); font-size: .85rem; }
.comment-card p { margin-bottom: 16px; color: var(--text); }
.comment-date {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: .85rem;
  border-top: 1px solid var(--border); padding-top: 12px;
}

/* Sidebar widgets */
.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px; margin-bottom: 20px;
}
.widget h4 {
  margin-bottom: 15px; color: var(--accent);
  border-bottom: 1px solid var(--border); padding-bottom: 5px;
}
.widget ul { list-style: none; padding: 0; }
.widget li {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.widget img {
  width: 50px; height: 50px; object-fit: cover; border-radius: 4px;
}
.categories a { flex: 1; color: var(--text); }
.categories span { color: var(--muted); }

/* Tag pills */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tags a {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: .85rem; color: var(--text);
}

/* Search */
.search-form { display: flex; gap: 6px; margin-bottom: 10px; }
.search-form input {
  flex: 1; padding: 8px; background: #ffffff; color: var(--text);
  border: 1px solid var(--border); border-radius: 4px 0 0 4px;
}
.search-form button {
  padding: 0 10px; border: 1px solid var(--accent);
  background: var(--accent); color: #ffffff;
  border-radius: 0 4px 4px 0; cursor: pointer; transition: var(--transition);
}
.search-form button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Avatar icon (fallback) */
.avatar-icon { font-size: 48px; color: var(--muted); }

/* Back to top */
.up-to-top {
  position: fixed; right: 20px; bottom: 40px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; cursor: pointer; transition: var(--transition); z-index: 100;
  border: 1px solid var(--accent);
}
.up-to-top:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Subscribe */
.widget.subscribe-widget {}
.subscribe-description {
  margin: 0 0 12px; color: var(--muted);
  font-size: .95rem; line-height: 1.4;
}
.subscribe-form { display: flex; width: 100%; gap: 6px; }
.subscribe-form input[type="email"] {
  flex: 1; min-width: 0; padding: 8px;
  border: 1px solid var(--border);
  border-radius: 4px 0 0 4px;
  background: #ffffff; color: var(--text);
  font-size: .95rem; box-sizing: border-box;
}
.subscribe-form button {
  flex: 0 0 auto; padding: 0 12px;
  border: 1px solid var(--accent);
  background: var(--accent); color: #ffffff;
  border-radius: 0 4px 4px 0; cursor: pointer; transition: var(--transition);
  font-size: .95rem;
}
.subscribe-form button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Flash messages */
.flash { padding: 10px; border-radius: 6px; margin-bottom: 15px; font-weight: bold; }
.flash-success { background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; }
.flash-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Responsive */
@media (max-width: 768px) {
  .container { flex-direction: column; padding: 0 16px; gap: 16px; }
  .main { order: 1; }
  .sidebar { order: 2; width: 100%; margin-top: 24px; }

  .post-header img { margin-bottom: 16px; }

  .meta { flex-wrap: wrap; gap: 12px; justify-content: center; font-size: .85rem; }

  .post-title { font-size: 1.75rem; text-align: center; margin-bottom: 16px; }

  .post-content p { font-size: 1rem; line-height: 1.5; margin-bottom: 1rem; }

  .post-tags { text-align: center; margin-bottom: 20px; }

  .share-buttons { justify-content: center; gap: 8px; margin-bottom: 32px; }

  .comment-form { padding: 16px; }
  .comment-form h4 { text-align: center; }
  .comment-form input, .comment-form textarea { padding: 8px; }
  .comment-form button { width: 100%; padding: 12px; }

  .comments-section h2 { text-align: center; margin-bottom: 16px; }
  .comment-card { padding: 16px; }
  .comment-author { justify-content: center; }
  .comment-author img { width: 40px; height: 40px; }
  .comment-date { justify-content: center; padding-top: 8px; }

  .widget { padding: 16px; }
  .widget ul li { flex-direction: column; align-items: flex-start; }
  .widget img { width: 100%; height: auto; margin-bottom: 8px; }

  .tags { justify-content: center; }

  .search-form input { padding: 6px; font-size: .9rem; }
  .search-form button { padding: 0 10px; font-size: .9rem; }

  .up-to-top { right: 16px; bottom: 24px; }
}

@media (max-width: 767px) {
  :root { font-size: 14px; }
  .container { padding: 0 12px; gap: 12px; }
  .post-title { font-size: 1.5rem; }
  .meta { font-size: .8rem; }
  .comment-form h4, .widget h4 { font-size: 1.2rem; }
  .flash { font-size: .9rem; }
  .share-buttons a { width: 32px; height: 32px; }
}
