/* SIRIUS — Armenian Site
   Cosmic blue + gold palette (matching Bulgarian / Russian originals)
   ============================================================== */

:root {
  /* Cosmic palette */
  --night-deep:    #02091f;
  --night:         #071a4b;
  --night-mid:     #0e2c70;
  --sky:           #1a4a93;
  --sky-soft:      #4a7fbf;
  --horizon:       #cfe5f4;

  --gold:          #e6b94c;
  --gold-deep:     #b78a23;
  --gold-soft:     #f4d99a;

  --paper:         #fbf6e8;     /* warm cream content */
  --paper-edge:    #efe6c8;
  --paper-line:    #d9cda3;

  --ink:           #1d2543;
  --ink-soft:      #4a557a;
  --muted:         #6c7595;

  --link:          #1e4a8a;
  --link-hover:    #c98a16;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(ellipse at top, #0e2c70 0%, #02091f 60%, #02091f 100%) fixed;
  color: var(--ink);
  font-family: "Noto Sans Armenian", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--link-hover); text-decoration: underline; }

/* =========================== Header banner ====================== */

.site-banner {
  width: 100%;
  display: block;
  background: var(--night-deep);
  border-bottom: 3px solid var(--gold);
  overflow: hidden;
}

.site-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
}

.site-banner a { display: block; }

/* =========================== Top utility bar ==================== */

.top-bar {
  background: var(--night-deep);
  border-bottom: 1px solid #0a2860;
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  border: 1px solid #1e4a8a;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(255,255,255,.05);
}

.search-box input {
  border: 0;
  outline: 0;
  padding: 6px 10px;
  font: inherit;
  width: 200px;
  background: transparent;
  color: #ffffff;
  font-size: 14px;
}

.search-box input::placeholder { color: #b9c8e0; }

.search-box button {
  border: 0;
  background: var(--gold);
  color: var(--night-deep);
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.search-box button:hover { background: var(--gold-soft); }

/* =========================== Main nav =========================== */

.main-nav {
  background: linear-gradient(180deg, #0a2566 0%, #061949 100%);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
  position: sticky;
  top: 0;
  z-index: 100;
}

.main-nav ul {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.main-nav a {
  display: block;
  color: #ffffff;
  padding: 14px 18px;
  font-weight: 500;
  letter-spacing: .3px;
  border-right: 1px solid rgba(255,255,255,.07);
}

.main-nav li:first-child a { border-left: 1px solid rgba(255,255,255,.07); }

.main-nav a:hover,
.main-nav a.active {
  background: rgba(230,185,76,.15);
  color: var(--gold-soft);
  text-decoration: none;
}

.main-nav a.active {
  border-bottom: 3px solid var(--gold);
  margin-bottom: -2px;
}

/* Hamburger toggle button — hidden on desktop */
#nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 14px 16px;
  margin-left: auto;
  flex-shrink: 0;
}

#nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  margin: 5px 0;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

#nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
#nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================== Layout ============================= */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 24px;
}

@media (max-width: 1000px) {
  .page {
    grid-template-columns: 1fr;
  }
  /* On tablet/mobile, left sidebar comes AFTER main content visually */
  .page > aside:first-child {
    order: 2;
  }
  .page > main {
    order: 1;
  }
  .page > aside:last-child {
    order: 3;
  }
}

/* =========================== Sidebar ============================ */

.sidebar {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(2,9,31,.35);
}

.sidebar h3 {
  color: var(--night-mid);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  margin: 0 0 12px;
}

.sidebar a {
  display: block;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px dashed var(--paper-line);
  color: var(--link);
}

.sidebar a:last-child { border-bottom: 0; }

.sidebar a:hover { color: var(--link-hover); }

.sidebar .banner {
  display: block;
  padding: 14px 8px;
  text-align: center;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-radius: 6px;
  color: var(--night-deep);
  font-weight: 700;
  margin: 12px 0;
  border-bottom: 0;
}

.sidebar .banner:hover {
  text-decoration: none;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #ffffff;
}

/* =========================== Main content ====================== */

main.content {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  padding: 28px 36px;
  box-shadow: 0 6px 24px rgba(2,9,31,.4);
}

main.content h1 {
  color: var(--night-mid);
  font-size: 30px;
  margin-top: 0;
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: .5px;
}

main.content h2 {
  color: var(--night-mid);
  font-size: 22px;
  margin-top: 28px;
  border-bottom: 1px solid var(--paper-line);
  padding-bottom: 6px;
}

main.content h3 {
  color: var(--gold-deep);
  font-size: 18px;
  margin-top: 22px;
}

main.content p { margin: 12px 0; }

main.content ul, main.content ol { padding-left: 20px; }

.section-rule {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  margin: 20px 0;
}

/* =========================== Master cards ====================== */

.master-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--paper-line);
}

.master-card:last-of-type { border-bottom: 0; }

.master-card .portrait {
  width: 130px;
  height: 165px;
  border-radius: 6px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 11px;
  text-align: center;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 14px rgba(2,9,31,.3);
  padding: 8px;
  line-height: 1.4;
  flex-shrink: 0;
  gap: 6px;
}



.master-card .portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.master-card h3 {
  margin-top: 0;
  font-size: 20px;
  color: var(--night-mid);
}

.master-card blockquote {
  margin: 10px 0;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  color: var(--ink-soft);
  font-style: italic;
  font-size: 15px;
}

.master-card .attribution {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

@media (max-width: 600px) {
  .master-card { grid-template-columns: 1fr; }
  .master-card .portrait { margin: 0 auto; }
}

/* =========================== Language switcher ================== */

.lang-switcher {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.lang-switcher a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  border-bottom: 0;
}

.lang-switcher a:hover { background: rgba(230,185,76,.18); text-decoration: none; }

.lang-switcher a.current {
  background: var(--gold);
  color: var(--night-deep);
  font-weight: 700;
}

.flag {
  width: 22px;
  height: 14px;
  display: inline-block;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  flex-shrink: 0;
}

.flag-emoji {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  width: 24px;
  text-align: center;
}

/* =========================== Book entries (sidebar) ============= */

.book-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 0;
  border-bottom: 1px dashed var(--paper-line);
}

.book-entry:last-of-type {
  border-bottom: 0;
}

.book-cover-placeholder {
  width: 130px;
  height: 180px;
  background: linear-gradient(135deg, #fff8e0 0%, #ffffff 100%);
  border: 2px dashed var(--gold);
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(2,9,31,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book-cover-placeholder::before {
  content: "📖";
  font-size: 32px;
  opacity: 0.35;
}

.book-cover-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.book-cover-placeholder img + ::before,
.book-cover-placeholder:has(img)::before {
  display: none;
}

.book-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--night-mid);
  margin: 6px 0 10px;
  line-height: 1.4;
  padding: 0 4px;
}

.btn-download {
  display: inline-block;
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--gold) 100%);
  color: var(--night-deep) !important;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  padding: 8px 18px;
  border-radius: 4px;
  border-bottom: 0 !important;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(2,9,31,.2);
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: auto !important;
  text-align: center;
}

.btn-download:hover {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #ffffff !important;
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-download:active {
  transform: translateY(0);
}

/* =========================== Sidebar banners ==================== */

.sidebar-banners {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.sidebar-banner {
  display: block;
  border-bottom: 0;
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.sidebar-banner:hover {
  opacity: 1;
}

.sidebar-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* =========================== Cycle list ========================= */

.cycle-list {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 18px;
}

.cycle-list li {
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: #fff8e0;
  border-radius: 0 4px 4px 0;
}

.cycle-list a { font-size: 14px; }

/* =========================== Rosaries =========================== */

.rosary-group {
  background: #fff8e0;
  border-left: 4px solid var(--gold);
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
  margin: 14px 0;
}

.rosary-group h4 {
  margin: 0 0 6px;
  color: var(--night-mid);
}

.rosary-group ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

/* =========================== Welcome card ======================= */

.welcome-card {
  background: linear-gradient(180deg, #fff8e0 0%, #ffffff 100%);
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 22px 26px;
  margin: 16px 0 24px;
}

.welcome-card .signature {
  text-align: right;
  font-style: italic;
  color: var(--night-mid);
  margin-top: 18px;
}

.author-photo {
  float: right;
  margin: 6px 0 16px 24px;
  width: 320px;
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(2,9,31,.2);
  border: 2px solid var(--gold);
}

@media (max-width: 768px) {
  .author-photo {
    float: none;
    display: block;
    margin: 0 auto 20px auto;
  }
}

.ps-note {
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  border-top: 1px dashed var(--paper-line);
  padding-top: 12px;
  margin-top: 18px;
}

/* =========================== Footer ============================= */

.site-footer {
  background: var(--night-deep);
  color: #cfe5f4;
  padding: 28px 24px;
  text-align: center;
  font-size: 14px;
  border-top: 3px solid var(--gold);
}

.site-footer a { color: var(--gold-soft); text-decoration: underline; }

.site-footer .source-note {
  margin-top: 8px;
  font-size: 12px;
  color: #8aa0c2;
}

/* =========================== Helpers ============================ */

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
/* ====================== MOBILE STYLES ====================== */

@media (max-width: 768px) {

  /* --- Navigation --- */
  .main-nav {
    position: sticky;
    top: 0;
  }

  /* Show the hamburger button */
  #nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Nav wrapper: row with toggle on the right */
  .main-nav > .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
  }

  /* Brand label inside nav on mobile */
  .nav-brand {
    display: block;
    color: var(--gold-soft);
    font-weight: 700;
    font-size: 15px;
    padding: 14px 16px;
    letter-spacing: .5px;
  }

  /* The <ul> is hidden by default, shown when nav-open class is added */
  .main-nav ul {
    display: none;
    flex-direction: column;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,.1);
  }

  .main-nav ul.nav-open {
    display: flex;
  }

  .main-nav a {
    padding: 13px 20px;
    border-right: none;
    border-left: none !important;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .main-nav a.active {
    border-left: 3px solid var(--gold) !important;
    border-bottom-width: 0;
    margin-bottom: 0;
    padding-left: 17px;
  }

  /* --- Banner --- */
  .site-banner img {
    max-height: 130px;
  }

  /* --- Layout --- */
  .page {
    padding: 14px 12px;
    gap: 14px;
  }

  /* --- Content --- */
  main.content {
    padding: 20px 18px;
  }

  main.content h1 {
    font-size: 24px;
  }

  main.content h2 {
    font-size: 19px;
  }

  /* --- Sidebar --- */
  .sidebar {
    padding: 14px;
  }

  /* Collapsible sidebar on mobile */
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
  }

  .sidebar-toggle::after {
    content: "▼";
    font-size: 10px;
    color: var(--gold-deep);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
  }

  .sidebar.collapsed .sidebar-toggle::after {
    transform: rotate(-90deg);
  }

  .sidebar-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 2000px;
  }

  .sidebar.collapsed .sidebar-content {
    max-height: 0;
  }

  /* Bigger touch targets for sidebar links */
  .sidebar a {
    padding: 8px 0;
    min-height: 40px;
    display: flex;
    align-items: center;
  }

  /* --- Welcome card --- */
  .welcome-card {
    padding: 16px 18px;
  }

  .author-photo {
    width: 100%;
    max-width: 240px;
  }

  /* --- Language switcher --- */
  .lang-switcher a {
    min-height: 40px;
  }
}

/* Extra small phones (≤ 480px) */
@media (max-width: 480px) {
  .page {
    padding: 10px 8px;
    gap: 10px;
  }

  main.content {
    padding: 16px 14px;
  }

  main.content h1 {
    font-size: 21px;
  }

  main.content h2 {
    font-size: 17px;
  }

  .main-nav a {
    font-size: 15px;
  }

  /* Cycle list: single column on tiny screens */
  .cycle-list {
    grid-template-columns: 1fr;
  }

  /* Rosary group full width */
  .rosary-group {
    padding: 12px 14px;
  }
}