/* Married to a Bedouin – static site styles.
   Colours, sizes and spacing carried over from the WordPress page's inline styles. */

:root {
  --accent: #8a5a2e;        /* links, buttons: 5.9:1 on white */
  --accent-dark: #6f4724;   /* hover */
  --accent-light: #c1976b;  /* decoration only (borders, underlines), not text */
  --green: #6b8e23;

  --text: #333;
  --text-body: #555;
  --text-soft: #444;
  --text-muted: #777;
  --text-faint: #888;

  --bg-white: #ffffff;
  --bg-tint: #f6ede1;     /* sand: alternates with white between sections */
  --bg-soft: #fbf6ef;     /* language editions panel under "Where to Buy" */
  --bg-card: #fbf7f1;
  --bg-footer: #ebe1d3;

  --serif-display: 'Playfair Display', Georgia, serif;
  --serif-body: 'Lora', Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-white);
  color: var(--text-body);
  font-family: var(--serif-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--serif-display); color: var(--text); line-height: 1.25; }
h2 { font-size: 2rem; margin: 0 0 20px; }
h3 { font-size: 1.6rem; margin: 0 0 20px; }

a { color: var(--accent); }

/* ---------- Layout helpers ---------- */

.section    { padding: 80px 20px; }
.section-md { padding: 50px 20px; }
.section-sm { padding: 40px 20px; }

.container        { max-width: 1100px; margin: 0 auto; }
.container.narrow { max-width: 1000px; }
.center { text-align: center; }
.muted  { color: var(--text-muted); }

.bg-white { background: var(--bg-white); }
.bg-tint  { background: var(--bg-tint); }
.bg-soft  { background: var(--bg-soft); border-top: 1px solid #efe4d6; }

.two-col {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}

.shadow    { border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.shadow-lg { border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #eee;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}
.site-title {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.site-tagline { font-size: 0.9rem; color: var(--text-muted); margin-top: 2px; }

.main-nav { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.main-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--accent-dark); border-bottom-color: var(--accent-light); }

/* Keep section headings clear of the sticky header when jumping to them */
section[id] { scroll-margin-top: 72px; }

/* ---------- Buttons ---------- */

.btn {
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 4px;
  font-family: var(--serif-body);
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}
.btn-small   { padding: 10px 22px; border-radius: 5px; font-weight: normal; }
.btn-primary { background: var(--accent); }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--accent-dark); }
.btn-outline { border-color: #fff; background: transparent; }
.btn-outline:hover, .btn-outline:focus-visible { background: #fff; color: var(--text); }
.btn-green   { background: var(--green); }
.btn-green:hover, .btn-green:focus-visible { background: #5a781d; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  text-align: center;
  color: #fff;
  font-family: var(--serif-display);
  background:
    radial-gradient(ellipse at center, rgba(30,18,10,0.62) 0%, rgba(30,18,10,0.5) 100%),
    url('images/petrascene.webp') center / cover no-repeat;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}
.hero-content { max-width: 800px; margin: auto; padding: 100px 20px; }
.hero h1 { font-size: 2.8rem; margin: 0 0 20px; color: #fff; }
.hero-subtitle { font-size: 1.4rem; margin: 0 0 30px; }
.hero-quote {
  font-family: var(--serif-body);
  font-size: 1.2rem;
  font-style: italic;
  margin: 20px 0;
}
.hero-intro {
  font-family: var(--serif-body);
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0 0 30px;
}
.hero-buttons { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }

/* ---------- About the book ---------- */

.col-text  { flex: 1 1 500px; }
.col-text p { font-size: 1.05rem; line-height: 1.8; margin: 0 0 20px; }
.col-text .lead { font-size: 1.1rem; }
.col-image { flex: 1 1 400px; }

.about-figure { margin: 0; }
.about-figure img { display: block; width: 100%; max-width: 440px; margin: 0 auto; }
.about-figure figcaption { font-size: 0.85rem; color: var(--text-faint); margin-top: 10px; text-align: center; }

/* ---------- Testimonials ---------- */

#reader-testimonials { padding-top: 60px; padding-bottom: 60px; }
#reader-testimonials h2 { margin-bottom: 40px; }
.cards { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; }
.card {
  flex: 1 1 280px;
  margin: 0;
  background: var(--bg-card);
  padding: 25px 20px;
  border-radius: 10px;
  border: 1px solid #efe6da;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.card p { font-style: italic; font-size: 1.05rem; color: var(--text-soft); margin: 0; }
.card cite { display: block; font-style: normal; font-size: 0.9rem; color: var(--text-muted); margin-top: 15px; }

/* ---------- Petra & the Bdoul ---------- */

#petra-and-bdoul { padding-top: 60px; padding-bottom: 60px; }
#petra-and-bdoul h2 { margin-bottom: 25px; }
.bdoul-image { display: block; max-width: 50%; margin: 0 auto 30px; }
.prose { text-align: left; }
.prose p { font-size: 1.1rem; line-height: 1.8; color: var(--text-soft); margin: 0 0 1.8em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- Buy the book ---------- */

#buy-the-book { padding-top: 60px; padding-bottom: 60px; }
.buy-cover { flex: 1 1 300px; text-align: center; }
.buy-cover img { width: 100%; max-width: 250px; }
.buy-text { flex: 2 1 400px; }
.buy-text h2 { font-size: 2.2rem; }
.buy-text p { font-size: 1.05rem; line-height: 1.8; }
.buy-buttons { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 10px; }
.buy-buttons .arrow { display: inline-block; transition: transform 0.3s; }
#toggle-editions[aria-expanded="true"] .arrow { transform: rotate(180deg); }

#language-editions { opacity: 1; transition: opacity 0.5s ease-in-out; }
#language-editions.fading { opacity: 0; }
.editions { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; margin-top: 30px; }
.edition { width: 158px; text-align: center; }
.edition img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 14px;
}
.edition a {
  display: inline-block;
  background: var(--accent);
  padding: 8px 12px;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95rem;
}
.edition a:hover, .edition a:focus-visible { background: var(--accent-dark); }

/* ---------- Excerpt ---------- */

#read-an-excerpt h2 { margin-bottom: 40px; }
.excerpt {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-soft);
  padding: 30px;
  border-left: 5px solid var(--accent-light);
  background: #fff;
  border-radius: 5px;
  text-align: left;
}
.excerpt::after { content: ""; display: table; clear: both; }
.excerpt p { margin: 0 0 1.8em; }
.excerpt p:last-child { margin-bottom: 0; }
.excerpt img { width: 40%; max-width: 300px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.float-left  { float: left;  margin: 0 20px 20px 0; }
.float-right { float: right; margin: 0 0 20px 20px; }
.source { margin-top: 30px; }

/* ---------- Gallery ---------- */

#photo-gallery h2 { margin-bottom: 40px; }
.gallery { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; }
.gallery img {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ---------- Author ---------- */

.author-text { flex: 2 1 500px; }
.author-photo { flex: 1 1 300px; text-align: center; }
.author-photo img { width: 100%; max-width: 300px; border-radius: 10%; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ---------- Petra Pieces ---------- */

.pieces { max-width: 900px; }
.pieces h2 { font-size: 1.8rem; margin-bottom: 40px; }
.pieces-grid { display: grid; gap: 30px; grid-template-columns: 1fr 1fr; align-items: center; }
.pieces-grid figure { margin: 0; }
.pieces-grid img {
  display: block;
  width: 80%;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.pieces-grid figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
.pieces-text { margin: 0; font-size: 1rem; line-height: 1.6; text-align: left; }

/* ---------- Contact form ---------- */

.form-wrap { max-width: 640px; }
.form-wrap h2 { margin-bottom: 6px; }
.form-wrap .lead { font-size: 1.1rem; margin: 0 0 28px; }

.contact-form { display: flex; flex-direction: column; }
.contact-form label { font-weight: 700; color: rgba(0,0,0,0.85); margin: 0 0 6px; }
.contact-form .req { color: #d63637; }
.contact-form input,
.contact-form textarea {
  font: inherit;
  font-size: 1rem;
  color: rgba(0,0,0,0.8);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 20px;
  width: 100%;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.contact-form button { align-self: flex-start; }
.form-status { min-height: 1.5em; margin: 16px 0 0; }
.form-status.success { color: #2e7d32; }
.form-status.error { color: #d63637; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg-footer);
  padding: 60px 20px;
  text-align: center;
}
.site-footer p { font-size: 1.1rem; margin: 0 0 20px; }
.footer-nav { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; margin-bottom: 30px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.footer-image { display: block; margin: 20px auto 0; max-width: 400px; width: 100%; }

#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 1.2rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }

/* ---------- Small screens ---------- */

@media (max-width: 768px) {
  .site-header { flex-direction: column; align-items: center; text-align: center; padding: 12px 16px 8px; gap: 6px; }
  .brand { align-items: center; }
  .site-title { font-size: 1.2rem; }
  .main-nav { justify-content: center; gap: 4px 22px; }
  .main-nav a { font-size: 0.95rem; }
  section[id] { scroll-margin-top: 100px; }

  .section { padding: 60px 16px; }
  .section-md, .section-sm { padding-left: 16px; padding-right: 16px; }
  .hero-content { padding: 80px 16px; }
  .hero h1 { font-size: 2.2rem; }
  .hero-subtitle { font-size: 1.2rem; }
  .col-text, .col-image, .buy-cover, .buy-text, .author-text, .author-photo { flex-basis: 100%; }
  .bdoul-image { max-width: 100%; }

  #read-an-excerpt h2 { font-size: 1.6rem; }
  .excerpt { font-size: 1rem; padding: 20px; }
  .excerpt img { float: none; display: block; margin: 20px auto; width: 90%; max-width: 280px; }

  .pieces-grid { grid-template-columns: 1fr; }
  .pieces-text { text-align: center; }
  .pieces-grid img { width: 90%; }

  #back-to-top { bottom: 20px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
