/* ========================================
   DMC Group — Article & Admin Styles
   ======================================== */

/* --- Articles Grid (Homepage) --- */
.latest-articles {
  padding: var(--section-pad) 0;
  background: var(--slate-50);
}

.latest-articles .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.latest-articles .section-desc { margin: 0 auto; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.article-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  transition: all 0.4s var(--ease-out);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: 0 12px 36px rgba(15,26,46,0.06);
  transform: translateY(-4px);
}

.article-card-image {
  height: 180px;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 2rem;
  overflow: hidden;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-date {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.article-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.article-card-title a {
  transition: color 0.3s;
}

.article-card-title a:hover { color: var(--gold-500); }

.article-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
}

.article-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold-500);
  transition: gap 0.3s var(--ease-out);
}

.article-card-link:hover { gap: 0.6rem; }

/* --- Articles Listing Page --- */
.articles-page { padding: var(--section-pad) 0; }

.articles-list-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.article-list-item {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  transition: all 0.3s var(--ease-out);
}

.article-list-item:hover {
  box-shadow: 0 8px 24px rgba(15,26,46,0.06);
  transform: translateY(-2px);
}

.article-list-image {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 2rem;
}

.article-list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-list-content { display: flex; flex-direction: column; justify-content: center; }

.article-list-date {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.article-list-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 0.6rem;
  line-height: 1.35;
}

.article-list-title a { transition: color 0.3s; }
.article-list-title a:hover { color: var(--gold-500); }

.article-list-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
}

.pagination a {
  border: 1px solid var(--slate-200);
  color: var(--text-secondary);
}

.pagination a:hover {
  border-color: var(--navy-800);
  color: var(--navy-800);
}

.pagination span.current {
  background: var(--navy-800);
  color: var(--white);
}

/* --- Single Article Page --- */
.article-page { padding: var(--section-pad) 0; }

.article-hero {
  max-width: 800px;
  margin: 0 auto 3rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.article-date {
  font-size: 0.85rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.article-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-500);
  background: rgba(184,148,47,0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

.article-page-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--navy-800);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.article-page-excerpt {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 1rem;
  color: var(--navy-800);
}

.article-content h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--navy-800);
}

.article-content p { margin-bottom: 1.25rem; }

.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-content li { margin-bottom: 0.4rem; }

.article-content blockquote {
  border-left: 3px solid var(--gold-500);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--slate-50);
  border-radius: 0 8px 8px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content img {
  border-radius: 8px;
  margin: 1.5rem 0;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gold-500);
  margin-bottom: 2rem;
  transition: gap 0.3s;
}

.article-back:hover { gap: 0.7rem; }

/* --- Admin Styles --- */
.admin-body {
  background: var(--slate-50);
}

/* Login */
.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.admin-login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(15,26,46,0.08);
  border: 1px solid var(--slate-200);
}

.admin-login-card h2 {
  font-family: var(--font-heading);
  color: var(--navy-800);
  margin-bottom: 0.5rem;
}

.admin-login-card p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.admin-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.admin-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Dashboard */
.admin-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: var(--navy-800);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-topbar-brand {
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-topbar-brand .logo-mark {
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

.admin-topbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.admin-topbar-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  transition: color 0.3s;
}

.admin-topbar-links a:hover { color: var(--white); }

.admin-topbar-links .btn {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}

.admin-topbar-links .btn:hover { background: rgba(255,255,255,0.25); }

.admin-content {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--navy-800);
}

/* Article Table */
.admin-table {
  width: 100%;
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--slate-200);
  overflow: hidden;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 1rem 1.25rem;
  background: var(--slate-50);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  border-bottom: 1px solid var(--slate-200);
}

.admin-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.93rem;
  color: var(--text-primary);
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: var(--slate-50); }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.published { background: #dcfce7; color: #166534; }
.status-badge.draft { background: #fef3c7; color: #92400e; }

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-actions a, .admin-actions button {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.btn-edit {
  background: var(--slate-100);
  color: var(--text-primary);
}

.btn-edit:hover { background: var(--slate-200); }

.btn-delete {
  background: #fef2f2;
  color: #991b1b;
}

.btn-delete:hover { background: #fee2e2; }

/* Admin Form */
.admin-form {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--slate-200);
  padding: 2rem;
}

.admin-form .form-group { margin-bottom: 1.5rem; }

.admin-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text-primary);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(184,148,47,0.12);
}

.admin-form textarea { resize: vertical; }

.admin-form textarea.content-editor {
  min-height: 350px;
  line-height: 1.75;
  font-family: 'DM Sans', monospace;
}

.admin-form .checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-form .checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy-800);
}

.admin-form .form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--slate-200);
}

.admin-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

/* Empty state */
.admin-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.admin-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.admin-empty h3 {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .articles-grid { grid-template-columns: 1fr; }
  .article-list-item { grid-template-columns: 1fr; gap: 1rem; padding: 1.25rem; }
  .admin-table { overflow-x: auto; }
  .admin-table table { min-width: 600px; }
  .admin-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .admin-form .form-actions { flex-direction: column; }
  .admin-topbar { padding: 0 1rem; }
  .admin-topbar-links { gap: 0.75rem; }
}
