@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --text: #111;
  --gray: #6b7280;
  --border: #e5e7eb;
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #121214;
  --text: #f4f4f5;
  --gray: #a1a1aa;
  --border: #1f2933;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.header {
  text-align: center;
  padding: 5rem 1rem 4rem;
}

.container {
  max-width: 760px;
  margin: auto;
  padding: 2rem 1rem;
}

.post-preview {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}

.post-preview img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.post-preview h2 {
  font-size: 1.5rem;
}

.date {
  color: var(--gray);
  font-size: 0.85rem;
}

.search-input {
  display: block;
  margin: auto;
  max-width: 420px;
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.article img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

.reactions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.comments textarea {
  width: 100%;
  min-height: 80px;
}

.comments ul {
  list-style: none;
  margin-top: 1rem;
}

.comments li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.footer {
  text-align: center;
  padding: 3rem;
  color: var(--gray);
}

/* ===============================
   LIKE BUTTON
================================ */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.25s ease;
}

.like-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.like-btn.liked {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  cursor: default;
}

.like-btn:disabled {
  opacity: 0.9;
}

/* ===============================
   COMMENTS
================================ */
.comments h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.comments form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comments textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  resize: vertical;
}

.comments textarea:focus {
  outline: none;
  border-color: var(--gray);
}

/* ===============================
   PUBLISH BUTTON
================================ */
.publish-btn {
  align-self: flex-start;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 999px;
  border: none;
  background: var(--text);
  color: white;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.publish-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ===============================
   COMMENT LIST
================================ */
.comments ul {
  margin-top: 2rem;
  list-style: none;
}

.comments li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.comments li p {
  margin-bottom: 0.4rem;
}

.comments li span {
  font-size: 0.8rem;
  color: var(--gray);
}

/* =================================
   DARK MODE FIX – COMMENTS & BUTTONS
================================= */

/* Textarea */
.comments textarea {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.comments textarea::placeholder {
  color: var(--gray);
}

/* Publish button */
.publish-btn {
  background: var(--text);
  color: var(--bg);
}

[data-theme="dark"] .publish-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Hover remains visible */
.publish-btn:hover {
  opacity: 0.85;
}

/* Comment text */
.comments li p {
  color: var(--text);
}

/* Comment date */
.comments li span {
  color: var(--gray);
}

/* =================================
   IMAGE SIZE – PREMIUM LOOK
================================= */

/* Images in article list (index) */
.post-preview img {
  max-height: 220px;
  object-fit: cover;
}

/* Image in article page */
.article img {
  max-height: 360px;
  object-fit: cover;
  margin-bottom: 2.5rem;
}

/* Center images nicely */
.post-preview img,
.article img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}

/* ===============================
   LIKE ANIMATION
================================ */
.like-btn {
  position: relative;
  overflow: hidden;
}

.like-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.6) 10%, transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.like-btn:hover::after {
  opacity: 1;
}

.like-btn.liked {
  animation: likePulse 0.6s ease;
}

@keyframes likePulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* ===============================
   COMMENTS ADMIN
================================ */
.comment {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
}

.replies {
  margin-top: 0.6rem;
}

.reply {
  font-size: 0.9rem;
  color: var(--gray);
  margin-left: 1rem;
}

.admin-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.admin-actions button {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.admin-actions button:hover {
  opacity: 0.8;
}

/* =================================
   AUTHOR BOX
================================= */

.author-box {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  margin-top: 4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: center;
}

.author-avatar img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
}

.author-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.author-name {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.author-bio {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.author-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.author-links a {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.author-links a:hover {
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
  .author-box {
    flex-direction: column;
    text-align: center;
  }
}


