/* ==================================================
   1. PAGE COLOURS AND FONT
   These variables can be reused throughout the CSS.
   Change a variable here to update several areas at once.
   ================================================== */
:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  color: #e9ffff;
  background: #071018;

  --ink: #e9ffff;
  --teal: #20f7df;
  --muted: #a9c0c1;
  --line: #24515a;
  --white: #0c1923;
  --lime: #d9ff64;
}

/* ==================================================
   2. GENERAL PAGE SETTINGS
   Dark neon surfaces and subtle page lighting are added here.
   ================================================== */

/* Include padding and borders inside an element's width. */
* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  line-height: 1.6;
  background:
    radial-gradient(circle at 15% 5%, rgba(32, 247, 223, .12), transparent 26rem),
    radial-gradient(circle at 85% 30%, rgba(217, 255, 100, .08), transparent 24rem),
    #071018;
}

/* Default link colour. */
a {
  color: var(--teal);
}

/* Make keyboard focus visible on links and form controls. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}

main {
  min-height: 70vh;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

/* ==================================================
   3. HEADER AND NAVIGATION
   The header contains the logo and page links.
   ================================================== */
.site-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px max(20px, calc((100% - 1120px) / 2));
  border-bottom: 1px solid rgba(32, 247, 223, .5);
  background: rgba(7, 16, 24, .96);
  box-shadow: 0 0 22px rgba(32, 247, 223, .08);
}

.brand {
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 750;
  text-decoration: none;
}

.brand span {
  display: block;
  color: var(--teal);
  font-size: .75rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(32, 247, 223, .45);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

nav a {
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--muted);
  font-size: .92rem;
  text-decoration: none;
}

/* This rule styles a link when hovered or on the current page. */
nav a:hover,
nav a[aria-current="page"] {
  background: rgba(32, 247, 223, .12);
  color: var(--teal);
  box-shadow: inset 0 -2px var(--teal);
}

/* The My Places number is shown as a small rounded badge. */
.favourite-count {
  display: inline-block;
  min-width: 1.6em;
  margin-left: 3px;
  padding: 1px 7px;
  border: 1px solid rgba(32, 247, 223, .45);
  border-radius: 999px;
  background: rgba(32, 247, 223, .14);
  color: var(--teal);
  font-size: .74rem;
  font-weight: 750;
  line-height: 1.5;
  text-align: center;
}

/* ==================================================
   4. HOME PAGE HERO
   A night skyline photograph sits behind the welcome text. The dark
   gradient on top of it keeps the text easy to read.
   ================================================== */
.hero {
  /* One centred column keeps every line starting at the same left edge. */
  display: grid;
  grid-template-columns: minmax(0, 1120px);
  justify-content: center;
  justify-items: start;
  align-content: center;
  min-height: clamp(380px, 62vh, 560px);
  padding: 58px 16px;
  border-bottom: 1px solid var(--teal);
  background:
    linear-gradient(90deg, rgba(7, 16, 24, .93) 0%, rgba(7, 16, 24, .7) 48%, rgba(7, 16, 24, .28) 100%),
    url("../images/web/IMG_20261102_044204.jpg") center / cover no-repeat,
    #081b25;
  color: var(--ink);
  box-shadow: 0 8px 35px rgba(32, 247, 223, .12);
}

.hero h1 {
  margin-top: 6px;
  margin-bottom: 12px;
  color: #f3ffff;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  line-height: 1.05;
  text-shadow: 0 0 18px rgba(32, 247, 223, .25);
}

.hero > p:not(.eyebrow) {
  max-width: 650px;
  color: #d8e6e1;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--lime);
}

/* ==================================================
   5. BUTTONS AND LINKS
   Shared styles for neon call-to-action buttons.
   ================================================== */
.button,
.save-button {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid var(--lime);
  border-radius: 4px;
  background: var(--lime);
  color: #071018;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(217, 255, 100, .24);
}

.button:hover,
.save-button:hover {
  border-color: var(--teal);
  background: var(--teal);
  color: #071018;
  box-shadow: 0 0 20px rgba(32, 247, 223, .42);
}

/* My Places controls use a softer colour so they are comfortable to read. */
.save-button {
  border-color: #4d8588;
  background: #143039;
  color: #c3dddc;
  box-shadow: 0 0 8px rgba(32, 247, 223, .08);
}

.save-button:hover {
  border-color: #71b8b3;
  background: #1c4148;
  color: #e9ffff;
  box-shadow: 0 0 12px rgba(32, 247, 223, .18);
}

/* ==================================================
   6. MAIN PAGE CONTENT
   These rules create the width and spacing of pages.
   ================================================== */
.page-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.narrow {
  max-width: 760px;
}

.page-section > h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
}

.intro {
  max-width: 65ch;
  margin: 10px 0 24px;
  color: var(--muted);
}

.section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
}

/* ==================================================
   7. ATTRACTION CARDS
   Cards use a dark surface with a restrained neon edge and glow.
   ================================================== */
.attraction-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.place-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1923;
  box-shadow: 0 0 18px rgba(32, 247, 223, .05);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.place-card:hover {
  border-color: var(--teal);
  box-shadow: 0 0 22px rgba(32, 247, 223, .18);
  transform: translateY(-2px);
}

.place-image {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: linear-gradient(135deg, #163440, #23294a);
  border-bottom: 1px solid rgba(32, 247, 223, .3);
}

.buddha-cover {
  height: 220px;
  background: #4e8fca;
}

.buddha-cover .place-image {
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  background: transparent;
}

.place-body {
  padding: 17px;
}

.place-meta {
  margin: 0 0 5px !important;
  color: var(--teal) !important;
  font-size: .78rem;
  font-weight: 700;
  text-transform: capitalize;
}

.place-meta span {
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
}

.place-body h2 {
  margin: 0;
  color: #f3ffff;
  font-size: 1.22rem;
}

.place-body > p:not(.place-meta) {
  margin: 8px 0;
  color: var(--muted);
}

.album-cover {
  position: relative;
  overflow: hidden;
}

.album-cover .place-image {
  height: 220px;
  transition: transform .45s ease;
}

.place-card:hover .album-cover .place-image {
  transform: scale(1.025);
}

.photo-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(233, 255, 255, .35);
  border-radius: 999px;
  background: rgba(7, 16, 24, .82);
  color: var(--ink);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .04em;
  backdrop-filter: blur(8px);
}

.place-card:has(details[open]) {
  grid-column: 1 / -1;
  border-color: rgba(32, 247, 223, .65);
  transform: none;
}

.place-card:has(details[open]) .place-body {
  padding: clamp(18px, 4vw, 28px);
}

.details-copy {
  display: grid;
  gap: 10px;
  max-width: 78ch;
  padding: 2px 0 10px;
}

.details-copy p {
  margin: 0;
  color: var(--muted);
}

.details-copy strong {
  color: var(--ink);
}

.album-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px 16px;
  margin: 18px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.album-heading h3,
.album-heading p {
  margin: 0;
}

.album-heading h3 {
  color: var(--ink);
  font-size: 1.05rem;
}

.album-heading p {
  color: var(--muted);
  font-size: .82rem;
}

/* Mobile: one photo per row, each shown in its own shape. */
.photo-album,
.photo-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.photo-album figure,
.photo-gallery figure {
  display: flex;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid rgba(36, 81, 90, .9);
  border-radius: 6px;
  background: #08131c;
}

.album-photo,
.photo-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, #163440, #23294a);
  transition: filter .25s ease, transform .35s ease;
}

/*
  --ratio is a photo's width divided by its height. JavaScript reads it from
  the img width and height attributes, so tall photos stay tall and are not cut.
  Without JavaScript the photo falls back to the 4:3 shape above.
*/
.album-photo {
  aspect-ratio: var(--ratio, 4 / 3);
}

/* The About page keeps four equal preview tiles, so tall photos are framed near their top. */
.photo-gallery img {
  object-position: center 12%;
}

.photo-gallery figcaption {
  padding: 9px 12px 11px;
  color: #d4e3e3;
  font-size: .85rem;
}

.photo-album figure:hover .album-photo,
.photo-gallery figure:hover img {
  filter: brightness(1.06);
  transform: scale(1.015);
}

.photo-album figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 9px;
  padding: 11px 12px 13px;
  color: #d4e3e3;
  font-size: .8rem;
  line-height: 1.45;
}

.album-number {
  color: var(--teal);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.travel-archive {
  margin-top: 42px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(20, 48, 57, .42), rgba(12, 25, 35, .9));
}

.travel-archive > h2 {
  margin: 0 0 8px;
}

.travel-archive > p:not(.eyebrow, .photo-credit) {
  max-width: 80ch;
  color: var(--muted);
}

.travel-photo-album {
  margin-top: 22px;
}

/* ==================================================
   8. SHOW/HIDE DETAILS
   Styles the HTML <details> and <summary> elements.
   ================================================== */
details {
  margin-top: 10px;
  color: var(--muted);
}

summary {
  width: fit-content;
  color: var(--teal);
  cursor: pointer;
  font-weight: 650;
}

details[open] summary {
  display: none;
}

details p {
  margin-bottom: 0;
}

.hide-details-button {
  margin-top: 10px;
  padding: 7px 11px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  background: rgba(32, 247, 223, .12);
  color: var(--teal);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.hide-details-button:hover {
  background: var(--teal);
  color: #071018;
}

/* ==================================================
   9. SEARCH AND CATEGORY FILTERS
   Dark fields remain clear and readable on the neon theme.
   ================================================== */
.filters {
  display: grid;
  gap: 12px;
  margin: 20px 0 8px;
}

/* Groups one label with its control so they stay together in the grid. */
.filter-field {
  display: grid;
  gap: 5px;
}

.filters label,
.contact-form label {
  display: grid;
  gap: 5px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #3a6b74;
  border-radius: 4px;
  background: #0c1923;
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.result-count,
.note {
  color: var(--muted);
  font-size: .9rem;
}

.empty-state {
  padding: 18px;
  border-left: 3px solid var(--teal);
  background: rgba(32, 247, 223, .08);
}

.text-link {
  display: inline-block;
  margin-top: 18px;
}

/* ==================================================
   10. ABOUT PAGE
   Styles each information section.
   ================================================== */
.info-section {
  margin: 26px 0;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.info-section h2 {
  font-size: 1.25rem;
}

.info-section p {
  color: var(--muted);
}

.credit-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: .9rem;
}

.credit-list li {
  margin: 4px 0;
}

/* ==================================================
   11. CONTACT FORM
   Neon-coloured validation messages remain readable.
   ================================================== */
.contact-form {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.contact-form label:not(:first-child) {
  margin-top: 8px;
}

.contact-form .button {
  justify-self: start;
}

.form-feedback {
  min-height: 1.5em;
  margin: 4px 0;
}

.form-feedback.error {
  color: #ff8d80;
}

.form-feedback.success {
  color: var(--lime);
}

/* ==================================================
   12. FOOTER
   A quiet dark footer finishes the neon layout.
   ================================================== */
footer {
  padding: 20px 16px;
  border-top: 1px solid rgba(32, 247, 223, .4);
  color: var(--muted);
  background: #071018;
  text-align: center;
  font-size: .88rem;
}

footer p {
  margin: 0;
}

/* ==================================================
   13. TABLET AND MOBILE RESPONSIVE SETTINGS
   These rules apply only at 620px wide or larger.
   ================================================== */
@media (min-width: 620px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .brand span {
    display: inline;
    margin-left: 4px;
  }

  .attraction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }

  .hero {
    padding: 76px 16px;
  }

  .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /*
    Albums become rows of photos with equal height. Each photo's width follows
    its own shape, so wide and tall photos sit side by side without cropping.
  */
  .photo-album {
    --row-height: clamp(160px, 21vw, 230px);
    display: flex;
    flex-wrap: wrap;
  }

  .photo-album figure {
    flex: var(--ratio, 1.333) 1 calc(var(--ratio, 1.333) * var(--row-height));
  }

  /* An invisible last item takes the spare space, so the final row is not stretched. */
  .photo-album::after {
    content: "";
    flex: 1000 0 0px;
  }

  .place-card:has(details[open]) .album-cover .place-image {
    height: 330px;
  }
}

/* ==================================================
   14. DESKTOP RESPONSIVE SETTINGS
   These rules apply only at 920px wide or larger.
   ================================================== */
@media (min-width: 920px) {
  .attraction-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==================================================
   15. FULL-SCREEN IMAGE VIEWER
   JavaScript adds .image-viewer when a picture is clicked.
   ================================================== */
.place-image,
.album-photo,
.photo-gallery img {
  cursor: zoom-in;
}

.viewer-open {
  overflow: hidden;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 56px 20px 20px;
  background: rgba(0, 0, 0, .94);
  backdrop-filter: blur(8px);
}

.image-viewer img {
  display: block;
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border: 1px solid var(--teal);
  border-radius: 6px;
  box-shadow: 0 0 35px rgba(32, 247, 223, .35);
}

.image-viewer-close {
  position: fixed;
  top: 16px;
  right: 20px;
  padding: 9px 14px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  background: #0c1923;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(32, 247, 223, .2);
}

.image-viewer-close:hover,
.image-viewer-nav:hover {
  background: var(--teal);
  color: #071018;
}

/* Round arrow buttons move to the previous or next photo in the same album. */
.image-viewer-nav {
  position: fixed;
  top: 50%;
  width: 46px;
  height: 46px;
  padding: 0 0 4px;
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: rgba(12, 25, 35, .88);
  color: var(--teal);
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  box-shadow: 0 0 14px rgba(32, 247, 223, .2);
}

.image-viewer-previous {
  left: 14px;
}

.image-viewer-next {
  right: 14px;
}

.image-viewer-caption {
  position: fixed;
  right: 20px;
  bottom: 12px;
  left: 20px;
  max-width: min(800px, calc(100% - 40px));
  margin: 0 auto;
  padding: 7px 12px;
  border-radius: 4px;
  background: rgba(7, 16, 24, .86);
  color: #dcecec;
  text-align: center;
  font-size: .85rem;
  line-height: 1.45;
}
