/* Shared theme, extracted from index.html, used by the blog pages */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #2a2a72;
  --secondary-color: #009ffd;
  --accent-color: #7d3cff;
  --text-color: #2d3436;
  --bg-color: #f9f9f9;
  --card-bg: #ffffff;
  --gradient: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  --transition-speed: 0.3s;
  --executive-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

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

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

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

/* Header / Nav */
header {
  background: var(--card-bg);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color var(--transition-speed);
}

.nav-links a:hover {
  color: var(--secondary-color);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: var(--text-color);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 1024px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    background: var(--card-bg);
    width: 100%;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    gap: 2rem;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }
}

/* Page header / hero */
.page-hero {
  background: var(--gradient);
  color: #fff;
  padding: 80px 20px;
  text-align: center;
}

.page-hero h1 {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.page-hero p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Section title */
.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 3rem;
  position: relative;
  font-weight: 700;
}

.section-title::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 4px;
  background: var(--secondary-color);
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-speed);
  font-size: 1rem;
  cursor: pointer;
  border: none;
}

.btn.primary {
  background: var(--accent-color);
  color: #fff;
}

.btn.primary:hover {
  background: #6b2cdd;
  transform: translateY(-2px);
}

.btn.secondary {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.btn.secondary:hover {
  background: rgba(125, 60, 255, 0.08);
}

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

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

/* Blog listing */
.blog-posts {
  padding: 80px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.post-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--executive-shadow);
  border: 1px solid #e8e8e8;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.post-card a.post-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--gradient);
}

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

.post-card-date {
  font-size: 0.85rem;
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.post-card p {
  color: var(--text-color);
  opacity: 0.85;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  opacity: 0.7;
}

/* Single post */
.post-article {
  padding: 60px 20px 100px;
  max-width: 800px;
  margin: 0 auto;
}

.post-article .post-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.post-article h1 {
  font-size: 2.4rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.post-article .post-meta {
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 2rem;
}

.post-content h2,
.post-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.post-content blockquote {
  border-left: 4px solid var(--secondary-color);
  padding-left: 1rem;
  margin: 1rem 0;
  color: #555;
  font-style: italic;
}

.post-content strong {
  font-weight: 700;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin-bottom: 1rem;
}

.post-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1rem 0;
}

.post-content a {
  color: var(--secondary-color);
}

.post-content pre {
  background: #1a1a2e;
  color: #f1f1f1;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.post-back-link {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-decoration: none;
}

/* Admin */
.admin-section {
  padding: 60px 20px 100px;
  max-width: 900px;
  margin: 0 auto;
}

.admin-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--executive-shadow);
  border: 1px solid #e8e8e8;
  padding: 2rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group textarea {
  min-height: 220px;
  resize: vertical;
  font-family: 'Consolas', 'Courier New', monospace;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.admin-post-list {
  list-style: none;
}

.admin-post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-post-row:last-child {
  border-bottom: none;
}

.admin-post-info h4 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 0.5rem;
}

.status-badge.published {
  background: #d4edda;
  color: #1e7e34;
}

.status-badge.draft {
  background: #fff3cd;
  color: #a67c00;
}

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

#post-content-editor .ql-editor {
  min-height: 260px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--card-bg);
}

#post-content-editor.ql-container {
  border-radius: 0 0 8px 8px;
}

.ql-toolbar.ql-snow {
  border-radius: 8px 8px 0 0;
}

#admin-status-message {
  margin-top: 1rem;
  font-weight: 600;
}

#admin-status-message.error {
  color: #c0392b;
}

#admin-status-message.success {
  color: #1e7e34;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  background: var(--primary-color);
  color: #fff;
}

footer a {
  color: #fff;
}

@media (max-width: 768px) {
  .page-hero h1 {
    font-size: 2rem;
  }

  .post-article h1 {
    font-size: 1.8rem;
  }
}
