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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nanum Gothic', sans-serif;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color .3s, color .3s;
  min-height: 100vh;
}

.hidden { display: none; }

/*====================================
  COLOR THEMES
====================================*/
:root {
  --bg-light: #f8f7f5;
  --text-light: #333;
  --accent-light: #ff6f61;
  --bg-dark:  #222;
  --text-dark: #eee;
  --accent-dark: #ff6f61;
}
body.light {
  --bg: var(--bg-light);
  --text: var(--text-light);
  --accent: var(--accent-light);
}
body.dark {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --accent: var(--accent-dark);
}

/*====================================
  BACKGROUND PATTERN
====================================*/
body.pattern-bg {
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,.03) 0, rgba(0,0,0,.03) 1px, transparent 1px, transparent 10px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.03) 0, rgba(0,0,0,.03) 1px, transparent 1px, transparent 10px);
  background-color: var(--bg);
  background-size: 20px 20px;
}

/*====================================
  LAYOUT HELPERS
====================================*/
.container {
  width: 90%;
  max-width: 900px;
  margin: 2rem auto;
}

/*====================================
  HEADER & NAV
====================================*/
header {
  text-align: center;
  padding: 1rem 0;
}
nav {
  margin-bottom: 1rem;
}
nav a,
nav button {
  color: var(--text);
  text-decoration: none;
  margin: 0 .5rem;
  font-weight: 700;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s;
}
nav a:hover,
nav button:hover,
nav a.current {
  opacity: 1;
}

/*====================================
  THEME TOGGLE
====================================*/
#theme-toggle {
  font-size: 1.1rem;
  vertical-align: middle;
}

/*====================================
  FADE-IN
====================================*/
.fade-in {
  opacity: 0;
  animation: fadeIn 1s forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

/*====================================
  ABOUT SECTION
====================================*/
.about-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.dog-sticker {
  width: 100px;
  height: 100px;
  background: url('stickers/kaya-sticker.png') center/contain no-repeat;
  cursor: pointer;
  position: relative;
}
.wisdom-bubble {
  position: absolute;
  top: -2.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: .4rem .8rem;
  border-radius: .4rem;
  font-size: .85rem;
  white-space: nowrap;
  pointer-events: none;
}

/*====================================
  LIKE BUTTON
====================================*/
.like-container {
  text-align: center;
  margin-top: 1rem;
}

/*====================================
  TRAITS GRID
====================================*/
.traits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.trait-card {
  background: var(--bg);
  border: 1px solid #ccc;
  border-radius: .5rem;
  padding: 1rem;
  text-align: center;
  transition: transform .2s;
}
.trait-card:hover {
  transform: translateY(-4px);
}
.trait-card i {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: .5rem;
}

/*====================================
  GUESTBOOK FORM
====================================*/
form {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: 1rem;
}
form input,
form textarea {
  padding: .5rem;
  border: 1px solid #aaa;
  border-radius: .25rem;
  font-family: inherit;
  font-size: 1rem;
}
.error {
  color: #b00;
  font-size: .9rem;
}
form button {
  align-self: start;
  background: var(--accent);
  color: #fff;
  padding: .5rem 1rem;
  border: none;
  border-radius: .25rem;
  cursor: pointer;
  margin-top: .5rem;
}

/*====================================
  CURSOR TRAIL
====================================*/
#cursorCanvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1000;
}

/*====================================
  FOOTER
====================================*/
footer {
  text-align: center;
  padding: 1rem 0;
  font-size: .9rem;
  color: var(--text);
}

/*====================================
  GALLERY PAGE GRID
====================================*/
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(180px,1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.gallery-item {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  cursor: pointer;
}

.gallery-item {
  transition: transform .3s ease, filter .3s ease;
  /* ensure they sit above neighbors when scaling */
  position: relative;
  z-index: 0;
}
.gallery-item:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
  z-index: 10;
}
/* MINI GALLERY: fixed‐box, center‐crop thumbs */
#mini-gallery .carousel {
  max-width: 600px;        /* total strip width */
  margin: 1rem auto;
  overflow-x: auto;
  display: flex;           /* easier than scroll‐snap if it’s a short strip */
  gap: 1rem;
}

#mini-gallery .carousel .slide {
  flex: 0 0 200px;         /* exactly 200px wide */
  height: 150px;           /* exactly 150px tall */
  background: #eee;        /* placeholder bg while loading */
  border-radius: 4px;
  overflow: hidden;        /* hide overflow before img loads */
  position: relative;
}

#mini-gallery .carousel .slide img {
  position: absolute;
  top: 50%; left: 50%;
  width: auto;             /* let one dimension auto‐scale */
  height: 100%;            /* fill the box vertically */
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center;
}

/*====================================
  LIGHTBOX
====================================*/
#lightbox {
  position: fixed;
  top: 0; left: 0;
  width:100%; height:100%;
  background: rgba(0,0,0,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity .3s, visibility .3s;
  z-index: 1000;
}
#lightbox.visible {
  visibility: visible;
  opacity: 1;
}
#lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
}
#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ——— Uniform, Center-Cropped Gallery Items ——— */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-grid img,
.gallery-grid video {
  width: 100%;
  height: 200px;          /* fixed height for all items */
  object-fit: cover;      /* center-crop */
  object-position: center;
  display: block;
  border-radius: 4px;
}