/* =========================
   GLOBAL
========================= */

body {
  margin: 0;
  background: #f2f2f2;
  font-family: "Cormorant Garamond", serif;
  color: #111;
  text-align: left;
}

.content {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px;
}

/* =========================
   HEADER
========================= */

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 10px 8px;
  text-align: center;
}

.site-title {
  font-weight: bold;
  text-decoration: none;
  color: black;
  font-size: 20px;
}

.site-title:hover {
  color: forestgreen;
}

/* clean green square separator */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: forestgreen;
  vertical-align: middle;
}

.divider {
  width: 100%;
  max-width: 700px; /* key control */
  margin: 10px auto;
}

/* =========================
   NAV
========================= */

.nav-wrap {
  width: fit-content;
  max-width: 100%;
}

.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}

.nav-link {
  text-decoration: none;
  color: black;
  padding: 4px 6px;
  border-radius: 5px;
  display: inline-block;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: forestgreen;
  background: rgba(0, 128, 0, 0.08);
}

.nav-link:hover span {   
  transform: scale(1.05);
}

.nav-link.active {
  color: forestgreen;
}

/* clean nav separator (NO font glyphs) */
.nav-dot {
  width: 6px;
  height: 6px;
  background: forestgreen;
  display: inline-block;
  flex: 0 0 6px;
  line-height: 0;
  font-size: 0;
  transform: none;
}

/* =========================
   DROPDOWN
========================= */

details > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px;
  border-radius: 6px;
  transition: 0.2s ease;
  display: inline-block;
  -webkit-tap-highlight-color: transparent;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary:hover,
details[open] > summary {
  background: rgba(0, 128, 0, 0.08);
  color: forestgreen;
}

details > *:not(summary) {
  margin-top: 8px;
  margin-left: 18px;
}

/* =========================
   WORKS DROPDOWN (CUSTOM)
========================= */

.works-dropdown {
  position: relative;
  display: inline-block;
}

/* the button replaces the link look */
.works-toggle {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* dropdown menu */
.works-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);

  display: none;
  flex-direction: column;
  gap: 6px;

  background: #f2f2f2;
  border: 1px solid rgba(0,0,0,0.15);
  padding: 8px 10px;
  border-radius: 8px;

  z-index: 9999;

  width: max-content;   /* key change */
}

/* show state */
.works-dropdown.open .works-menu {
  display: flex;
}

/* dropdown items */
.works-item {
  text-decoration: none;
  color: black;
  padding: 4px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

.works-item:hover {
  color: forestgreen;
  background: rgba(0, 128, 0, 0.08);
}

/* =========================
   FOOTER
========================= */

.site-footer {
  margin-top: 30px;
  padding-bottom: 25px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.social-link img {
  width: 30px;
  transition: transform 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.social-link img:hover {
  transform: scale(1.10);
  opacity: 0.9;
  filter: brightness(0) saturate(100%)
    invert(28%) sepia(55%) saturate(600%) hue-rotate(85deg);
}

.footer-text {
  font-size: 12px;
  color: gray;
  margin-top: 10px;
  text-align: center;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {
  .site-title {
    font-size: 18px;
  }

  .nav-link {
    font-size: 14px;
  }

  .site-nav {
    gap: 4px;
  }

  .content {
    padding: 12px;
  }

  .social-link img {
    width: 28px;
  }
}

/* =========================
   IMAGES
========================= */

img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   LINKS (SINGLE SYSTEM ONLY)
========================= */

a {
  color: black;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: forestgreen;
  background-color: rgba(0, 128, 0, 0.08);
  transform: scale(1.05);
}

/* =========================
   PAGE TRANSITIONS
========================= */

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s;
}

::view-transition-old(root) {
  animation: fade-out 0.4s ease forwards;
}

::view-transition-new(root) {
  animation: fade-in 0.4s ease forwards;
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Bold green non-hyperlink text */
.green-bold {
  color: forestgreen;
  font-weight: bold;
}

details[open] > *:not(summary) {
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
