@import 'tokens.css';

/* ============================================================================
   RESET
   ============================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  color: var(--navy);
  background: var(--cream);
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================================
   CONTAINER
   ============================================================================ */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--container-pad-mobile);
    padding-right: var(--container-pad-mobile);
  }
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .eyebrow {
    font-size: 11px;
  }
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.85rem 2rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn--primary {
  background: var(--navy);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--terracotta);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--stone);
}

.btn--ghost:hover {
  background: var(--sand);
  border-color: var(--navy);
}

.btn--ghost-light {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--white);
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
}

/* ============================================================================
   CAROUSEL BACKGROUNDS
   ============================================================================ */

.swiper-slide[data-tour-id="klis-salona"] {
  background-image: url('../assets/images/tour-klis.jpg');
  background-size: cover;
  background-position: center;
}

.swiper-slide[data-tour-id="split"] {
  background-image: url('../assets/images/tour-split.jpg');
  background-size: cover;
  background-position: center;
}

.swiper-slide[data-tour-id="krka-sibenik"] {
  background-image: url('../assets/images/tour-krka.jpg');
  background-size: cover;
  background-position: center;
}

.swiper-slide[data-tour-id="three-springs"] {
  background-image: url('../assets/images/tour-springs.jpg');
  background-size: cover;
  background-position: center;
}

.swiper-slide[data-tour-id="trogir"] {
  background-image: url('../assets/images/tour-trogir.jpg');
  background-size: cover;
  background-position: center;
}

/* ============================================================================
   NAVBAR
   ============================================================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar.scrolled {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--stone);
}

.navbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--container-pad);
}

.navbar__brand {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--white);
  transition: color 0.3s ease;
}

.navbar.scrolled .navbar__brand {
  color: var(--navy);
}

.navbar__links {
  display: flex;
  gap: var(--space-md);
}

.navbar__links a {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.3s ease;
}

.navbar.scrolled .navbar__links a {
  color: var(--navy);
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
}

.navbar__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: background 0.3s ease;
}

.navbar.scrolled .navbar__toggle-bar {
  background: var(--navy);
}

.navbar__overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background: var(--navy);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.navbar__overlay.open {
  transform: translateX(0);
}

.navbar__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-md);
  font-size: 32px;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.navbar__overlay-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
  text-align: center;
}

.navbar__overlay-links a {
  font-family: var(--font-sans);
  font-size: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  min-height: 48px;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .navbar__links {
    display: none;
  }

  .navbar__toggle {
    display: flex;
  }

  .navbar__inner {
    padding: var(--space-sm) var(--container-pad-mobile);
  }
}

/* ============================================================================
   HERO
   ============================================================================ */

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__mobile-bg {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 680px;
  padding: 0 var(--container-pad);
}

.hero .eyebrow {
  color: var(--white);
  opacity: 0.8;
}

.hero__headline {
  font-family: var(--font-serif);
  font-size: 72px;
  line-height: 1.05;
  color: var(--white);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  margin: var(--space-md) 0;
  font-weight: 400;
}

.hero__subheading {
  font-size: 18px;
  color: var(--white);
  opacity: 0.8;
  max-width: 520px;
  margin: var(--space-md) auto;
}

.hero__ctas {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.hero__ctas .btn--ghost {
  color: var(--white);
  border-color: var(--white);
}

.hero__ctas .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
}

/* Fade-up animation */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__content .eyebrow,
.hero__headline,
.hero__subheading,
.hero__ctas {
  opacity: 0;
  animation: fadeUp 0.6s ease forwards;
}

.hero__content .eyebrow {
  animation-delay: 0s;
}

.hero__headline {
  animation-delay: 0.1s;
}

.hero__subheading {
  animation-delay: 0.2s;
}

.hero__ctas {
  animation-delay: 0.3s;
}

@media (max-width: 768px) {
  .hero__video {
    display: none;
  }

  .hero__mobile-bg {
    display: block;
  }

  .hero__headline {
    font-size: 40px;
    line-height: 1.1;
  }

  .hero__subheading {
    font-size: 16px;
  }

  .hero__content {
    padding: 0 var(--container-pad-mobile);
  }
}

/* ============================================================================
   CAROUSEL
   ============================================================================ */

.tours {
  position: relative;
  width: 100%;
  height: 100vh;
}

.tour-carousel,
.swiper-wrapper,
.swiper-slide {
  width: 100%;
  height: 100%;
}

/* Ken-burns effect: pseudo-element inherits background and scales */
.swiper-slide {
  position: relative;
  overflow: hidden;
}

.swiper-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: inherit;
  background-size: cover;
  background-position: center;
  animation: kenBurns 6s ease-in-out forwards;
  z-index: 0;
}

@keyframes kenBurns {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* Dark overlay */
.slide__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  z-index: 1;
}

/* Content overlay: left-aligned on desktop */
.slide__content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-lg);
  background: linear-gradient(to right, rgba(11, 29, 51, 0.7) 0%, rgba(11, 29, 51, 0.3) 60%, transparent 100%);
  z-index: 2;
}

/* Slide content text styles */
.slide__content .eyebrow {
  color: var(--white);
  opacity: 0.8;
}

.slide__title {
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1.1;
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  margin-top: var(--space-xs);
  font-weight: 400;
}

.slide__description {
  font-size: 16px;
  color: var(--white);
  opacity: 0.8;
  max-width: 400px;
  margin-top: var(--space-xs);
}

.slide__duration {
  font-size: 13px;
  color: var(--white);
  opacity: 0.6;
  margin-top: var(--space-xs);
}

/* CTA button with terracotta background */
.slide__cta {
  margin-top: var(--space-sm);
  background: var(--terracotta);
  color: var(--white);
  align-self: flex-start;
}

.slide__cta:hover {
  background: var(--terracotta-dark);
  transform: translateY(-1px);
}

/* Pagination styling */
.tour-carousel .swiper-pagination-bullet {
  background: var(--white);
  opacity: 0.4;
}

.tour-carousel .swiper-pagination-bullet-active {
  opacity: 1;
}

/* Navigation arrows */
.tour-carousel .swiper-button-prev,
.tour-carousel .swiper-button-next {
  color: var(--white);
}

/* Mobile (≤768px): content moves to bottom */
@media (max-width: 768px) {
  .slide__content {
    width: 100%;
    height: auto;
    top: auto;
    bottom: 0;
    justify-content: flex-end;
    padding: var(--space-md);
    padding-bottom: calc(var(--space-lg) + 40px);
    background: linear-gradient(to top, rgba(11, 29, 51, 0.8) 0%, rgba(11, 29, 51, 0.3) 60%, transparent 100%);
  }

  .slide__title {
    font-size: 28px;
    line-height: 1.15;
  }

  /* Hide navigation arrows on mobile */
  .tour-carousel .swiper-button-prev,
  .tour-carousel .swiper-button-next {
    display: none;
  }
}

/* ============================================================================
   SECTION BACKGROUNDS
   ============================================================================ */

/* ============================================================================
   DAY BOAT TOUR (Section 4)
   ============================================================================ */

.boat-tour {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boat-tour__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.boat-tour__mobile-bg {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.boat-tour__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  z-index: 1;
}

.boat-tour__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 680px;
  padding: 0 var(--container-pad);
}

.boat-tour .eyebrow {
  color: var(--white);
  opacity: 0.8;
}

.boat-tour__headline {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1.15;
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  margin: var(--space-md) 0;
  font-weight: 400;
}

.boat-tour__body {
  font-size: 18px;
  color: var(--white);
  opacity: 0.8;
  max-width: 560px;
  margin: var(--space-sm) auto 0;
}

.boat-tour .btn--primary {
  margin-top: var(--space-md);
  background: var(--terracotta);
}

.boat-tour .btn--primary:hover {
  background: var(--terracotta-dark);
}

@media (max-width: 768px) {
  .boat-tour__video {
    display: none;
  }

  .boat-tour__mobile-bg {
    display: block;
  }

  .boat-tour__headline {
    font-size: 32px;
    line-height: 1.2;
  }

  .boat-tour__body {
    font-size: 16px;
  }

  .boat-tour__content {
    padding: 0 var(--container-pad-mobile);
  }
}

/* ============================================================================
   CUSTOM TOURS (Section 5)
   ============================================================================ */

.custom-tours {
  position: relative;
  width: 100%;
  height: 100vh;
  background-image: url('../assets/images/custom-tours.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.custom-tours__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
  z-index: 1;
}

.custom-tours__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 680px;
  padding: 0 var(--container-pad);
}

.custom-tours .eyebrow {
  color: var(--white);
  opacity: 0.8;
}

.custom-tours__headline {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1.15;
  color: var(--white);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  margin: var(--space-md) 0;
  font-weight: 400;
}

.custom-tours__body {
  font-size: 18px;
  color: var(--white);
  opacity: 0.8;
  max-width: 560px;
  margin: var(--space-sm) auto 0;
}

.custom-tours .btn--primary {
  margin-top: var(--space-md);
  background: var(--terracotta);
}

.custom-tours .btn--primary:hover {
  background: var(--terracotta-dark);
}

@media (max-width: 768px) {
  .custom-tours__headline {
    font-size: 32px;
    line-height: 1.2;
  }

  .custom-tours__body {
    font-size: 16px;
  }

  .custom-tours__content {
    padding: 0 var(--container-pad-mobile);
  }
}

/* ============================================================================
   HOMESTAY (Section 6)
   ============================================================================ */

.homestay {
  width: 100%;
  background: var(--cream);
}

.homestay__layout {
  display: grid;
  grid-template-columns: 60% 40%;
  min-height: 600px;
}

.homestay__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.homestay__content {
  background: var(--cream);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: -60px;
  z-index: 1;
  position: relative;
}

.homestay .eyebrow {
  color: var(--terracotta);
}

.homestay__headline {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1.15;
  color: var(--navy);
  margin: var(--space-sm) 0;
  font-weight: 400;
}

.homestay__body {
  color: var(--navy);
  opacity: 0.75;
  font-size: 16px;
  margin: var(--space-sm) 0 0;
}

.homestay .btn--primary {
  margin-top: var(--space-md);
  background: var(--navy);
  align-self: flex-start;
}

.homestay .btn--primary:hover {
  background: var(--terracotta);
}

@media (max-width: 768px) {
  .homestay__layout {
    grid-template-columns: 1fr;
  }

  .homestay__image {
    max-height: 400px;
  }

  .homestay__content {
    margin-left: 0;
    padding: var(--space-md);
  }

  .homestay__headline {
    font-size: 32px;
    line-height: 1.2;
  }
}

/* ============================================================================
   FOOTER (Section 7)
   ============================================================================ */

.footer {
  background: var(--navy);
  padding: var(--space-md);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer__copyright,
.footer__email {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--white);
  opacity: 0.5;
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
}

.footer__social-link {
  color: var(--white);
  opacity: 0.5;
  padding: 14px;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
}

.footer__social-link:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .footer__inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  .footer__social {
    order: -2;
  }

  .footer__email {
    order: -1;
  }

  .footer__copyright {
    order: 0;
  }

  .footer__copyright,
  .footer__email {
    font-size: 12px;
  }
}

/* ============================================================================
   SIDE PANEL / BOTTOM SHEET
   ============================================================================ */

.panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 200;
}

.panel-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  height: 100%;
  background: var(--overlay-panel);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 201;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md);
}

.panel.open {
  transform: translateX(0);
}

.panel__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  color: var(--white);
  font-size: 32px;
  line-height: 1;
  padding: 8px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel__eyebrow {
  color: var(--white);
  opacity: 0.8;
}

.panel__heading {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--white);
  margin-top: var(--space-xs);
}

.panel__body {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--white);
  opacity: 0.8;
  margin-top: var(--space-xs);
  line-height: 1.65;
}

.panel__divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: var(--space-md) 0;
}

.panel__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.panel__form label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.6;
  display: block;
  margin-bottom: 4px;
}

.panel__form input,
.panel__form select,
.panel__form textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  transition: border-color 0.2s;
}

.panel__form input:focus,
.panel__form select:focus,
.panel__form textarea:focus {
  outline: none;
  border-color: var(--terracotta);
}

.panel__form textarea {
  min-height: 120px;
  resize: vertical;
}

.panel__form select {
  appearance: none;
  cursor: pointer;
}

.panel__form input::placeholder,
.panel__form textarea::placeholder {
  color: var(--white);
  opacity: 0.35;
}

.panel__submit {
  width: 100%;
  background: var(--terracotta);
  color: var(--white);
  padding: 0.85rem 2rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  min-height: 48px;
  margin-top: var(--space-xs);
  transition: background 0.2s, transform 0.15s;
}

.panel__submit:hover {
  background: var(--terracotta-dark);
  transform: translateY(-1px);
}

.panel__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.panel__result {
  font-size: 14px;
  color: var(--white);
  text-align: center;
  margin-top: var(--space-xs);
  min-height: 1.4em;
}

.panel__result.error {
  color: #ff6b6b;
}

.panel__booked-slots {
  font-size: 13px;
  color: var(--white);
  opacity: 0.6;
  margin: -0.5rem 0 0.5rem;
  min-height: 1.2em;
}

body.panel-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .panel {
    top: auto;
    bottom: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 85vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding: var(--space-md);
  }

  .panel.open {
    transform: translateY(0);
  }
}
