/* Открытые страницы для поисковиков: уроки грамматики, тест уровня, уровни, IELTS, слова.
   Цвета и шрифты — переменные из site_settings.py, как везде. */

.pub { max-width: 820px; margin: 0 auto; padding: 0 16px; }

/* Шапка: название и вход, под ними — разделы (на телефоне прокручиваются вбок) */
.pub-top { padding: 12px 0 4px; }
.pub-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-headings); font-weight: 800;
  font-size: 1.15rem; color: var(--text); text-decoration: none; min-height: 44px; }
.pub-brand img { border-radius: 8px; }
.pub-actions { display: inline-flex; align-items: center; gap: 8px; }
.pub-login { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px;
  background: var(--option); color: var(--text); font-weight: 700; text-decoration: none; }
.pub-nav { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.pub-nav::-webkit-scrollbar { display: none; }
.pub-nav a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border-radius: 99px; background: var(--option); color: var(--text); text-decoration: none; font-size: .95rem; }
.pub-nav a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 16%, var(--option)); color: var(--accent); font-weight: 700; }

/* Текст страницы */
.pub-main { padding: 18px 0 8px; }
.pub-main h1 { font-size: clamp(1.6rem, 6vw, 2.3rem); margin-bottom: 12px; }
.pub-main h2 { font-size: clamp(1.2rem, 4.5vw, 1.5rem); margin: 28px 0 10px; }
.pub-main h3 { font-size: 1.05rem; margin: 0 0 6px; }
.pub-main p { margin: 0 0 12px; line-height: 1.65; }
.pub-lead { font-size: 1.1rem; color: var(--muted); }
.pub-main a:not(.btn) { color: var(--accent); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; font-size: .9rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--muted); }

.pub-card { padding: 16px 18px; border-radius: var(--radius-card); background: var(--option); box-shadow: 0 2px 12px #33221D0D; }
.pub-card + .pub-card { margin-top: 12px; }
.pub-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .pub-grid.two { grid-template-columns: 1fr 1fr; } .pub-grid.three { grid-template-columns: repeat(3, 1fr); } }
.pub-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.55; }
.lvl-tag { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 2px 10px;
  border-radius: 99px; font-weight: 800; font-family: var(--font-headings); color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.pub-muted { color: var(--muted); font-size: .95rem; }

/* Список уроков */
.lesson-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lesson-list a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; min-height: 44px; border-radius: var(--radius-button);
  background: var(--option); color: var(--text); text-decoration: none; transition: transform var(--speed); }
.lesson-list a:hover { transform: translateY(-2px); }
.lesson-list b { color: var(--text); }
.lesson-list small { color: var(--muted); }
.lesson-list [aria-current="page"] { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Упражнения: ответ открывается по нажатию (работает без JavaScript) */
.ex { padding: 14px 16px; border-radius: var(--radius-button); background: var(--option); }
.ex + .ex { margin-top: 10px; }
.ex-q { margin: 0 0 8px; font-weight: 700; }
.ex-q .gap { color: var(--accent); letter-spacing: .05em; }
.ex-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.ex-opts li { padding: 4px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.ex details summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--accent); font-weight: 700; }
.ex-ans { margin: 4px 0 0; }
.ex-ans b { color: var(--correct-text); }

.pager { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0 0; }
.pager a { display: inline-flex; flex-direction: column; max-width: 48%; padding: 10px 14px; border-radius: var(--radius-button);
  background: var(--option); text-decoration: none; color: var(--text); }
.pager small { color: var(--muted); }
.pager .next { margin-left: auto; text-align: right; }

/* Слова */
.words-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.words-table th, .words-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.words-table th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.words-table td:first-child { font-weight: 700; white-space: nowrap; }
.words-table small { display: block; color: var(--muted); }
@media (max-width: 560px) {
  .words-table thead { display: none; }
  .words-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .words-table td { border: 0; padding: 0; overflow-wrap: anywhere; }
  .words-table td:first-child { white-space: normal; }
  .words-table td:nth-child(2) { text-align: right; }
  .words-table td:last-child { grid-column: 1 / -1; }
}

/* Справочник: таблица неправильных глаголов остаётся таблицей и на телефоне (4 узкие колонки),
   таблицы времён и предлогов на телефоне складываются в карточки (как слова выше) */
.verbs-table td:first-child { color: var(--accent); }
@media (max-width: 560px) {
  .verbs-table { font-size: .9rem; }
  .verbs-table thead { display: table-header-group; }
  .verbs-table tr { display: table-row; padding: 0; }
  .verbs-table th, .verbs-table td { display: table-cell; padding: 8px 4px; border-bottom: 1px solid var(--line);
    overflow-wrap: normal; text-align: left !important; }
  .verbs-table td:first-child { white-space: nowrap; }
  .verbs-table td:last-child { grid-column: auto; }
  .guide-table td:first-child { font-family: var(--font-headings); color: var(--accent); }
  .guide-table td:nth-child(2) { text-align: right; }
}
.guide-examples li span { font-weight: 600; }

/* Вопросы-ответы */
.faq details { padding: 4px 16px; border-radius: var(--radius-button); background: var(--option); }
.faq details + details { margin-top: 8px; }
.faq summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.faq details p { margin: 0 0 12px; }

.band-table { width: 100%; border-collapse: collapse; }
.band-table td, .band-table th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }

/* Подвал: призыв и все ссылки */
.pub-foot { padding: 24px 0 40px; }
.pub-cta { padding: 22px 20px; border-radius: var(--radius-card); text-align: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--option)), color-mix(in srgb, var(--accent-2) 14%, var(--option))); }
.pub-cta h2 { font-size: clamp(1.2rem, 4.5vw, 1.5rem); margin-bottom: 8px; }
.pub-cta p { color: var(--muted); margin: 0 0 16px; }
.pub-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin: 22px 0 8px; }
.pub-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--muted); font-size: .92rem; }
.pub-copy { text-align: center; color: var(--muted); font-size: .85rem; margin: 0; }
