/* Calculator page — trip cost estimator. Vanilla CSS, no preprocessors. */

.page-calculator { background: #fcfaf5; min-height: 100vh; }
.calc-section { padding: 100px 0 60px; }
@media (max-width: 768px) { .calc-section { padding: 80px 0 40px; } }

.calc-header { text-align: center; margin-bottom: 32px; max-width: 760px; margin-left: auto; margin-right: auto; }
.calc-title {
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: clamp(28px, 5vw, 44px); line-height: 1.1;
  color: #0B1D3A; margin: 0 0 16px;
}
.calc-subtitle { font-size: 16px; line-height: 1.55; color: #4a5568; margin: 0; }

/* ── Mode switcher ─────────────────────────────── */
.calc-modes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  max-width: 760px; margin: 0 auto 32px;
}
@media (max-width: 600px) { .calc-modes { grid-template-columns: 1fr; } }

.calc-mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 18px 22px; border-radius: 14px; border: 2px solid #e0e7ef;
  background: #fff; cursor: pointer; text-align: left;
  transition: all .15s ease;
}
.calc-mode:hover { border-color: #2E6BC6; }
.calc-mode--active {
  border-color: #0B1D3A; background: #0B1D3A; color: #fff;
  box-shadow: 0 4px 16px rgba(11,29,58,.2);
}
.calc-mode__title { font-weight: 600; font-size: 16px; }
.calc-mode__hint { font-size: 13px; opacity: .75; line-height: 1.35; }

/* ── Layout (form + result) ───────────────────── */
.calc-layout {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px; align-items: start;
}
@media (max-width: 980px) {
  .calc-layout { grid-template-columns: 1fr; }
}

/* ── Form ─────────────────────────────────────── */
.calc-form { display: flex; flex-direction: column; gap: 20px; }
.calc-step {
  background: #fff; border: 1px solid #e0e7ef; border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 1px 3px rgba(11,29,58,.04);
}
.calc-step--hidden { display: none; }
.calc-step__title {
  font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 600;
  color: #0B1D3A; margin: 0 0 18px; line-height: 1.2;
}
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.calc-row--3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) {
  .calc-row, .calc-row--3 { grid-template-columns: 1fr; }
}

.calc-field { display: flex; flex-direction: column; gap: 6px; }
/* The HTML5 `hidden` attribute is supposed to imply display:none, but
   the UA-stylesheet rule has the same specificity as our .calc-field
   rule above, so display:flex wins and the field stays visible.
   These explicit overrides restore the expected hide behaviour. */
.calc-field[hidden],
.calc-checkbox[hidden] { display: none; }
.calc-field__label { font-size: 13px; font-weight: 500; color: #4a5568; }
.calc-field select, .calc-field input {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid #cbd5e0; background: #fff; font-size: 14px;
  color: #0B1D3A; font-family: inherit;
}
.calc-field select:focus, .calc-field input:focus {
  outline: none; border-color: #2E6BC6; box-shadow: 0 0 0 3px rgba(46,107,198,.15);
}

.calc-checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: #f4f7fb; border-radius: 10px;
  margin-bottom: 8px; cursor: pointer;
}
.calc-checkbox input { margin-top: 3px; flex-shrink: 0; }
.calc-checkbox strong { display: block; font-size: 14px; color: #0B1D3A; }
.calc-checkbox small { display: block; font-size: 12px; color: #6b7b8d; margin-top: 2px; line-height: 1.4; }

/* ── Tour filters + grid (step 1 in tour mode) ── */
.calc-tour-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.calc-tour-filter {
  padding: 6px 14px; border-radius: 999px; border: 1px solid #cbd5e0;
  background: #fff; color: #4a5568; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s ease;
}
.calc-tour-filter:hover { border-color: #2E6BC6; color: #2E6BC6; }
.calc-tour-filter--active { background: #0B1D3A; color: #fff; border-color: #0B1D3A; }

.calc-tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.calc-tour-empty { padding: 24px; text-align: center; color: #6b7b8d; font-size: 14px; grid-column: 1/-1; }
.calc-tour-card {
  border: 2px solid #e0e7ef; border-radius: 10px; padding: 12px; cursor: pointer;
  background: #fff; transition: all .15s ease; text-align: left;
  display: flex; flex-direction: column; gap: 4px;
}
.calc-tour-card:hover { border-color: #2E6BC6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(46,107,198,.1); }
.calc-tour-card--active { border-color: #0B1D3A; background: #f4f7fb; box-shadow: 0 0 0 3px rgba(11,29,58,.1); }
.calc-tour-card__title { font-weight: 600; font-size: 13px; color: #0B1D3A; line-height: 1.3; }
.calc-tour-card__meta { font-size: 11px; color: #6b7b8d; }
.calc-tour-card__price { font-size: 13px; font-weight: 600; color: #2E6BC6; margin-top: 4px; }

.calc-tour-hint { font-size: 12px; color: #6b7b8d; margin: 10px 0 0; }

.calc-tour-selected {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: #eef4fb; border: 1px solid #b3d0eb;
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.calc-tour-selected__label { color: #6b7b8d; }
.calc-tour-selected__title { color: #0B1D3A; flex: 1; }
.calc-tour-selected__clear {
  background: transparent; border: none; color: #6b7b8d; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px;
}
.calc-tour-selected__clear:hover { background: rgba(11,29,58,.08); color: #DC2626; }

/* ── Tour preview modal ─────────────────────── */
.calc-tour-modal[hidden] { display: none !important; }
.calc-tour-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.calc-tour-modal__backdrop {
  position: absolute; inset: 0; background: rgba(11,29,58,.5);
  backdrop-filter: blur(4px);
}
.calc-tour-modal__panel {
  position: relative; background: #fff; border-radius: 14px;
  max-width: 440px; width: 100%; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.calc-tour-modal__close {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  background: rgba(255,255,255,.92); border: none; color: #0B1D3A;
  font-size: 22px; line-height: 1; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.calc-tour-modal__close:hover { background: #fff; color: #DC2626; }
.calc-tour-modal__img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  flex-shrink: 0; background: #f4f7fb;
  border-radius: 14px 14px 0 0;
}
.calc-tour-modal__img:not([src]) { display: none; }
.calc-tour-modal__panel > *:not(.calc-tour-modal__img):not(.calc-tour-modal__close) {
  padding-left: 20px; padding-right: 20px;
}
.calc-tour-modal__title {
  font-family: 'Playfair Display', serif; font-size: 19px; font-weight: 600;
  color: #0B1D3A; line-height: 1.25; margin: 14px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.calc-tour-modal__meta {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px;
}
.calc-tour-modal__meta span {
  display: inline-block; padding: 3px 9px; background: #f4f7fb;
  color: #4a5568; font-size: 12px; border-radius: 999px;
  font-weight: 500;
}
.calc-tour-modal__price { font-size: 17px; font-weight: 700; color: #2E6BC6; margin: 0 0 10px; }
.calc-tour-modal__announce {
  font-size: 14px; line-height: 1.5; color: #4a5568; margin: 0 0 14px;
  /* No line-clamp — tourTeaser() already returns a complete short
     summary that ends on a sentence. Let the modal grow naturally;
     panel's max-height + overflow-y handles the rare overflow. */
}
.calc-tour-modal__actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding-top: 12px; padding-bottom: 18px;
  border-top: 1px solid #eef0f4; margin-top: auto;
}
.calc-tour-modal__cta {
  flex: 1; min-width: 160px;
  background: #0B1D3A; color: #fff; border: none;
  padding: 11px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s ease;
}
.calc-tour-modal__cta:hover { background: #1A3A6B; }
.calc-tour-modal__link { color: #2E6BC6; font-size: 13px; text-decoration: none; white-space: nowrap; }
.calc-tour-modal__link:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .calc-tour-modal__panel { max-height: 92vh; }
  .calc-tour-modal__img { aspect-ratio: 16/10; }
  .calc-tour-modal__title { font-size: 17px; }
}

/* ── Result ───────────────────────────────────── */
.calc-result {
  position: sticky; top: 100px;
  display: flex; flex-direction: column; gap: 14px;
}
@media (max-width: 980px) { .calc-result { position: static; } }
.calc-result__loading {
  padding: 40px 24px; text-align: center; color: #6b7b8d; font-size: 15px;
  background: #fff; border: 1px solid #e0e7ef; border-radius: 14px; border-style: dashed;
}

.calc-block {
  border-radius: 14px; padding: 18px 20px; border-width: 1px; border-style: solid;
}
.calc-block--amist  { background: #eef4fb; border-color: #b3d0eb; }
.calc-block--third  { background: #fdf6e0; border-color: #ead9a3; }
.calc-block--onsite { background: #f4f5f7; border-color: #d0d5dc; }

.calc-block__header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.calc-block__title  { font-size: 14px; font-weight: 600; color: #0B1D3A; margin: 0; line-height: 1.3; }
.calc-block__amount { font-size: 18px; font-weight: 700; color: #0B1D3A; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-block__hint   { font-size: 12px; color: #6b7b8d; line-height: 1.4; margin: 0 0 8px; }
.calc-block__items  { font-size: 13px; color: #4a5568; }
.calc-block__row    { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed rgba(11,29,58,.08); }
.calc-block__row:last-child { border-bottom: none; }
.calc-block__row-label { flex: 1; }
.calc-block__row-amount { font-variant-numeric: tabular-nums; white-space: nowrap; }

.calc-block details summary { font-size: 13px; color: #2E6BC6; cursor: pointer; padding: 6px 0; user-select: none; }
.calc-block details summary:hover { text-decoration: underline; }

.calc-total {
  background: #0B1D3A; color: #fff;
  border-radius: 14px; padding: 22px 24px;
  text-align: center;
}
.calc-total__label { font-size: 12px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.calc-total__amount { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; line-height: 1.1; }
.calc-total__per    { font-size: 13px; opacity: .75; margin-top: 8px; }
.calc-total__cta {
  margin-top: 16px; display: inline-block;
  background: #C9A84C; color: #0B1D3A; padding: 12px 24px;
  border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .15s ease;
}
.calc-total__cta:hover { background: #d6b964; }

.calc-disclaimer {
  margin-top: 32px; text-align: center; color: #6b7b8d;
  font-size: 13px; max-width: 760px; margin-left: auto; margin-right: auto;
  line-height: 1.5;
}
.calc-disclaimer a { color: #2E6BC6; text-decoration: none; }
.calc-disclaimer a:hover { text-decoration: underline; }

/* ── Breadcrumbs (re-use minimal styling) ─────── */
.breadcrumbs { font-size: 13px; color: #6b7b8d; }
.breadcrumbs a { color: #2E6BC6; text-decoration: none; }
.breadcrumbs__sep { margin: 0 6px; opacity: .5; }

/* ── Footer minimal ─────────────────────────── */
.footer { background: #0B1D3A; color: #fff; padding: 48px 0 24px; margin-top: 60px; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 768px) { .footer__inner { grid-template-columns: 1fr; gap: 24px; } }
.footer__logo { color: #fff; text-decoration: none; font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 700; }
.footer__text { color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.5; margin-top: 12px; }
.footer__heading { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__link { color: rgba(255,255,255,.75); text-decoration: none; font-size: 14px; }
.footer__link:hover { color: #C9A84C; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 18px; margin-top: 32px; }
.footer__bottom p { color: rgba(255,255,255,.5); font-size: 12px; text-align: center; margin: 0; }

.skip-link {
  position: absolute; top: -100px; left: 8px;
  padding: 8px 12px; background: #0B1D3A; color: #fff;
  text-decoration: none; border-radius: 4px;
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; }
