/* ==========================================================================
   Majorka po rejsie — ilustrowany plan
   Kierunek: morska zieleń + kamień, jedna kompozycja (nie dashboard kart).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Source+Sans+3:wght@400;500;600;700&display=swap");

:root {
  /* Sea / stone palette */
  --sea-deep: #1f4d47;
  --sea: #2f6f63;
  --sea-soft: #6fa89a;
  --sea-mist: #dce9e4;
  --stone: #8c8474;
  --stone-soft: #c9c0ab;
  --sand: #f4efe4;
  --sand-deep: #e9e0cc;
  --ink: #24302c;
  --ink-soft: #52605a;
  --paper: #faf7ef;
  --active-edge: var(--sea);
  --rest-edge: var(--stone);
  --shadow: 0 12px 30px -18px rgba(31, 77, 71, 0.35);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(111, 168, 154, 0.25), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(140, 132, 116, 0.18), transparent 55%),
    var(--paper);
  line-height: 1.55;
}

a {
  color: var(--sea-deep);
  text-decoration-color: var(--sea-soft);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--sea);
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--sea-deep);
  margin: 0 0 0.4em;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sea);
  background: rgba(47, 111, 99, 0.1);
  border: 1px solid rgba(47, 111, 99, 0.25);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Hero — top of the single composition
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 4rem 0 3rem;
  background:
    linear-gradient(180deg, rgba(31, 77, 71, 0.06), transparent 70%),
    var(--sand);
  border-bottom: 1px solid var(--sand-deep);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto 0 -60% 0;
  height: 220px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(47, 111, 99, 0.15), transparent 70%);
  pointer-events: none;
}

.hero__title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.05;
  max-width: 16ch;
}

.hero__lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 0 1.5rem;
}

.hero__variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hero__variants li {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--sea-deep);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(47, 111, 99, 0.22);
  border-radius: 10px;
  padding: 0.55em 0.9em;
  box-shadow: var(--shadow);
}

.hero__variants span {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* --------------------------------------------------------------------------
   Timeline — horizontal on desktop, vertical spine on mobile
   -------------------------------------------------------------------------- */

.section {
  padding: 3rem 0;
}

.section__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.section__heading p {
  margin: 0;
  color: var(--ink-soft);
}

#timeline {
  background: linear-gradient(180deg, rgba(220, 233, 228, 0.5), transparent);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--sea-soft), var(--stone-soft));
}

.timeline__item {
  flex: 1;
  position: relative;
  padding-top: 3rem;
  text-align: center;
  font-size: 0.88rem;
}

.timeline__dot {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--sea-soft);
  z-index: 1;
}

.timeline__item--active .timeline__dot {
  border-color: var(--sea);
  background: var(--sea);
}

.timeline__item--rest .timeline__dot {
  border-color: var(--stone);
  background: var(--paper);
}

.timeline__date {
  display: block;
  font-weight: 700;
  color: var(--sea-deep);
}

.timeline__type {
  display: block;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Day cards — simple left-edge blocks, not "card hell"
   -------------------------------------------------------------------------- */

.days {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.day {
  break-inside: avoid;
  page-break-inside: avoid;
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 1.25rem;
  align-items: start;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(140, 132, 116, 0.2);
  border-left: 6px solid var(--rest-edge);
  border-radius: 6px;
  padding: 1.1rem 1.4rem;
}

.day--active {
  border-left-color: var(--active-edge);
  background: rgba(111, 168, 154, 0.12);
}

.day__num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--sea-deep);
  line-height: 1;
}

.day__num small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-top: 0.35em;
}

.day__title {
  margin: 0 0 0.3em;
  font-size: 1.15rem;
}

.day__type {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sea);
  margin-bottom: 0.4em;
}

.day--active .day__type {
  color: var(--sea-deep);
}

.day--rest .day__type {
  color: var(--stone);
}

.day__default {
  margin: 0 0 0.35em;
  color: var(--ink);
}

.day__alt {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.day__alt strong {
  color: var(--ink);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Map section + legend
   -------------------------------------------------------------------------- */

#map-section {
  background: linear-gradient(180deg, transparent, rgba(220, 233, 228, 0.45));
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 1.5rem;
  align-items: start;
}

#map {
  min-height: 420px;
  height: 420px;
  border-radius: 10px;
  border: 1px solid rgba(47, 111, 99, 0.25);
  background:
    repeating-linear-gradient(135deg, rgba(47, 111, 99, 0.06) 0 12px, transparent 12px 24px),
    var(--sea-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.legend__item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(140, 132, 116, 0.2);
  border-radius: 8px;
  padding: 0.55em 0.75em;
}

.legend__marker {
  flex: none;
  width: 12px;
  height: 12px;
  margin-top: 0.35em;
  border-radius: 50%;
  background: var(--sea);
  box-shadow: 0 0 0 3px rgba(47, 111, 99, 0.15);
}

.legend__text {
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
}

.legend__role {
  color: var(--ink-soft);
}

.legend__day {
  color: var(--sea);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 0.15em;
}

.map-print-note {
  display: none;
}

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

.footer {
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--sand-deep);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.footer a {
  font-weight: 600;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 0.5rem;
  list-style: none;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Responsive: vertical timeline on small screens
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .timeline {
    flex-direction: column;
    gap: 1.5rem;
  }

  .timeline::before {
    top: 0;
    bottom: 0;
    left: 11px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--sea-soft), var(--stone-soft));
  }

  .timeline__item {
    padding-top: 0;
    padding-left: 2.5rem;
    text-align: left;
  }

  .timeline__dot {
    top: 2px;
    left: 0;
    transform: none;
  }

  .day {
    grid-template-columns: 1fr;
  }

  .day__num {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
  }

  .map-layout {
    grid-template-columns: 1fr;
  }
}

/* Tabs (shared) */
.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  border-bottom: 1px solid var(--sand-deep);
}

.tablist button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.65rem 1rem;
  margin-bottom: -1px;
  cursor: pointer;
}

.tablist button[aria-selected="true"] {
  color: var(--sea-deep);
  border-bottom-color: var(--sea);
}

.tablist--inner {
  margin-top: 1.75rem;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.75rem 0 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}

.data-table th,
.data-table td {
  border: 1px solid var(--sand-deep);
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--sea-mist);
  color: var(--sea-deep);
  font-weight: 600;
}

.main-panel[hidden] {
  display: none !important;
}

.lodging-panel[hidden] {
  display: none !important;
}

.lodging-note,
.lodging-default {
  color: var(--ink-soft);
}

.lodging-row--struck,
.lodging-row--struck a {
  text-decoration: line-through;
  opacity: 0.72;
}

.lodging-excluded {
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   Print — plan powinien nadawać się do wydruku na trasę
   -------------------------------------------------------------------------- */

@media print {
  body {
    background: #fff;
  }

  .hero::before,
  #timeline::before {
    display: none;
  }

  .hero,
  #timeline,
  #map-section {
    background: #fff !important;
    border: none;
  }

  .hero__variants li,
  .legend__item {
    background: #fff !important;
    box-shadow: none;
    border-color: #ccc;
  }

  /* Grey out the top/right/bottom border but keep border-left-color
     (set by .day / .day--active above) so the active-vs-regeneracja
     colour coding still reads on a printed page. */
  .day {
    background: #fff !important;
    box-shadow: none;
    border-top-color: #ccc;
    border-right-color: #ccc;
    border-bottom-color: #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  #map {
    height: 360px;
    min-height: 360px;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #eef3f1 !important;
  }

  /* Tiles often fail to print (external image requests) — the legend
     is the mandatory fallback content for the map on paper. Stack it
     under the map (instead of the on-screen 2fr/1fr side-by-side grid)
     so the "legenda poniżej" print note stays accurate. */
  .map-layout {
    grid-template-columns: 1fr;
  }

  /* Hide the on-map zoom buttons (useless on paper) but keep the
     OpenStreetMap attribution visible — it must remain on every
     printed rendering of the tiles, per OSM's attribution requirement. */
  .leaflet-control-zoom {
    display: none !important;
  }

  .map-print-note {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    font-style: italic;
    color: #555;
  }

  .footer {
    border-top-color: #ccc;
  }

  a {
    color: var(--ink);
    text-decoration: underline;
  }

  .tablist {
    display: none !important;
  }

  /* Only the active main panel prints */
  #panel-plan:not(.is-active),
  #panel-noclegi:not(.is-active),
  #panel-mapa:not(.is-active) {
    display: none !important;
  }

  #panel-plan.is-active,
  #panel-noclegi.is-active,
  #panel-mapa.is-active {
    display: block !important;
  }

  /* Inner lodging: hide inactive category panels */
  .lodging-panel:not(.is-active) {
    display: none !important;
  }

  .lodging-panel.is-active {
    display: block !important;
  }

  /* Comparison + finca scenario always print with Noclegi */
  .lodging-always-print {
    display: block !important;
  }

  /* Paper has no scrollbars — let wide lodging tables shrink to fit
     instead of clipping the trailing columns. */
  .table-scroll {
    overflow-x: visible;
  }

  .data-table {
    min-width: 0;
    font-size: 0.72rem;
  }

  .hero {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }
}
