/* =================================================================
   AUSSIE IVRIT — DESIGN TOKENS
   -----------------------------------------------------------------
   Palette is drawn from the Israeli flag, whose blue-on-white
   stripes were themselves borrowed from the tallit (prayer shawl).
   That stripe motif is the site's recurring signature — it shows
   up in the top bar, section dividers and the footer, rather than
   using the flag as a flat two-colour scheme.
   ================================================================= */

:root {
  /* Colour */
  --flag-blue:        #0038b8;   /* primary — Israeli flag blue   */
  --flag-blue-deep:   #012a6b;   /* headers, nav background       */
  --flag-blue-soft:   #e9f0fc;   /* tints, hover backgrounds       */
  --stone-gold:       #c9a961;   /* Jerusalem-stone accent, used sparingly */
  --white:            #ffffff;
  --ink:              #10182f;
  --ink-soft:         #55607a;
  --border:           #dde3f0;

  /* Type */
  --font-display: 'Frank Ruhl Libre', 'Georgia', serif;
  --font-body:    'Assistant', 'Segoe UI', sans-serif;
  --font-utility: 'Heebo', 'Segoe UI', sans-serif;

  /* Layout */
  --max-width: 1160px;
  --radius: 6px;
  --stripe-size: 10px;
}

/* =================================================================
   RESET
   ================================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.5em;
  line-height: 1.15;
  color: var(--flag-blue-deep);
}

/* =================================================================
   SIGNATURE MOTIF — the tallit stripe
   A thin repeating blue/white bar used as a top rule and divider.
   ================================================================= */
.tallit-stripe {
  height: var(--stripe-size);
  background: repeating-linear-gradient(
    90deg,
    var(--flag-blue) 0,
    var(--flag-blue) 40px,
    var(--white) 40px,
    var(--white) 44px
  );
}

/* Star of David mark, built from two overlapping triangles in CSS */
.magen-mark {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.magen-mark svg { width: 100%; height: 100%; display: block; }

/* =================================================================
   SKIP LINK / ACCESSIBILITY
   ================================================================= */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--flag-blue-deep);
  color: var(--white);
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
}
:focus-visible {
  outline: 3px solid var(--stone-gold);
  outline-offset: 2px;
}

/* =================================================================
   HEADER / NAV
   ================================================================= */
.site-header {
  background: var(--flag-blue-deep);
  color: var(--white);
}

.nav-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--white);
  letter-spacing: 0.01em;
}
.brand-tagline {
  font-family: var(--font-utility);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--stone-gold);
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.main-nav ul {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 4px;
}
.main-nav a {
  display: inline-block;
  padding: 10px 12px;
  font-family: var(--font-utility);
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius);
  color: var(--white);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.main-nav a:hover {
  background: rgba(255,255,255,0.12);
}
.main-nav a.active {
  background: var(--white);
  color: var(--flag-blue-deep);
  font-weight: 700;
}

/* Dictionary / Flashcards utility buttons */
.nav-utility {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.btn-utility {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-family: var(--font-utility);
  font-size: 0.86rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  white-space: nowrap;
}
.btn-utility:hover { background: rgba(255,255,255,0.1); }
.btn-utility-fill {
  background: var(--stone-gold);
  border-color: var(--stone-gold);
  color: var(--flag-blue-deep);
}
.btn-utility-fill:hover { background: #b8964f; }
@media (max-width: 780px) {
  .nav-utility { width: 100%; order: 3; padding: 10px 0 4px; }
  .btn-utility { flex: 1; text-align: center; }
}

/* -----------------------------------------------------------------
   Dropdown submenus (Learn Hebrew, etc.)
   ----------------------------------------------------------------- */
.has-dropdown { position: relative; }
.has-dropdown > a { display: flex; align-items: center; gap: 4px; }
.caret { font-size: 0.7em; transition: transform 0.15s ease; }
.has-dropdown:hover > a .caret,
.has-dropdown.open > a .caret { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(1, 42, 107, 0.18);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 50;
}
.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu,
.has-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}
.dropdown-menu a:hover,
.dropdown-menu a.active {
  background: var(--flag-blue-soft);
  color: var(--flag-blue-deep);
}

@media (max-width: 780px) {
  .dropdown-menu {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.2s ease;
  }
  .has-dropdown.open .dropdown-menu {
    max-height: 500px;
    padding: 4px 0 4px 14px;
  }
  .dropdown-menu a { color: rgba(255,255,255,0.85); }
  .dropdown-menu a:hover, .dropdown-menu a.active { background: rgba(255,255,255,0.12); color: var(--white); }
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  color: var(--white);
  padding: 8px 10px;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .main-nav.open { max-height: 400px; }
  .main-nav ul {
    flex-direction: column;
    padding: 8px 0 4px;
  }
  .nav-wrap { flex-wrap: wrap; }
}

/* =================================================================
   MAIN CONTENT AREA
   ================================================================= */
main {
  min-height: 50vh;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 20px;
}

/* Generic placeholder block used by index.php until real pages exist */
.placeholder-card {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--flag-blue-soft);
}
.placeholder-card h2 {
  margin-bottom: 0.3em;
}

/* =================================================================
   CATEGORY HUB PAGE (e.g. learn-hebrew.php)
   ================================================================= */
.hub-hero {
  background: var(--flag-blue-soft);
  border-bottom: 1px solid var(--border);
}
.hub-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 20px 48px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-utility);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--flag-blue);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  background: var(--flag-blue);
  display: inline-block;
}
.hub-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  max-width: 18ch;
}
.hub-hero p.lede {
  max-width: 62ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 48px 0;
}
.hub-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--white);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.hub-card:hover {
  box-shadow: 0 14px 30px rgba(1, 42, 107, 0.12);
  transform: translateY(-2px);
  border-color: var(--flag-blue);
}
.hub-card-index {
  font-family: var(--font-utility);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--stone-gold);
  letter-spacing: 0.08em;
}
.hub-card h3 {
  margin: 6px 0 8px;
  font-size: 1.2rem;
}
.hub-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 14px;
}
.hub-card .card-link {
  font-family: var(--font-utility);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--flag-blue);
}
.hub-card .card-link::after { content: ' →'; }

/* =================================================================
   CONTENT + SIDEBAR LAYOUT (used by every article/lesson page)
   ================================================================= */
.page-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 44px 20px 72px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
}

/* -- Sidebar -- */
.category-sidebar {
  position: sticky;
  top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 900px) { .category-sidebar { position: static; } }

.sidebar-block + .sidebar-block {
  border-top: 1px solid var(--border);
}
.sidebar-heading {
  font-family: var(--font-utility);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  padding: 16px 16px 8px;
}
.sidebar-block ul { padding-bottom: 10px; }
.sidebar-block a {
  display: block;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-family: var(--font-utility);
  color: var(--ink);
  border-left: 3px solid transparent;
}
.sidebar-block a:hover {
  background: var(--flag-blue-soft);
}
.sidebar-block a.active {
  background: var(--flag-blue-soft);
  border-left-color: var(--flag-blue);
  color: var(--flag-blue-deep);
  font-weight: 700;
}
.sidebar-block.explore-more { background: var(--flag-blue-deep); }
.sidebar-block.explore-more .sidebar-heading { color: rgba(255,255,255,0.65); }
.sidebar-block.explore-more a { color: rgba(255,255,255,0.9); }
.sidebar-block.explore-more a:hover { background: rgba(255,255,255,0.1); }
.sidebar-block.explore-more a.active { background: rgba(255,255,255,0.14); border-left-color: var(--stone-gold); color: var(--white); }

/* -- Article typography -- */
.article-header {
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.article-header h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
}
.article-header .lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 70ch;
}
.article-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-utility);
  font-size: 0.78rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 10px;
}

article.lesson-content h2 {
  font-size: 1.5rem;
  margin-top: 2.2em;
  padding-top: 0.2em;
}
article.lesson-content h2:first-child { margin-top: 0; }
article.lesson-content h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-top: 1.6em;
}
article.lesson-content p { margin: 0 0 1.1em; }
article.lesson-content ul,
article.lesson-content ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}
article.lesson-content ul { list-style: disc; }
article.lesson-content ol { list-style: decimal; }
article.lesson-content li { margin-bottom: 0.4em; }
article.lesson-content strong { color: var(--flag-blue-deep); }
article.lesson-content .hebrew { font-family: var(--font-display); font-size: 1.15em; direction: rtl; unicode-bidi: isolate; }

.callout {
  background: var(--flag-blue-soft);
  border-left: 4px solid var(--flag-blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 1.6em 0;
  font-size: 0.96rem;
}
.callout strong { display: block; margin-bottom: 4px; color: var(--flag-blue-deep); }

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0 1.8em;
  font-size: 0.95rem;
}
.vocab-table caption {
  text-align: left;
  font-family: var(--font-utility);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.vocab-table th, .vocab-table td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
.vocab-table th {
  background: var(--flag-blue-soft);
  font-family: var(--font-utility);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--flag-blue-deep);
}
.vocab-table td.heb { font-family: var(--font-display); font-size: 1.15em; direction: rtl; unicode-bidi: isolate; }
.vocab-table td.translit { color: var(--ink-soft); font-style: italic; }

.dialogue { margin: 1.4em 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dialogue-line { display: grid; grid-template-columns: 90px 1fr; gap: 14px; padding: 12px 16px; }
.dialogue-line:nth-child(odd) { background: #fafbfe; }
.dialogue-line + .dialogue-line { border-top: 1px solid var(--border); }
.dialogue-speaker { font-family: var(--font-utility); font-weight: 700; font-size: 0.82rem; color: var(--flag-blue-deep); }
.dialogue-text .heb { display: block; font-family: var(--font-display); font-size: 1.2em; direction: rtl; unicode-bidi: isolate; }
.dialogue-text .translit { display: block; color: var(--ink-soft); font-style: italic; font-size: 0.9em; }
.dialogue-text .eng { display: block; margin-top: 2px; }

.page-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 3em;
  padding-top: 1.6em;
  border-top: 1px solid var(--border);
  font-family: var(--font-utility);
}
.page-nav-links a {
  color: var(--flag-blue);
  font-weight: 700;
  font-size: 0.94rem;
}

/* =================================================================
   BREADCRUMB TRAIL
   ================================================================= */
.breadcrumb-trail {
  background: #fafbfe;
  border-bottom: 1px solid var(--border);
}
.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 20px;
  font-family: var(--font-utility);
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb-inner a { color: var(--flag-blue); }
.breadcrumb-inner a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-inner [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* =================================================================
   SITE-WIDE FLASH MESSAGES (newsletter, contact form, etc.)
   ================================================================= */
.site-flash {
  padding: 14px 20px;
}
.site-flash-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-family: var(--font-utility);
  font-size: 0.92rem;
  border-left: 4px solid var(--flag-blue);
  background: var(--flag-blue-soft);
  color: var(--flag-blue-deep);
}
.site-flash-error .site-flash-inner { border-color: #c0392b; background: #fdecec; color: #7b241c; }
.site-flash-success .site-flash-inner { border-color: #1f9d55; background: #e9f8ee; color: #145a32; }

/* =================================================================
   NEWSLETTER SIGNUP BAND (footer)
   ================================================================= */
.newsletter-band {
  background: var(--flag-blue);
  color: var(--white);
}
.newsletter-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}
.newsletter-inner h3 { color: var(--white); font-size: 1.15rem; margin-bottom: 2px; }
.newsletter-inner p { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin: 0; }
.newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.4);
  min-width: 240px;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.95);
}
.newsletter-form button {
  padding: 11px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--stone-gold);
  color: var(--flag-blue-deep);
  font-family: var(--font-utility);
  font-weight: 700;
  cursor: pointer;
}
.newsletter-form button:hover { background: #b8964f; }

/* =================================================================
   GENERIC PUBLIC-SITE FORMS (contact page, etc.)
   ================================================================= */
.site-form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.site-form .form-row { display: flex; flex-direction: column; gap: 6px; }
.site-form label { font-family: var(--font-utility); font-size: 0.86rem; font-weight: 700; color: var(--ink); }
.site-form input[type="text"], .site-form input[type="email"], .site-form input[type="password"], .site-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.98rem;
}
.site-form textarea { min-height: 140px; resize: vertical; }
.site-form input:focus, .site-form input[type="password"]:focus, .site-form textarea:focus { outline: none; border-color: var(--flag-blue); box-shadow: 0 0 0 3px var(--flag-blue-soft); }
.site-form button[type="submit"] {
  align-self: flex-start;
  padding: 12px 26px;
  border-radius: var(--radius);
  border: none;
  background: var(--flag-blue);
  color: var(--white);
  font-family: var(--font-utility);
  font-weight: 700;
  cursor: pointer;
}
.site-form button[type="submit"]:hover { background: var(--flag-blue-deep); }

/* =================================================================
   AUDIO PRONUNCIATION BUTTON
   ================================================================= */
.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--flag-blue);
  cursor: pointer;
  font-size: 0.85rem;
  vertical-align: middle;
  margin-left: 6px;
  flex-shrink: 0;
}
.audio-btn:hover { background: var(--flag-blue-soft); }
.audio-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.audio-btn.is-playing { background: var(--flag-blue); color: var(--white); }

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.9rem;
  vertical-align: middle;
  margin-left: 4px;
}
.bookmark-btn:hover { background: #fdf6e3; border-color: var(--stone-gold); }
.bookmark-btn.is-bookmarked { background: var(--stone-gold); border-color: var(--stone-gold); color: var(--white); }

.level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-family: var(--font-utility);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.level-badge-beginner { background: #e9f8ee; color: #145a32; }
.level-badge-intermediate { background: #fdf3e0; color: #8a5a00; }
.level-badge-advanced { background: #fdecec; color: #7b241c; }

/* =================================================================
   FOOTER
   ================================================================= */
.site-footer {
  background: var(--flag-blue-deep);
  color: rgba(255,255,255,0.85);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--font-utility);
  font-size: 0.88rem;
}
.footer-inner a:hover { color: var(--stone-gold); }
.footer-brand {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.05rem;
}
.footer-links ul {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
