/*
Theme Name: Lauritzen Systems
Theme URI: https://lauritzensystems.com
Description: A calm, biophilic, neurodivergent-friendly full-site editing theme built on the Lauritzen Systems design system. Warm sanctuary palette, generous spacing, and predictable navigation.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lauritzen-systems
Tags: block-themes, full-site-editing, blog, portfolio, accessibility-ready, custom-colors, custom-logo, custom-menu
*/

/* ============================================================
   DESIGN TOKENS — CSS CUSTOM PROPERTIES
   Source of truth that mirrors theme.json for use in
   classic CSS contexts and block overrides.
   ============================================================ */

:root {
  /* Colors */
  --bg-sanctuary:   #FBF9F4;
  --bg-surface:     #F3EFE3;
  --text-primary:   #2C3531;
  --text-muted:     #606A66;
  --accent-focus:   #4A6B5D;
  --accent-soft:    #D4E2D7;
  --intent-error:   #C87A7A;

  /* Spacing (8px grid) */
  --space-xs:   0.5rem;   /* 8px  */
  --space-sm:   1rem;     /* 16px */
  --space-md:   1.5rem;   /* 24px */
  --space-lg:   2rem;     /* 32px */
  --space-xl:   3rem;     /* 48px */
  --space-2xl:  4rem;     /* 64px */

  /* Border */
  --radius-sm:  0.5rem;   /* 8px  */
  --radius-md:  0.75rem;  /* 12px */
  --radius-lg:  1rem;     /* 16px */
  --border-muted: 1px solid var(--text-muted);

  /* Focus ring */
  --focus-ring: 2px solid var(--accent-focus);

  /* Typography */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background-color: var(--bg-sanctuary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

h1 { font-size: 2.0rem;  font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem;  font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem;  font-weight: 600; }
h5 { font-size: 1rem;    font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; }

p {
  margin-top: 0;
  margin-bottom: var(--space-md);
  max-width: 68ch;
}

.text-muted,
.has-text-muted-color {
  font-size: 0.875rem;
  color: var(--text-muted);
}

a {
  color: var(--accent-focus);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   LAYOUT WRAPPERS
   ============================================================ */

.site-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section-padding {
  padding-block: var(--space-2xl);
}

/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--accent-soft);
  padding-block: var(--space-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.site-logo a,
.site-title a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title a:hover {
  color: var(--accent-focus);
}

/* Primary Nav */
.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.primary-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--accent-focus);
  border-bottom-color: var(--accent-focus);
}

.primary-nav a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */

.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--accent-soft);
  padding-block: var(--space-xl);
  margin-top: var(--space-2xl);
}

.site-footer .inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: none;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.wp-block-button__link,
.btn,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem var(--space-md);
  background-color: var(--accent-focus);
  color: #fff !important;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.wp-block-button__link:hover,
.btn:hover,
button:hover,
input[type="submit"]:hover {
  background-color: #3a5a4e;
}

.wp-block-button__link:focus-visible,
.btn:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.wp-block-button__link:active,
.btn:active {
  transform: translateY(1px);
}

/* Outline variant */
.wp-block-button.is-style-outline .wp-block-button__link,
.btn-outline {
  background-color: transparent;
  color: var(--accent-focus) !important;
  border: 2px solid var(--accent-focus);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.btn-outline:hover {
  background-color: var(--accent-soft);
}

/* ============================================================
   CARDS & SURFACES
   ============================================================ */

.ls-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid var(--accent-soft);
}

.ls-card h3 {
  margin-bottom: var(--space-xs);
}

.ls-card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

/* ============================================================
   FORMS — Neurodivergent-friendly pattern
   ============================================================ */

.ls-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: var(--space-lg);
}

.ls-form-group label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}

.ls-form-group .ls-field-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.ls-form-group input[type="text"],
.ls-form-group input[type="email"],
.ls-form-group input[type="tel"],
.ls-form-group input[type="url"],
.ls-form-group textarea,
.ls-form-group select,
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.625rem var(--space-sm);
  background-color: var(--bg-sanctuary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ls-form-group input:focus,
.ls-form-group textarea:focus,
.ls-form-group select:focus,
.wpcf7 input:focus,
.wpcf7 textarea:focus {
  border-color: var(--accent-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ls-form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.ls-hero {
  padding-block: var(--space-2xl) calc(var(--space-2xl) * 1.25);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--accent-soft);
}

.ls-hero__inner {
  max-width: 780px;
}

.ls-hero__eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-focus);
  background-color: var(--accent-soft);
  padding: 0.25rem var(--space-sm);
  border-radius: 100px;
  margin-bottom: var(--space-md);
}

.ls-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.ls-hero__description {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-xl);
  max-width: 56ch;
}

.ls-hero__actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* ============================================================
   SERVICES GRID
   ============================================================ */

.ls-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.ls-service-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-lg);
  transition: box-shadow 0.2s ease;
}

.ls-service-card:hover {
  box-shadow: 0 4px 24px rgba(44, 53, 49, 0.08);
}

.ls-service-card__icon {
  width: 48px;
  height: 48px;
  background-color: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  color: var(--accent-focus);
  font-size: 1.5rem;
}

.ls-service-card h3 {
  margin-bottom: var(--space-xs);
  font-size: 1.125rem;
}

.ls-service-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0;
}

/* ============================================================
   BLOG / ARCHIVE
   ============================================================ */

.ls-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.ls-post-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ls-post-card__image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.ls-post-card__body {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ls-post-card__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.ls-post-card h2 {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

.ls-post-card h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

.ls-post-card h2 a:hover {
  color: var(--accent-focus);
}

.ls-post-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  flex: 1;
}

.ls-post-card__readmore {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-focus);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: var(--space-sm);
}

.ls-post-card__readmore:hover {
  color: var(--text-primary);
}

/* ============================================================
   SINGLE POST
   ============================================================ */

.ls-article {
  max-width: 72ch;
  margin-inline: auto;
}

.ls-article__header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--accent-soft);
}

.ls-article__meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.ls-article__content {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.ls-article__content p {
  max-width: none;
}

.ls-article__content blockquote {
  border-left: 4px solid var(--accent-focus);
  margin-left: 0;
  padding-left: var(--space-lg);
  color: var(--text-muted);
  font-style: italic;
}

.ls-article__content code {
  font-family: var(--font-mono);
  background-color: var(--bg-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.ls-article__content pre {
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-lg);
  overflow-x: auto;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */

.ls-contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (max-width: 768px) {
  .ls-contact-layout {
    grid-template-columns: 1fr;
  }
}

.ls-contact-info h2 {
  margin-bottom: var(--space-sm);
}

.ls-contact-info p {
  color: var(--text-muted);
}

/* ============================================================
   ACCESSIBILITY & UTILITIES
   ============================================================ */

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  background: var(--accent-focus);
  color: #fff;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 200;
}

.skip-to-content:focus {
  top: var(--space-sm);
}

/* State visibility: color + icon shape (not color alone) */
[aria-pressed="true"],
[aria-checked="true"],
.is-active {
  color: var(--accent-focus);
  font-weight: 700;
}

/* ============================================================
   GUTENBERG BLOCK OVERRIDES
   ============================================================ */

.wp-block-separator {
  border-color: var(--accent-soft);
  opacity: 1;
}

.wp-block-pullquote {
  border-color: var(--accent-focus);
}

.wp-block-code {
  background-color: var(--bg-surface);
  border: 1px solid var(--accent-soft);
  font-family: var(--font-mono);
}

.wp-block-table td,
.wp-block-table th {
  border-color: var(--accent-soft);
  padding: var(--space-sm) var(--space-md);
}

.wp-block-table thead {
  background-color: var(--bg-surface);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .site-container {
    padding-inline: var(--space-md);
  }
}

@media (max-width: 640px) {
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.25rem; }

  .ls-hero {
    padding-block: var(--space-xl);
  }

  .section-padding {
    padding-block: var(--space-xl);
  }

  .primary-nav ul {
    gap: var(--space-md);
  }

  .site-header .inner {
    flex-wrap: wrap;
  }

  .ls-contact-layout {
    grid-template-columns: 1fr;
  }
}
