/* ============================================================
   E. M. Halle — emhalle.com
   Clean literary-thriller aesthetic. Vanilla CSS, no build step.
   ============================================================ */

:root {
  --bg:        #faf8f4;   /* warm paper */
  --bg-alt:    #f1ede5;
  --ink:       #1c1b19;   /* near-black */
  --ink-soft:  #4a463f;
  --muted:     #7c766b;
  --line:      #e2dccf;
  --gold:      #9c7a3c;   /* restrained brass accent */
  --gold-deep: #7d5f2b;
  --dark:      #16181c;   /* cold noir */
  --dark-soft: #21242a;
  --paper-on-dark: #ece8df;
  --crimson:   #7a2230;   /* binding-clause accent */
  --steel:     #2c4a52;   /* hard-asset accent */
  --radius:    4px;
  --maxw:      1140px;
  --shadow:    0 14px 40px rgba(20,18,15,.16);
  --shadow-sm: 0 4px 14px rgba(20,18,15,.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .book-card h3, .modal-body h2 {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: .2px;
}

a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: 760px; }

.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;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .94rem;
  letter-spacing: .3px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, background .2s ease, color .2s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-deep); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,244,.92);
  backdrop-filter: saturate(120%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 1.5rem; color: var(--ink); letter-spacing: 1px; }
.brand:hover { text-decoration: none; color: var(--gold-deep); }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-soft); font-size: .92rem; font-weight: 500; }
.nav-links a:hover { color: var(--gold-deep); text-decoration: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); transition: .25s; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(156,122,60,.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: 90px 22px 96px; max-width: 880px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 4px; font-size: .8rem;
  color: var(--gold-deep); font-weight: 600; margin: 0 0 18px;
}
.hero-title { font-size: clamp(2.1rem, 5vw, 3.5rem); margin: 0 0 22px; }
.hero-sub { font-size: 1.16rem; color: var(--ink-soft); max-width: 660px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 78px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--dark); color: var(--paper-on-dark); }
.section-dark h2 { color: #fff; }
.section-dark .section-head p { color: #b9b3a7; }
.section-head { max-width: 680px; margin: 0 auto 46px; text-align: center; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 0 0 14px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

/* ---------- Book grid ---------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 34px;
}
.loading { color: var(--muted); grid-column: 1 / -1; text-align: center; }

.book-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.book-cover { position: relative; aspect-ratio: 2 / 3; background: var(--bg-alt); overflow: hidden; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-cover .series-flag {
  position: absolute; top: 12px; left: 12px;
  font-size: .68rem; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 600; color: #fff; padding: 5px 10px; border-radius: 3px;
  background: rgba(20,20,20,.72); backdrop-filter: blur(2px);
}
.book-card[data-series="hard-asset"] .series-flag { background: rgba(44,74,82,.88); }
.book-card[data-series="binding-clause"] .series-flag { background: rgba(122,34,48,.88); }

.book-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.book-body h3 { font-size: 1.55rem; margin: 0 0 4px; color: var(--ink); }
.book-series-name { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold-deep); font-weight: 600; margin: 0 0 12px; }
.book-tagline { font-style: italic; color: var(--ink-soft); margin: 0 0 14px; font-size: 1.02rem; }
.book-blurb-short { color: var(--ink-soft); font-size: .94rem; margin: 0 0 16px; }

.lang-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.lang-badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .5px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-soft); background: var(--bg);
}
.lang-badge[data-status="live"]   { border-color: #2e7d4f; color: #2e7d4f; background: #eef7f0; }
.lang-badge[data-status="review"] { border-color: var(--gold); color: var(--gold-deep); background: #fbf5e9; }

.book-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status-pill {
  font-size: .74rem; font-weight: 600; letter-spacing: .4px;
  padding: 5px 11px; border-radius: 999px;
}
.status-pill.live   { background: #e7f4ec; color: #246b43; }
.status-pill.review { background: #fbf1da; color: var(--gold-deep); }
.status-pill.soon   { background: #efeae0; color: var(--muted); }
.book-foot .btn { padding: 9px 16px; font-size: .85rem; }
.link-more { margin-left: auto; font-size: .85rem; font-weight: 600; background: none; border: 0; color: var(--gold-deep); cursor: pointer; }
.link-more:hover { text-decoration: underline; }
.adult-tag { font-size: .68rem; color: var(--muted); border: 1px solid var(--line); padding: 2px 7px; border-radius: 3px; }

/* ---------- Series ---------- */
.series-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; }
.series-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 30px 28px; box-shadow: var(--shadow-sm); border-top: 4px solid var(--gold); }
.series-card[data-series="hard-asset"] { border-top-color: var(--steel); }
.series-card[data-series="binding-clause"] { border-top-color: var(--crimson); }
.series-card .kind { font-size: .76rem; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); font-weight: 600; }
.series-card h3 { font-size: 1.9rem; margin: 6px 0 12px; }
.series-card p { color: var(--ink-soft); margin: 0 0 16px; }
.series-card .count { font-size: .86rem; color: var(--muted); }

/* ---------- News ---------- */
.news-list { display: flex; flex-direction: column; gap: 8px; }
.news-item { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 22px 24px; box-shadow: var(--shadow-sm); }
.news-item time { font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-deep); font-weight: 600; }
.news-item h3 { font-family: "Cormorant Garamond", serif; font-size: 1.45rem; margin: 6px 0 8px; }
.news-item p { margin: 0; color: var(--ink-soft); }

/* ---------- Forms ---------- */
.signup-form, .feedback-form { max-width: 620px; margin: 0 auto; }
.field-row { display: flex; gap: 10px; }
.field-row input { flex: 1; }
.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.section-dark .field label { color: #cfc9bd; }

input, select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
textarea { resize: vertical; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: var(--muted); margin: 14px 0 16px; line-height: 1.5; }
.section-dark .consent { color: #b9b3a7; }
.consent input { width: auto; margin-top: 3px; flex-shrink: 0; }

.form-status { min-height: 1.2em; font-size: .9rem; margin: 10px 0 0; font-weight: 500; }
.form-status.ok { color: #2e7d4f; }
.section-dark .form-status.ok { color: #7fd3a0; }
.form-status.err { color: var(--crimson); }
.section-dark .form-status.err { color: #e98a96; }
.form-status.info { color: var(--muted); }
.section-dark .form-status.info { color: #b9b3a7; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark-soft); color: #b9b3a7; padding: 46px 0; }
.footer-inner { text-align: center; }
.footer-brand { font-family: "Cormorant Garamond", serif; font-size: 1.6rem; color: #fff; letter-spacing: 1px; margin: 0 0 8px; }
.footer-note { font-size: .86rem; margin: 0 0 12px; }
.footer-links a { color: #cabf9b; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15,14,12,.62); }
.modal-card {
  position: relative; max-width: 760px; margin: 6vh auto; background: var(--bg);
  border-radius: 8px; box-shadow: var(--shadow); max-height: 88vh; overflow: auto;
}
.modal-close { position: sticky; top: 0; float: right; margin: 10px 10px -40px auto; z-index: 2; background: rgba(255,255,255,.7); border: 1px solid var(--line); width: 38px; height: 38px; border-radius: 50%; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink); }
.modal-close:hover { background: #fff; }
.modal-body { padding: 34px 38px 40px; }
.modal-detail { display: grid; grid-template-columns: 200px 1fr; gap: 28px; }
.modal-detail img { width: 100%; border-radius: 4px; box-shadow: var(--shadow-sm); }
.modal-detail h2 { font-size: 2.1rem; margin: 0 0 4px; }
.modal-series { font-size: .78rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold-deep); font-weight: 600; margin: 0 0 14px; }
.modal-tagline { font-style: italic; font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 16px; }
.modal-blurb p { color: var(--ink-soft); margin: 0 0 12px; }
.modal-comps { font-size: .88rem; color: var(--muted); font-style: italic; }
.editions-table { width: 100%; border-collapse: collapse; margin: 18px 0 6px; }
.editions-table th, .editions-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.editions-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.edition-action a { font-weight: 600; }
.edition-action .soft { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: absolute; top: 64px; right: 0; left: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line); padding: 8px 0;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .2s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 22px; }
  .nav-toggle { display: flex; }
  .hero-inner { padding: 64px 22px 70px; }
  .section { padding: 56px 0; }
  .modal-detail { grid-template-columns: 1fr; }
  .modal-detail img { max-width: 200px; margin: 0 auto; }
  .modal-body { padding: 30px 22px 34px; }
}

/* ---------- Language switcher ---------- */
.lang-switch { position: relative; margin-left: 8px; }
.lang-switch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-soft); font: inherit; font-size: .86rem; font-weight: 600;
  padding: 7px 12px; cursor: pointer;
}
.lang-switch-btn:hover { border-color: var(--gold); color: var(--gold-deep); }
.lang-switch-btn .chev { font-size: .7rem; }
.lang-switch-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow-sm); padding: 6px; list-style: none; margin: 0;
  display: none; z-index: 60;
}
.lang-switch-menu.open { display: block; }
.lang-switch-menu li { margin: 0; }
.lang-switch-menu a {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 8px 12px; border-radius: 4px; color: var(--ink-soft); font-size: .9rem; font-weight: 500;
}
.lang-switch-menu a:hover { background: var(--bg-alt); text-decoration: none; color: var(--gold-deep); }
.lang-switch-menu a[aria-current="true"] { color: var(--gold-deep); font-weight: 700; }
.lang-switch-menu a .native { color: var(--muted); font-size: .8rem; }
@media (max-width: 760px) {
  .lang-switch { margin: 0; }
  .lang-switch-menu { right: 0; left: auto; }
}
