/* =========================================================
   Turn & Return — "Warm Jerusalem" stylesheet
   ========================================================= */

:root {
  --burgundy: #5C1A1A;
  --terra-cotta: #C44E2D;
  --terra-cotta-dark: #a64124;
  --gold: #E8C770;
  --dark-gold: #D4A520;
  --cream: #FFF6E5;
  --light-cream: #FFEABD;
  --dark-text: #3A2010;

  --shadow-sm: 0 2px 8px rgba(58, 32, 16, 0.08);
  --shadow-md: 0 4px 16px rgba(58, 32, 16, 0.12);
  --shadow-header: 0 2px 8px rgba(92, 26, 26, 0.2);

  --radius: 12px;
  --radius-sm: 8px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
img, svg, video, iframe { max-width: 100%; height: auto; display: block; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: Georgia, "Times New Roman", "Iowan Old Style", serif;
  background: var(--cream);
  color: var(--dark-text);
  line-height: 1.7;
  font-size: 18px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--terra-cotta); }
a:hover, a:focus { color: var(--terra-cotta-dark); }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--burgundy);
  line-height: 1.2;
}

ul, ol { margin: 0 0 1.25rem 1.5rem; }
ul:last-child, ol:last-child { margin-bottom: 0; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--burgundy);
  color: var(--gold);
  padding: 0.75rem 1rem;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ============ Header ============ */
.site-header {
  background: var(--burgundy);
  color: var(--gold);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-header);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gold);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.01em;
}
.brand:hover, .brand:focus { color: #fff; }

.crown-icon {
  width: 48px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.brand-name { white-space: nowrap; }

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-nav a {
  color: var(--gold);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.5rem 0.25rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a.is-active {
  border-bottom-color: var(--gold);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 10px 8px;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
}

.menu-toggle span {
  display: block;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform 0.2s;
}

/* ============ Hero ============ */
.hero {
  background:
    radial-gradient(ellipse at top, var(--light-cream), var(--cream) 70%);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--burgundy);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--dark-gold);
  font-style: italic;
  margin-bottom: 2rem;
}

.hero p {
  max-width: 750px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}

/* ============ Buttons ============ */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: bold;
  min-height: 44px;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: var(--terra-cotta);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--terra-cotta-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 78, 45, 0.3);
}

.btn-secondary {
  background: var(--gold);
  color: var(--burgundy);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--dark-gold);
  color: var(--burgundy);
  transform: translateY(-1px);
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ Sections ============ */
.section { padding: 4rem 0; }
.section-alt { background: var(--light-cream); }

.section h2 {
  color: var(--burgundy);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ============ Cards ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--light-cream);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card h3 {
  color: var(--burgundy);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.card h3 a {
  color: var(--burgundy);
  text-decoration: none;
}
.card h3 a:hover { color: var(--terra-cotta); }

.card .date {
  color: var(--dark-gold);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  display: block;
  font-style: italic;
}

.card p {
  flex: 1;
  margin-bottom: 1rem;
}

.card a {
  color: var(--terra-cotta);
  text-decoration: none;
  font-weight: bold;
}
.card a:hover { text-decoration: underline; }

/* ============ List page ============ */
.list-page { padding: 3rem 0; }

.list-page h1 {
  color: var(--burgundy);
  font-size: clamp(2rem, 5vw, 3rem);
  text-align: center;
  margin-bottom: 0.5rem;
}

.list-page .lead {
  text-align: center;
  font-size: 1.15rem;
  margin-bottom: 3rem;
  color: var(--dark-text);
}

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.item {
  background: #fff;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--terra-cotta);
  box-shadow: var(--shadow-sm);
}

.item h2 {
  color: var(--burgundy);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.item h2 a {
  color: var(--burgundy);
  text-decoration: none;
}
.item h2 a:hover { color: var(--terra-cotta); }

.item .date {
  color: var(--dark-gold);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.75rem;
  font-style: italic;
}

.item .excerpt { margin-bottom: 1rem; }

/* ============ Article / single page ============ */
.article-content {
  max-width: 750px;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.article-content h1 {
  color: var(--burgundy);
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin-bottom: 0.5rem;
}

.article-content .meta {
  color: var(--dark-gold);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.article-content .lead {
  font-size: 1.15rem;
  color: var(--dark-text);
  margin-bottom: 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--gold);
}

.article-content p { margin-bottom: 1.25rem; }

.article-content a {
  color: var(--terra-cotta);
  text-decoration: underline;
}
.article-content a:hover { color: var(--terra-cotta-dark); }

.article-content h2 {
  color: var(--burgundy);
  margin: 2rem 0 1rem;
  font-size: 1.5rem;
}

.article-content h3 {
  color: var(--burgundy);
  margin: 1.5rem 0 0.75rem;
  font-size: 1.25rem;
}

.back-link { margin: 0.5rem 0 1.5rem; }

.download-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--gold);
  color: var(--burgundy);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: bold;
  min-height: 44px;
  line-height: 1.4;
}
.download-link:hover {
  background: var(--dark-gold);
  color: var(--burgundy);
}

.audio-player {
  width: 100%;
  margin: 1rem 0;
}

/* ============ Spotify ============ */
.spotify-embed {
  margin: 1.5rem 0;
  max-width: 100%;
}
.spotify-embed iframe {
  max-width: 100%;
  width: 100%;
}

/* ============ Sub-navigation ============ */
.sub-nav {
  background: transparent;
  padding: 0.5rem 0;
  margin: 0 0 2rem;
}

.sub-nav .container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
}

.sub-nav a {
  color: var(--burgundy);
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: bold;
  border: 2px solid var(--gold);
  background: #fff;
  font-size: 0.95rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.sub-nav a:hover,
.sub-nav a.is-active {
  background: var(--gold);
  color: var(--burgundy);
}

/* ============ 613 Mitzvot grid ============ */
.legend-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: bold;
  font-size: 0.9rem;
  margin: 0 0.25rem;
}

.mitzvah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
  margin: 2rem 0 3rem;
}

.mitzvah-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--burgundy);
  text-align: center;
  font-weight: bold;
  min-height: 48px;
  font-size: 0.95rem;
  transition: transform 0.1s, background 0.15s;
  border: 2px solid var(--dark-gold);
}

.mitzvah-tile:hover {
  background: var(--dark-gold);
  color: var(--burgundy);
  transform: translateY(-1px);
}

.mitzvah-tile.is-pending {
  background: var(--light-cream);
  color: var(--dark-text);
  opacity: 0.55;
  border-color: transparent;
  cursor: default;
}

.mitzvah-tile.is-pending:hover {
  transform: none;
  background: var(--light-cream);
}

/* ============ Text page (about, donate, contact) ============ */
.text-page {
  max-width: 750px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.text-page h1 {
  color: var(--burgundy);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
  text-align: center;
}

.text-page .lead {
  text-align: center;
  font-size: 1.2rem;
  color: var(--dark-gold);
  font-style: italic;
  margin-bottom: 2.5rem;
}

.text-page h2 {
  color: var(--burgundy);
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

.text-page p { margin-bottom: 1.25rem; }

/* ============ Donate ============ */
.donate-section { text-align: center; }
.donate-embed {
  max-width: 500px;
  margin: 2rem auto;
}

/* ============ Contact form ============ */
.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form > div {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form label {
  font-weight: bold;
  color: var(--burgundy);
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 2px solid var(--light-cream);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--dark-text);
  width: 100%;
  min-height: 44px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--terra-cotta);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button { align-self: flex-start; }

/* ============ Footer ============ */
.site-footer {
  background: var(--burgundy);
  color: var(--gold);
  padding: 2.5rem 0;
  text-align: center;
  margin-top: 4rem;
}

.site-footer p {
  margin: 0.5rem 0;
}

.footer-blessing {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold);
}

.footer-copyright {
  font-size: 0.9rem;
  opacity: 0.85;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}

.site-footer a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* ============ Mobile ============ */
@media (max-width: 768px) {
  body { font-size: 17px; }

  .menu-toggle { display: flex; }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0 0.5rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(232, 199, 112, 0.3);
    align-items: flex-start;
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    width: 100%;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(232, 199, 112, 0.15);
  }

  .site-nav a:last-child { border-bottom: none; }

  .hero { padding: 3rem 0 2.5rem; }

  .section { padding: 3rem 0; }

  .item, .card { padding: 1.25rem; }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-group .btn { width: 100%; }

  .mitzvah-grid {
    grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    gap: 0.4rem;
  }

  .mitzvah-tile {
    min-height: 44px;
    font-size: 0.85rem;
    padding: 0.5rem 0.25rem;
  }
}

/* ============ Print ============ */
@media print {
  .site-header, .site-footer, .menu-toggle, .btn-group, .sub-nav, .back-link {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}

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