/*
Theme Name: Lachlan McDonald Author
Theme URI: https://lachlanmcdonald.com
Author: Lachlan McDonald
Author URI: https://lachlanmcdonald.com
Description: Literary author theme for Lachlan McDonald, writer of crime and mystery fiction. Ported from a Lovable-generated site to a standard WordPress theme.
Version: 1.3.2
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lm-author
*/

/* ==========================================================================
   Design tokens — warm paper, deep ink, burnt sienna accent, muted gold.
   Carried over from the original Lovable/Tailwind design system.
   ========================================================================== */

:root {
  --radius: 0.5rem;

  --background: oklch(0.97 0.01 95);
  --foreground: oklch(0.2 0.02 260);
  --paper: oklch(0.99 0.005 95);
  --ink: oklch(0.16 0.02 260);

  --card: oklch(0.99 0.005 95);
  --card-foreground: oklch(0.2 0.02 260);

  --primary: oklch(0.45 0.13 35);
  --primary-foreground: oklch(0.98 0.01 85);

  --secondary: oklch(0.92 0.02 85);
  --secondary-foreground: oklch(0.25 0.03 260);

  --accent: oklch(0.88 0.06 80);
  --accent-foreground: oklch(0.25 0.03 260);

  --muted: oklch(0.9 0.01 90);
  --muted-foreground: oklch(0.5 0.03 260);

  --destructive: oklch(0.55 0.18 25);
  --destructive-foreground: oklch(0.99 0.005 95);

  --border: oklch(0.75 0.02 80 / 35%);
  --input: oklch(0.75 0.02 80 / 35%);
  --ring: oklch(0.45 0.13 35 / 60%);

  --amber: oklch(0.77 0.16 75);

  --font-heading: "Crimson Pro", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

/*
 * The hidden attribute should always win. Without this, a class that sets
 * its own `display` (e.g. `.form-status { display: flex }`) can override
 * the browser's default `[hidden] { display: none }` rule whenever it has
 * equal-or-higher specificity — which is exactly what was making the
 * contact and ARC reviewer "message sent" panels show immediately instead
 * of only after a real submission.
 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container-wide { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.container-tight { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }

@media (min-width: 640px) {
  .container-wide, .container-tight { padding: 0 1.5rem; }
}
@media (min-width: 1024px) {
  .container-wide, .container-tight { padding: 0 2rem; }
}

.section-padding { padding: 4rem 0; }
@media (min-width: 768px) { .section-padding { padding: 6rem 0; } }

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

.eyebrow {
  display: block;
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn-primary { background-color: #000; color: #fff; }
.btn-primary:hover { background-color: rgba(0, 0, 0, 0.9); }

.btn-outline { background: transparent; border-color: var(--foreground); color: var(--foreground); }
.btn-outline:hover { background-color: rgba(0, 0, 0, 0.05); }

.btn-secondary { background-color: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { opacity: 0.85; }

.btn-amber { background-color: var(--amber); color: #1a1a1a; }
.btn-amber:hover { opacity: 0.9; }

.btn-amber-outline {
  background: transparent;
  border-color: rgba(251, 191, 36, 0.2);
  color: var(--amber);
}
.btn-amber-outline:hover { background-color: rgba(251, 191, 36, 0.1); }

.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background-color: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 7rem;
}
@media (min-width: 640px) { .site-header .container-wide { height: 9rem; } }

.site-logo img {
  height: 6rem;
  width: auto;
  max-width: 70vw;
  object-fit: contain;
}
@media (min-width: 640px) { .site-logo img { height: 8rem; } }

.site-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}
@media (min-width: 768px) { .site-nav { display: flex; } }

.site-nav a.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  transition: color 0.15s ease;
}
.site-nav a.nav-link:hover { color: rgba(255, 255, 255, 0.8); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 0.5rem;
  border-radius: 999px;
  cursor: pointer;
}
.menu-toggle:hover { background-color: rgba(255, 255, 255, 0.1); }
@media (min-width: 768px) { .menu-toggle { display: none; } }

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: #000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-menu.is-open { display: block; }

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.mobile-menu-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu a.nav-link { font-size: 1.125rem; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--background);
}

.hero .container-wide {
  display: flex;
  min-height: 70vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-heading {
  font-size: 2.5rem;
  max-width: 48rem;
}
@media (min-width: 640px) { .hero-heading { font-size: 3.25rem; } }
@media (min-width: 1024px) { .hero-heading { font-size: 3.75rem; } }

.hero-subtitle {
  margin-top: 1rem;
  max-width: 40rem;
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) { .hero-actions { flex-direction: row; } }

/* ==========================================================================
   About
   ========================================================================== */

.about-photo {
  margin: 2rem auto 0;
  max-width: 56rem;
}

.about-photo img {
  border-radius: var(--radius);
  width: 100%;
  height: auto;
}

/* ==========================================================================
   Novel
   ========================================================================== */

.novel-inner { max-width: 56rem; margin: 0 auto; }

.novel-card {
  margin: 0 auto;
  max-width: 48rem;
}

.novel-card > img {
  border-radius: var(--radius);
  width: 100%;
  height: auto;
  margin-bottom: 2rem;
}

.novel-hook {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 1rem;
  text-align: center;
}

.novel-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.novel-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-icon { display: block; margin: 0 auto 1rem; width: 2rem; height: 2rem; color: var(--ink); }

.contact-card {
  margin-top: 2.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
@media (min-width: 640px) { .contact-card { padding: 2rem; } }
@media (min-width: 768px) { .contact-card { padding: 2.5rem; } }

.form-grid { display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .form-grid.two-col { grid-template-columns: 1fr 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }

.form-field label { font-size: 0.875rem; font-weight: 500; }

.form-field input,
.form-field textarea {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid var(--input);
  background-color: var(--paper);
  padding: 0.625rem 0.875rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--foreground);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.form-field textarea { resize: none; }

.field-error { color: var(--destructive); font-size: 0.875rem; margin: 0; }

.form-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 0;
}

.form-status .status-icon { width: 3rem; height: 3rem; color: var(--primary); margin-bottom: 1rem; }

/* ==========================================================================
   Newsletter
   ========================================================================== */

.newsletter {
  background-color: #000;
  color: var(--amber);
  padding: 4rem 0;
}
@media (min-width: 768px) { .newsletter { padding: 6rem 0; } }

.newsletter .eyebrow { color: var(--amber); }
.newsletter h2 { color: var(--amber); }

.newsletter-copy {
  margin: 1rem auto 0;
  max-width: 36rem;
  font-size: 1.125rem;
  color: rgba(251, 191, 36, 0.8);
}

.newsletter-form {
  margin: 2.5rem auto 0;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 640px) { .newsletter-form { flex-direction: row; } }

.newsletter-form .form-field { flex: 1; text-align: left; margin-bottom: 0; }

.newsletter-form input {
  height: 3rem;
  border-radius: 999px;
  border-color: rgba(251, 191, 36, 0.2);
  background-color: rgba(251, 191, 36, 0.1);
  color: var(--amber);
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.newsletter-form input::placeholder { color: rgba(251, 191, 36, 0.5); }

.newsletter-form .btn { height: 3rem; }

.newsletter-status {
  margin-top: 2.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(251, 191, 36, 0.1);
  background-color: rgba(251, 191, 36, 0.05);
  padding: 2rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--background);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.footer-links a { font-size: 0.875rem; color: #000; }
.footer-links a:hover { color: rgba(0, 0, 0, 0.7); }

.footer-bottom {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* ==========================================================================
   404
   ========================================================================== */

.not-found {
  display: flex;
  min-height: 60vh;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
}
.not-found h1 { font-size: 4.5rem; }
