/* Safe improvements – no layout changes */

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Better focus visibility */
a:focus,
button:focus,
input:focus {
  outline: 3px solid rgba(0,119,182,0.3);
  outline-offset: 2px;
}

/* Image loading stability (NO cropping) */
img {
  height: auto;
}

/* Prevent hero image cropping */
.main-image {
  object-fit: contain;
}

html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #fdfdfd;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}
body.dark {
  background-color: #121212;
  color: #e0e0e0;
}
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
}


nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1rem;
}
nav a {
  text-decoration: none;
  color: #555;
  font-weight: bold;
}
nav a:hover {
  color: #000;
}
body.dark nav a {
  color: #ccc;
}
body.dark nav a:hover {
  color: #fff;
}
nav a.active {
  color: #0077b6;
  text-decoration: underline;
}
body.dark nav a.active {
  color: #00bfff;
}


main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
section {
  margin-bottom: 3rem;
}
section h2 {
  text-align: center;
}
#about p {
  text-align: center;
}
#about img,
#main-picture-section img,
.main-image {
  max-width: 400px;
  width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 10px;
}


#hero {
  text-align: center;
  padding: 2rem 1rem;
}
#hero img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
#hero h2 {
  font-size: 2rem;
  margin-top: 0;
}
body.dark #hero h2 {
  color: #eee;
}


.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 1.5rem 0;
}
#gallery-container a {
  display: inline-block;
  margin: 0.5rem;
  max-width: 300px;
  width: 100%;
  box-sizing: border-box;
}
#gallery-container a img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  object-fit: cover;
  display: block;
}


#adventures-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}
.adventure-post h3 {
  margin-bottom: 0.3rem;
  text-align: center;
}
.adventure-post small {
  display: block;
  color: #666;
  margin-bottom: 1rem;
  text-align: center;
}
.adventure-post img.adventure-image {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 1rem 0;
  text-align: center;
}
.adventure-video {
  text-align: center;
  margin: 1.5rem 0;
}
.adventure-video iframe,
.adventure-video video {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 10px;
  text-align: center;
}


footer {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 1rem 1.5rem;
  box-sizing: border-box;
  text-align: center;
  color: #333;
  background-color: #f8f8f8;
  font-family: 'Inter', sans-serif;
}
.social-section {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: nowrap;
  margin-top: 1rem;
}
@media (max-width: 600px) {
  .social-section {
    flex-wrap: wrap;
  }
}
.person-social h3 {
  margin-bottom: 0.5rem;
}
.person-social {
  text-align: center;
}
.social-section a {
  font-size: 1.8rem;
  color: #555;
  text-decoration: none;
  margin: 0 0.3rem;
  transition: color 0.3s ease;
}
.social-section a:hover {
  color: #0073e6;
}

.blog-post {
  margin-bottom: 3rem;
  text-align: center;
}

.blog-post h3 {
  margin-bottom: 0.3rem;
}

.blog-post small {
  display: block;
  color: #666;
  margin-bottom: 1rem;
}

.blog-post img.blog-image {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 1rem 0;
  text-align: center;
}

.blog-video {
  text-align: center;
  margin: 1.5rem 0;
}

.blog-video iframe,
.blog-video video {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 10px;
}


body.dark .blog-post small {
  color: #aaa;
}




.logo {
  display: block;
  margin: 0 auto 1rem auto;
  height: auto;
  max-height: 80px;
  width: auto;
}
@media (min-width: 768px) {
  .logo {
    max-height: 60px;
  }
}


header h1 {
  display: none;
}


#gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0 1rem;
  text-align: center;
}

#album-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
#album-buttons button {
  padding: 0.4rem 0.9rem;
  background-color: #eee;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}
#album-buttons button:hover {
  background-color: #ddd;
}
body.dark #album-buttons button {
  background-color: #333;
  color: #f0f0f0;
}
body.dark #album-buttons button:hover {
  background-color: #444;
}
body.dark #searchInput,
body.dark #albumFilter {
  background-color: #222;
  color: #eee;
  border: 1px solid #555;
}

/* === Album Covers Gallery View === */
#gallery-controls {
  text-align: center;
  margin-bottom: 1rem;
}
.album-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
}
#gallery-container.album-view {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.album-tile {
  flex: 0 1 200px;
  display: flex;
  flex-direction: column;
  align-items: center; 
  text-align: center;  
  cursor: pointer;
  transition: transform 0.2s ease;
  margin: 1rem 0.5rem;
}
.album-tile:hover {
  transform: scale(1.03);
}
.album-tile img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background-color: #f0f0f0;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.album-name {
  margin-top: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
  color: #444;
  width: 100%;
}

/* Back button */
#gallery-controls button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
  cursor: pointer;
}
#gallery-controls button:hover {
  background-color: #ddd;
}

@media (max-width: 600px) {
  #gallery-container.album-view {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  .album-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; 
    gap: 1.5rem;
    padding: 1rem 0;
  }
  .album-tile {
    display: flex;
    flex-direction: column;
    align-items: center; 
  }
}

#search,
#searchInput {
  margin: 0 auto;
  display: block;
  text-align: center;
  max-width: 280px; 
  width: 100%;
}


.gallery-item {
  max-width: 300px;
  margin: 1rem;
  text-align: center;
  display: inline-block;
  vertical-align: top;
}
.gallery-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.gallery-caption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #555;
  text-align: center;
  font-style: italic;
}
body.dark .gallery-caption {
  color: #ccc;
}

/* Header logo size  */
header .logo {
  display: block;
  margin: 0 auto 1rem auto;
  height: auto;
  max-height: 70px; 
  width: auto;
}


@media (min-width: 768px) {
  header .logo {
    max-height: 70px;
  }
}

.theme-toggle {
  cursor: pointer;
  font-size: 1.5rem;
  margin-left: 1rem;
  display: flex;
  align-items: center;
}

.theme-toggle i {
  color: #555;
  transition: color 0.3s ease;
}

body.dark .theme-toggle i {
  color: #f5f5f5;
}

.theme-toggle:hover i {
  color: #0073e6;
}

body.dark footer {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

body.dark .social-section a {
  color: #ccc;
}

body.dark .social-section a:hover {
  color: #00bfff;
}


#searchInput,
#albumFilter {
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 280px;
  width: 90%;
  background-color: #fff;
  color: #333;
  transition: all 0.3s ease;
}

#searchInput:focus,
#albumFilter:focus {
  border-color: #0077b6;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 119, 182, 0.4);
}


body.dark #searchInput,
body.dark #albumFilter {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border: 1px solid #555;
}

body.dark #searchInput:focus,
body.dark #albumFilter:focus {
  border-color: #00bfff;
  box-shadow: 0 0 5px rgba(0, 191, 255, 0.5);
}






#gallery-preview-section .album-tile {
  flex: 0 1 150px; 
}

#gallery-preview-section .album-tile img {
  max-height: 150px;
  object-fit: cover;
}


#gallery-preview-section .album-tile:nth-child(n+7) {
  display: none; 
}


#adventures-preview-section .adventure-post {
  max-width: 300px; 
  margin: 1rem auto;
  padding: 0.5rem;
  border-radius: 8px;
  background-color: #f9f9f9;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  text-align: center;
}

body.dark #adventures-preview-section .adventure-post {
  background-color: #1a1a1a;
}

/* Adventure images in preview */
#adventures-preview-section .adventure-post img,
#adventures-preview-section .adventure-post iframe,
#adventures-preview-section .adventure-post video {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin: 0.5rem 0;
}


#adventures-preview-section .adventure-post:nth-child(n+4) {
  display: none; 
}

.explore-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  background-color: #0077b6;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s ease;
}
.explore-button:hover {
  background-color: #005f8c;
}
body.dark .explore-button {
  background-color: #00bfff;
  color: #121212;
}
body.dark .explore-button:hover {
  background-color: #009acd;
}

#blog-preview-section .blog-post {
  max-width: 400px;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 8px;
  background-color: #f9f9f9;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
body.dark #blog-preview-section .blog-post {
  background-color: #1a1a1a;
}

body.dark #about p {
  color: #ddd;
}
body.dark #about img {
  box-shadow: 0 2px 6px rgba(255,255,255,0.1);
}


body.dark #gallery-preview-section .album-tile {
  background-color: #1a1a1a;
  border-radius: 8px;
  padding: 0.5rem;
}
body.dark #gallery-preview-section .album-name {
  color: #eee;
}


body.dark #adventures-preview-section .adventure-post {
  background-color: #1a1a1a;
  color: #eee;
}
body.dark #adventures-preview-section .adventure-post h3 {
  color: #fff;
}
body.dark #adventures-preview-section .adventure-post small {
  color: #aaa;
}


body.dark #blog-preview-section .blog-post {
  background-color: #1a1a1a;
  color: #eee;
}
body.dark #blog-preview-section .blog-post h3 {
  color: #fff;
}
body.dark #blog-preview-section .blog-post small {
  color: #aaa;
}


body.dark .explore-button {
  background-color: #00bfff;
  color: #121212;
}
body.dark .explore-button:hover {
  background-color: #009acd;
}

/* =========================================
   FIX: Adventures iframe preview visibility
   ========================================= */
#adventures-preview-section .adventure-video {
  width: 100%;
  max-width: 100%;
}

#adventures-preview-section .adventure-video iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  min-height: 160px; /* ← THIS IS THE CRITICAL LINE */
  display: block;
}

/* === FORCE HEIGHT FOR ADVENTURE PREVIEW IFRAMES === */
#adventures-preview-section .adventure-video iframe {
  height: 180px !important;
  max-height: none !important;
}

/* === Playable video preview overlay === */
.video-preview {
  position: relative;
  width: 100%;
  max-width: 100%;
  cursor: pointer;
}

.video-preview img {
  width: 100%;
  border-radius: 8px;
  display: block;
}

.video-preview::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: #fff;
  background: rgba(0,0,0,0.6);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-preview:hover::after {
  background: rgba(0,0,0,0.75);
}

/* ===== Language Dropdown ===== */
.language-dropdown {
  position: relative;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  min-width: 150px;
  z-index: 2000;
}

.lang-menu.open {
  display: block;
}

.lang-menu div {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
}

.lang-menu div:hover {
  background: #f2f2f2;
}

body.dark .lang-menu {
  background: #1e1e1e;
  border-color: #444;
}

body.dark .lang-menu div:hover {
  background: #2a2a2a;
}

/* ===== Header Layout ===== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 1.5rem 2rem;
  background: #fdfdfd;
  border-bottom: 1px solid #eee;
}

body.dark header {
  background: #121212;
  border-color: #444;
}

/* Center logo + nav */
.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

/* Right controls (theme + language) */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.flag {
  width: 26px;
  height: 18px;
  display: inline-block;
  background-size: cover;
  background-position: center;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);

  /* 🔥 Important */
  font-size: 0;
  line-height: 0;
}

/* UK */
.flag-en {
  background-image: url("images/flags/gb.svg");
}

/* Sweden */
.flag-sv {
  background-image: url("images/flags/se.svg");
}

/* Vietnam */
.flag-vn {
  background-image: url("images/flags/vn.svg");
}

/* ================= MOBILE HEADER (3 ROW LAYOUT) ================= */

@media (max-width: 768px) {

  header {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    justify-items: center;
    text-align: center;
    padding: 10px 15px;
  }

  .header-center {
  display: contents;
}

  /* Row 1 — Logo */
  .logo {
    max-height: 40px;
    margin-bottom: 8px;
  }

  /* Row 2 — Navigation */
  nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 8px 0;
    flex-wrap: wrap;
  }

  nav a {
    font-size: 14px;
  }

  /* Row 3 — Theme + Language */
  .header-right {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-top: 5px;
  }

  .lang-menu {
    right: 0;
    left: auto;
  }

}