/* local fonts */

@font-face {
  font-family: "GeologicaLocal";
  src: url("fonts/Geologica-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OutfitLocal";
  src: url("fonts/Outfit-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OutfitLocal";
  src: url("fonts/Outfit-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "InterLocal";
  src: url("fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "InterLocal";
  src: url("fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "DavidLibreLocal";
  src: url("fonts/DavidLibre-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JostLocal";
  src: url("fonts/Jost-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JostLocal";
  src: url("fonts/Jost-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JostLocal";
  src: url("fonts/Jost-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JostLocal";
  src: url("fonts/Jost-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* root tokens */

:root {
  --color-bg-main: #FFF8E4;
  --color-bg-alt: #fff8d4;
  --color-hero-gradient-end: #CBEDFF;

  --color-primary: #002874;
  --color-subtitle: #626262;
  --color-text-main: #000000;
  --color-text-light: #ffffff;
  --color-nav-hover: rgb(255, 207, 112);

  --color-dark-green: #275300;
  --color-bright-green: #649600;
  --color-medium-green: #4C7A00;

  --color-border-subtle: #e2e2e2;
  --color-highlight: rgb(240, 180, 90); /* #FFCF70; */
  --color-card: #FFF8F0;

  --color-button-bg: #002874;
  --color-button-text: #ffffff;
  --color-button-hover-bg: rgb(255, 207, 112);
  --color-button-hover-text: #002874;

  --color-link: #0014C8;
  --color-link-visited: purple;
  --color-link-hover: rgb(210, 135, 25);

  --font-heading: "GeologicaLocal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "OutfitLocal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-alternate: "JostLocal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-diacritic: "InterLocal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-md: 10px;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);

  --content-width: 960px;
  --section-padding-xy: clamp(1rem, 5vw, 4rem); 
}

/* reset */

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text-main);
  background-color: var(--color-bg-main);
  line-height: 1.6;
  font-size: clamp(1rem, 3.5vw, 1.125rem); /* 16-18px */
}

b, strong {
  font-weight: 700;
}

.diacritic {
  font-family: var(--font-diacritic);
  font-size: 0.9em;
}

h1 {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 6vw, 4.5rem);
  text-align: center;
  color: var(--color-primary);
  line-height: 1.25;
}

.hero-section h1 {
  margin: 0 0 0.25rem 0;
  font-size: clamp(1.5rem, 10vw, 3.75rem);
}

.article .hero-section h1 {
  font-size: clamp(1.2rem, 6vw, 2rem);
}

.article-title p {
  line-height: 1.4;
}

.hero-subtitle {
  color: var(--color-subtitle);
  margin: 0 0 1rem;
  font-size: clamp(1rem, 6vw, 2rem);
  text-align: center;
}

.hero-tagline {
  margin: 0.5rem 0 2rem;
  font-family: var(--font-alternate);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 8vw, 3.25rem);
  color: var(--color-medium-green);
  line-height: 1.2;
  text-align: centre;
  animation: foldUp 3s ease forwards;
}

@keyframes foldUp {
  0% {
    opacity: 0;
    transform: rotateX(-90deg);
    transform-origin: bottom;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotateX(0deg) translateY(0);
    transform-origin: bottom;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-tagline {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (min-width: 700px) {
  .hero-section h1 {
    font-size: clamp(2rem, 6vw, 4rem);
  }
  .hero-subtitle {
    font-size: clamp(1rem, 3vw, 2rem);
  }
  .article .hero-section h1 {
    font-size: clamp(1rem, 6vw, 2.5rem);
  }
  .hero-tagline {
    font-size: clamp(1.85rem, 5vw, 3.25rem);
  }
}

h2 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: clamp(1.25rem, 4.25vw, 1.375rem); /* 20-22px */
  line-height: 1.2;
  position: relative;
}

/* Underline accent under section headings */
h2::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.35rem;
  height: 2px;
  border-radius: 999px;
  width: 100%;
  background: var(--color-highlight);
}

h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.175rem;
  font-family: var(--font-body);
  font-weight: 700;
}

[lang="he"] {
  font-family: "DavidLibreLocal", system-ui, sans-serif;
  direction: rtl;
  unicode-bidi: bidi-override;
}

p {
  margin-bottom: 1em;
}

cite {
    font-style: normal;
}

cite.book {
  font-style: italic;
}

/* layout helpers */

.container {
  width: 100%;
  position: relative;
  z-index: 1;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--section-padding-xy) 0;
}

/* skip link */

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
}

/* nav header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-primary);
  border-bottom: none;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  gap: 1 rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  min-width: min-content;
  gap: 1.25rem;
}

.nav-link {
  font-size: 1rem;
  text-decoration: none;
  color: var(--color-text-light);
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--color-nav-hover);
}

.nav-link-active {
  color: var(--color-text-light);
  border-bottom-color: var(--color-text-light);
}

/* hero */

.hero-section {
  position: relative;
  overflow: hidden;
  background-image: linear-gradient(90deg, var(--color-bg-main), var(--color-hero-gradient-end));
  padding-top: clamp(1rem, 10vw, 3rem);
  padding-bottom: clamp(1rem, 10vw, 3rem);
  text-align: center;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("img/hebrew-scroll-mobile.jpg") center/cover no-repeat;
  opacity: 0.2;
  pointer-events: none;
}

@media (min-width: 700px){
  .hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("img/hebrew-scroll.jpg") center/cover no-repeat;
    opacity: 0.2;
    pointer-events: none;
  }
}

.hero-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 5vw, 2rem);
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-image {
  width: 100%;
  max-width: 450px;
  justify-content: center;
}

/* 2-column layout on tablet & desktop */

@media (min-width: 700px) {
  .hero-inner {
    display: flex;
    flex-direction: row-reverse;
    gap: 2rem;
    align-items: center;
  }
  .hero-text {
    flex: 1.2;
    min-width: 0;
  }
  .hero-image {
    flex: 0.8;
  }
}

.hero-image img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  display: block;
  object-fit: cover;
}

/* sections */

.section {
  padding-top: 2rem;
  padding-bottom: 2rem;
  background-color: var(--color-bg-main);
}

.article .container {
  max-width: 800px;
}

section > *:last-child {
  margin-bottom: 0;
}

.section-alt {
  padding-top: 2rem;
  padding-bottom: 2rem;
  background-color: var(--color-bg-alt);
}

section-alt > *:last-child {
  margin-bottom: 0;
}

.section-content > *:last-child {
  margin-bottom: 0;
}

.article-title > *:last-child {
  margin-bottom: 0;
}

/* Section layout: heading left, body right (on wider screens) */

.section-inner {
  display: block;
}

@media (min-width: 700px) {
  .section-inner {
    display: grid;
    gap: 1.25rem 3rem;
    grid-template-columns: 10rem minmax(0, 1fr);
    align-items: flex-start;
  }
}

/* lists and text */

.bullet-list {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
  list-style: disc;
}

/* Text inline or stacked depending on viewport */

.conditional-inline {
    display: block;
    margin-left: 0;
}

@media (min-width: 768px) {
  .conditional-inline {
    display: inline;
    margin-left: 0.25rem;
  }
}

/* cards */

.card-list {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem 2rem;
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
}

@media (max-width: 700px) {
  .card {
    margin-top: 1rem;
  }
}

/* Slightly tighter text width inside cards */
.card p {
  max-width: 32rem;
}

/* links and buttons */

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

.site-brand a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  min-width: min-content;
  margin: 0 1rem 0 0;
  color: var(--color-text-light);
  text-decoration: none;
}

.site-brand a:hover, 
.site-brand a:focus-visible {
  color: var(--color-nav-hover);
}

.text-link {
  text-decoration: none;
  border-bottom: 1px solid var(--color-link);
  padding-bottom: 1px;
}

.text-link:visited {
  color: var(--color-link-visited);
  border-bottom-color: var(--color-link-visited);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--color-link-hover);
  border-bottom-color: var(--color-link-hover);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  border: none;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  background-color: var(--color-button-bg);
  color: var(--color-button-text);
  box-shadow: var(--shadow-soft);
}

.button:hover,
.button:focus-visible {
  background-color: var(--color-button-hover-bg);
  color: var(--color-button-hover-text);
}

.center {
  text-align: center;
}

/* footer */

.site-footer {
  background: var(--color-primary);
  color: var(--color-text-light);
  border-top: none;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  font-size: 1rem;
}

.site-footer a {
  color: var(--color-highlight);
}

/* animations */

.fade-section {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.js-enabled .fade-section {
  opacity: 0;
  transform: translateY(16px);
}

body.js-enabled .fade-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}
