/* =====================================================================
   Sunny Side Cycling — identity layer
   Load AFTER sunnyside-tokens.css. Every value comes from a token.
   Component classes are prefixed .ss- ; base element styles are scoped
   to body.ss so they can be switched on page by page during migration.
   ===================================================================== */

/* ---------- Base ---------- */
body.ss {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px; line-height: 24px; font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.ss h1, .ss h2, .ss h3 { font-family: var(--font-display); color: var(--ink); margin: 0 0 var(--space-4); }
.ss h1 { font-size: clamp(40px, 6vw, 72px); line-height: .95; font-weight: 700; letter-spacing: .01em; text-transform: uppercase; color: var(--display-accent); }
.ss h2 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.1; font-weight: 600; }
.ss h3 { font-size: 22px; line-height: 28px; font-weight: 600; }
.ss h4 { font-family: var(--font-text); font-size: 18px; line-height: 26px; font-weight: 600; margin: 0 0 var(--space-2); }
.ss p { margin: 0 0 var(--space-4); }
.ss a { color: var(--accent-text); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ss a:hover { text-decoration-color: var(--sun); }
.ss strong, .ss b { font-weight: 600; }
.ss ::selection { background: var(--sun); color: var(--night); }
.ss :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.ss img { max-width: 100%; height: auto; }

.ss-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); box-sizing: border-box; }
.ss-section { padding: var(--space-16) 0; }
.ss-section--warm { background: var(--surface-warm); }
.ss-section--valley { background: var(--surface); } /* combine with .ss-dark */
.ss-section-head { max-width: 720px; margin-bottom: var(--space-8); }
.ss-kicker, .ss-label { font-family: var(--font-text); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.ss-lede { font-size: 18px; line-height: 28px; max-width: 60ch; }
.ss-muted { color: var(--ink-muted); }

/* ---------- Hills edge (section and footer transitions) ---------- */
.ss-hills { display: block; width: 100%; height: clamp(48px, 8vw, 120px); margin-bottom: -1px; }
.ss-hills img, .ss-hills svg { display: block; width: 100%; height: 100%; }

/* ---------- Buttons ---------- */
.ss-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-text); font-weight: 500; font-size: 16px; line-height: 24px;
  padding: var(--space-3) var(--space-6); min-height: 48px; box-sizing: border-box;
  border-radius: var(--radius-pill); border: 2px solid transparent;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background-color .15s ease, transform .1s ease;
}
.ss-btn:active { transform: translateY(1px); }
.ss-btn[disabled], .ss-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.ss-btn-primary { background: var(--fill-primary); color: var(--on-primary) !important; }
.ss-btn-primary:hover { background: var(--trail); }
.ss-btn-secondary { background: transparent; color: var(--ink) !important; border-color: var(--control-border); }
.ss-btn-secondary:hover { background: var(--surface-warm); }
.ss-btn-quiet { background: transparent; color: var(--accent-text) !important; padding-left: 0; padding-right: 0; min-height: 0;
  text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 5px; }
.ss-btn-lg { font-family: var(--font-display); font-weight: 600; font-size: 20px; padding: var(--space-4) var(--space-8); min-height: 56px; letter-spacing: .01em; }
/* Arrow: neither brand font contains "→". Remove the character from labels and add .ss-arrow. */
.ss-arrow::after {
  content: ""; width: 1.1em; height: 1.1em; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s ease;
}
.ss-arrow:hover::after { transform: translateX(3px); }

/* ---------- Header and navigation ---------- */
.ss-header { background: var(--surface); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.ss-header-inner { display: flex; align-items: center; gap: var(--space-6); min-height: 72px; }
.ss-header-logo { display: block; flex: none; }
.ss-header-logo img { height: 40px; width: auto; display: block; }
.ss-nav { display: flex; align-items: center; gap: var(--space-6); margin-left: auto; }
.ss-nav a { color: var(--ink); text-decoration: none; font-weight: 400; padding: var(--space-2) 0; }
.ss-nav a:hover, .ss-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.ss-nav-group { position: relative; }
.ss-nav-menu { position: absolute; top: 100%; left: calc(-1 * var(--space-4)); min-width: 220px; padding: var(--space-2) 0;
  background: var(--surface-raised); border-radius: var(--radius-md); box-shadow: var(--shadow-tile); display: none; }
.ss-nav-group:hover .ss-nav-menu, .ss-nav-group:focus-within .ss-nav-menu { display: block; }
.ss-nav-menu a { display: block; padding: var(--space-2) var(--space-4); }
.ss-lang { display: flex; gap: var(--space-2); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.ss-lang a { color: var(--ink-muted); text-decoration: none; padding: var(--space-1); }
.ss-lang a[aria-current="true"], .ss-lang a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.ss-menu-toggle { display: none; margin-left: auto; width: 48px; height: 48px; border-radius: var(--radius-pill); border: 2px solid var(--control-border); background: transparent; color: var(--ink); cursor: pointer; }
@media (max-width: 1100px) {
  .ss-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .ss-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); padding: var(--space-4) var(--space-6) var(--space-8); border-bottom: 1px solid var(--line); }
  .ss-nav.is-open { display: flex; }
  .ss-nav a { padding: var(--space-3) 0; font-size: 18px; }
  .ss-nav-menu { position: static; display: block; box-shadow: none; background: transparent; padding: 0 0 0 var(--space-4); }
}

/* ---------- Hero ---------- */
.ss-hero { position: relative; padding: var(--space-12) 0 0; overflow: hidden; }
.ss-hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--space-12); align-items: center; }
.ss-hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-6); }
.ss-hero-media { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; }
.ss-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 860px) { .ss-hero-grid { grid-template-columns: 1fr; } .ss-hero-media { aspect-ratio: 4 / 3; } }
/* Sticker-style promo ("Oktober – maj: 2 + 1 dan najema") */
.ss-promo { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4);
  background: var(--sun); color: var(--night) !important; border-radius: var(--radius-pill); font-weight: 500;
  text-decoration: none !important; transform: rotate(-2deg); box-shadow: 0 0 0 4px var(--cream); }

/* ---------- Chips (tour tags) ---------- */
.ss-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.ss-chip { display: inline-flex; align-items: center; padding: 4px var(--space-3); border-radius: var(--radius-pill);
  background: var(--surface-warm); color: var(--ink); font-size: 13px; line-height: 16px; font-weight: 500; }
.ss-chip--sun { background: var(--sun); color: var(--night); }

/* ---------- Cards ---------- */
.ss-grid { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.ss-card { display: flex; flex-direction: column; background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-md); overflow: hidden; }
.ss-card-media { aspect-ratio: 3 / 2; overflow: hidden; }
.ss-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.ss-card:hover .ss-card-media img { transform: scale(1.03); }
.ss-card-body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); flex: 1; }
.ss-card-title { font-family: var(--font-display); font-size: 26px; line-height: 30px; font-weight: 600; margin: 0; color: var(--ink); }
.ss-card-sub { color: var(--ink-muted); margin: 0; }
.ss-card-price { color: var(--accent-text); font-weight: 600; }
.ss-card-foot { margin-top: auto; padding-top: var(--space-2); }

/* Stats row: "25 km · 1800 m · Samo vodeno" */
.ss-stats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-6); margin: 0; }
.ss-stat { display: flex; flex-direction: column; }
.ss-stat dt { font-size: 12px; line-height: 16px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.ss-stat dd { margin: 0; font-size: 18px; line-height: 26px; font-weight: 500; }

/* ---------- Difficulty badge (word + 4 pips, never colour alone) ---------- */
.ss-diff { display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px var(--space-3) 4px 10px;
  border: 2px solid var(--control-border); border-radius: var(--radius-pill); background: var(--surface-raised);
  font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink); white-space: nowrap; align-self: flex-start; width: fit-content; }
.ss-pips { display: inline-flex; gap: 3px; }
.ss-pip { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink); box-sizing: border-box; }
.ss-pip.on { background: var(--ink); }

/* ---------- Elevation profile (GPX, inline SVG polyline) ---------- */
.ss-elevation { display: block; width: 100%; height: auto; overflow: visible; }
.ss-elevation path, .ss-elevation polyline { fill: none; stroke: var(--trail); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* ---------- Bike cards (rentals) ---------- */
.ss-specs { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-4); margin: 0; font-size: 14px; line-height: 20px; }
.ss-specs dt { color: var(--ink-muted); }
.ss-specs dd { margin: 0; font-weight: 500; }

/* Segmented control (height selector 150 / 175 / 200 cm, filters) */
.ss-segment { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--radius-pill); background: var(--surface-warm); }
.ss-segment button { font: 500 15px/20px var(--font-text); color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-pill); padding: var(--space-2) var(--space-4); min-height: 40px; cursor: pointer; }
.ss-segment button[aria-pressed="true"], .ss-segment button.is-active { background: var(--night); color: var(--cream); }

/* ---------- Feature blocks ("Zakaj najeti kolo v Bovcu") ---------- */
.ss-features { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.ss-feature-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--sun); display: grid; place-items: center; margin-bottom: var(--space-4); color: var(--night); }
.ss-feature-icon svg { width: 28px; height: 28px; }

/* ---------- Tables (price lists) ---------- */
.ss-table-wrap { overflow-x: auto; border-radius: var(--radius-md); background: var(--surface-raised); }
.ss-table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 24px; }
.ss-table th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); padding: var(--space-4) var(--space-6); border-bottom: 2px solid var(--line); }
.ss-table td { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--line); }
.ss-table tr:last-child td { border-bottom: 0; }
.ss-table td.ss-num, .ss-table th.ss-num { text-align: right; font-variant-numeric: tabular-nums; }
.ss-table .ss-price { font-weight: 600; color: var(--accent-text); }

/* ---------- Accordion / FAQ (native <details>) ---------- */
.ss-accordion { border-top: 2px solid var(--line); }
.ss-accordion details { border-bottom: 2px solid var(--line); }
.ss-accordion summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) 0; font-weight: 600; font-size: 18px; line-height: 26px; }
.ss-accordion summary::-webkit-details-marker { display: none; }
.ss-accordion summary::after { content: ""; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-warm);
  -webkit-mask: none; box-shadow: inset 0 0 0 2px var(--control-border);
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--ink), var(--ink));
  background-size: 12px 2px, 2px 12px; background-position: center; background-repeat: no-repeat; transition: transform .2s ease; }
.ss-accordion details[open] summary::after { transform: rotate(45deg); }
.ss-accordion .ss-accordion-body { padding: 0 0 var(--space-6); max-width: 70ch; }

/* ---------- Testimonials ---------- */
.ss-quote { background: var(--surface-raised); border-radius: var(--radius-md); padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); height: 100%; box-sizing: border-box; }
.ss-stars { display: inline-flex; gap: 2px; }
.ss-stars svg { width: 18px; height: 18px; fill: var(--sun); stroke: var(--night); stroke-width: 1.5; stroke-linejoin: round; }
.ss-quote-text { font-size: 16px; line-height: 24px; margin: 0; }
.ss-quote-name { font-weight: 600; margin-top: auto; }

/* ---------- Swiper.js overrides (carousels) ---------- */
.ss .swiper { --swiper-theme-color: var(--night); --swiper-pagination-bullet-inactive-color: var(--ink-muted); --swiper-pagination-bullet-inactive-opacity: .4; }
.ss .swiper-pagination-bullet-active { background: var(--night); }
.ss-carousel-btn, .ss .swiper-button-prev, .ss .swiper-button-next {
  width: 48px; height: 48px; border-radius: 50%; background: var(--surface-raised); color: var(--ink);
  border: 2px solid var(--control-border); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ss .swiper-button-prev::after, .ss .swiper-button-next::after { font-size: 16px; font-weight: 700; }
.ss-carousel-btn:hover, .ss .swiper-button-prev:hover, .ss .swiper-button-next:hover { background: var(--sun); border-color: var(--sun); color: var(--night); }

/* ---------- Forms (contact, booking) ---------- */
.ss-field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.ss-field label { font-weight: 500; font-size: 15px; }
.ss-field .ss-hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ss input[type="text"], .ss input[type="email"], .ss input[type="tel"], .ss input[type="date"], .ss input[type="number"], .ss select, .ss textarea {
  font: 400 16px/24px var(--font-text); color: var(--ink); background: var(--surface-raised);
  border: 2px solid var(--control-border); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); min-height: 48px; box-sizing: border-box; width: 100%; }
.ss textarea { min-height: 140px; resize: vertical; }
.ss input:focus-visible, .ss select:focus-visible, .ss textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ss input[type="checkbox"], .ss input[type="radio"] { accent-color: var(--valley); width: 20px; height: 20px; }
.ss-field.is-invalid input, .ss-field.is-invalid textarea { border-color: var(--night); border-width: 3px; }
.ss-field .ss-error { font-size: 14px; font-weight: 600; color: var(--ink); }
.ss-field .ss-error::before { content: "! "; }

/* ---------- Cookie consent (both choices equally prominent) ---------- */
.ss-cookie { position: fixed; inset: auto var(--space-4) var(--space-4) auto; max-width: 420px; z-index: 100;
  background: var(--surface-raised); color: var(--ink); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-tile); }
.ss-cookie h2 { font-size: 22px; line-height: 28px; }
.ss-cookie-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.ss-cookie-actions .ss-btn { flex: 1; }

/* ---------- Footer (on a .ss-dark band) ---------- */
.ss-footer { background: var(--surface); color: var(--ink); padding: var(--space-12) 0 var(--space-8); }
.ss-footer-grid { display: grid; gap: var(--space-8); grid-template-columns: 1.4fr 1fr 1fr; }
.ss-footer a { color: var(--ink); }
.ss-footer h3 { font-size: 20px; line-height: 24px; color: var(--ink); }
.ss-footer-logo img { height: 48px; width: auto; }
.ss-footer-bottom { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-4); font-size: 14px; color: var(--ink-muted); }
.ss-social { display: flex; gap: var(--space-3); }
.ss-social a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-warm); }
.ss-social img, .ss-social svg { width: 22px; height: 22px; }
@media (max-width: 760px) { .ss-footer-grid { grid-template-columns: 1fr; } }

/* ---------- Motion ---------- */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1); /* fast start, long soft landing */
  --reveal-dur: .9s;
  --reveal-step: 80ms;
}
@keyframes ss-settle { from { transform: scale(1.06); } }
@keyframes ss-rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }

/* Reveal on scroll (driven by static/reveal.js). Hidden only under html.js-reveal,
   which base.html sets before first paint and withdraws if the script never
   starts. Keep the selector list in sync with static/reveal.js. The H1 and hero
   images are deliberately not hidden: they are the LCP candidates. */
@media screen and (prefers-reduced-motion: no-preference) {
  /* :where() keeps this at one class of specificity so `.js-reveal .is-in` always wins */
  .js-reveal :where(.ss-section-head, .ss-grid > .ss-card, .tours-feature, .tours-custom, .tours-filter,
                 .reviews-container, .route-stats, .route-map, .elevation-profile-wrapper, .blog-tour-cta,
                 .route-photos__item, .multiday-price-band, .multiday-day, .tour-faq) {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
    transition: opacity var(--reveal-dur) var(--ease-out), transform var(--reveal-dur) var(--ease-out);
    transition-delay: calc(var(--reveal-i, 0) * var(--reveal-step));
  }
  .js-reveal .is-in { opacity: 1; transform: none; }

  /* Photos settle out of a slight zoom inside their frame as the card lands.
     `backwards` fill hands transform back to the hover zoom once it ends. */
  .js-reveal :is(.ss-card.is-in .ss-card-media, .route-photos__item.is-in) img {
    animation: ss-settle 1.4s var(--ease-out) backwards;
    animation-delay: calc(var(--reveal-i, 0) * var(--reveal-step));
  }

  /* Page-load entrances, CSS only: the hero photo settles (never transparent,
     so LCP is unaffected) and the hero actions rise in after the headline. */
  .blog-hero img { animation: ss-settle 1.6s var(--ease-out) backwards; }
  .home-hero__actions { animation: ss-rise .9s var(--ease-out) .15s backwards; }
  .home-hero__promo { animation: ss-rise .9s var(--ease-out) .3s backwards; }
}

@media (prefers-reduced-motion: reduce) {
  .ss *, .ss *::before, .ss *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 480px) { .ss-cookie { left: var(--space-4); max-width: none; } }
