/* ========================================
   Selfouille CMS Styles
   Based on UltraZen Tumblr Theme
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
}

a {
  color: #333;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #999;
}

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

/* ========================================
   Layout
   ======================================== */

.wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 20px;
}

/* ========================================
   Header
   ======================================== */

.header {
  text-align: center;
  margin-bottom: 60px;
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 5px;
  color: #333;
  display: inline-block;
  margin-bottom: 15px;
}

.logo:hover {
  color: #333;
}

.tagline {
  color: #999;
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #999;
}

.nav a:hover {
  color: #333;
}

/* ========================================
   Posts
   ======================================== */

.posts {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.post {
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.post-image-link {
  display: block;
  margin-bottom: 20px;
}

.post-image {
  width: 100%;
  transition: opacity 0.2s ease;
}

.post-image-link:hover .post-image {
  opacity: 0.9;
}

.post-meta {
  text-align: center;
}

.post-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.post-title a {
  color: #333;
}

.post-title a:hover {
  color: #999;
}

.post-date {
  display: block;
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 10px;
}

.post-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  font-size: 0.75rem;
  color: #999;
}

.tag:hover {
  color: #333;
}

/* Single Post */
.post-single {
  margin-bottom: 40px;
}

.post-single .post-title {
  font-size: 1.25rem;
  margin-top: 20px;
}

.post-nav {
  text-align: center;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #f2f2f2;
}

.back-link {
  font-size: 0.875rem;
  color: #999;
}

.back-link:hover {
  color: #333;
}

/* ========================================
   Archive
   ======================================== */

.page-title,
.archive-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 40px;
  color: #333;
}

.archive {
  max-width: 400px;
  margin: 0 auto;
}

.archive-year {
  margin-bottom: 30px;
}

.archive-year-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: #333;
}

.archive-months {
  list-style: none;
}

.archive-month {
  margin-bottom: 8px;
}

.archive-month a {
  font-size: 0.875rem;
  color: #666;
  text-transform: capitalize;
}

.archive-month a:hover {
  color: #333;
}

.archive-month .count {
  color: #999;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #f2f2f2;
}

.pagination-link {
  font-size: 0.875rem;
  color: #999;
}

.pagination-link:hover {
  color: #333;
}

.pagination-info {
  font-size: 0.75rem;
  color: #999;
}

/* ========================================
   No Posts / Empty State
   ======================================== */

.no-posts {
  text-align: center;
  color: #999;
  font-size: 0.875rem;
  padding: 40px 0;
}

.no-posts a {
  color: #333;
  text-decoration: underline;
}

/* ========================================
   Error Pages
   ======================================== */

.error-page {
  text-align: center;
  padding: 80px 0;
}

.error-page h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 4rem;
  font-weight: 700;
  color: #ddd;
  margin-bottom: 20px;
}

.error-page p {
  color: #999;
  margin-bottom: 30px;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  text-align: center;
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid #f2f2f2;
}

.footer p {
  font-size: 0.75rem;
  color: #999;
}

/* ========================================
   Admin Styles
   ======================================== */

.admin-body {
  background: #f5f5f5;
  min-height: 100vh;
}

/* Admin Login/Setup */
.admin-login {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.admin-logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #333;
  display: block;
  margin-bottom: 30px;
}

.admin-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.admin-subtitle {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 30px;
}

.admin-back {
  margin-top: 30px;
  font-size: 0.875rem;
}

.admin-back a {
  color: #999;
}

/* Admin Wrapper */
.admin-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-nav a {
  font-size: 0.875rem;
  color: #666;
}

.admin-user {
  font-size: 0.875rem;
  color: #999;
}

.btn-logout {
  color: #e74c3c !important;
}

.admin-main {
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-main h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 30px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.admin-toolbar h1 {
  margin-bottom: 0;
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #f2f2f2;
}

.admin-table th {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
}

.admin-table td {
  font-size: 0.875rem;
}

.admin-thumbnail {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.inline-form {
  display: inline;
}

.admin-pagination {
  margin-top: 30px;
  border-top: none;
  padding-top: 20px;
}

/* Forms */
.admin-form,
.editor-form {
  text-align: left;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: border-color 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #333;
}

.form-group input[type="file"] {
  font-size: 0.875rem;
}

.current-image {
  margin-bottom: 15px;
}

.current-image img {
  max-width: 300px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.image-note {
  font-size: 0.75rem;
  color: #999;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #333;
  color: #fff;
}

.btn-primary:hover {
  background: #555;
  color: #fff;
}

.btn-secondary {
  background: #f5f5f5;
  color: #333;
}

.btn-secondary:hover {
  background: #e5e5e5;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.7rem;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

/* Alerts */
.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 0.875rem;
}

.alert-error {
  background: #fce4e4;
  color: #c0392b;
  border: 1px solid #f5c6cb;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
  .wrapper {
    padding: 40px 15px;
  }

  .header {
    margin-bottom: 40px;
  }

  .logo {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }

  .nav {
    gap: 20px;
  }

  .posts {
    gap: 40px;
  }

  .admin-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .admin-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .admin-toolbar {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .admin-toolbar h1 {
    text-align: center;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) {
    display: none;
  }

  .admin-thumbnail {
    width: 60px;
    height: 45px;
  }

  .admin-actions {
    flex-direction: column;
    gap: 5px;
  }
}
