/* #326 /ferie/ planer ferii. Travel-magazine layout in the site palette (navy, yellow) and font (TL Plus Jakarta Sans).
   Side margins follow the shared header (#316): max(0px, 50% - 640px) + clamp(16px, 3vw, 40px). */
.fer-page { background: #fff; }
.fer, .fer * { box-sizing: border-box; }
.fer {
  --navy: #102e48; --navy-2: #1b4466; --ink: #17212b; --muted: #57687a; --line: #e3e9ef;
  --sand: #fbf6ec; --sand-2: #f4ead6; --sea: #0b7c8c; --sea-bg: #e3f4f5; --blue: #0066cc;
  --yellow: #ffca32; --yellow-h: #ffbe0b; --r: 18px; --r-s: 12px;
  --gut: calc(max(0px, 50% - 640px) + clamp(16px, 3vw, 40px));
  --shadow: 0 1px 2px rgba(16, 46, 72, .06), 0 10px 30px rgba(16, 46, 72, .10);
  --shadow-lg: 0 2px 4px rgba(16, 46, 72, .06), 0 24px 60px rgba(16, 46, 72, .18);
  color: var(--ink); background: #fff;
  font-family: "TL Plus Jakarta Sans", "Open Sans", -apple-system, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.fer :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
/* Zero specificity: component margins must win over this reset. The site shell has its own
   body.tl-home-clean :is(h1…p) { margin: 0 } (0,1,2), so text rules with a margin start with #fer. */
:where(.fer) :where(h1, h2, p) { margin: 0; }
:where(.fer) button { font: inherit; cursor: pointer; }
.fer img { display: block; max-width: 100%; }

/* ---------------------------------------------------------------- hero */
.fer-hero {
  position: relative; isolation: isolate; overflow: hidden; color: #fff;
  min-height: clamp(460px, 62vh, 640px); display: flex; align-items: flex-end;
  padding: 0 var(--gut) 150px;
}
.fer-hero-photo, .fer-hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.fer-hero-photo img { object-fit: cover; object-position: 55% 55%; transform: scale(1.04); animation: fer-zoom 9s ease-out forwards; }
.fer-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(9, 30, 49, .78) 0%, rgba(9, 30, 49, .45) 42%, rgba(9, 30, 49, 0) 72%),
    linear-gradient(0deg, rgba(9, 30, 49, .55) 0%, rgba(9, 30, 49, 0) 45%);
}
.fer-hero-inner { max-width: 620px; }
.fer-kicker span {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; margin-bottom: 18px;
  background: var(--yellow); color: var(--navy); border-radius: 999px; font-size: 13px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
}
.fer-kicker span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.fer-hero h1 {
  font-size: clamp(34px, 5.4vw, 64px); line-height: 1.02; font-weight: 800; letter-spacing: -.025em;
  text-wrap: balance; text-shadow: 0 2px 24px rgba(0, 0, 0, .25);
}
#fer .fer-hero-lead { margin-top: 16px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.5; max-width: 34em; color: rgba(255, 255, 255, .92); text-wrap: pretty; }
.fer-credit { position: absolute; right: var(--gut); bottom: 128px; font-size: 11px; color: rgba(255, 255, 255, .7); }

/* ---------------------------------------------------------------- layout */
.fer-wrap { padding: 0 var(--gut) 72px; position: relative; }
.fer-sec-head { margin-bottom: 22px; max-width: 680px; }
.fer-sec-head h2 { font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; font-weight: 800; color: var(--navy); letter-spacing: -.015em; text-wrap: balance; }
#fer .fer-sec-head p { margin-top: 8px; color: var(--muted); }
.fer-countries, .fer-terms, .fer-pages { margin-top: clamp(56px, 7vw, 88px); }

/* ---------------------------------------------------------------- planner card */
.fer-plan {
  position: relative; z-index: 2; margin-top: -110px; background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-lg); padding: clamp(20px, 2.6vw, 32px);
}
.fer-plan:focus { outline: none; }
#fer .fer-plan-h { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; color: var(--navy); margin-bottom: 18px; }
.fer-step {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--navy); color: var(--yellow); font-size: 15px; font-weight: 800;
}
.fer-plan-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr) auto auto; gap: 16px 18px; align-items: end; }
.fer-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fer-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .01em; }
.fer-select { position: relative; display: block; }
.fer-select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; margin-top: -7px; pointer-events: none;
  border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy); transform: rotate(45deg);
}
.fer select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 56px; padding: 0 44px 0 16px;
  font: inherit; font-weight: 700; color: var(--navy); background: var(--sand); border: 2px solid transparent;
  border-radius: var(--r-s); transition: border-color .15s, background .15s;
}
.fer select:hover { background: var(--sand-2); }
.fer select:focus-visible { outline: none; border-color: var(--blue); background: #fff; }
.fer-plan.is-missing .fer-field--region select { border-color: #d93025; background: #fff5f4; animation: fer-shake .4s; }
.fer-plan.is-missing .fer-field--region .fer-label { color: #b3261e; }

.fer-stepper {
  display: inline-flex; align-items: center; min-height: 56px; padding: 6px; gap: 4px;
  background: var(--sand); border-radius: var(--r-s);
}
.fer-stepper button {
  width: 44px; height: 44px; border: 0; border-radius: 10px; background: #fff; color: var(--navy);
  font-size: 22px; font-weight: 700; line-height: 1; box-shadow: 0 1px 2px rgba(16, 46, 72, .12); transition: background .15s, transform .1s;
}
.fer-stepper button:hover:not(:disabled) { background: var(--yellow); }
.fer-stepper button:active:not(:disabled) { transform: scale(.94); }
.fer-stepper button:disabled { opacity: .35; cursor: default; box-shadow: none; }
.fer-stepper output { min-width: 34px; text-align: center; font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }

.fer-ages { border: 0; margin: 20px 0 0; padding: 0; min-width: 0; }
.fer-ages[hidden] { display: none; }
.fer-ages legend { padding: 0; margin-bottom: 8px; }
.fer-ages-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fer-age { display: flex; align-items: center; gap: 0; background: var(--sand); border-radius: var(--r-s); padding-left: 8px; }
.fer-age-no {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sea-bg); color: var(--sea); font-size: 13px; font-weight: 800; flex: none;
}
.fer-select--s select { min-height: 48px; min-width: 150px; background: transparent; }
.fer-select--s select:hover { background: transparent; }

.fer-plan-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line);
}
.fer-switch { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--navy); }
.fer-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fer-switch-ui { position: relative; width: 46px; height: 28px; border-radius: 999px; background: #c9d4de; transition: background .2s; flex: none; }
.fer-switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.fer-switch input:checked + .fer-switch-ui { background: var(--sea); }
.fer-switch input:checked + .fer-switch-ui::after { transform: translateX(18px); }
.fer-switch input:focus-visible + .fer-switch-ui { outline: 3px solid var(--blue); outline-offset: 3px; }

.fer-go-btn, .fer-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px;
  border: 0; border-radius: 999px; background: var(--yellow); color: var(--navy); font-size: 17px; font-weight: 800;
  text-decoration: none; box-shadow: 0 6px 18px rgba(255, 190, 11, .35); transition: background .15s, transform .15s, box-shadow .15s;
}
.fer-go-btn:hover, .fer-btn:hover { background: var(--yellow-h); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255, 190, 11, .45); }
.fer-btn-arrow { transition: transform .2s; }
.fer-btn:hover .fer-btn-arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------- result: boarding pass */
.fer-result { margin-top: 28px; scroll-margin-top: 90px; }
.fer-result:not([hidden]) { animation: fer-in .35s ease-out; }
.fer-result-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.fer-pass {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); overflow: hidden;
  background: var(--navy); color: #fff; border-radius: var(--r);
  background-image: radial-gradient(circle at 100% 0, rgba(255, 202, 50, .18), transparent 45%), radial-gradient(circle at 0 100%, rgba(11, 124, 140, .45), transparent 55%);
}
.fer-pass-main { padding: 26px 28px 28px; }
#fer .fer-pass-eyebrow { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--yellow); }
.fer-pass-eyebrow .fer-step { background: var(--yellow); color: var(--navy); width: 26px; height: 26px; font-size: 13px; }
#fer .fer-pass-date { margin-top: 14px; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
#fer .fer-pass-region { margin-top: 8px; color: rgba(255, 255, 255, .78); }
.fer-pass-side {
  position: relative; margin: 0; padding: 24px 26px; display: grid; gap: 14px; align-content: center;
  border-left: 2px dashed rgba(255, 255, 255, .28);
}
.fer-pass-side::before, .fer-pass-side::after {
  content: ""; position: absolute; left: -13px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
}
.fer-pass-side::before { top: -12px; }
.fer-pass-side::after { bottom: -12px; }
.fer-pass-side dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .6); font-weight: 700; }
.fer-pass-side dd { margin: 2px 0 0; font-weight: 700; font-size: 16px; }
.fer-cta {
  display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 26px 28px;
  background: var(--sand); border-radius: var(--r);
}
.fer-cta .fer-btn { width: 100%; }
#fer .fer-cta-note { color: var(--muted); font-size: 14px; }
#fer .fer-ad { font-size: 12px; color: #6b6b6b; }

/* ---------------------------------------------------------------- checked trips */
.fer-checked { margin-top: 44px; }
.fer-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.fer-cards li { animation: fer-in .4s calc(var(--i) * 70ms) ease-out backwards; }
.fer-card {
  display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; background: #fff;
  border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.fer-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.fer-card-photo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand-2); }
.fer-card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.fer-card:hover .fer-card-photo img { transform: scale(1.05); }
.fer-card-country {
  position: absolute; left: 14px; top: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .94);
  color: var(--navy); font-size: 13px; font-weight: 800;
}
.fer-card-price {
  position: absolute; right: 14px; bottom: 14px; display: grid; justify-items: end; padding: 8px 14px 9px; border-radius: 14px;
  background: var(--yellow); color: var(--navy); font-size: 22px; font-weight: 800; line-height: 1.05; box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}
.fer-card-price small { font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.fer-card-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 20px; font-size: 14px; color: var(--muted); }
#fer .fer-card-body strong { font-size: 19px; line-height: 1.25; color: var(--navy); }
.fer-card-place { color: var(--sea); font-weight: 700; }
.fer-card-when { margin-top: 6px; color: var(--ink); }
.fer-more { display: inline-flex; margin-top: 20px; color: var(--blue); font-weight: 800; text-decoration: none; }
.fer-more:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- country tiles */
.fer-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.fer-tile a {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--r); color: #fff; text-decoration: none;
  background: var(--navy); box-shadow: var(--shadow); isolation: isolate;
}
.fer-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.fer-tile a::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(9, 30, 49, .85) 0%, rgba(9, 30, 49, .25) 45%, rgba(9, 30, 49, 0) 70%);
}
.fer-tile a:hover img { transform: scale(1.07); }
.fer-tile-text { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 1; display: grid; gap: 4px; }
#fer .fer-tile-text strong { color: #fff; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.fer-tile-text span { font-size: 13px; line-height: 1.35; color: rgba(255, 255, 255, .88); }
.fer-tile-text strong::after { content: " →"; color: var(--yellow); opacity: 0; transition: opacity .2s; }
.fer-tile a:hover .fer-tile-text strong::after { opacity: 1; }
.fer-tile.is-off a { filter: grayscale(1); opacity: .45; pointer-events: none; }

/* ---------------------------------------------------------------- turns */
.fer-turns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.fer-turn {
  position: relative; display: grid; gap: 2px; padding: 22px 22px 24px; border-radius: var(--r); background: var(--sand);
  border: 2px solid transparent; transition: background .2s, border-color .2s, transform .2s;
}
.fer-turn::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 6px; border-radius: 0 0 6px 6px; background: var(--sea); opacity: .35; }
.fer-turn-no { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--sea); }
.fer-turn-days { margin-top: 6px; font-size: clamp(34px, 3.6vw, 46px); line-height: 1; font-weight: 800; color: var(--navy); letter-spacing: -.03em; }
.fer-turn-month { font-size: 18px; font-weight: 700; color: var(--navy); }
.fer-turn-regions { margin-top: 12px; font-size: 14px; color: var(--muted); }
.fer-turn.is-active { background: #fff; border-color: var(--yellow); box-shadow: var(--shadow); transform: translateY(-3px); }
.fer-turn.is-active::before { background: var(--yellow); opacity: 1; }

/* ---------------------------------------------------------------- our #285 pages */
.fer-pages-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.fer-pages-list a {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 16px 10px 10px;
  border-radius: var(--r-s); border: 1px solid var(--line); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.fer-pages-list a:hover { border-color: var(--yellow); box-shadow: var(--shadow); }
.fer-pages-list img { width: 76px; height: 58px; object-fit: cover; border-radius: 8px; }
.fer-pages-text { display: grid; gap: 2px; min-width: 0; }
.fer-pages-text strong { color: var(--navy); font-size: 15px; }
.fer-pages-text span { color: var(--muted); font-size: 13px; }
.fer-pages-price { font-weight: 800; color: var(--navy); white-space: nowrap; font-size: 15px; }

#fer .fer-noscript { margin-top: 24px; background: var(--sand); padding: 14px 18px; border-radius: var(--r-s); }
#fer .fer-photo-note { margin-top: 48px; font-size: 12px; color: #7a8896; }

/* ---------------------------------------------------------------- motion */
/* Movement only, never opacity: content stays readable even when an animation does not run to the end. */
@keyframes fer-in { from { transform: translateY(14px); } to { transform: none; } }
@keyframes fer-zoom { to { transform: scale(1); } }
@keyframes fer-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) {
  .fer *, .fer *::before, .fer *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- tablet */
@media (max-width: 1099px) {
  .fer-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fer-plan-grid { grid-template-columns: minmax(0, 1fr) auto auto; }
  .fer-field--region { grid-column: 1 / -1; }
  .fer-pages-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899px) {
  .fer-result-top { grid-template-columns: 1fr; }
  .fer-cards { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- phone */
@media (max-width: 759px) {
  .fer { font-size: 15px; }
  .fer-hero { min-height: 0; aspect-ratio: 4 / 5; max-height: 78vh; padding-bottom: 92px; align-items: flex-end; }
  .fer-hero::before {
    background: linear-gradient(0deg, rgba(9, 30, 49, .88) 0%, rgba(9, 30, 49, .55) 38%, rgba(9, 30, 49, .05) 70%);
  }
  .fer-hero-photo img { object-position: 50% 40%; }
  .fer-kicker span { margin-bottom: 12px; font-size: 12px; }
  .fer-hero h1 { font-size: clamp(30px, 8.6vw, 40px); }
  #fer .fer-hero-lead { margin-top: 10px; font-size: 15px; }
  .fer-credit { bottom: 70px; right: 16px; font-size: 10px; }
  .fer-wrap { padding-left: 12px; padding-right: 12px; }
  .fer-plan { margin-top: -60px; border-radius: 22px; padding: 20px 16px; }
  #fer .fer-plan-h { font-size: 18px; margin-bottom: 14px; }
  .fer-plan-grid { gap: 14px 12px; }
  .fer-stepper { display: flex; justify-content: space-between; }
  .fer-plan-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fer-field--airport { grid-column: 1 / -1; }
  .fer-btn { font-size: 16px; padding: 0 18px; }
  .fer-cta { padding: 16px; }
  .fer-age { flex: 1 1 calc(50% - 5px); }
  .fer-select--s { flex: 1; }
  .fer-select--s select { min-width: 0; }
  .fer-plan-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  .fer-go-btn { width: 100%; }
  .fer-pass { grid-template-columns: 1fr; }
  .fer-pass-main { padding: 22px 20px 20px; }
  .fer-pass-side { grid-template-columns: 1fr 1fr; border-left: 0; border-top: 2px dashed rgba(255, 255, 255, .28); padding: 18px 20px 20px; }
  .fer-pass-side > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .fer-pass-side::before, .fer-pass-side::after { top: -13px; bottom: auto; }
  .fer-pass-side::before { left: -12px; }
  .fer-pass-side::after { left: auto; right: -12px; }
  .fer-cta { padding: 20px; }
  .fer-cards { grid-template-columns: 1fr; gap: 18px; }
  .fer-sec-head { margin-bottom: 16px; }
  .fer-wrap > section, .fer-result { padding-left: 4px; padding-right: 4px; }
  /* Tiles scroll sideways on a phone: a swipeable strip, not a long grid. */
  .fer-tiles {
    display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 12px;
    scrollbar-width: none;
  }
  .fer-tiles::-webkit-scrollbar { display: none; }
  .fer-tile { flex: 0 0 62%; scroll-snap-align: start; }
  .fer-tile-text strong::after { opacity: 1; }
  .fer-turns { grid-template-columns: 1fr; gap: 12px; }
  .fer-turn { grid-template-columns: auto 1fr; column-gap: 16px; padding: 18px; }
  .fer-turn-no { grid-column: 1 / -1; }
  .fer-turn-days { grid-row: span 2; font-size: 38px; align-self: center; }
  .fer-turn-month { align-self: end; }
  .fer-turn-regions { margin-top: 2px; grid-column: 2; font-size: 13px; }
  .fer-pages-list { grid-template-columns: 1fr; }
}
