@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #1b2130;
  --ink-soft: #3c4356;
  --parchment: #efe9db;
  --parchment-dim: #e2dac7;
  --stone: #cabfa4;
  --gold: #9c7a3f;
  --gold-bright: #b6924f;
  --wine: #5c2331;
  --slate: #6b7280;
  --slate-soft: #eef0f2;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(156, 122, 63, 0.10), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(60, 67, 86, 0.06), transparent 55%),
    var(--parchment);
  background-size: 140% 140%, 140% 140%, 100% 100%;
  animation: ambient-drift 24s ease-in-out infinite alternate;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

@keyframes ambient-drift {
  0%   { background-position: 0% 0%, 100% 0%, 0 0; }
  100% { background-position: 10% 6%, 92% 8%, 0 0; }
}

a { color: inherit; text-decoration: none; }

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

/* ---------- Header ---------- */

.site-header {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--stone);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.brand .brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

.site-nav a {
  position: relative;
  font-size: 14px;
  color: var(--ink-soft);
  margin-left: 28px;
  padding-bottom: 3px;
  transition: color .15s ease;
}
.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transition: right .25s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }
.site-nav a.is-active { color: var(--ink); }
.site-nav a.is-active::after { right: 0; background: var(--slate); }

/* ---------- Hero ---------- */

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}

/* Блок-цитата под списком проповедей */
.hero {
  padding: 20px 0 64px;
  position: relative;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.22;
  margin: 0 0 16px;
  max-width: 22ch;
  color: var(--ink);
}

.hero p {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0;
}

.hero-rule {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-top: 26px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Sermon list ---------- */

.list-section {
  padding: 8px 0 100px;
}

.list-section--top {
  padding-top: 44px;
}

.list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.list-header h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  margin: 0;
}

.search-box {
  flex: 0 0 260px;
  max-width: 100%;
}

.search-box input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--stone);
  background: transparent;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
}
.search-box input:focus {
  outline: none;
  border-color: var(--gold);
}

.sermon-row {
  display: grid;
  grid-template-columns: 108px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--stone);
  transition: opacity .15s ease, transform .5s ease, box-shadow .15s ease;
  opacity: 0;
  transform: translateY(10px);
}
.sermon-row.is-visible { opacity: 1; transform: translateY(0); }

.sermon-row:active { opacity: 0.85; }

.sermon-row:hover .sermon-title { color: var(--wine); }
@media (min-width: 641px) {
  .sermon-row:hover { box-shadow: inset 0 0 0 9999px rgba(156, 122, 63, 0.03); }
}

.sermon-date {
  font-family: var(--font-display);
  text-align: left;
}
.sermon-date .day {
  font-size: 30px;
  line-height: 1;
  display: block;
  font-weight: 500;
}
.sermon-date .month-year {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: block;
  margin-top: 4px;
}

.sermon-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  margin: 0 0 6px;
  transition: color .15s ease;
}

.sermon-meta {
  font-size: 13px;
  color: var(--ink-soft);
  font-style: italic;
}

.sermon-desc {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 60ch;
}

.play-affordance {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: background .15s ease;
}
.play-affordance::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  animation: play-ring 4.5s ease-out infinite;
}
@keyframes play-ring {
  0%   { opacity: 0.35; transform: scale(0.85); }
  70%  { opacity: 0; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.15); }
}
.sermon-row:hover .play-affordance { background: var(--gold); }
.play-affordance svg { width: 14px; height: 14px; fill: var(--gold); transition: fill .15s ease; }
.sermon-row:hover .play-affordance svg { fill: var(--parchment); }

.empty-state {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-soft);
}
.empty-state p:first-child {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--stone);
  padding: 28px 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-info { display: flex; flex-direction: column; gap: 3px; }
.build-tag { font-size: 10px !important; opacity: 0.35; margin-top: 2px !important; }

.site-footer p {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
}
.site-footer a {
  font-size: 12px;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
}
.site-footer a:hover { color: var(--ink); border-color: var(--gold); }

/* ---------- Video page ---------- */

.video-page { padding: 48px 0 100px; }

.back-link {
  font-size: 13px;
  color: var(--ink-soft);
  display: inline-block;
  margin-bottom: 28px;
}
.back-link:hover { color: var(--gold); }

.player-frame {
  background: var(--ink);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 32px;
}
.player-frame video {
  width: 100%;
  display: block;
  max-height: 70vh;
}

.mode-toggle {
  display: inline-flex;
  border: 1px solid var(--stone);
  border-radius: 30px;
  padding: 3px;
  margin-bottom: 12px;
  background: #fffdf8;
}
.mode-btn {
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 24px;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.mode-btn.is-active {
  background: var(--ink);
  color: var(--parchment);
}

.mode-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 52ch;
}

.audio-frame {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--ink);
  border-radius: 4px;
  padding: 28px;
  margin-bottom: 32px;
}
.audio-frame-art {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--gold);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 4px rgba(156, 122, 63, 0.25);
}
.audio-frame audio {
  flex: 1;
  min-width: 0;
}

.video-info h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(26px, 4vw, 36px);
  margin: 0 0 10px;
}

.video-info .video-meta {
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 20px;
}

.video-info .video-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 68ch;
  white-space: pre-line;
}

/* ---------- Admin ---------- */

.admin-page { padding: 48px 0 100px; }

.admin-shell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-shell h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  margin: 0;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--parchment);
  transition: opacity .15s ease;
  font-family: var(--font-body);
}
.btn:hover { opacity: 0.85; }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--stone);
}
.btn.danger {
  background: transparent;
  border-color: var(--wine);
  color: var(--wine);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-card {
  max-width: 380px;
  margin: 80px auto;
  padding: 40px;
  border: 1px solid var(--stone);
  border-radius: 4px;
}
.login-card h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 28px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--stone);
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
.field input:focus,
.field textarea:focus,
.field input[type=file]:focus {
  outline: none;
  border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 90px; }

.form-error {
  background: #fbe9e9;
  color: var(--wine);
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.form-error.show { display: block; }

.form-note {
  background: #eef3ea;
  color: #33502f;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}
.form-note.show { display: block; }

.upload-card {
  border: 1px solid var(--stone);
  border-radius: 4px;
  padding: 32px;
  margin-bottom: 48px;
}
.upload-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-grid .full { grid-column: 1 / -1; }

.progress-track {
  height: 6px;
  background: var(--parchment-dim);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 16px;
  display: none;
}
.progress-track.show { display: block; }
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width .2s ease;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink);
}
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--stone);
  font-size: 14px;
  vertical-align: top;
}
.admin-table td.title-cell { font-family: var(--font-display); font-size: 16px; }
.admin-table .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-table .row-actions button {
  font-size: 12px;
  padding: 6px 12px;
}
.tag-hidden {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wine);
  border: 1px solid var(--wine);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

.edit-row td { padding: 0; border-bottom: 1px solid var(--stone); }
.edit-form {
  background: var(--slate-soft);
  padding: 22px 20px;
}
.edit-form .field label {
  font-size: 11px;
}

@media (max-width: 640px) {
  .sermon-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "date play" "content content";
    row-gap: 14px;
    column-gap: 12px;
    padding: 20px 18px;
    margin-bottom: 14px;
    background: #fffdf8;
    border: 1px solid var(--stone);
    border-bottom: 1px solid var(--stone);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(27, 33, 48, 0.05);
  }
  .sermon-row:active { transform: scale(0.99); }
  .sermon-date { grid-area: date; display: flex; align-items: baseline; gap: 8px; }
  .sermon-date .day { font-size: 22px; }
  .sermon-content { grid-area: content; }
  .play-affordance {
    grid-area: play;
    width: 40px;
    height: 40px;
    background: var(--gold);
    align-self: start;
  }
  .play-affordance svg { fill: var(--parchment); }
  .form-grid { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; }
}

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

/* ---------- Где церковь ---------- */

.location-page { padding: 56px 0 100px; }

.location-page h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(30px, 5vw, 42px);
  margin: 0 0 14px;
}

.location-lead {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0 0 40px;
}

.location-card {
  background: #fffdf8;
  border: 1px solid var(--stone);
  border-radius: 10px;
  padding: 36px;
  max-width: 480px;
  box-shadow: 0 2px 10px rgba(27, 33, 48, 0.05);
}

.location-card-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--slate-soft);
}
.location-card-row:first-child { padding-top: 0; }

.location-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 6px;
}

.location-value {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}

.map-btn {
  margin-top: 24px;
  width: 100%;
  text-align: center;
  background: var(--ink);
  border-color: var(--ink);
}
.map-btn:hover { background: var(--slate); border-color: var(--slate); }
