/* Taniti Tourism — palette: #FAF7F0 bg, #2C4A3E green, #7EC8E3 cyan, #E8C97A gold */
/* Text/headers/nav use #2C4A3E on #FAF7F0 — WCAG AA compliant */

:root {
  --color-bg: #FAF7F0;
  --color-green: #2C4A3E;
  --color-cyan: #7EC8E3;
  --color-gold: #E8C97A;
  --color-nav-bg: #2C4A3E;
  --color-nav-text: #FAF7F0;
  --color-link: #1a3d32;
  --color-link-visited: #1a3d32;
  --color-link-hover: #0f2922;
}

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

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-green);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.5;
}

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

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.75rem 1rem;
  background: var(--color-green);
  color: var(--color-nav-text);
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  transform: translateY(-100%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ----- Header ----- */
.site-header {
  padding: 1rem 1.5rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  background: var(--color-cyan);
  color: var(--color-green);
  padding: 0.4rem 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
}

.logo a {
  display: block;
}

.logo-image {
  display: block;
  height: 2.5rem;
  width: auto;
}

/* Mobile: hide duplicate logo in nav (shown only in nav-left on desktop) */
.logo-mobile {
  display: none;
}

.site-title {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--color-green);
}

.header-separator {
  margin: 0.75rem 0 0;
  border: none;
  border-top: 1px dashed var(--color-green);
  opacity: 0.7;
}

/* ----- Primary nav ----- */
.primary-nav {
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  padding: 0.75rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Hamburger: hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-nav-text);
  border-radius: 4px;
}

.nav-toggle:hover,
.nav-toggle:focus {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.primary-nav.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.primary-nav.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.primary-nav.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 1;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .logo-mobile {
    display: inline-block;
    margin-left: auto;
  }

  .primary-nav.nav-open .logo-mobile {
    display: none;
  }

  .primary-nav.nav-open .nav-menu .logo {
    display: none;
  }

  .nav-menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
  }

  .primary-nav.nav-open .nav-menu {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .primary-nav:not(.nav-open) .nav-link:hover,
  .primary-nav:not(.nav-open) .nav-link:focus {
    background: transparent;
  }

  .primary-nav.nav-open .nav-link:hover,
  .primary-nav.nav-open .nav-link:focus {
    background: #9DA9A0;
    border-radius: 4px;
    text-decoration: none;
  }

  .nav-search {
    width: 100%;
  }

  .search-results {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-top: 0.5rem;
    order: 1;
  }

  .search-field {
    flex: 1;
    min-width: 0;
  }
}

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

.nav-links a,
.nav-link {
  color: var(--color-nav-text);
  text-decoration: none;
  font-weight: 500;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
}

.nav-link:hover,
.nav-link:focus {
  background: #9DA9A0;
  border-radius: 4px;
  text-decoration: none;
}

/* Current page indicator: only on the nav link inside the menu, not the hamburger */
.primary-nav .nav-menu .nav-link.current {
  background: #415B50;
  border-radius: 4px;
}

.primary-nav .nav-toggle,
.primary-nav.nav-open .nav-toggle {
  background: transparent;
}

.nav-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.search-field {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-bg);
  border-radius: 4px;
  min-width: 140px;
  font-size: 0.95rem;
}

.search-btn {
  padding: 0.35rem 0.75rem;
  background: var(--color-gold);
  color: var(--color-green);
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}

.search-btn:hover {
  filter: brightness(1.05);
}

.search-results {
  width: auto;
  max-width: 180px;
  margin-right: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.search-results-message {
  margin: 0;
  color: var(--color-nav-text);
}

.search-results-error {
  color: #f0a0a0;
}

.search-results-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-results-list li {
  margin: 0.25rem 0;
}

.search-results-list a {
  color: var(--color-cyan);
  text-decoration: none;
}

.search-results-list a:hover,
.search-results-list a:focus {
  text-decoration: underline;
}

/* ----- Main ----- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-green);
}

/* ----- Hero ----- */
.hero {
  margin-bottom: 2.5rem;
}

.hero-image {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  /* clamp height: tall on desktop, shorter on mobile */
  height: clamp(320px, 80vh, 680px);
  background-color: var(--color-cyan); /* fallback if image fails */
}

.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%; /* keeps water/beach in frame, not just sky */
  color: var(--color-bg); /* alt text color on image failure */
}

/* gradient overlay — bottom-heavy so text stays legible */
.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.65) 0%,
      rgba(0, 0, 0, 0.2) 50%,
      rgba(0, 0, 0, 0.0) 100%
  );
  border-radius: inherit;
}

.hero-content {
  position: absolute;
  bottom: 10%;
  left: 5%;
  z-index: 1; /* sits above the ::after overlay */
  max-width: 600px;
}
.hero-headline {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.hero-subheading {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.cta-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--color-gold);
  color: var(--color-green);
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
}

.cta-btn:hover,
.cta-btn:focus {
    filter: brightness(1.08);
}

.image-attribution {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.6;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.image-attribution:hover,
.image-attribution:focus {
  opacity: 1;
}

.hero-headline {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-green);
}

.hero-subheading {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--color-green);
}

.cta-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--color-green);
  color: var(--color-nav-text);
  text-decoration: none;
  font-weight: 600;
  border-radius: 6px;
}

.cta-btn:hover,
.cta-btn:focus {
  filter: brightness(1.1);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

@media (max-width: 768px) {
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ----- Content sections ----- */
.content-section {
  margin-bottom: 2.5rem;
}

.section-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--color-link);
  font-weight: 600;
  text-decoration: none;
}

.section-link:hover,
.section-link:focus {
  text-decoration: underline;
  color: var(--color-link-hover);
}

.section-heading {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--color-green);
}

.section-intro {
  margin: 0 0 1.25rem;
  color: var(--color-green);
  max-width: 170ch;
}

/* ----- Cards ----- */
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: #fff;
  border: 1px solid var(--color-cyan);
  border-radius: 8px;
  overflow: hidden;
}

.card-image {
  position: relative;
  background: var(--color-cyan);
  color: #1a3328;
  text-align: center;
  font-size: 0.85rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;  /* all card images same height regardless of source */
}

.card-image a {
  display: block;
  line-height: 0;
}

.card-image img {
  display: block;
  width: 100%;
  height: auto;
}

.card-label,
.card-desc {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}

.card-label {
  background: #E8C97A;
  color: #1a3328;
}

.card-label a {
  color: inherit;
  text-decoration: none;
  padding: 0.25rem 0.35rem;
  margin: -0.25rem -0.35rem;
  border-radius: 4px;
}

.card-label a:hover,
.card-label a:focus {
  background: #D1B56E;
  border-radius: 4px;
  text-decoration: none;
}

.card-desc a {
  color: inherit;
  text-decoration: none;
  padding: 0.25rem 0.35rem;
  margin: -0.25rem -0.35rem;
  border-radius: 4px;
}

.card-desc a:hover,
.card-desc a:focus {
  background: #D1B56E;
  border-radius: 4px;
  text-decoration: none;
}

.card-desc {
  color: var(--color-green);
}

.card-trip {
  display: flex;
  flex-direction: column;
}

.card-trip .card-heading {
  margin: 0.75rem 1rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-green);
}

.card-sublink {
  display: inline-block;
  margin: 0.25rem 1rem 0;
  color: var(--color-link);
  font-size: 0.9rem;
  text-decoration: none;
}

.card-sublink:hover,
.card-sublink:focus {
  text-decoration: underline;
  color: var(--color-link-hover);
}

.card-trip .card-desc {
  padding-top: 0.25rem;
}

#plan-preview .card-trip .card-trip-body {
  flex: 1; 
  background: #E8C97A;
  padding: 0.75rem 1rem 1rem;
}

#plan-preview .card-trip .card-trip-body .card-heading {
  margin: 0 0 0.25rem;
  padding: 0;
}

#plan-preview .card-trip .card-trip-body .card-desc {
  margin: 0;
  padding: 0;
}

#plan-preview .card-trip .card-desc a:hover,
#plan-preview .card-trip .card-desc a:focus {
  background: #D1B56E;
}

/* ----- Footer ----- */
.site-footer {
  background: var(--color-green);
  color: var(--color-nav-text);
  padding: 1.5rem;
  text-align: center;
  margin-top: 2rem;
}

.site-footer p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--color-cyan);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
  text-decoration: underline;
}

.footer-links span {
  margin: 0 0.25rem;
  opacity: 0.8;
}

.back-to-top {
  display: inline-block;
  margin-top: 0.5rem;
}

.footer-copyright,
.footer-tagline {
  opacity: 0.9;
  font-size: 0.9rem;
}

.footer-image-credits {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.footer-credits-heading {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.footer-credits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-credits-list li {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}
