/*
   GLOBAL.CSS
   Shared site-wide styles for Jean's Theme
   Homepage-specific styling moved to homepage.css
*/

/* =========================
   DESIGN SYSTEM
   ========================= */

:root {
  --site-bg: #d7d5cf;
  --page-bg: #f5f2eb;
  --surface: #f7f2eb;
  --surface-alt: #ece8df;
  --text-main: #2f2924;
  --text-soft: #5c5146;
  --border-soft: #d8cfc4;
  --border-strong: #c8c2b8;
  --accent: #a65a3a;
  --accent-hover: #8d4a2e;
  --footer-bg: #6b6a64;
  --footer-bg-hover: #575650;
  --white-soft: #f5f2eb;

  --max-width-page: 1500px;
  --max-width-content: 1400px;
  --max-width-wide: 1400px;
  --max-width-home: 1240px;
  --max-width-text: 760px;
}

/* Hide default page titles site-wide (Twenty Eleven) */
.page .entry-title {
  display: none;
}

/* =========================
   GLOBAL RESET / BASE
   ========================= */

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

body,
body.custom-background {
  margin: 0;
  padding: 0;
  background: var(--site-bg);
  color: var(--text-main);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

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

/* =========================
   PAGE WRAPPER + LAYOUT
   ========================= */

#page {
  width: 100%;
  max-width: var(--max-width-page);
  margin: 0 auto;
  border: none;
  background: var(--page-bg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.site,
#page,
#main,
#primary,
#content,
#supplementary {
  box-sizing: border-box;
}

#main {
  clear: both;
  min-height: 1px;
  padding: 0;
  background-color: var(--page-bg);
}

#primary {
  width: 100%;
  background-color: var(--page-bg);
}

#supplementary {
  padding: 2em 7.6%;
  font-size: 12px;
  line-height: 1.5;
  font-weight: normal;
  background-color: var(--page-bg);
  border-top: 1px solid var(--border-strong);
}

/* =========================
   TYPOGRAPHY SYSTEM
   ========================= */

body,
input,
textarea,
select,
button {
  color: var(--text-main);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

h1,
h2,
h3,
h4,
h5,
h6,
.books-page-title,
.books-page-featured-title,
.books-page-grid-heading,
.books-page-card-title {
  margin: 0 0 0.75em;
  color: var(--text-main);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.2;
}

h1 {
  font-size: 42px;
}

h2 {
  font-size: 32px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 20px;
}

p,
#primary p,
.entry-content p,
.books-page-description,
.books-page-featured-description {
  margin: 0 0 1.2em;
  color: var(--text-soft);
  line-height: 1.8;
}

.entry-content,
.entry-summary {
  color: var(--text-main);
}

.entry-content p,
.entry-summary p {
  max-width: 760px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin-bottom: 0.6em;
}

/* =========================
   CONTENT WIDTH + SPACING
   ========================= */

#content {
  width: 100%;
  margin: 0;
  padding: 0;
}

.singular .hentry,
.page .hentry,
.entry-content,
.entry-header {
  padding-left: 20px;
  padding-right: 20px;
}

.singular .entry-content,
.singular .entry-header,
.page .entry-content,
.page .entry-header {
  padding-left: 30px;
  padding-right: 30px;
}

.entry-content p,
#primary p {
  margin-bottom: 1.2em;
  line-height: 1.7;
}

/* =========================
   WIDE / FULL ALIGN SUPPORT
   ========================= */

.alignwide,
.wp-block-group.alignwide,
.wp-block-columns.alignwide,
.wp-block-cover.alignwide {
  max-width: var(--max-width-wide);
  margin-left: auto;
  margin-right: auto;
}

.alignfull,
.wp-block-group.alignfull,
.wp-block-cover.alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* =========================
   BLOCK / CONTENT SPACING
   ========================= */

.wp-block-button,
.wp-block-image,
.wp-block-columns,
.wp-block-group,
.wp-block-cover {
  margin-bottom: 1.5em;
}

/* =========================
   HEADER SEARCH TWEAK
   ========================= */

#branding .with-image #searchform {
  display: none;
}

#branding .only-search + #access div {
  padding-right: 0;
}

/* =========================
   NAVIGATION REFRESH
   ========================= */

#access {
  margin: 0;
  background: var(--surface);
  background-image: none !important;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

#access,
#access ul,
#access li,
#access a {
  background-image: none !important;
  box-shadow: none;
}

#access ul {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 20px;
  list-style: none;
}

#access li {
  margin: 0;
  position: relative;
}

#access a {
  display: block;
  padding: 18px 20px;
  background: none !important;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
}

#access a:hover,
#access a:focus,
#access .current-menu-item > a,
#access .current_page_item > a {
  background: transparent;
  color: var(--accent);
}

#access ul ul {
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

#access ul ul a {
  min-width: 220px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}

#access ul ul li:last-child a {
  border-bottom: 0;
}

/* =========================
   GENERIC BUTTON SYSTEM
   ========================= */

a.button,
.wp-block-button__link,
.book-card-button,
.closing-cta-button,
.retailer-button,
.featured-book-cta,
.books-page-featured-button,
.books-page-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

a.button:hover,
a.button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus,
.book-card-button:hover,
.book-card-button:focus,
.closing-cta-button:hover,
.closing-cta-button:focus,
.retailer-button:hover,
.retailer-button:focus,
.featured-book-cta:hover,
.featured-book-cta:focus,
.books-page-featured-button:hover,
.books-page-featured-button:focus,
.books-page-card-button:hover,
.books-page-card-button:focus {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
}

/* =========================
   LINKS
   ========================= */

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

a:hover,
a:focus {
  color: var(--accent-hover);
}

/* =========================
   FORMS
   ========================= */

input,
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166, 90, 58, 0.12);
}

button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

button:hover,
button:focus,
input[type="submit"]:hover,
input[type="submit"]:focus,
input[type="button"]:hover,
input[type="button"]:focus,
input[type="reset"]:hover,
input[type="reset"]:focus {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* =========================
   FOOTER
   ========================= */

#colophon {
  background: var(--footer-bg);
  color: #fff;
  border-top: none;
}

#colophon a {
  color: #fff;
}

#colophon a:hover,
#colophon a:focus {
  color: var(--white-soft);
}

#site-generator {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.82);
}

/* =========================
   UTILITY / SHARED HELPERS
   ========================= */

.text-center {
  text-align: center;
}

.max-text-width {
  max-width: var(--max-width-text);
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
  #access ul {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 768px) {
  #page {
    box-shadow: none;
  }

  .singular .entry-content,
  .singular .entry-header,
  .page .entry-content,
  .page .entry-header,
  .singular .hentry,
  .page .hentry,
  .entry-content,
  .entry-header {
    padding-left: 20px;
    padding-right: 20px;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 22px;
  }
}

@media (max-width: 680px) {
  #access a {
    padding: 16px 14px;
    font-size: 14px;
  }

  body,
  body.custom-background,
  body input,
  body textarea,
  body select,
  body button {
    font-size: 16px;
  }

  .wp-block-button__link,
  a.button,
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"] {
    width: auto;
    min-width: 0;
  }
}