/* =========================================================
   Abara — main.css
   Modernized: removed vendor prefixes, skel.js dependency,
   jQuery dependency. Uses CSS custom properties & modern layout.
   ========================================================= */

/* --- Variables --- */
:root {
  --accent:      #e74c3c;
  --accent-dark: #c0392b;
  --white:       #ffffff;
  --text:        #444444;
  --text-light:  #888888;
  --bg:          #ffffff;
  --header-bg:   rgba(254, 254, 254, 0.92);
  --radius:      4px;
  --transition:  0.2s ease-in-out;
  --font-display: 'Pattaya', sans-serif;
  --font-body:    'Work Sans', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13pt;
  font-weight: 300;
  line-height: 1.65;
  -webkit-text-size-adjust: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: underline;
}
a:hover {
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-weight: 300;
  line-height: 1.4;
  color: #555;
}

ul { list-style: none; }

/* --- Splash Header --- */
#header {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--header-bg);
  z-index: 1000;
  transition: background 1s ease-in-out, height 0.3s ease-in-out;
}

#header.hide {
  background: transparent;
  height: 0;
}

.header-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  width: 35em;
  height: 35em;
  padding: 4em;
  text-align: center;
  box-shadow: 0 0 0 1em var(--white);
  cursor: default;
  transition: width 0.2s ease-in-out, height 0.2s ease-in-out;
}

#header.hide .header-inner {
  width: 5em;
  height: 5em;
  padding: 1em;
}

.header-content {
  transition: opacity 1s ease-in-out;
}

#header.hide .header-content {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.header-content h1 {
  font-family: var(--font-display);
  font-size: 4em;
  color: var(--white);
  margin-bottom: 0.25em;
}

.header-content h2 {
  font-size: 1.25em;
  color: var(--white);
  margin-bottom: 1.25em;
}

.button {
  display: inline-block;
  background: var(--white);
  color: var(--accent);
  border: none;
  border-radius: 30px;
  padding: 0.65em 2em;
  font-family: var(--font-body);
  font-size: 1em;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.button:hover {
  background: var(--accent-dark);
  color: var(--white);
}

/* Home button shown when header is minimized */
.home-link {
  display: none;
  color: var(--white);
  font-size: 1.5em;
  text-decoration: none;
}
#header.hide .home-link {
  display: block;
}

/* --- Mini header (subpages) --- */
#header.mini {
  position: sticky;
  top: 0;
  height: auto;
  background: var(--accent);
  padding: 0.75em 1.5em;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner.mini {
  background: transparent;
  border-radius: 0;
  width: auto;
  height: auto;
  padding: 0;
  box-shadow: none;
  flex-direction: row;
  justify-content: flex-start;
  gap: 1em;
}

.home-btn {
  color: var(--white);
  font-size: 1.4em;
  text-decoration: none;
  transition: opacity var(--transition);
}
.home-btn:hover { opacity: 0.75; }

.site-title {
  font-family: var(--font-display);
  font-size: 1.4em;
  color: var(--white);
}

/* --- Main gallery --- */
#main {
  padding: 2em;
}

.columns {
  column-count: 4;
  column-gap: 0.75em;
}

.image.fit {
  display: block;
  width: 100%;
  margin: 0 0 0.75em;
  overflow: hidden;
  border-radius: var(--radius);
  break-inside: avoid;
}

.image.fit img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  transition: transform 0.3s ease-in-out;
}

.columns .image:hover img {
  transform: scale(1.05);
}

/* --- Gallery page (gallery.html) --- */
.gallery-page {
  padding: 2em;
}

.gallery-header {
  text-align: center;
  margin-bottom: 1.5em;
}

.gallery-header h2 {
  font-family: var(--font-display);
  font-size: 2em;
  color: var(--accent);
}

.gallery-grid {
  column-count: 4;
  column-gap: 0.75em;
}

.gallery-grid .image.fit {
  cursor: pointer;
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-img-wrap {
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 1em;
  right: 1.25em;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.5em;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  font-size: 3em;
  line-height: 1;
  padding: 0.1em 0.3em;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.lightbox-nav.prev { left: 0.5em; }
.lightbox-nav.next { right: 0.5em; }

/* --- Calendar page --- */
.calendar-page {
  padding: 2em;
}

.calendar-header {
  text-align: center;
  margin-bottom: 1.5em;
}

.calendar-header h2 {
  font-family: var(--font-display);
  font-size: 2em;
  color: var(--accent);
}

.calendar-wrap {
  display: flex;
  justify-content: center;
}

.calendar-wrap iframe {
  width: 100%;
  max-width: 900px;
  height: 600px;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* --- Footer --- */
#footer {
  position: fixed;
  bottom: -22em;
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 999;
  transition: bottom 0.3s ease;
}

#footer.show { bottom: 0; }

.info-btn {
  display: inline-block;
  background: var(--accent);
  border: none;
  border-radius: 50% 50% 0 0;
  width: 3em;
  height: 3em;
  color: var(--white);
  font-size: 1.25em;
  cursor: pointer;
  margin-bottom: -1.5em;
  position: relative;
  transition: background var(--transition);
}
.info-btn:hover { background: var(--accent-dark); }

.footer-inner {
  background: var(--accent);
  padding: 2em;
  display: flex;
  justify-content: center;
  gap: 4em;
  color: rgba(255,255,255,0.85);
}

.footer-content h3,
.footer-links h3 {
  color: var(--white);
  font-size: 1.4em;
  margin-bottom: 0.75em;
}

.footer-content p {
  max-width: 28em;
  line-height: 1.7;
}

.social-icons {
  display: flex;
  gap: 1em;
  margin-top: 0.5em;
}

.social-icons a {
  color: var(--white);
  font-size: 1.75em;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity var(--transition);
}
.social-icons a:hover { opacity: 1; }

/* --- Responsive --- */
@media screen and (max-width: 980px) {
  .columns, .gallery-grid { column-count: 2; }

  #footer {
    position: relative;
    bottom: 0;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 2em;
    text-align: center;
  }
  .info-btn { display: none; }
}

@media screen and (max-width: 600px) {
  body { font-size: 12pt; }
  .header-inner { width: 26em; height: 26em; padding: 2em; font-size: 0.65em; }
  .columns, .gallery-grid { column-count: 1; }
  .calendar-wrap iframe { height: 400px; }
}
