/* The Piedmont Record — News Site Styles */
:root {
  --primary: #1a1a2e;
  --accent: #c41e3a;
  --text: #2d2d2d;
  --text-light: #6b6b6b;
  --bg: #ffffff;
  --bg-alt: #f5f5f5;
  --border: #e0e0e0;
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

/* Header */
.site-header {
  border-bottom: 3px solid var(--primary);
  background: var(--bg);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 20px;
  font-size: 0.8rem;
  color: var(--text-light);
}

.header-main {
  text-align: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.site-tagline {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 4px;
  font-style: italic;
}

/* Navigation */
.site-nav {
  background: var(--primary);
}

.site-nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0;
}

.site-nav li a {
  display: block;
  padding: 10px 20px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.site-nav li a:hover,
.site-nav li a.active {
  background: var(--accent);
  color: #fff;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* Featured Article */
.featured-article {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 30px;
}

.featured-article .article-image {
  min-height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 4rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #c41e3a 100%);
}

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

.featured-article .article-content h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 12px;
}

.featured-article .article-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.featured-article .article-summary {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}

/* Article Grid */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 20px;
  color: var(--primary);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  margin-bottom: 40px;
}

.article-card {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.article-card .card-image {
  height: 180px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 2.5rem;
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
}

.article-card .card-image[data-cat="Politics"] { background: linear-gradient(135deg, #1a1a2e 0%, #4a4a8a 100%); }
.article-card .card-image[data-cat="Business"] { background: linear-gradient(135deg, #2c3e50 0%, #27ae60 100%); }
.article-card .card-image[data-cat="Technology"] { background: linear-gradient(135deg, #0f0c29 0%, #302b63 100%); }
.article-card .card-image[data-cat="Science"] { background: linear-gradient(135deg, #1a2a6c 0%, #b21f1f 50%, #fdbb2d 100%); }
.article-card .card-image[data-cat="Health"] { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.article-card .card-image[data-cat="Sports"] { background: linear-gradient(135deg, #c41e3a 0%, #e74c3c 100%); }
.article-card .card-image[data-cat="Entertainment"] { background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%); }
.article-card .card-image[data-cat="World"] { background: linear-gradient(135deg, #2c3e50 0%, #4ca1af 100%); }

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

.article-card .card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.article-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-card h3:hover {
  color: var(--accent);
}

.article-card .card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 6px;
}

.article-card .card-summary {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* Sidebar Layout */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.sidebar {
  border-left: 1px solid var(--border);
  padding-left: 30px;
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 15px;
}

.sidebar-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-item h5 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.sidebar-item .item-meta {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: #ccc;
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.footer-section h4 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 15px;
}

.footer-section p,
.footer-section li {
  font-size: 0.8rem;
  line-height: 1.8;
}

.footer-section ul { list-style: none; }

.footer-section a { color: #aaa; }
.footer-section a:hover { color: #fff; }

.footer-bottom {
  max-width: 1200px;
  margin: 20px auto 0;
  padding-top: 20px;
  border-top: 1px solid #333;
  font-size: 0.75rem;
  text-align: center;
  color: #777;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 900px) {
  .featured-article { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 20px; }
  .footer-content { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-title { font-size: 1.8rem; }
  .article-grid { grid-template-columns: 1fr; }
  .site-nav ul { flex-wrap: wrap; justify-content: center; }
  .site-nav li a { padding: 8px 12px; font-size: 0.75rem; }
}

/* =========================================
   Admin Panel Overlay (hidden by default)
   ========================================= */
.admin-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  overflow-y: auto;
}

.admin-overlay.active { display: block; }

.admin-container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 30px;
  color: #e0e0e0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

.admin-header h1 {
  font-size: 1.4rem;
  color: #4fc3f7;
}

.admin-close {
  background: none;
  border: 1px solid #555;
  color: #999;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 0.85rem;
}

.admin-close:hover { border-color: #999; color: #fff; }

/* Admin Login */
.admin-login {
  max-width: 350px;
  margin: 100px auto;
  text-align: center;
}

.admin-login h2 {
  color: #4fc3f7;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.admin-login input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: #1a1a2e;
  border: 1px solid #333;
  color: #e0e0e0;
  font-size: 0.9rem;
}

.admin-login button {
  width: 100%;
  padding: 10px;
  background: #4fc3f7;
  color: #000;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-login button:hover { background: #29b6f6; }

.admin-login .error {
  color: #ef5350;
  font-size: 0.85rem;
  margin-top: 10px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 25px;
  border-bottom: 1px solid #333;
}

.admin-tab {
  padding: 10px 24px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
}

.admin-tab:hover { color: #ccc; }
.admin-tab.active { color: #4fc3f7; border-bottom-color: #4fc3f7; }

/* Admin Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: #1a1a2e;
  padding: 18px;
  border: 1px solid #2a2a4a;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #4fc3f7;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  margin-top: 4px;
}

/* Fingerprint Table */
.fp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.fp-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid #333;
  color: #4fc3f7;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.fp-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #222;
  color: #ccc;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-table tr:hover td { background: #1a1a2e; }

/* Fingerprint Detail */
.fp-detail {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  padding: 25px;
  margin-top: 20px;
}

.fp-detail h3 {
  color: #4fc3f7;
  margin-bottom: 15px;
  font-size: 1rem;
}

.fp-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.fp-field {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #222;
}

.fp-field .label {
  color: #888;
  font-size: 0.8rem;
}

.fp-field .value {
  color: #e0e0e0;
  font-size: 0.8rem;
  font-family: monospace;
  text-align: right;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Body scroll lock when admin overlay is open */
body.admin-open { overflow: hidden; }

/* Admin panel responsive */
@media (max-width: 900px) {
  .admin-container { padding: 15px; margin: 10px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-tabs { flex-wrap: wrap; }
  .admin-tab { padding: 8px 14px; font-size: 0.8rem; }
  .fp-detail-grid { grid-template-columns: 1fr; }
  .fp-detail { padding: 15px; }
  .fp-field .value { max-width: none; text-align: left; }
  .fp-field { flex-direction: column; gap: 2px; }
  .fp-table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-header { flex-direction: column; gap: 10px; }
  .admin-header h1 { font-size: 1.1rem; }
}

@media (max-width: 500px) {
  .admin-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .admin-tab { padding: 6px 10px; font-size: 0.75rem; }
  .admin-container { padding: 10px; margin: 5px; }
}

/* Accessibility: focus styles */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid #4fc3f7;
  outline-offset: 2px;
}

/* Admin text contrast fix */
.admin-tab { color: #aaa; }
.stat-card .stat-label { color: #aaa; }
