/* ------------------------------------------------------------------
   SĪRA — global styles & design tokens
   Editorial encyclopedia landing page.
   ------------------------------------------------------------------ */

@import './fonts.css';

:root {
  /* Palette — cream paper, forest green, muted browns */
  --paper:        #f4f0e4;   /* page background            */
  --paper-left:   #efe9da;   /* hero panel (slightly deeper)*/
  --paper-hair:   #ddd4bf;   /* hairlines / rules          */
  --ink:          #23312b;   /* near-black green ink        */
  --ink-soft:     #3a4740;   /* softened ink                */
  --green:        #164c45;   /* primary accent (brand green) */
  --green-soft:   #2a6f63;   /* lighter green (hover)        */
  --brown:        #675b3e;   /* muted brown body text (AA ~5.8:1) */
  --brown-soft:   #6f6244;   /* brown labels / meta   (AA ~5.3:1) */
  --gold:         #766634;   /* subtitle gold         (AA ~5.0:1) */
  --numeral:      #cfc6ac;   /* large index numerals        */

  /* Type */
  --serif:  "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --arabic: "Amiri", "Scheherazade New", "Traditional Arabic", serif;

  /* Rhythm */
  --page-max: 1180px;
  --gutter:   clamp(1.25rem, 4vw, 3.25rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  font-feature-settings: "kern" 1, "liga" 1;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p {
  margin: 0;
}

/* Small letter-spaced caps used for labels / nav / meta */
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ------------------------------------------------------------------
   Search suggestions (masthead).
   Global rather than scoped: the rows are rendered from the client
   script, so they never receive Astro's component scope attribute.
   ------------------------------------------------------------------ */
.suggest {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  width: max(100%, 26rem);
  max-height: min(70vh, 30rem);
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--paper-hair);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(35, 49, 43, 0.13);
}
.suggest[hidden] { display: none; }

.suggest__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--paper-hair);
}
.suggest__title {
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.3;
}
.suggest__kind {
  grid-row: 1;
  grid-column: 2;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brown-soft);
  white-space: nowrap;
  align-self: center;
}
.suggest__blurb {
  grid-column: 1 / -1;
  font-size: 0.88rem;
  color: var(--brown);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.suggest__row:hover,
.suggest__row[aria-selected='true'] { background: rgba(47, 107, 87, 0.07); }
.suggest__row:hover .suggest__title,
.suggest__row[aria-selected='true'] .suggest__title { color: var(--green); }

.suggest__more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--green);
}
.suggest__more:hover,
.suggest__more[aria-selected='true'] { background: rgba(47, 107, 87, 0.07); }

.suggest__empty {
  padding: 0.9rem 1rem;
  margin: 0;
  color: var(--brown-soft);
  font-style: italic;
}

.suggest mark {
  background: rgba(118, 102, 52, 0.18);
  color: inherit;
  border-radius: 2px;
}

/* Available to screen readers only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Diagonal cross-hatch pattern for the hero panel */
.crosshatch {
  background-color: var(--paper-left);
  background-image:
    repeating-linear-gradient( 45deg, transparent 0 26px, rgba(138,124,96,0.10) 26px 27px),
    repeating-linear-gradient(-45deg, transparent 0 26px, rgba(138,124,96,0.10) 26px 27px);
}

@media (prefers-reduced-motion: no-preference) {
  a, .row { transition: color 160ms ease, background-color 160ms ease; }
}
