/* ═══════════════════════════════════════════════════════════════════════════════
 * Cookie AI — Components
 * ═══════════════════════════════════════════════════════════════════════════════
 * Work Unit: WU-02 — CSS Design System
 * Acceptance Criteria: REQ-03, REQ-10
 * ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Inline Arrow Icon ─────────────────────────────────────────────────────── */
.icon-arrow {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border: 1px solid var(--copper);
  background: transparent;
  color: var(--text-cream);
  font-family: var(--font-body);
  font-size: var(--text-nav);
  font-weight: 500;
  letter-spacing: var(--tracking-nav);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  background: var(--copper);
  color: var(--text-dark);
}

.btn:focus,
.btn:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

/* Prevent reset.css display:block from breaking inline button images */
.btn img {
  display: inline-block;
  width: 16px;
  height: 16px;
}

.btn--primary {
  background-color: var(--copper);
  color: var(--text-dark);
  border-color: var(--copper);
}

.btn--primary:hover {
  background-color: var(--copper-hover);
  border-color: var(--copper-hover);
}

.btn--outline {
  background-color: transparent;
  color: var(--text-cream);
  border-color: var(--copper);
}

.btn--outline:hover {
  background-color: var(--copper);
  color: var(--text-dark);
}

/* Dark variant for cream backgrounds */
.btn--outline-dark {
  background-color: transparent;
  color: var(--text-dark);
  border-color: var(--copper);
}

.btn--outline-dark:hover {
  background-color: var(--copper);
  color: var(--text-cream);
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  padding: var(--space-md);
  background-color: var(--bg-dark-subtle);
  border: 1px solid var(--border-dark);
  border-radius: 0;
}

.card--cream {
  background-color: var(--bg-cream);
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--copper);
  margin-bottom: var(--space-sm);
}

.card__body {
  color: var(--text-muted);
}

/* ─── Service Item (Flow Diagram) ───────────────────────────────────────────── */
.service-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.service-item:last-child {
  margin-bottom: 0;
}

.service-item__dot {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background-color: var(--copper);
  border-radius: 50%;
  margin-top: 0.3em;
}

.service-item__content {
  flex: 1;
}

.service-item__title {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--copper);
  margin-bottom: var(--space-xs);
}

.service-item__description {
  color: var(--text-muted);
  max-width: 50ch;
}

/* ─── CTA Closing (Pull-Quote Style) ───────────────────────────────────────── */
.cta-closing {
  text-align: center;
  padding: var(--space-xl) 0;
}

.cta-closing__rule {
  width: 60px;
  height: 1px;
  background: var(--copper);
  border: none;
  margin: 0 auto clamp(40px, 5vw, 60px);
}

.cta-closing__text {
  font-family: var(--font-heading);
  font-size: var(--text-pull-quote);
  font-weight: 400;
  font-style: italic;
  color: var(--copper);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
  margin: 0 auto clamp(20px, 3vw, 32px);
  max-width: 600px;
}

.cta-closing__link {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--copper);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cta-closing__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cta-closing__link:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

/* ─── Horizontal Rule ───────────────────────────────────────────────────────── */
.divider,
.hr--copper,
hr.copper {
  width: 80px;
  height: 1px;
  background: var(--copper);
  border: none;
  margin: var(--space-md) auto;
}

.hr--copper.wide {
  width: 120px;
}

/* ─── Form Elements ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--text-small);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--text-dark);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-sm);
  font-size: var(--text-body);
  background-color: var(--bg-cream);
  border: 1px solid var(--border-light);
  transition: border-color 150ms ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--copper);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

/* ─── Download Section ──────────────────────────────────────────────────────── */
.download-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background-color: var(--bg-dark-subtle);
  border: 1px solid var(--border-dark);
  border-left: 3px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.download-card:hover {
  border-left-color: var(--copper);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.download-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  color: var(--copper);
}

.download-card__content {
  flex: 1;
}

.download-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.download-card__description {
  font-size: var(--text-small);
  color: var(--text-muted);
}

/* ─── Navigation ───────────────────────────────────────────────────────────── */
.nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-sm) 0;
}

.nav__inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.nav__logo {
  text-decoration: none;
  color: var(--text-cream);
}

.nav__logo-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
}

.nav__links {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

.nav__link {
  font-family: var(--font-body);
  font-size: var(--text-nav);
  font-weight: 500;
  letter-spacing: var(--tracking-nav);
  color: var(--text-cream);
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
  padding-bottom: 2px;
}

/* Underline slide-in from left on hover */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--copper);
  transition: width 0.3s ease;
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link:hover {
  color: var(--copper);
}

/* Current page — terracotta always, no persistent underline */
.nav__link--current {
  color: var(--copper);
}

.nav__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Mobile toggle - hidden on desktop */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}

.nav__toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-cream);
  transition: transform 0.2s ease;
}

/* ─── Mobile modal overlay — hidden on desktop ────────────────────────────── */
.nav-links {
  display: none;
}

@media (max-width: 768px) {
  /* Nav bar itself: no background, no padding — just a fixed anchor for the toggle */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
    z-index: 1001;
    background: transparent;
  }

  /* Hide logo text on mobile — hamburger is the only chrome */
  .nav__logo-text {
    display: none;
  }

  /* Hide desktop link list on mobile */
  .nav__links {
    display: none;
  }

  /* Show hamburger toggle — floating fixed in top-right */
  .nav__toggle {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    z-index: 1001;
    padding: 0.5rem;
  }

  /* Mobile modal overlay (default: terracotta for non-homepage) */
  .nav-links {
    /* Off-screen by default — transform-based show/hide */
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--copper);
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  /* Hide hamburger when modal is open */
  .nav__toggle[aria-expanded="true"] {
    display: none;
  }

  /* Close button — top-right corner of modal */
  .nav__close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    color: var(--text-cream);
    transition: opacity 0.2s ease;
  }

  .nav__close:hover {
    opacity: 0.7;
  }

  .nav__close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
  }

  .nav__mobile-links {
    list-style: none;
    text-align: center;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }

  .nav__mobile-link {
    display: block;
    padding: 0.5rem var(--space-md);
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: var(--text-cream);
    text-decoration: none;
    letter-spacing: var(--tracking-heading);
    transition: opacity 0.2s ease;
  }

  .nav__mobile-link:hover {
    opacity: 0.7;
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  .nav__mobile-link--current {
    text-decoration: underline;
    text-underline-offset: 4px;
  }
}

/* ─── Footer (v3 Editorial Deep Footer) ────────────────────────────────────── */
.footer {
  background-color: var(--color-footer-bg);
  color: var(--color-footer-text);
  width: 100%;
  padding: clamp(60px, 8vw, 100px) 4vw clamp(32px, 4vw, 48px);
  border-top: 2px solid var(--copper);
}

/* ─── Top Section: Brand + Columns ─────────────────────────────────────────── */
.footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  gap: clamp(40px, 6vw, 80px);
}

/* ─── Brand Zone ───────────────────────────────────────────────────────────── */
.footer__brand {
  flex: 1;
  max-width: 440px;
}

.footer__wordmark {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  color: var(--color-footer-brand);
  letter-spacing: var(--tracking-heading);
  line-height: var(--leading-tight);
  display: block;
  margin-bottom: 16px;
}

.footer__tagline {
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--color-footer-text);
  opacity: 0.5;
  line-height: 1.7;
  margin: 0;
}

/* ─── Column Zone ──────────────────────────────────────────────────────────── */
.footer__columns {
  display: flex;
  gap: clamp(40px, 6vw, 80px);
}

.footer__col-label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-footer-text);
  opacity: 0.35;
  margin-bottom: 20px;
}

.footer__col-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__col-list a {
  color: var(--color-footer-text);
  text-decoration: none;
  font-size: var(--text-small);
  opacity: 0.5;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer__col-list a:hover {
  opacity: 1;
}

.footer__col-list a:focus-visible {
  outline: 2px solid var(--color-footer-brand);
  outline-offset: 2px;
}

.footer__col-list svg {
  display: inline-block;
}

/* Book a call CTA — terracotta, full opacity */
.footer__cta {
  color: var(--color-footer-brand);
  opacity: 0.8;
}

.footer__cta:hover {
  opacity: 1;
}

/* ─── Bottom Section: Copyright ────────────────────────────────────────────── */
.footer__bottom {
  max-width: 1400px;
  margin: 0 auto;
  margin-top: clamp(40px, 6vw, 64px);
  padding-top: 20px;
  border-top: 1px solid rgba(245, 240, 232, 0.08);
}

.footer__copyright {
  font-size: var(--text-label);
  opacity: var(--opacity-subtle);
  color: var(--color-footer-text);
  margin: 0;
}

/* ─── Footer Responsive: Mobile ────────────────────────────────────────────── */
@media (max-width: 767px) {
  .footer {
    padding: 48px 16px 32px;
  }

  .footer__top {
    flex-direction: column;
    gap: 40px;
  }

  .footer__brand {
    max-width: 100%;
  }

  .footer__columns {
    gap: 40px;
  }

  .footer__bottom {
    margin-top: 40px;
  }
}

/* ─── 404 Page ───────────────────────────────────────────────────────────────── */
.error-404 {
  background-color: var(--bg-dark);
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--section-pad) var(--space-lg);
}

.error-404__inner {
  text-align: center;
  max-width: var(--max-width-narrow);
}

.error-404__heading {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  color: var(--text-cream);
  margin-bottom: var(--space-lg);
}

.error-404__message {
  font-family: var(--font-body);
  color: var(--text-muted-light);
  margin-bottom: var(--space-xl);
}
