/* =====================================================
   Photo Blogger Site - Stylesheet
   ===================================================== */

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

:root {
  --primary: #ff6b6b;
  --primary-dark: #ee5a52;
  --accent: #4ecdc4;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --bg: #fafafa;
  --card: #ffffff;
  --border: #e8e8e8;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.25s ease;
}

body {
  font-family: 'Prompt', 'Segoe UI', 'Tahoma', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.logo:hover { color: var(--primary); }
.logo-mark { font-size: 1.6rem; }

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex: 1;
}
.main-nav a, .nav-dropdown-toggle {
  color: var(--text);
  font-weight: 500;
  padding: 0.5rem 0;
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}
.main-nav a:hover, .nav-dropdown-toggle:hover { color: var(--primary); }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  border-radius: var(--radius);
  min-width: 200px;
  padding: 0.5rem;
  z-index: 50;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 8px;
}
.nav-dropdown-menu a:hover { background: #f0f0f0; }

.search-box {
  display: flex;
  background: #f5f5f5;
  border-radius: 24px;
  padding: 0.25rem 0.25rem 0.25rem 1rem;
  align-items: center;
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  width: 200px;
  font-family: inherit;
  font-size: 0.95rem;
}
.search-box button {
  background: var(--primary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: white;
  font-size: 1rem;
}
.search-box button:hover { background: var(--primary-dark); }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---------- Main ---------- */
.site-main {
  padding: 2rem 0 4rem;
  min-height: 60vh;
}
.container-main { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

.page-title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-left: 1rem;
}
.page-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 5px;
  background: var(--primary);
  border-radius: 3px;
}

/* ---------- Hero / Featured ---------- */
.hero-featured {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.hero-featured img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  color: white;
}
.hero-overlay .badge {
  display: inline-block;
  background: var(--primary);
  padding: 0.25rem 0.8rem;
  border-radius: 16px;
  font-size: 0.85rem;
  width: fit-content;
  margin-bottom: 0.75rem;
}
.hero-overlay h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.hero-overlay a { color: white; }

/* ---------- Post grid ---------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.post-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}
.post-card-img {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #eee;
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-cat {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.post-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  flex: 1;
}
.post-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-light);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ---------- Single Post ---------- */
.post-single {
  max-width: 820px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.post-single .post-cat {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.9rem;
  border-radius: 16px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.post-single h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.post-meta {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.post-cover img { width: 100%; }

.post-content {
  font-size: 1.05rem;
  line-height: 1.9;
}
.post-content p { margin-bottom: 1.2rem; }
.post-content img { border-radius: 8px; margin: 1rem 0; }
.post-content h2, .post-content h3 { margin: 1.5rem 0 0.75rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}
.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 0.5rem;
  font-size: 0.85rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-caption { transform: translateY(0); }

.post-tags {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.tag {
  display: inline-block;
  background: #f0f0f0;
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  font-size: 0.85rem;
  color: var(--text);
  margin-right: 0.4rem;
  margin-bottom: 0.4rem;
}
.tag:hover { background: var(--primary); color: white; }

/* ---------- About ---------- */
.about-box {
  max-width: 820px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}
.about-box h1 { margin-bottom: 1rem; font-size: 2rem; }
.about-contact {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.about-contact h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.contact-item {
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

/* ---------- Pagination / Empty ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }

.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}
.pagination a, .pagination span {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 0.95rem;
}
.pagination a:hover, .pagination .current {
  background: var(--primary);
  color: white;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #2c3e50;
  color: #ddd;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.footer-col h4 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #bbb; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid #34495e;
  color: #999;
  font-size: 0.9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .mobile-toggle { display: block; }
  .main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 1rem;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .main-nav.open { display: flex; }
  .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .hero-overlay h2 { font-size: 1.3rem; }
  .hero-featured img { height: 280px; }
  .post-single { padding: 1.5rem; }
  .post-single h1 { font-size: 1.5rem; }
}

/* =====================================================
   Admin Panel Styles
   ===================================================== */
.admin-body { background: #f4f6f9; min-height: 100vh; }

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #1e293b;
  color: white;
  padding: 1.5rem 0;
}
.admin-sidebar .brand {
  padding: 0 1.5rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 1px solid #334155;
  margin-bottom: 1rem;
}
.admin-sidebar nav a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #cbd5e1;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: #334155;
  color: white;
  border-left-color: var(--primary);
}

.admin-main { padding: 2rem; overflow-x: auto; }
.admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.admin-header-bar h1 { font-size: 1.5rem; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card.green { border-left-color: #10b981; }
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.orange { border-left-color: #f59e0b; }
.stat-card .num {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.25rem 0;
}
.stat-card .label { color: var(--text-light); font-size: 0.9rem; }

.admin-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.admin-card h3 { margin-bottom: 1rem; font-size: 1.15rem; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
}
.data-table tr:hover { background: #f9fafb; }
.data-table img.thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}
.status-published { background: #d1fae5; color: #065f46; }
.status-draft { background: #fee2e2; color: #991b1b; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); color: white; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #10b981; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.95rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15);
}
textarea.form-control { resize: vertical; min-height: 200px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.help-text { font-size: 0.85rem; color: var(--text-light); margin-top: 0.25rem; }

.alert {
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 1rem;
}
.login-box {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
}
.login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.gallery-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

@media (max-width: 800px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
