:root {
  --primary: #20180f; /* charcoal brown for structure */
  --primary-light: #c51317; /* ember red for actions */
  --primary-light-hover: #a80f13;
  --primary-dark: #0c0a08; /* near-black for depth */
  --accent-soft: #f7e6c9; /* warm saffron cream */
  --accent-gold: #f4b528; /* flame highlight */
  --status-error: #8b1a1a;
  --white: #fffaf2;
  --gray-50: #fdf7ef;
  --gray-100: #f6ecdd;
  --gray-200: #e7d7bc;
  --gray-300: #d9c5a4;
  --gray-600: #5e5345;
  --gray-700: #3b3128;
  --gray-800: #231a12;
  --hero-overlay-top: rgba(12, 10, 8, 0.26);
  --hero-overlay-mid: rgba(12, 10, 8, 0.48);
  --hero-overlay-bottom: rgba(12, 10, 8, 0.76);
  --hero-overlay-left: rgba(12, 10, 8, 0.66);
  --hero-overlay-right: rgba(12, 10, 8, 0.26);
  --shadow-xs: 0 1px 2px rgba(18, 21, 28, 0.08);
  --shadow-sm: 0 4px 10px rgba(18, 21, 28, 0.08);
  --shadow-md: 0 10px 26px rgba(18, 21, 28, 0.1);
  --shadow-lg: 0 20px 44px rgba(18, 21, 28, 0.14);
  --shadow: var(--shadow-md);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --anim-duration: 0.3s;
  --btn-radius: 12px;
  --btn-padding: 0.82rem 1.25rem;
  --btn-min-width: 140px;
  --card-radius: 16px;
  --font-heading: "Bebas Neue", "Segoe UI", sans-serif;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  line-height: 1.55;
  color: var(--gray-800);
  background:
    radial-gradient(circle at 90% 8%, rgba(244, 181, 40, 0.18), transparent 28%),
    radial-gradient(circle at 8% 0%, rgba(197, 19, 23, 0.1), transparent 26%),
    var(--gray-50);
  padding-top: 90px; /* header height (60) + vertical padding (20) */
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

main {
  min-height: 65vh;
}

.page-shell {
  padding-top: 7rem;
  padding-bottom: 2.25rem;
}

.page-header {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 48rem;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.page-header p {
  color: var(--gray-700);
  line-height: 1.65;
}

.section-stack {
  display: grid;
  gap: 1.25rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--primary);
  line-height: 1.04;
  letter-spacing: 0.03em;
}

p,
li,
input,
textarea,
select,
button {
  font-family: var(--font-body);
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-light);
}

.container {
  max-width: 1120px;
  margin: auto;
  padding: 1.1rem;
}

section.container {
  padding-top: 2.4rem;
  padding-bottom: 2.1rem;
}
/* Image defaults: keep aspect ratio, be responsive, avoid distortion */
img {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover; /* when width+height set elsewhere, preserves cover behavior */
}
/* Common utility classes */
.text-center {
  text-align: center;
}

.hidden {
  display: none;
}

/* Animation classes */
.animate {
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
}

.animate.in-view {
  opacity: 1;
  transform: translateY(0);
}

.animate-delay-1 {
  transition-delay: 0.2s;
}

.animate-delay-2 {
  transition-delay: 0.4s;
}

.animate-delay-3 {
  transition-delay: 0.6s;
}

.btn {
  display: inline-block;
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: all var(--anim-duration) ease;
  min-width: var(--btn-min-width);
  border: 2px solid transparent;
  min-height: 48px;
  box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
  outline: 3px solid rgba(197, 19, 23, 0.24);
  outline-offset: 2px;
}

/* Primary button - "Get Quote" style */
.btn-primary {
  background: var(--primary-light);
  color: var(--white);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--primary-light-hover);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary button style */
.btn.btn-secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn.btn-secondary:hover {
  background: var(--primary);
  color: var(--white);
}

/* White variant for dark backgrounds */
.btn.btn-white {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
}

.btn.btn-white:hover {
  background: var(--gray-100);
  color: var(--primary-dark);
}

.btn.btn-call {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--white);
  box-shadow: 0 12px 28px rgba(197, 19, 23, 0.28);
}

.btn.btn-call:hover {
  background: var(--primary-light-hover);
  border-color: var(--primary-light-hover);
  color: var(--white);
}

/* Small variant */
.btn.btn-sm {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
}

/* Large variant */
.btn.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem;
}

.mobile-quick-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: var(--primary-dark);
  border-top: 2px solid rgba(255, 255, 255, 0.12);
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
}

.mobile-quick-bar .quick-action {
  min-height: 44px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.mobile-quick-bar .quick-action-call {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--white);
}

@media (max-width: 860px) {
  body {
    padding-bottom: 86px;
  }

  .mobile-quick-bar {
    display: grid;
  }
}
.post-card.card-link {
  text-decoration: none;
  color: inherit;
  display: grid;
}
.post-card.card-link:hover {
  text-decoration: none;
}
/* Blog card aesthetic (aligned with portfolio style) */
.post-grid .post-card.blog-card {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.post-grid .post-card.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-grid .post-card.blog-card .thumb {
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
}
.post-grid .post-card.blog-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}
.post-grid .post-card.blog-card:hover .thumb img {
  transform: scale(1.05);
}
.post-grid .post-card.blog-card .post-body {
  padding: 1rem 1rem 1.25rem;
}
/* Blog card date fallback */
.post-grid .post-card.blog-card.no-thumb .thumb.no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  height: 250px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 55%,
    var(--primary-dark) 100%
  );
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.post-grid .post-card.blog-card .thumb.no-thumb .date-text {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
/* Generic no-thumb fallback for any post-card */
/* Generic card date fallback */
.post-card.no-thumb .thumb.no-thumb,
.admin-post-card.no-thumb .thumb.no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.25rem;
  height: 250px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 55%,
    var(--primary-dark) 100%
  );
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.5px;
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
}
.post-card.no-thumb .thumb.no-thumb .date-text,
.admin-post-card.no-thumb .thumb.no-thumb .date-text {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
/* Toolbar and form controls (used on Blogs and Portfolio) */
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.form-control {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-800);
  font: inherit;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(11, 42, 107, 0.12);
}

.status-message {
  margin-top: 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.status-message.error {
  color: var(--status-error);
}

.status-message.success {
  color: var(--primary);
}
.toolbar .form-control {
  min-width: 140px;
}
.toolbar input.form-control::placeholder {
  color: var(--gray-600);
}
.pagination {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
/* Hero fallback */
.project-hero.no-hero {
  background: linear-gradient(
    135deg,
    var(--primary-dark) 0%,
    var(--primary) 50%,
    var(--primary-light) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-hero.no-hero .hero-inner {
  background: rgba(0, 0, 0, 0.35);
  padding: 2rem;
  border-radius: 8px;
}
/* About & team fallback blocks */
.about-image-block.no-thumb,
.team-photo.no-thumb {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 55%,
    var(--primary-dark) 100%
  );
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 2px;
  width: 100%;
  height: 100%;
}
.about-image-block.no-thumb .initial,
.team-photo.no-thumb .initial,
.about-image-block.no-thumb .date-text,
.team-photo.no-thumb .date-text {
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Bottom actions wrapper for post/blog pages */
.bottom-actions {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  text-align: center;
}

/* Alternative CTA style (light card) */
.cta-section.cta-alt {
  background: var(--accent-soft);
  color: var(--primary);
  padding: 3rem 1rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  margin-top: 3rem;
  border: 1px solid var(--gray-200);
}
.cta-section.cta-alt h2 {
  color: var(--primary);
  margin-bottom: 0.75rem;
}
.cta-section.cta-alt p {
  max-width: 680px;
  margin: 0 auto 1.25rem;
  line-height: 1.7;
}
.cta-section.cta-alt .btn {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--white);
}
.cta-section.cta-alt .btn:hover {
  background: var(--primary-light-hover);
  border-color: var(--primary-light-hover);
  color: var(--white);
}

/* Default dark CTA */
.cta-section {
  background: linear-gradient(145deg, #1a2c46, #0f1a2a);
  color: var(--white);
  padding: 4rem 1rem;
  margin-top: 2rem; /* prevent clash with preceding buttons/sections */
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.cta-section h2 {
  color: var(--white);
  margin-bottom: 0.75rem;
}
.cta-section p {
  max-width: 680px;
  margin: 0 auto 1.25rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}
.cta-section .btn-primary {
  background: var(--primary-light);
  color: var(--white);
}
.cta-section .btn-primary:hover {
  background: var(--primary-light-hover);
}

@media (max-width: 860px) {
  .page-shell {
    padding-top: 6.2rem;
    padding-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 78px;
  }

  .container {
    padding: 1rem 0.95rem;
  }

  section.container {
    padding-top: 1.85rem;
    padding-bottom: 1.65rem;
  }

  .page-shell {
    padding-top: 5.45rem;
    padding-bottom: 1.25rem;
  }

  .page-header {
    gap: 0.55rem;
    margin-bottom: 1.1rem;
  }

  .card {
    padding: 1rem;
  }

  .toolbar,
  .pagination,
  .bottom-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .form-control,
  .toolbar .btn,
  .pagination .btn,
  .bottom-actions .btn,
  .bottom-actions a {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0.85rem 0.8rem;
  }

  .card {
    border-radius: 14px;
  }

  .mobile-quick-bar {
    gap: 0.35rem;
    padding: 0.55rem 0.6rem calc(0.55rem + env(safe-area-inset-bottom));
  }

  .mobile-quick-bar .quick-action {
    font-size: 0.8rem;
  }
}
