<template>
  <NuxtLayout>
    <v-app>
      <a id="top" />
      <div class="content-wrapper">
        <div class="body">
          <header>
            <Topbar />
          </header>

          <NuxtPage />

          <BackToTheTop />
        </div>

        <Footer />
      </div>
    </v-app>
  </NuxtLayout>
</template>

<script setup lang="ts">
const route = useRoute()

useHead(() => ({
  link: [
    {
      rel: 'canonical',
      href: 'https://sauvagerie.fr' + route.path,
    },
  ],
}))
</script>

<style lang="scss">
html {
  scroll-behavior: smooth;
  height: 100%;
  overflow-x: hidden;
  font-size: 16px;
}

body {
  min-height: 100%;
  padding: 0;
  margin: 0;
  line-height: 1.6;
}

.v-application {
  background: url('/images/photos/20250624_220653.jpg') no-repeat center center fixed !important;
  background-size: cover !important;
  color: rgb(var(--v-theme-on-background)) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  padding: 20px 0 0 0; /* Removed padding to allow footer to extend to the edges */
  box-sizing: border-box;
  letter-spacing: 0.015em;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 20px); /* Account for top padding of v-application */
}

.body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
  margin: 24px 15% 24px 15%; /* Increased margins for better spacing */
  background-color: rgba(var(--v-theme-card-background), 0.75); /* Slightly more opaque for better readability */
  border-radius: 16px; /* Slightly larger border radius */
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15); /* Enhanced shadow */
  backdrop-filter: blur(8px); /* Increased blur for better contrast with background */
  border: 1px solid rgba(255, 255, 255, 0.4); /* Slightly more visible border */

  @media (max-width: 1600px) {
    margin: 24px 8% 24px 8%; /* Increased margins */
    padding: 28px;
  }

  @media (max-width: 600px) {
    margin: 20px 4% 20px 4%; /* Increased margins */
    padding: 20px;
  }
}

.topbar-container {
  padding: 32px 0;
  border-bottom: solid 1px rgba(var(--v-theme-on-background), 0.2);
  margin-bottom: 3rem;
  position: sticky;
  top: 0;
  background-color: rgb(var(--v-theme-card-background));
  backdrop-filter: blur(5px);
  z-index: 1000;
}

:deep(h2) {
  margin: 48px 0 24px 0;
  padding-bottom: 9px;
  border-bottom: solid 1px rgba(var(--v-theme-on-background), 0.2);

  @media (max-width: 600px) {
    margin: 24px 0;
  }
}

.v-footer {
  max-height: 36px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  border-top: rgb(var(--v-theme-on-surface));
  font-size: 12px;
  margin-top: 20px; /* Add some space between content and footer */

  a {
    color: rgb(var(--v-theme-on-background));
  }

  span {
    margin: 0 24px;
  }
}

</style>
