:root {

  /* Font family */
  --font-primary: 'Kanit', sans-serif;
  --font-hobbit: 'Uncial Antiqua', cursive;

  /* General Colors */
  --neutral-0: #FFFFFF;
  --neutral-100: #F5F5F5;
  --neutral-200: #E5E5E5; 
  --neutral-300: #C4C4C4;
  --neutral-400: #68696E;
  --neutral-500: #333333;

  --brown-0: #EDECEC;
  --brown-100: #DCD8D8;
  --brown-200: #837878;
  --brown-300: #4E3E3E;
  --brown-400: #3B2E2E;

  --green-0: #E7EAE9;
  --green-100: #CFD6D2;
  --green-200: #41594B;
  --green-300: #1C4C2D;
  --green-400: #123F25;
  --green-500: #111B15;

  /* Theme Colors */
  --text-color-primary: var(--brown-300);
  --text-color-secondary: var(--neutral-400);
  --text-color-accent: #F6CE95;

  --text-color-hobbit-primary: var(--neutral-0);
  --text-color-hobbit-secondary: var(--neutral-200);
  --text-color-hobbit-accent: #F4BC6E;

  --background-color: #FAFAFA;
  --background-color-hobbit: #11301E;
  --background-image-hobbit: url('assets/middle-earth-map.png');
}

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

body {
  background-color: var(--background-color);
  font-family: var(--font-primary);
  color: var(--text-color-primary);
  overflow-x: hidden;
  transition: background-color 0.3s ease, background-image 0.3s ease;
}

h1, h2, h3, h4 {
  font-family: var(--font-hobbit);
  margin: 0.2rem 0;
}

a {
  text-decoration: none;
  color: var(--text-color-primary);
  transition: color 0.3s ease;
}

.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: transparent;
  color: var(--neutral-0);
}

.navbar.scrolled {
  height: 60px;
  background-color: rgba(65, 65, 65, 0.9); 
  backdrop-filter: blur(4px);
  transition: background-color 0.3s ease;
}

/* NZ Time Display */
#nzTime {
  font-family: var(--font-hobbit);
  color: var(--neutral-0);
  font-size: 14px;
}

.home-icon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-hobbit);
  color: var(--neutral-0);
  font-size: 0.8rem;
}

.nav-left .home-icon img {
  width: 32px;
  transition: transform 0.5s ease;
}

.nav-left .home-icon:hover img {
  transform: scale(1.15);
}

.home-icon i {
  font-size: 1.2rem;
  color: inherit;
}

/* Right side icons & toggles */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

/* TOGGLE SWITCH FOR HOBBIT MODE */
.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  position: relative;
  margin: 0.5rem;
}

.toggle-label {
  font-size: 0.8rem;
  font-family: var(--font-hobbit);
  color: var(--neutral-0);
}

.navbar.scrolled .toggle-label {
  color: var(--neutral-0); 
}

/* Hide the actual checkbox */
.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* The track */
.switch-wrapper {
  position: relative;
  width: 50px;
  height: 24px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--background-color);
  border: solid 1px var(--neutral-200);
  border-radius: 20px;
  transition: background-color 0.3s ease;
}

/* The knob */
.switch-handle {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 28px;
  height: 28px;
  background: url('assets/hobbit-hole.png') no-repeat center center;
  background-size: cover;
  border-radius: 50%;
  transition: transform 0.3s ease;
}


/* When the checkbox is checked, change track color */
.theme-switch input:checked + .switch-wrapper {
  background-color: #136436;
}

/* Slide the knob to the right when checked */
.theme-switch input:checked + .switch-wrapper .switch-handle {
  transform: translateX(24px);
}


/* ICON BUTTON */
.icon-btn {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 1.5rem;
  cursor: pointer;
}

/* HERO SECTION */
.hero {
  margin-top: 0;
  padding-top: 0;
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.hero-video,
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.video-overlay {
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.hero-image {
  display: none; /* Hidden on desktop/tablet by default */
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

/* HERO CONTENT (overlay text) */
.hero-content {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3; 
  text-align: center;
  padding: 2rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
  color: #FFFFFF;
}

.hero-content h1 {
  font-size: 2.4rem;
}
.hero-content h2 {
  font-size: 2rem;
}

.date-range {
  font-style: italic;
  font-weight: 500;
  padding: 0.5rem;
}


/* MAIN CONTENT */
main {
  width: 98%;
  max-width: 1000px;
  margin: 2rem auto;
  padding-top: 20px;
}

/* SECTION TITLES */
.featured-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.featured-section {
  margin: 5rem 2rem ;
}

/* CARD GRID */
.card-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-bottom: 2rem;
  justify-items: center;
}

/* CARD */
.card {
  color: var(--text-color-primary);
  background-color: var(--neutral-0);
  border: solid 1px var(--neutral-200);
  width: 100%;
  min-width: 160px;
  max-width: 400px;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
}

.card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.card p {
  padding: 0.5rem;
  font-weight: 400;
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  transition: transform 0.5s ease;
  box-shadow: 0 4px 20px var(--neutral-300);
}

/* FOOTER */
footer {
  background-color: transparent;
  text-align: center;
  padding: 4rem;
  border-top: solid 1px var(--neutral-200);
  margin-top: 2rem;
}

footer a {
  font-size: 14px;
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
  color: var(--neutral-300);
  padding: 8px;
}

footer a:hover {
  color: var(--neutral-400);
  letter-spacing: 2px;
  transition: 0.5s;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.dot-divider {
  color: var(--neutral-300);
}

/*------------------------------------*/
/* CREDITS SUBPAGE                    */
/*------------------------------------*/
.credits-list {
  padding: 1rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

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

.credits-list li {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 20px #4f434310;
  line-height: 1.2;
}

.credit-img img {
  width: 80px;       
  height: 80px;
  margin-right: 1.2rem;
  border-radius: 8px; 
}

.credit-details a {
  color: #333;
  text-decoration: none;
  font-weight: bold;
}

.credit-details a:hover {
  text-decoration: underline;
}


/*------------------------------------*/
/* REGION SUBPAGE                     */
/*------------------------------------*/
.small-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 40vh;
  padding: 8rem 0rem 4rem;
  margin: 0 auto;
  transition: all 0.5s ease;
}

.small-hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  z-index: -1;
}

.small-hero-banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.region-photo img {
  width: 100px;     
  height: 100px;     
  object-fit: cover; 
  border-radius: 8px;
  margin-bottom: 1rem;
}

.small-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 85%;
  margin: 0 auto;
}

.small-hero-content h1 {
  color: var(--neutral-0);
  font-weight: 600;
  font-size: 2.2rem;
  z-index: 1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.small-hero-content p {
  font-size: 1rem;
  font-weight: 400;
  color: var(--neutral-0);
  margin-top: 0.5rem;
  z-index: 1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.work-hero {
  background-image: url('../assets/work-thumbnail.png');
  background-size: cover; 
  background-position: center center; 
  background-attachment: fixed;
}

.otago-hero {
  background-color: #EAEFF8;
}

.tasman-hero {
  background-color: #FCF8E6;
}

.mackenzie-hero {
  background-color: #eaf0f7;
}

/* Filter Pills Container */
.filter-pills-wrapper {
  display: flex;
  justify-content: center;
  position: sticky;
  top: 60px; 
  z-index: 10;
  padding: 0.8rem 0;
  background-color: var(--neutral-100);
  transition: top 0.3s ease-in-out;
}

.filter-pills {
  display: flex;
  flex-wrap: nowrap; 
  justify-content: flex-start; 
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS devices */
  padding: 0; 
  gap: 0.5rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.filter-pills::-webkit-scrollbar {
  display: none;
}

/* Individual Filter Pills */
.filter-pill {
  display: inline-flex;
  align-items: center;   
  justify-content: center;
  gap: 0.4rem;           
  font-size: 0.8rem;
  font-weight: 500;
  flex: 0 0 auto;
  padding: 0.35rem 0.5rem 0.35rem 0.8rem;
  color: var(--brown-200);
  background-color: var(--neutral-0);
  border: 1.5px solid var(--brown-100);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.filter-pill.active {
  background-color: var(--neutral-0);
  color: var(--text-color-primary);
  font-weight: 600;
  border: 2px solid var(--brown-300);
}

.filter-pill .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--neutral-100);
  color: var(--brown-200);
  font-size: 0.6rem;
  font-weight: 600;
  padding:0.2rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--neutral-200);
}


/* Weather Icons */
.fa-sun {
color: #ffbf00;
}

.fa-cloud {
  color: #a1a3c1;
}

.fa-rainbow {
  color: #ff75b8;
}


/* Posts */
.post {
  max-width: 96%;
  margin: 0 auto;
  background-color: var(--neutral-0);
  color: var(--neutral-500);
  margin-bottom: 2rem;
  padding: 1rem;
  border: solid 1px var(--neutral-100);
  border-radius: 8px;
  box-shadow: 0 4px 20px #4f434310;
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.post-header h2 {
  font-family: 'Kanit', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.weather-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.weather-info i {
  font-size: 0.9rem;
}

.temperature {
  font-weight: bold;
  font-size: 1rem;
}

/* Carousel Container */
.carousel-container {
  position: relative;
  overflow: hidden;
}

/* The image container */
.post-images {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0.5rem;
}

/* Hide the default scrollbar (WebKit) */
.post-images::-webkit-scrollbar {
  display: none;
}

/* Chevrons */
.carousel-btn {
  width: 24px;
  height: 32px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: var(--neutral-0);
  cursor: pointer;
  z-index: 2;
  display: none; /* Hidden by default, shown via JS */
  border-radius: 8px;
  padding: 0.5rem ;
}

.carousel-btn.left-btn {
  left: 4px;
}

.carousel-btn.right-btn {
  right: 4px;
}

/* Hover state for chevrons */
.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.5);
}

/* Ensure images don't shrink */
.post-images img, .post-images video {
  flex: 0 0 auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 4px;
}


.post-body h3 {
  color: var(--neutral-500);
  font-family: var(--font-primary);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 2px 4px;
}

.post-body p {
  color: var(--neutral-400);
  font-weight: 300;
  line-height: 1.2rem;
  padding: 2px 4px;
}


/*------------------------------------*/
/* Post Image Modal                   */
/*------------------------------------*/
.post-image-container {
  position: relative;
  display: inline-block;
}

/* Expand icon */
.expand-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  color: var(--neutral-0);
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}
.expand-icon:hover {
  background: rgba(0, 0, 0, 0.5);
}

.fullscreen-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
  max-height: 90%;
  gap: 1rem;
  padding: 1rem;
  box-sizing: border-box;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

#modalCaption {
  color: var(--neutral-0);
  font-size: 1rem;
  text-align: center;
  font-weight: 300;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  color: var(--neutral-0);
  cursor: pointer;
  z-index: 1001;
}


/*------------------------------------*/
/* BLOG POST LAYOUT                   */
/*------------------------------------*/
.blog-hero {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  /* background-color: var(--neutral-100); */
  padding: 8rem 0rem 4rem;
  margin: 0 auto;
  gap: 2rem;
}

.blog-hero img {
  width: 800px;
  max-width: 90%;
}

.blog-container {
  max-width: 820px;
  margin: 0 auto;
}

.blog-content {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1rem;
}

.blog-content p {
  font-weight: 300;
  text-align: justify;
}

.blog-content a {
  font-weight: 400;
  text-decoration: underline;
  transition: 0.3s ease;
}

.blog-content a:hover {
  font-weight: 500;
  letter-spacing: 0.5px;
}

.blog-image-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 1.5rem auto;
  gap: 0.2rem;
}

.blog-image-container img{
  width: 800px;
  max-width: 100%;
}

.blog-image-container figcaption {
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
}

/*------------------------------------*/
/* HOBBIT MODE (body.hobbit-mode)     */
/*------------------------------------*/
body.hobbit-mode {
  background-color: var(--background-color-hobbit);
  background-image: url('assets/middle-earth-map.png');
  background-size: cover; 
  background-position: center center; 
  background-attachment: fixed;
  background-repeat: no-repeat;
  width: 100%;
  color: var(--text-color-hobbit-primary);
  cursor: url('assets/hobbit-cursor.png') 8 8, auto;
  transition: background-color 0.3s ease, background-image 0.3s ease;
}

/* Vignette/darkening effect */
body.hobbit-mode .hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 40%, rgba(25, 30, 25, 0.8) 100%);
  z-index: 2;
  pointer-events: none;
}

body.hobbit-mode .navbar {
  background-color: rgba(15, 45, 28, 0);
}

body.hobbit-mode .navbar.scrolled {
  background-color: rgba(15, 45, 28, 0.9);
  transition: background-color 0.3s ease;
}

body.hobbit-mode .navbar.scrolled .home-icon {
  color: var(--text-color-hobbit-primary);
}

body.hobbit-mode .hero-content {
  text-shadow:
  0 0px 1px rgba(255, 250, 224, 0.5),
  0 0 12px rgba(215, 125, 0, 0.4),
  0 0 20px rgba(50, 30, 4, 0.3);
}

body.hobbit-mode .featured-section h2 {
  background: linear-gradient(
    to bottom,
    #ffeca9 15%,
    #ecd3a8 25%,
    #e38c2f 60%,
    #e4a022 70%,
    #FCD445 90%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.hobbit-mode .card {
  background-color: var(--green-500);
  border: 1px solid var(--green-200);
}

body.hobbit-mode .card p {
  color: var(--text-color-hobbit-secondary);
}

body.hobbit-mode footer {
  border-top: solid 1px var(--green-200);
}


body.hobbit-mode .post {
  background-color: var(--green-500);
  border: solid 1px var(--green-300);
  color: var(--neutral-100);
}
body.hobbit-mode .post-header h2 {
  font-family: var(--font-primary);
  color: var(--text-color-hobbit-primary);
}

body.hobbit-mode .post-body h3 {
  color: var(--text-color-hobbit-primary);
}

body.hobbit-mode .post-body p {
  color: var(--neutral-100);
}


body.hobbit-mode .filter-pills-wrapper {
  background-color: var(--green-500);
}

body.hobbit-mode .filter-pill {
  color: var(--neutral-0);
  background-color: var(--green-200);
  border: 1.5px solid var(--green-200);
}

body.hobbit-mode .filter-pill.active {
  background-color: var(--green-400);
  color: var(--neutral-200);
  border: 2px solid var(--green-100);
}

body.hobbit-mode .filter-pill .count {
  background-color: var(--green-100);
  color: var(--neutral-500);
  border: 1px solid var(--green-200);
}

/*------------------------------------*/
/* RESPONSIVE QUERIES                 */
/*------------------------------------*/
/* For tablets and below */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  .filter-pills {
    padding: 0 1rem;
  }
}

/* For mobile (example: max-width: 480px) */
@media (max-width: 480px) {
  /* Hide the video, show the fallback image */
  
  .navbar {
  padding: 1rem 1.5rem;
  }
  
  footer {
    padding: 2rem;
  }
  .toggle-label {
    display: none;
  }
  .hero-video {
    display: none;
  }
  .hero-image {
    display: block;
  }
  .hero-content h1 {
    font-size: 1.6rem;
  }

  .small-hero-content h1 {
    font-size: 1.8rem;
  }

  .small-hero-content p {
    font-size: 0.95rem;
  }
  .post-images img, .post-images video {
    max-height: 270px;
  }

}
