:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fdfcf8;
  --ink: #203b31;
  --muted: #52665b;
  --line: #dcded3;
  --accent: #94461c;
  --accent-fill: #eca04b;
  --accent-hover: #f5b467;
  --accent-soft: #faeee0;
  --accent-line: #e7c7a5;
  --green: #25483b;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--sans);
}

[hidden] { display: none !important; }
a { color: inherit; }
button, select { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.container { width: min(1200px, calc(100% - 96px)); margin-inline: auto; }
.site-header { background: #fbf8f2; border-bottom: 1px solid #e8dac9; }
.header-inner, .header-inner nav { display: flex; align-items: center; }
.header-inner { min-height: 82px; justify-content: space-between; gap: 16px; padding-block: 9px; }
.header-inner nav { gap: clamp(20px, 3vw, 38px); }
.brand { display: inline-flex; align-items: center; min-width: 0; }
.brand-logo { display: block; width: 154px; max-width: 100%; height: auto; }
.nav-calendar, .text-link { font-size: 0.92rem; font-weight: 650; text-decoration: none; }
.nav-calendar:hover, .text-link:hover, .site-footer a:hover { text-decoration: underline; text-underline-offset: 4px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 48px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 680;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.arrow-up-right, .arrow-down-right {
  position: relative;
  display: inline-block;
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
}
.arrow-up-right::after, .arrow-down-right::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 1.5px;
  top: 3px;
  right: -1px;
  background: currentColor;
  transform: rotate(-45deg);
}
.arrow-down-right { transform: rotate(90deg); }
.button-small { min-height: 42px; padding-inline: 13px; }
.button-primary, .button-light { background: var(--accent-fill); color: var(--ink); }
.button-primary:hover, .button-light:hover { background: var(--accent-hover); }
.button-outline { background: transparent; border-color: #bb835c; color: var(--ink); }
.button-outline:hover { background: var(--accent-soft); border-color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.03fr);
  align-items: stretch;
  gap: clamp(25px, 4vw, 60px);
  padding: clamp(38px, 5vw, 72px) 0 clamp(39px, 5.4vw, 76px);
}
.hero-copy { align-self: center; padding: 12px 0 16px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 17px;
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.135em;
  font-weight: 750;
  text-transform: uppercase;
}
.eyebrow-line { display: block; width: 24px; height: 2px; background: var(--accent-fill); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; }
h1 {
  margin-bottom: 20px;
  font-size: clamp(3.1rem, 6.25vw, 5.65rem);
  letter-spacing: -0.058em;
  line-height: 0.99;
}
.intro { max-width: 430px; margin-bottom: 25px; color: var(--muted); font-size: 1.06rem; line-height: 1.62; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px 23px; }
.text-link { display: inline-flex; gap: 6px; align-items: center; min-height: 44px; }

.hero-photo {
  min-height: clamp(330px, 34vw, 470px);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 13px;
  background: #334b42;
  color: white;
  text-decoration: none;
}
.hero-photo img, .trip-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo img { position: absolute; inset: 0; object-position: 53% 44%; z-index: -2; }
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 36% 0 0;
  z-index: -1;
  background: linear-gradient(transparent, rgba(15, 27, 25, 0.92));
}
.hero-caption { width: 100%; display: flex; justify-content: space-between; align-items: end; gap: 13px; padding: clamp(16px, 2.4vw, 28px); }
.hero-caption-date { display: block; margin-bottom: 4px; font-weight: 650; font-size: 0.78rem; }
.hero-caption-title { display: block; font: 500 clamp(1.35rem, 2.3vw, 2.05rem)/1.16 var(--serif); }
.hero-arrow {
  flex: 0 0 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 50%;
  background: rgba(252, 252, 240, 0.12);
  font-size: 1.3rem;
  transition: background-color 180ms ease;
}
.hero-photo:hover .hero-arrow { background: rgba(252, 252, 240, 0.29); }

.calendar { padding-top: clamp(25px, 3.7vw, 43px); border-top: 1px solid var(--line); scroll-margin-top: 14px; }
.calendar-heading { display: flex; justify-content: space-between; gap: 10px 18px; align-items: baseline; }
.calendar-heading h2, .register h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.044em;
  line-height: 1.13;
}
#trip-count { color: var(--muted); font-size: 0.88rem; margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }

.filters {
  display: flex;
  gap: 12px 17px;
  align-items: end;
  margin: 20px 0 25px;
  padding: 13px 15px;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--accent-soft);
}
.field { display: block; flex: 0 1 255px; min-width: 0; }
.field-label { display: block; color: var(--muted); margin: 0 0 4px; font-size: 0.77rem; font-weight: 680; }
.select-wrap { position: relative; display: block; }
.select-wrap::after, details summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.select-wrap::after { position: absolute; right: 15px; top: 16px; pointer-events: none; }
.field select {
  appearance: none;
  width: 100%;
  min-height: 44px;
  border: 1px solid #ccaf95;
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 29px 8px 10px;
  font-weight: 580;
  font-size: 0.88rem;
  cursor: pointer;
}
.filter-reset {
  min-height: 44px;
  padding: 5px 7px;
  color: var(--muted);
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
}
.filter-reset span { margin-left: 4px; }
.filter-reset:hover { color: var(--ink); background: #f4dec7; }

.trip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 22px; }
.trip-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  overflow: hidden;
  scroll-margin-top: 20px;
}
.trip-card:target { border-color: #8a9b82; }
.trip-photo { aspect-ratio: 2.08; overflow: hidden; background: #dce4d9; }
.trip-photo img { display: block; }
.photo-pskov img { object-position: 50% 29%; }
.photo-baikal img { object-position: 50% 46%; }
.photo-nizhny img { object-position: 50% 47%; }
.photo-yekaterinburg img { object-position: 50% 48%; }
.photo-serbia-italy img { object-position: 50% 51%; }
.photo-petersburg img { object-position: 50% 50%; }
.trip-content { padding: 16px 18px 4px; }
.trip-date {
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.79rem;
  text-transform: uppercase;
  font-weight: 740;
  letter-spacing: 0.046em;
}
.trip-content h3 { margin: 0; font-size: clamp(1.45rem, 2.18vw, 1.93rem); line-height: 1.14; letter-spacing: -0.035em; }
.trip-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.35; }
.school-tag { display: inline-block; padding: 3px 8px; background: #e8eee0; border-radius: 4px; color: #35503c; font-size: 0.74rem; font-weight: 680; }
.school-tag-senior { background: var(--accent-soft); color: var(--accent); }
.trip-price { margin: 8px 0 0; color: var(--muted); font-size: 0.87rem; }
.trip-price strong { color: var(--ink); font-size: 1rem; }

details { margin-top: 14px; border-top: 1px solid var(--line); font-size: 0.9rem; color: var(--muted); }
details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 9px 5px 9px 0;
  border-radius: 2px;
  list-style: none;
  cursor: pointer;
  color: var(--ink);
  font-weight: 680;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { flex: 0 0 7px; margin-bottom: 4px; }
details[open] summary::after { transform: rotate(225deg); margin-bottom: 0; }
details summary:hover { color: var(--accent); }
details p, details ul { margin: 1px 0 13px; }
details ul { padding-left: 19px; }
details li + li { margin-top: 6px; }

.empty-state { padding: 40px 15px; text-align: center; border: 1px dashed #abb7a7; border-radius: 9px; }
.empty-state h3 { margin-bottom: 14px; font-size: 1.55rem; }

.register {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 17px 30px;
  margin: clamp(30px, 5vw, 58px) 0 0;
  padding: clamp(23px, 4vw, 42px);
  border-radius: 12px;
  background: var(--green);
  color: #fffdf2;
}
.register h2 { font-size: clamp(1.85rem, 3.3vw, 2.8rem); }
.register p { margin: 6px 0 0; color: #e3ebe0; font-size: 0.95rem; }
.button-light { flex-shrink: 0; }
.button-light:focus-visible { outline-color: #f4d3aa; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding-block: 21px;
  color: var(--muted);
  font-size: 0.82rem;
}
.site-footer a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; text-decoration: none; }

@media (max-width: 960px) {
  .container { width: calc(100% - 64px); }
  .trip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
}
@media (max-width: 700px) {
  .container { width: calc(100% - 36px); }
  .header-inner { min-height: 70px; padding-block: 7px; }
  .nav-calendar { display: none; }
  .button-small { min-height: 44px; }
  .hero { grid-template-columns: 1fr; gap: 26px; padding: 32px 0 37px; }
  .hero-copy { padding: 0; }
  h1 { font-size: clamp(3rem, 10vw, 4.45rem); margin-bottom: 15px; }
  .eyebrow { margin-bottom: 12px; }
  .intro { margin-bottom: 16px; font-size: 0.99rem; }
  .hero-photo { min-height: clamp(230px, 58vw, 350px); }
  .filters { gap: 9px 12px; }
}
@media (max-width: 500px) {
  .header-inner { gap: 9px; }
  .header-inner nav { flex-shrink: 0; }
  .brand-logo { width: 128px; }
  .button-small { gap: 8px; padding-inline: 9px; font-size: 0.81rem; }
  .calendar-heading { flex-wrap: wrap; }
  .filters { display: grid; grid-template-columns: minmax(0, 1fr); margin: 15px 0 19px; padding: 10px; }
  .filter-reset { grid-column: 1 / -1; justify-self: end; margin-top: -3px; }
  .trip-grid { grid-template-columns: minmax(0, 1fr); }
  .trip-content h3 { font-size: 1.69rem; }
  .register { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.contacts, .trip-story { padding-block: clamp(24px,4vw,48px); }
.contacts { border-bottom: 1px solid var(--muted); }
.contacts p, .trip-story p { max-width: 72ch; line-height: 1.6; }
.contacts address { display: grid; gap: .65rem; font-style: normal; }
.contacts a, .contact-nav { text-underline-offset: .2em; }
.trip-story h2:not(:first-child) { margin-top: 1em; }
@media (max-width: 420px) {
  .header-inner { flex-wrap: wrap; }
  .header-inner nav { flex-wrap: wrap; gap: 10px; }
}
