:root {
  --primary: #9a3412;
  --primary-dark: #7c2d12;
  --secondary: #2c3e50;
  --light: #f8f9fa;
  --white: #ffffff;
  --text: #212529;
  --muted: #4b5563;
  --border: #e2e8f0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--light);
}

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

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 12px;
  padding: 0.6rem 0.9rem;
  background: var(--white);
  color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 800;
  z-index: 1000;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.skip-link:focus {
  left: 16px;
}

/* Shared header (blog + blog index) */
.site-header {
  background: var(--white);
  padding: 0.75rem 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  min-width: 0;
}

.header-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.header-logo-picture {
  display: block;
  line-height: 0;
}

.header-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.2;
}

.header-title span {
  color: var(--primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav a {
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
}

.header-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.header-cta {
  background: var(--primary);
  color: var(--white) !important;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.9rem;
}

.header-cta:hover {
  background: var(--primary-dark);
}

/* Article pages */
.article-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3.5rem;
}

.breadcrumbs {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumbs a {
  color: var(--muted);
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: 2.15rem;
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: var(--secondary);
}

.article-meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.article-content {
  font-size: 1.05rem;
}

.article-content h2 {
  margin: 2.1rem 0 0.85rem;
  color: var(--secondary);
  font-size: 1.35rem;
  line-height: 1.2;
}

.article-content ul,
.article-content ol {
  padding-left: 1.25rem;
}

.article-content li {
  margin: 0.35rem 0;
}

.article-media {
  margin: 1.35rem 0 1.85rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.article-media img {
  display: block;
  width: 100%;
  height: auto;
}

.article-media figcaption {
  padding: 0.8rem 1rem 0.95rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.callout {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  padding: 1.1rem 1.1rem;
  border-radius: 12px;
  margin: 1.75rem 0;
}

.callout h3 {
  margin: 0 0 0.35rem;
  color: var(--secondary);
  font-size: 1.15rem;
}

.callout-success {
  background: #f0fdf4;
  border-left-color: #15803d;
}

.callout-success h3 {
  color: #166534;
}

.callout-error {
  background: #fff7f7;
  border-left-color: #b91c1c;
}

.callout-error h3 {
  color: #991b1b;
}

.callout[hidden] {
  display: none !important;
}

#success-message:target,
#form-error-message:target {
  display: block !important;
  scroll-margin-top: 96px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
}

.btn:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.callout-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.callout-link {
  font-weight: 700;
}

/* Blog index */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.25rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.2;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--secondary);
}

.card p {
  margin: 0.5rem 0 0.9rem;
  color: var(--muted);
}

.card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.card li {
  margin: 0.35rem 0;
}

.card-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* Footer */
.footer {
  background: #1a252f;
  color: #f5f7fa;
  padding: 2.5rem 1.25rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.footer h4 {
  margin: 0 0 0.75rem;
  color: rgba(255, 255, 255, 0.95);
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer li {
  margin: 0.45rem 0;
}

.footer a {
  color: #f5f7fa;
}

.footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  color: #f5f7fa;
  font-size: 0.95rem;
}

/* Forms */
.form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.field {
  margin-bottom: 1.05rem;
}

.field label {
  display: block;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: var(--white);
}

.field textarea {
  min-height: 130px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(154, 52, 18, 0.22);
  border-color: rgba(154, 52, 18, 0.55);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: #b91c1c;
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.08);
}

.field-error {
  margin: 0.4rem 0 0;
  color: #991b1b;
  font-size: 0.92rem;
}

.field-error[hidden] {
  display: none !important;
}

.form-status {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.form-status[hidden] {
  display: none !important;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.form-actions .btn {
  border: 0;
  cursor: pointer;
}

.form-actions .btn[disabled] {
  opacity: 0.68;
  cursor: wait;
}

.form-note {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

#contact-form {
  scroll-margin-top: 110px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 0.6rem 1rem;
  }
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .header-brand {
    justify-content: center;
  }
  .header-title {
    display: inline;
    font-size: 1rem;
    text-align: center;
  }
  .header-nav {
    justify-content: center;
    gap: 0.4rem 0.55rem;
    width: 100%;
  }
  .header-nav a {
    padding: 0.45rem 0.55rem;
  }
  .article-title {
    font-size: 1.85rem;
  }
}
