* { box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --accent: #06b6d4;
  --dark: #0f172a;
  --text: #0f172a;
  --muted: #475569;
  --surface: #ffffff;
  --soft: #f8fafc;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.10), transparent 30%),
    radial-gradient(circle at top right, rgba(6,182,212,0.12), transparent 25%),
    #f8fafc;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.narrow {
  max-width: 560px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,0.86);
  border-bottom: 1px solid rgba(15,23,42,0.08);
}

.nav-shell {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 800;
  color: var(--dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-links a {
  color: #334155;
  font-weight: 600;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero h1,
.section h1,
.section h2 {
  margin: 0 0 1rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero h1 {
  max-width: 900px;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
}

.hero p,
.section p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 1rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(37,99,235,0.08);
}

.section {
  padding: 2rem 0 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
}

.post-card,
.form-card,
.empty-state,
.admin-table-wrap {
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(15,23,42,0.08);
}

.post-card {
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(15,23,42,0.14);
}

.post-image {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  background: #ffffff;
}

.post-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    rgba(37,99,235,.10),
    rgba(6,182,212,.16)
  );
}

.post-body {
  padding: 1.3rem;
}

.post-body h2 {
  margin: .8rem 0;
  font-size: 1.25rem;
}

.post-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  padding: .35rem .65rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.badge {
  color: var(--primary);
  background: rgba(37,99,235,.10);
}

.badge-client {
  color: #0f766e;
  background: rgba(13,148,136,.12);
}

.status-draft {
  color: #92400e;
  background: rgba(245,158,11,.14);
}

.status-published {
  color: #166534;
  background: rgba(34,197,94,.14);
}

.text-link {
  display: inline-block;
  margin-top: .75rem;
  color: var(--primary);
  font-weight: 700;
}

.article-shell {
  max-width: 900px;
}

.article-header {
  margin: 2rem 0;
}

.article-header h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.article-summary {
  font-size: 1.2rem;
}

.article-main-image {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: 24px;
  display: block;
  margin-bottom: 2rem;
}

.article-content {
  color: #334155;
  font-size: 1.08rem;
  line-height: 1.8;
}

.article-content img {
  max-width: 100%;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
}

.form-card {
  padding: 1.5rem;
}

.field {
  display: grid;
  gap: .5rem;
  margin-bottom: 1rem;
}

.field label {
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
select {
  width: 100%;
  padding: .95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.12);
  background: #ffffff;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.placement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.checkbox-card {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(37,99,235,.06);
  border: 1px solid rgba(37,99,235,.10);
}

.checkbox-card input {
  margin-top: .25rem;
}

.checkbox-card span {
  display: grid;
  gap: .25rem;
}

.btn,
button {
  border: none;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .9rem 1.2rem;
  border-radius: 14px;
  font-weight: 700;
}

.btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 28px rgba(37,99,235,.28);
}

.btn-secondary {
  color: var(--dark);
  background: #ffffff;
  border: 1px solid rgba(15,23,42,.1);
}

.admin-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

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

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(15,23,42,.08);
}

.actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.actions form {
  margin: 0;
}

.link-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 700;
}

.danger {
  color: #b91c1c;
}

.admin-preview {
  width: min(360px, 100%);
  max-height: 240px;
  object-fit: cover;
  border-radius: 18px;
}

.admin-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.admin-gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.flash-wrap {
  margin-top: 1rem;
}

.flash-message {
  padding: 1rem 1.2rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  font-weight: 600;
}

.flash-success {
  background: rgba(34,197,94,.12);
  color: #166534;
}

.flash-error {
  background: rgba(239,68,68,.12);
  color: #991b1b;
}

.site-footer {
  margin-top: 3rem;
  background: var(--dark);
  color: #e2e8f0;
}

.footer-inner {
  padding: 2rem 0;
}

@media (max-width: 900px) {
  .posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .nav-shell,
  .admin-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .posts-grid,
  .placement-grid,
  .gallery-grid,
  .admin-gallery {
    grid-template-columns: 1fr;
  }

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