body {
  background: url('https://www.transparenttextures.com/patterns/aged-paper.png');
  background-color: #fdf6e3;
  font-family: 'Georgia', serif;
  color: #4b3621;
  margin: 0;
  padding: 0;
  padding-top: 20px;
  padding-bottom: 80px;
  font-size: 18px; /* Increased base font size for mobile readability */
}

.container {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background-color: rgba(255, 248, 220, 0.95);
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border: 1px solid #c4b998;
  border-radius: 12px;
}

h1 {
  text-align: center;
  font-size: 2em; /* Slightly larger heading */
  margin-bottom: 0.5rem;
  color: #5b4228;
  text-shadow: 1px 1px #ddd;
}

.top-buttons {
  display: flex;
  gap: 10px; /* or 12px */
  justify-content: space-between;
  margin-bottom: 20px;
}

.top-buttons a {
  font-size: 1.1em; /* larger font for touch devices */
  padding: 6px 12px;
  color: indigo;
  text-decoration: none;
  font-weight: bold;
}

.top-buttons a:hover {
  text-decoration: underline;
}

a {
  font-size: 1.1em;
}

@media (max-width: 600px) {
  body {
    font-size: 21px; /* Even larger text for small devices */
    line-height: 1.6;
    body { padding-top: 10px; }
  }

  .container {
    padding: 15px;
    margin: 10px;
  }

  h1 {
    font-size: 1.8em;
  }
li {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .top-buttons a {
    font-size: 18px;
    padding: 8px 14px;
  }
.popup {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -20%);
    background-color: white;
    border: 2px solid #888;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 20px;
    width: 80%;
    max-width: 600px;
  }
  }
    .popup {
    display: none;
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -20%);
    background-color: white;
    border: 2px solid #888;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 20px;
    width: 80%;
    max-width: 600px;
    max-height: 70vh;
    overflow: auto;
  }

.language-switcher {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 12px 20px 0 0;
  font-size: 18px;
  font-family: Georgia, serif;
}

.lang {
  display: inline-block;
  min-width: 56px;
  text-align: right;
  text-decoration: underline;
  transition: opacity 0.3s, color 0.3s;
  line-height: 1;
}

.lang.active {
  color: #0044cc;
  opacity: 1;
}

.lang.active:hover {
  opacity: 0.8;
}

.lang.inactive {
  color: #aaa;
  cursor: default;
  text-decoration: none;
  opacity: 0.6;
  pointer-events: none;
}

.back-button {
  background-color: #e8f0fe; /* same as Select dropdown? */
  color: #1a73e8;            /* Google-style blue */
  border: 1px solid #c6dafc;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
}
.back-button:hover {
  background-color: #d2e3fc;
}

/* Если стрелка и слово "BACK" вставлены отдельно через <span>, можно усилить: */
.back-button span,
.back-button svg,
.back-button i {
  color: #3366cc !important;
  fill: #3366cc !important;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fffdf5;
  width: 95px; /* 🎯 задаём фиксированную ширину */
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 999;
  border-radius: 6px;
  padding: 4px 0;
  font-size: 14px;
}
.dropdown-content a {
  color: #333;
  padding: 6px 10px;
  text-decoration: none;
  display: block;
  font-weight: normal;
  font-size: 16px;
  text-align: center;
  line-height: 1.4;
  white-space: nowrap; /* 🔹 не переносить строки */
}
.dropdown-content a {
  font-weight: normal !important;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
  display: block;
}
.prayer-box {
  background-color: #fdf6e3;
  border: 2px solid #e0c48c;
  border-radius: 12px;
  padding: 20px;
  margin: 20px auto;
  max-width: 700px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-size: 1.1em;
  line-height: 1.2;
}
.prayer-box p {
  margin: 10px 0;
}
.prayer-box a {
  color: #0044cc;
  text-decoration: none;
}
.prayer-box a:hover {
  text-decoration: underline;
}

   .footnotes {
  margin-top: 1.2em;
  font-size: 0.92em;
  color: #444;
}
.bible-link-note {
  font-size: 1em;
  text-align: left;  /* выравниваем по левому краю */
  margin: 12px 0 6px;
}
.bible-link-note a {
  color: #5b3d1f;
  text-decoration: underline;
}
.bible-link-note a:hover {
  color: #7a532a;
}
.bible-link-note {
  margin-bottom: 0.5em;
}
.topic-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1.5rem;
}

.button-link {
  display: inline-block;
  margin: 0.5rem 0;
  padding: 0.7rem 1rem;
  background-color: #fdf6e3;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-weight: 500;
  text-decoration: none;
  color: #2c3e50;
  transition: background-color 0.3s;
}
.button-link:hover {
  background-color: #f4e9d8;
}

.highlight-title {
  font-style: italic;
  font-weight: 600;
}

.source-note {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: #555;
  background-color: #fefefe;
  border-top: 1px solid #ccc;
  padding-top: 1rem;
}

.footer {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #444;
  background-color: #f0f0f0; /* ✅ Light gray background */
  padding: 1rem;
  border-top: 1px solid #ccc;
  border-radius: 12px; /* Optional: adds soft round corners */
}

  #overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .popup h2 {
    color: darkblue;
    margin-bottom: 10px;
  }
  .popup p {
    margin-bottom: 10px;
  }
  .popup-buttons a {
    display: inline-block;
    padding: 6px 12px;
    background-color: darkgreen;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-left: 10px;
  }

  .popup-buttons a:hover {
    background-color: green;
  }
  .popup-buttons button,
  .popup-buttons a {
    display: inline-block;
    padding: 8px 16px;
    background-color: darkgreen;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px;
    margin: 5px;
    font-size: 16px;
    cursor: pointer;
  }

  .popup-buttons button:hover,
  .popup-buttons a:hover {
    background-color: green;
  }
  .popup {
  position: fixed !important;
}
.tooltip-container {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip-text {
  visibility: hidden;
  width: 260px;
  background-color: #444;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  position: absolute;
  bottom: 125%; /* Сместить над элементом */
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  white-space: normal;
}

.tooltip-container:hover .tooltip-text,
.tooltip-container:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Медиа-запрос для мобильных */
@media screen and (max-width: 600px) {
  .tooltip-text {
    width: 90vw;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    bottom: 110%;
  }
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3em 0.5em;
  background-color: #fffdf5;
}
.top-bar a {
  margin-right: 12px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
}
.key-idea-box {
  background-color: #fffaf2;
  border-left: 5px solid #ffcc80;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 1.05em;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.key-idea-box .verse-note {
  font-size: 0.95em;
  color: #5f5f5f;
  margin-top: 6px;
}

#scrollTopBtn {
  display: none; /* ✅ hide by default */
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: transparent;
  cursor: pointer;
  padding: 0;
}

#scrollTopBtn img {
  width: 48px;
  height: 48px;
  transition: transform 0.2s;
}

#scrollTopBtn:hover img {
  transform: scale(1.1);
}

.top-left a {
  font-weight: bold;
  color: #333;
  text-decoration: none;
}

.top-left a:hover {
  text-decoration: underline;
}

.top-center button {
  background-color: white;
  color: #3366cc;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  cursor: pointer;
}

.top-center button:hover {
  background-color: #f3f3f3;
}

.dropbtn {
  background-color: white;
  color: #3366cc;
  font-size: 15px;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  vertical-align: middle;
}
.icon-button img {
  background: transparent;
  border-radius: 0;
}
.icon-share {
  background: transparent;
  border-radius: 0;
  display: inline-block;
  vertical-align: middle;
}
    #hidden-verses {
      display: none;
    }
    #toggle-hidden {
      margin-top: 20px;
      padding: 10px 18px;
      font-size: 1em;
    }
  
    /* Testimonials */
.comments-form {
  background-color: #fff8f0;
  padding: 30px 20px;
  border-top: 2px solid #ffb347;
  text-align: center;
  margin-top: 40px;
}

.comments-form h3 {
  font-size: 1.5em;
  color: #ff8c42;
  margin-bottom: 20px;
}

.comments-form form {
  max-width: 600px;
  margin: 0 auto;
  text-align: left;
  padding: 0 10px;
}

.comments-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
}

.comments-form input,
.comments-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-family: inherit;
}

.comments-form button {
  background-color: #ff8c42;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
}

  .comments {
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
  }

  .confirmation-message {
  display: none;
  margin-top: 20px;
  margin-bottom: 40px; /* добавим */
  font-weight: bold;
  font-size: 1.2em;
  color: #2e7d32; /* тёмно-зелёный */
  background-color: #e8f5e9; /* светло-зелёный фон */
  border-left: 6px solid #66bb6a;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  animation: fadeIn 1.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
button[type="submit"] {
  background-color: #ffa726;
  color: white;
  border: none;
  padding: 10px 22px;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
  background-color: #fb8c00;
}
.form-note {
  display: block;
  font-size: 0.85em;
  color: #777;
  margin-top: 1px;
  margin-bottom: 30px;
  font-style: italic;
}

/* Tighter base scoping (avoid touching other tables) */
table.book-dates { table-layout: fixed; width: 100%; }
table.book-dates th, 
table.book-dates td { word-wrap: break-word; }

/* Default desktop/tablet widths */
table.book-dates th:nth-child(1),
table.book-dates td:nth-child(1) { width: 45%; } /* Book */
table.book-dates th:nth-child(2),
table.book-dates td:nth-child(2) { width: 40%; } /* Date */
table.book-dates th:nth-child(3),
table.book-dates td:nth-child(3) { width: 15%; text-align: center; } /* Info */

/* Align table headers to the start of each column */
table.book-dates th { 
  text-align: left;           /* left align all headers */
  padding-left: 8px;          /* match td padding for nice alignment */
  vertical-align: bottom;     /* optional: sits closer to the row content */
}

/* Keep the info column header centered */
table.book-dates th:nth-child(3) {
  text-align: center;
  padding-left: 0;
}

/* 📱 Medium phones */
@media (max-width: 640px) {
  table.book-dates th, 
  table.book-dates td { padding: 6px 8px; }

  table.book-dates th:nth-child(1),
  table.book-dates td:nth-child(1) { width: 55%; }

  table.book-dates th:nth-child(2),
  table.book-dates td:nth-child(2) { width: 35%; }

  table.book-dates th:nth-child(3),
  table.book-dates td:nth-child(3) { width: 10%; }

  /* fit the ℹ︎ button */
  .book-dates .bd-actions .bd-info {
    width: 34px;      /* было 28px */
    height: 34px;     /* было 28px */
    line-height: 34px;
    font-size: 18px;  /* добавь, чтобы «i» стало крупнее */
  }
 
}

/* 📱 Small phones */
@media (max-width: 400px) {
  table.book-dates th, 
  table.book-dates td { padding: 5px 7px; }

  table.book-dates th:nth-child(1),
  table.book-dates td:nth-child(1) { width: 52%; }

  table.book-dates th:nth-child(2),
  table.book-dates td:nth-child(2) { width: 38%; }

  table.book-dates th:nth-child(3),
  table.book-dates td:nth-child(3) { width: 10%; }

  .book-dates .bd-actions .bd-info {
    width: 34px; height: 34px; line-height: 34px;
  }
}


.book-dates .bd-actions .bd-info {
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  text-align: center;
  line-height: 34px;
  font-weight: bold;
  background: #f5f5f5;
  border: 1px solid #ccc;
  cursor: pointer;
}

.book-dates .bd-actions .bd-info:hover{ filter:brightness(.98); }
/* Modal improvements (optional) */
.bd-modal{
  max-height: 85vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.bd-modal p{ margin: .45rem 0; }
@media (max-width: 480px){
  .bd-modal{ max-height: 88vh; }
}
/* Fix table layout */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* makes columns respect width */
}

table th, table td {
  padding: 8px;
  word-wrap: break-word;
}

/* Column widths */
table th:nth-child(1),
table td:nth-child(1) {
  width: 60%; /* Book name */
}

table th:nth-child(2),
table td:nth-child(2) {
  width: 30%; /* Date */
}

table th:nth-child(3),
table td:nth-child(3) {
  width: 10%; /* Icon column */
  text-align: center;
}

/* Make the info button fit */
.info-btn {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-weight: bold;
  background: #f5f5f5;
  border: 1px solid #ccc;
}
/* 📱 Super-small phones: turn rows into cards */
@media (max-width: 480px) {
  .book-dates thead { display: none; }

  .book-dates tbody tr {
    display: block;
    background: #fffdf5;
    border: 1px solid #eadfbe;
    border-radius: 10px;
    padding: 6px 10px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
  }

  .book-dates td {
    display: block;
    width: auto !important;
    padding: 4px 0;
  }

  .book-dates td:nth-child(1) { 
    font-weight: 700; 
    font-size: 1.05em; 
    margin-bottom: 4px;
  }

  .book-dates td:nth-child(2) { 
    color: #5b4228;
  }

  .book-dates td:nth-child(3) { 
    text-align: right; 
    margin-top: 6px; 
  }

  /* компактная иконка ℹ︎ на маленьких телефонах */
  .book-dates .bd-actions .bd-info {
    width: 34px; height: 34px; line-height: 34px;
  }
}
/* Заголовок и поиск внутри блока #book-dates */
#book-dates h2 {
  text-align: center;
  margin: 0 0 8px 0;
  color: #5b4228;
  text-shadow: 1px 1px #ddd;
}

#book-dates .bd-search {
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  border: 1px solid #eadfbe;
  border-radius: 22px;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Делаем summary (ВЗ/НЗ) более удобными для тапов */
#book-dates details {
  margin: 4px 0 10px;
}
#book-dates summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  background: #fffdf5;
  border: 1px solid #eadfbe;
  border-radius: 10px;
  font-weight: 700;
}
#book-dates summary::-webkit-details-marker { display: none; }

/* Мобильные правки заголовка */
@media (max-width: 600px) {
  #book-dates h2 { font-size: 1.4em; line-height: 1.25; }
}
/* Компактные карточки книг */
.book-card{
  padding: 8px 12px;
  margin: 10px 0;
  border-radius: 10px;
}
.book-card h3{           /* заголовок "Матфея", "Марка" и т.п. */
  margin: 0 0 6px;
  font-size: 1.25rem;    /* чуть меньше заголовок */
}
.book-card .years{       /* строка "70–90" */
  margin: 0;
  font-size: 1.05rem;
}
.book-card .info-btn{    /* кружок с i */
  width: 34px; height: 34px;
}

@media (max-width: 480px){
  .book-card{ padding: 6px 10px; margin: 6px 0; }
  .book-card h3{ font-size: 1.18rem; }
}
/* Сжимаем карточки, где есть .info-btn */
section div:has(.info-btn){
  padding: 8px 12px !important;
  margin: 10px 0 !important;
  border-radius: 10px !important;
}
section div:has(.info-btn) h3{ margin: 0 0 6px; font-size: 1.25rem; }
section div:has(.info-btn) .years{ margin: 0; font-size: 1.05rem; }

@media (max-width: 480px){
  section div:has(.info-btn){ padding: 6px 10px !important; margin: 8px 0 !important; }
}
/* === Compact book cards & headings === */
#book-dates { line-height: 1.3; }                       /* общий межстрочный интервал поменьше */
#book-dates h3, 
#book-dates p { margin: 4px 0; }                        /* убираем лишние внешние отступы у текста */

/* summary (Ветхий/Новый Завет) — чуть компактнее */
#book-dates summary { padding: 8px 10px; }              /* было 10px 12px */

/* карточки-строки в мобильном режиме: меньше внутренний отступ и зазор между карточками */
@media (max-width: 480px) {
  .book-dates tbody tr { 
    padding: 4px 10px;                                  /* было 6px 10px */
    margin-bottom: 4px;                                 /* было 6px */
  }
}

/* секции, где есть .info-btn (текущие “карточки” с кнопкой i) — ещё компактнее */
section div:has(.info-btn){
  padding: 6px 10px !important;                         /* было 8px 12px */
  margin: 8px 0 !important;                             /* было 10px 0 */
}
section div:has(.info-btn) h3 { margin: 2px 0 4px; }    /* вместо 0 0 6px */
section div:has(.info-btn) .years { margin: 0; }

/* arrows for details/summary */
#book-dates summary {
  position: relative;
  padding-right: 28px;               /* место под стрелку справа */
}

#book-dates summary::after {
  content: "▾";                      /* стрелка вниз (закрыто) */
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  opacity: .8;
}

#book-dates details[open] summary::after {
  content: "▴";                      /* стрелка вверх (открыто) */
}

/* Выравниваем название книги и иконку ℹ в одну строку */
.book-dates td:first-child {
  display: flex;
  justify-content: space-between;  /* название слева, иконка справа */
  align-items: center;             /* по вертикали по центру */
  gap: 8px;                        /* немного воздуха между текстом и кнопкой */
}

/* убираем лишнюю ячейку для кнопки
.book-dates td:nth-child(3) {
  display: none;
} */

/* Мобильная строка-карточка: title + ℹ в первой строке, даты ниже */
@media (max-width: 480px) {
  .book-dates tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;  /* название растягивается, ℹ — справа */
    grid-template-rows: auto auto;    /* 1-я строка: title+ℹ, 2-я: даты */
    align-items: center;
    padding: 6px 10px;
    gap: 2px 8px;                     /* чуть воздуха между колонками */
  }

  /* убираем принудительный block-режим, заданный выше, и раскладываем по сетке */
  .book-dates td { display: block; padding: 4px 0; }

  .book-dates td:nth-child(1) {      /* Название книги */
    grid-column: 1; 
    grid-row: 1;
    margin: 0;
  }
  .book-dates td:nth-child(3) {      /* Кнопка ℹ */
    grid-column: 2; 
    grid-row: 1;
    text-align: right;
    margin: 0;
  }
  .book-dates td:nth-child(2) {      /* Даты */
    grid-column: 1 / span 2; 
    grid-row: 2;
    margin-top: 2px;
    color: #5b4228;
  }
}
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
  position: relative;
}

abbr[title]:hover::after,
abbr[title]:focus::after {
  content: attr(title);
  position: absolute;
  background: #333;
  color: #fff;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  white-space: nowrap;
  top: 120%;  /* ниже текста */
  left: 0;
  z-index: 10;
}

/* Кастомная подсказка для года (работает и в модалке) */
.tip {
  position: relative;
  text-decoration: underline dotted;
  cursor: help;
}
.tip:focus { outline: none; }

/* Сам пузырёк */
.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: 1.35em;             /* ниже текста; можно подправить */
  background: #333;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  line-height: 1.25;
  white-space: pre-line;   /* ← перенос по \n */
  box-shadow: 0 6px 18px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .12s ease;
  z-index: 1000;
  max-width: 280px;
}

/* показываем по ховеру/фокусу (тап на мобиле даёт фокус) */
.tip:hover::after,
.tip:focus::after {
  opacity: 1;
}
