/* SimpleDerby LLC — shared styles
 *
 * Typography and colors mirror the original WordPress (Astra) theme:
 *   - Body  : Source Sans Pro 400, 16px
 *   - Headings : Playfair Display 700
 *   - Color tokens taken from --ast-global-color-* on the live site.
 *
 * Fonts are loaded via the <link> tag in each HTML <head>.
 */

/* ---------- Design tokens (mirror Astra --ast-global-color-*) ---------- */
:root {
  --color-link: #2235DD;        /* Astra color-0  */
  --color-link-hover: #1a2bc6;  /* Astra color-1  */
  --color-text: #05060F;        /* Astra color-2  */
  --color-muted: #131739;       /* Astra color-3  */
  --color-bg-alt: #f0f1fd;      /* Astra color-4  */
  --color-bg: #FFFFFF;          /* Astra color-5  */
  --color-bg-subtle: #E4E7FD;   /* Astra color-6  */
  --color-footer: #131739;      /* Astra color-7  */
  --color-border: #d8d9ea;

  --font-body: 'Source Sans Pro', sans-serif;
  --font-heading: 'Playfair Display', serif;

  --radius: 4px;
  --max-width: 1200px;          /* Astra normal-container-width */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
}

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

html { font-size: 100%; scroll-behavior: smooth; }

/* Honor user preference for less motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Skip-to-content link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-link);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  outline: none;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--color-link); text-decoration: none; }
a:hover, a:focus { color: var(--color-link-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-top: 0;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.375rem; }

p { margin: 0 0 var(--space-sm); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
  gap: var(--space-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.625rem;       /* Astra .site-title */
  color: var(--color-text);
  text-decoration: none;
}

.brand img { width: 320px; height: auto; }
.brand:hover, .brand:focus { color: var(--color-link); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  min-height: 44px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.nav-list a {
  color: var(--color-text);
  font-weight: 600;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

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

.nav-list a:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 4px;
  border-radius: 2px;
}

.nav-list .cta a {
  background: var(--color-link);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border-bottom: none;
}

.nav-list .cta a:hover,
.nav-list .cta a:focus {
  background: var(--color-link-hover);
  border-bottom: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--color-link);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}

.btn:hover, .btn:focus { background: var(--color-link-hover); color: #fff; }

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

.btn-light {
  background: #fff;
  color: var(--color-link);
}
.btn-light:hover, .btn-light:focus { background: var(--color-bg-alt); color: var(--color-link-hover); }
.btn-light:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- Sections ---------- */
section { padding: var(--space-xl) 0; }

.section-alt { background: var(--color-bg-alt); }
.section-subtle { background: var(--color-bg-subtle); }

.section-heading {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-heading p { color: var(--color-muted); max-width: 640px; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--color-footer);
  color: #fff;
  padding: var(--space-xl) 0;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 { color: #fff; font-size: 3rem; margin-bottom: var(--space-sm); }
.hero p { font-size: 1.25rem; max-width: 720px; margin: 0 auto var(--space-md); opacity: 0.95; }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}

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

.card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-body { padding: var(--space-md); }
.card h3 { margin-bottom: var(--space-xs); }
.card p { color: var(--color-muted); margin: 0; }

/* ---------- Testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.testimonial-grid .featured { grid-column: 1 / -1; }

.testimonial {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.testimonial blockquote {
  margin: 0;
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.6;
  font-style: italic;
}

.testimonial-attribution {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.testimonial-attribution img,
.testimonial-attribution .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

.testimonial-attribution img { object-fit: cover; }

.testimonial-attribution img.logo {
  object-fit: contain;
  background: #fff;
  padding: 4px;
  border: 1px solid var(--color-border);
}

.testimonial-attribution .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-link);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.testimonial-attribution cite {
  font-style: normal;
  display: block;
  line-height: 1.35;
}

.testimonial-attribution .name { display: block; font-weight: 600; color: var(--color-text); }
.testimonial-attribution .role { display: block; font-size: 0.9rem; color: var(--color-muted); }
.testimonial-attribution .role a { color: var(--color-link); }
.testimonial-attribution .role a:hover,
.testimonial-attribution .role a:focus { color: var(--color-link-hover); text-decoration: underline; }

.testimonial-more {
  text-align: center;
  margin-top: var(--space-md);
  font-weight: 600;
}

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

/* ---------- Forms ---------- */
.form {
  max-width: 600px;
  margin: 0;
  display: grid;
  gap: var(--space-sm);
}

.form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.form input,
.form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
  color: var(--color-text);
}

.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--color-link);
  outline-offset: 1px;
  border-color: var(--color-link);
}

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

/* Visually hidden honeypot field — kept in the DOM so bots see it,
   but pushed off-screen so humans never interact with it. */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.form-status.success {
  background: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #a5d6a7;
}

.form-status.error {
  background: #fdecea;
  color: #b71c1c;
  border: 1px solid #f5a9a9;
}

/* ---------- Two-column layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* ---------- Slideshow ---------- */
.slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-footer);
}

.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slideshow img.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow img { transition: none; }
}

.contact-info dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  margin: 0;
}

.contact-info dt { font-weight: 600; color: var(--color-text); }
.contact-info dd { margin: 0; color: var(--color-muted); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-footer);
  color: #cfd2e8;
  padding: var(--space-md) 0;
  text-align: center;
  font-size: 0.95rem;
}

.site-footer a { color: #fff; }
.site-footer a:hover, .site-footer a:focus { color: var(--color-bg-subtle); }

/* ---------- Social CTA ---------- */
.social-list {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  background: var(--color-link);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.social-list a:hover,
.social-list a:focus {
  background: var(--color-link-hover);
  color: #fff;
}

.social-list a:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.social-list svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ---------- Responsive ----------
 * Two breakpoints:
 *   - 900px: nav switches to hamburger (the brand + 6 nav items
 *     overflow horizontally below ~900px on most browsers).
 *   - 720px: two-column content collapses to one column,
 *     hero/h1 typography shrinks, section padding tightens.
 */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }

  .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm) var(--space-md);
  }

  .nav-list.open { display: flex; }
  .nav-list li { padding: 0.5rem 0; }
  .nav-list .cta a { text-align: center; }
}

@media (max-width: 720px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.625rem; }
  .hero h1 { font-size: 2.25rem; }
  .hero p { font-size: 1.05rem; }
  .hero { padding: var(--space-lg) 0; }
  section { padding: var(--space-lg) 0; }
  .two-col { grid-template-columns: 1fr; gap: var(--space-md); }
  .brand { font-size: 1.375rem; }
}
