/* ==========================================================================
   Spearpoint Publishing House — Main Stylesheet
   ========================================================================== */

:root {
  --navy: #102A43;
  --deep-blue: #173F67;
  --royal-blue: #214E83;
  --gold: #C9A227;
  --soft-gold: #E3C56B;
  --cream: #F7F3E8;
  --white: #FFFFFF;
  --charcoal: #1F2933;
  --muted: #5A6B7A;
  --line: rgba(16, 42, 67, 0.12);

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --container: 1180px;
  --radius: 10px;
  --shadow-soft: 0 10px 30px rgba(16, 42, 67, 0.10);
  --shadow-card: 0 6px 18px rgba(16, 42, 67, 0.10);
  --transition: 220ms ease;
}

/* -------------------- Reset -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@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;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-serif); color: var(--navy); line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--muted); }
ul { padding-left: 1.2em; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--navy);
  padding: 12px 20px;
  z-index: 999;
  font-weight: 700;
}
.skip-link:focus { left: 12px; top: 12px; }

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--soft-gold); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6); }
.btn-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--deep-blue); }
.btn-outline-navy { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: var(--white); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn-disabled { background: #E7E9EC; color: #8B97A3; cursor: default; }
.btn-disabled:hover { transform: none; }

/* -------------------- Header -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--container);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.15rem;
}
.brand img { height: 44px; width: 44px; object-fit: cover; border-radius: 9px; box-shadow: 0 2px 8px rgba(16,42,67,0.35); }
.brand-sub { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--navy);
  border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--royal-blue); background: rgba(33,78,131,0.07); }
.nav-cta { margin-left: 8px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: '';
  display: block;
  width: 26px;
  height: 2px;
  background: var(--navy);
  margin: 6px 0;
  transition: transform var(--transition), opacity var(--transition);
}

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 84vw);
    height: 100vh;
    background: var(--navy);
    flex-direction: column;
    align-items: stretch;
    padding: 90px 24px 24px;
    transform: translateX(100%);
    transition: transform var(--transition);
    gap: 4px;
  }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a { color: var(--cream); padding: 14px 10px; border-bottom: 1px solid rgba(255,255,255,0.08); border-radius: 0; }
  .main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--soft-gold); background: rgba(255,255,255,0.05); }
  .nav-cta { margin: 16px 10px 0; }
  .nav-scrim {
    display: none;
    position: fixed; inset: 0; background: rgba(16,42,67,0.5); z-index: 90;
  }
  .nav-scrim.is-open { display: block; }
}

/* -------------------- Hero -------------------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--deep-blue) 55%, var(--royal-blue) 100%);
  color: var(--cream);
  padding: 100px 0 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto -10% -60% -10%;
  height: 220px;
  background: radial-gradient(ellipse at center, rgba(201,162,39,0.18), transparent 70%);
  pointer-events: none;
}
.hero-banner {
  max-width: 900px;
  margin: 0 auto 32px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  border: 1px solid rgba(201,162,39,0.35);
}
.hero-banner img { width: 100%; display: block; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 780px; margin: 0 auto 18px; }
.hero .eyebrow { color: var(--soft-gold); text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; font-weight: 700; margin-bottom: 16px; }
.hero p.lede { color: rgba(247,243,232,0.85); max-width: 620px; margin: 0 auto 32px; font-size: 1.08rem; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.page-hero {
  background: linear-gradient(160deg, var(--navy), var(--royal-blue));
  color: var(--white);
  padding: 70px 0 60px;
  text-align: center;
}
.page-hero h1 { color: var(--white); font-size: clamp(1.8rem, 4vw, 2.6rem); }
.page-hero p { color: rgba(247,243,232,0.85); max-width: 640px; margin: 12px auto 0; }
.breadcrumb { font-size: 0.82rem; color: var(--soft-gold); margin-bottom: 12px; letter-spacing: 0.04em; }
.breadcrumb a { color: var(--soft-gold); }
.breadcrumb a:hover { text-decoration: underline; }

/* -------------------- Sections -------------------- */
section { padding: 84px 0; }
.section-alt { background: var(--cream); }
.section-navy { background: var(--navy); color: var(--cream); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy p { color: rgba(247,243,232,0.82); }

.section-head { max-width: 700px; margin: 0 auto 48px; text-align: center; }
.section-head .eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.76rem; font-weight: 700; margin-bottom: 12px; display: block; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { font-size: 1.02rem; }

.gold-rule { width: 64px; height: 3px; background: var(--gold); margin: 0 auto 20px; border: none; }
.gold-rule.left { margin: 0 0 20px; }

/* -------------------- Grids & Cards -------------------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); }
.card .icon { width: 46px; height: 46px; border-radius: 50%; background: var(--cream); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.3rem; margin-bottom: 18px; border: 1px solid var(--soft-gold); }
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p:last-child { margin-bottom: 0; }

/* -------------------- Book Cards -------------------- */
.book-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-soft); }
.book-cover-wrap {
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, var(--cream), #eee6d3);
  display: flex; align-items: center; justify-content: center;
  padding: 14px;
  position: relative;
}
.book-cover-wrap img { max-height: 100%; object-fit: contain; }
.book-cover-placeholder {
  width: 100%; height: 100%;
  border: 1px dashed var(--soft-gold);
  border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 16px;
  background: var(--white);
}
.book-cover-placeholder .mark { color: var(--gold); font-size: 1.6rem; margin-bottom: 10px; }
.book-cover-placeholder .t { font-family: var(--font-serif); color: var(--navy); font-weight: 700; font-size: 0.95rem; }
.book-cover-placeholder .a { color: var(--muted); font-size: 0.78rem; margin-top: 6px; }

.book-info { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.book-title { font-size: 1.02rem; margin-bottom: 4px; }
.book-author { font-size: 0.86rem; color: var(--muted); margin-bottom: 10px; }
.book-status-row { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  align-self: flex-start;
}
.badge-available { background: rgba(33,78,131,0.1); color: var(--royal-blue); }
.badge-progress { background: rgba(201,162,39,0.14); color: #8a6c15; }
.badge-enquire { background: rgba(90,107,122,0.12); color: var(--muted); }

/* -------------------- Timeline -------------------- */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--gold), var(--royal-blue));
}
.timeline-item { position: relative; padding: 0 0 34px 64px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-num {
  position: absolute; left: 0; top: 0;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--soft-gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 1rem;
  border: 2px solid var(--gold);
}
.timeline-item h3 { font-size: 1.05rem; margin-bottom: 4px; }
.timeline-item p { margin-bottom: 0; font-size: 0.95rem; }

/* -------------------- Author profile -------------------- */
.profile-hero {
  background: linear-gradient(160deg, var(--navy), var(--royal-blue));
  color: var(--cream);
  padding: 70px 0;
}
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: center; }
@media (max-width: 800px) { .profile-grid { grid-template-columns: 1fr; text-align: center; } }
.profile-photo {
  width: 100%; aspect-ratio: 1/1;
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: var(--shadow-soft);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-hero h1 { color: var(--white); margin-bottom: 6px; }
.profile-hero .role { color: var(--soft-gold); font-weight: 600; margin-bottom: 18px; }
.profile-hero p { color: rgba(247,243,232,0.88); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tag { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.25); color: var(--cream); padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; }

.qual-card { background: var(--white); border-left: 4px solid var(--gold); border-radius: 6px; padding: 22px 24px; box-shadow: var(--shadow-card); margin-bottom: 18px; }
.qual-card h4 { font-size: 1rem; margin-bottom: 6px; }
.qual-card p { margin-bottom: 0; font-size: 0.92rem; }

.placeholder-note {
  background: rgba(201,162,39,0.1);
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 0.85rem;
  color: #7a5f14;
  margin-top: 16px;
}

/* -------------------- Spearpoint team -------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}
.team-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 18px 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.team-card:hover {
  transform: translateY(-5px);
  border-color: var(--soft-gold);
  box-shadow: var(--shadow-soft);
}
.team-portrait-link { display: inline-block; border-radius: 50%; }
.team-portrait {
  width: 170px;
  height: 170px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 4px solid var(--gold);
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 8px 22px rgba(16,42,67,0.16);
}
.team-portrait-book { object-position: center; }
.team-card h3 { font-size: 1.22rem; margin-bottom: 8px; }
.team-role {
  color: #806516;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0;
}
.team-profile-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--royal-blue);
  font-weight: 700;
  font-size: 0.9rem;
}
.team-profile-link:hover { color: var(--navy); text-decoration: underline; }
@media (max-width: 1100px) {
  .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .team-grid { grid-template-columns: 1fr; }
  .team-portrait { width: 155px; height: 155px; }
}

/* -------------------- Contact -------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-detail { display: flex; gap: 16px; margin-bottom: 22px; }
.contact-detail .ic { width: 42px; height: 42px; border-radius: 50%; background: var(--cream); border: 1px solid var(--soft-gold); color: var(--gold); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-detail h4 { font-size: 0.95rem; margin-bottom: 2px; }
.contact-detail p { font-size: 0.92rem; margin-bottom: 0; }

form.enquiry-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--charcoal);
  background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 0.8rem; color: var(--muted); }
.form-success { display: none; background: rgba(33,78,131,0.08); border: 1px solid var(--royal-blue); border-radius: 8px; padding: 16px; color: var(--navy); font-weight: 600; }

/* -------------------- CTA band -------------------- */
.cta-band {
  background: linear-gradient(160deg, var(--navy), var(--deep-blue));
  color: var(--cream);
  text-align: center;
  padding: 70px 0;
}
.cta-band h2 { color: var(--white); }
.cta-band .actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* -------------------- Footer -------------------- */
.site-footer { background: var(--navy); color: rgba(247,243,232,0.75); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 40px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { height: 40px; width: 40px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(201,162,39,0.5); }
.footer-brand span { font-family: var(--font-serif); color: var(--white); font-weight: 700; font-size: 1.1rem; }
.site-footer h5 { color: var(--soft-gold); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.82rem; }
.social-row { display: flex; gap: 12px; }
.social-row a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.social-row a:hover { background: rgba(255,255,255,0.1); }

.back-to-top {
  position: fixed; right: 22px; bottom: 22px;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--navy); color: var(--soft-gold);
  border: 2px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-soft);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  z-index: 80;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

/* -------------------- Bookstore controls -------------------- */
.store-controls {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 36px;
}
.store-controls .field { min-width: 180px; flex: 1; }
.store-controls .field.search-field { flex: 2; min-width: 240px; }
.results-count { font-size: 0.88rem; color: var(--muted); margin-bottom: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }

/* -------------------- Utility -------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* -------------------- 404 -------------------- */
.error-page { text-align: center; padding: 140px 0; }
.error-page .code { font-family: var(--font-serif); font-size: 6rem; color: var(--gold); line-height: 1; margin-bottom: 10px; }
