/* ==========================================================================
   Shared styles for every page of valeriamera.com
   Colors come from CSS variables set by assets/js/layout.js (values in assets/js/config.js):
     --accent / --accent-light / --accent-dark  = the CURRENT page's color
     --c-home, --c-exp, --c-story, ...          = every page's color
   Page-specific rules live in assets/css/<page>.css.
   ========================================================================== */

html { scroll-behavior: smooth; }
body { font-family: var(--font-body, 'Inter', sans-serif); background-color: var(--cream, #f7f7f4); color: var(--text, var(--text)); }

/* Accessibility: "skip to content" link, visible only when focused */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: .5rem 1rem; border-radius: .5rem;
  background: var(--accent); color: #fff; font-size: .875rem;
  transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Scroll-in animations: add class "fade" or "fade-up" to any element */
.fade    { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s ease; }
.fade.show, .fade-up.show, .show { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade, .fade-up { opacity: 1; transform: none; transition: none; }
  .floating-element { animation: none; }
}

/* Underlined text links inside page content */
.link { position: relative; }
.link::after {
  content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.link:hover::after { transform: scaleX(1); }

.content-link {
  display: inline-flex; align-items: center; gap: .25rem;
  color: #808080; font-weight: 500; position: relative;
  transition: color .3s ease; text-decoration: none;
}
.content-link::after {
  content: ''; position: absolute; left: 0; bottom: -1px; width: 100%; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .3s ease;
}
.content-link:hover { color: var(--accent); }
.content-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* --- Navigation ---------------------------------------------------------- */
.home-icon {
  display: block !important; align-items: initial !important; gap: initial !important;
  position: static !important; color: var(--nav-text);
}
.home-icon::after { display: none !important; }
.home-icon:hover { color: var(--accent) !important; }

nav a { display: initial; align-items: initial; gap: initial; color: var(--nav-text); }

/* Menu links are dark, take their page's color on hover, and the current page's link is highlighted */
a.nav-link { position: relative; transition: color .3s ease; color: var(--nav-text); }
a.nav-link[aria-current="page"] { color: var(--accent); }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .3s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.mobile-menu { transition: all .3s ease; transform: translateY(-100%); opacity: 0; visibility: hidden; }
.mobile-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }

.hamburger span { transition: all .3s ease; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* --- Section headings ---------------------------------------------------- */
.section-divider { position: relative; text-align: center; margin: 3rem 0; }
.section-divider::after {
  content: ''; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%);
  width: 60px; height: 2px; border-radius: 2px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
}

.floating-element { animation: float 4s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-15px) rotate(1deg); }
}

/* --- Footer -------------------------------------------------------------- */
.social-icon {
  position: static; display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: linear-gradient(145deg, #f7f7f4, #f0f0eb);
  box-shadow: 5px 5px 10px #e6e6e1, -5px -5px 10px #ffffff;
  transition: all .3s ease; color: var(--accent);
}
.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 8px 8px 15px #e6e6e1, -8px -8px 15px #ffffff;
  color: var(--accent-dark);
}
.social-icon i { width: 1.25rem; height: 1.25rem; }

/* Visitor counter badge (bottom-right) */
.visitor-counter {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  background: rgba(74, 74, 69, .7); color: rgba(245, 245, 240, .9);
  padding: 10px 14px; border-radius: 12px; font-size: 12px; font-weight: 400;
  box-shadow: 0 2px 8px rgba(74, 74, 69, .15); backdrop-filter: blur(6px);
  border: 1px solid rgba(74, 74, 69, .2); transition: all .3s ease; opacity: .8;
}
.visitor-counter:hover {
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(74, 74, 69, .25);
  background: rgba(74, 74, 69, .85); opacity: 1;
}
.counter-icon { display: inline-block; margin-right: 6px; font-size: 14px; }
.counter-number { color: rgba(245, 245, 240, .9); font-weight: 500; margin-left: 4px; }
.visitor-counter.new-visit { animation: pulse .6s ease-in-out; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }
@media (max-width: 640px) {
  .visitor-counter { bottom: 15px; right: 15px; }
  .counter-icon { font-size: 13px; }
}
