/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --slate-100: hsl(210, 46%, 95%);
  --slate-400: hsl(212, 23%, 69%);
  --slate-500: hsl(214, 17%, 51%);
  --slate-600: hsl(217, 19%, 35%);
  --white: hsl(0, 0%, 100%);
  --shadow: hsla(210, 29%, 84%, 50%);
}

body {
  font-family: "Manrope", sans-serif;
  font-weight: 500;

  background-color: var(--slate-100);

  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
}

.card {
  border-radius: 0.625rem;
  background-color: var(--white);
  box-shadow: 0 40px 40px -10px var(--shadow);
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.625rem 0.625rem 0 0;
}

.content header {
  padding: 2rem 1.875rem;
}

.content header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.25px;
  color: var(--slate-600);
  margin-bottom: 1.5rem;
}

.content header p {
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.12px;
  color: var(--slate-500);
}

footer {
  position: relative;
}

.author_wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.875rem 1.125rem;
  transition: all 280ms ease-in;
}

.author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  aspect-ratio: 1;
}

.author_info {
  display: flex;
  flex-direction: column;
}

.author_info h2 {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12px;
  color: var(--slate-600);
}

.author_info time {
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.12px;
  color: var(--slate-400);
}

.share_btn {
  width: 2rem;
  height: 2rem;
  border: none;
  outline: none;
  border-radius: 50%;
  background-color: var(--slate-100);

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
}

button:focus-visible {
  outline: 2px solid var(--slate-500);
  outline-offset: 2px;
}

.share_panel {
  padding: 1.25rem 2rem;
  background-color: var(--slate-600);
  border-radius: 0 0 0.625rem 0.625rem;
  display: flex;
  align-items: center;
  justify-content: space-between;

  position: absolute;
  inset: 0;

  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.share_panel.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.share_panel.active + .author_wrapper {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.share_content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.panel_label {
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 2.75px;
  color: var(--slate-400);
  text-transform: uppercase;
}

.social_links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social_links a {
  display: inline-flex;
}

.share_panel .share_btn {
  background-color: var(--slate-500);
}

.share_panel .share_btn img {
  filter: brightness(100);
}

@media (min-width: 384px) {
  body {
    padding: 3rem 1.5rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 38rem;
  }

  .card {
    display: grid;
    grid-template-columns: 230px 1fr;
  }

  figure img {
    height: 100%;
    border-radius: 0.625rem 0 0 0.625rem;
  }

  .content {
    padding: 2.5rem 2.25rem;
    padding-left: 2rem;
  }

  footer {
    position: relative;
  }

  .content header,
  .author_wrapper {
    padding: 0;
  }

  .author_wrapper {
    margin-top: 1.5rem;
    display: flex;
  }

  .share_panel {
    width: 248px;
    border-radius: 0.625rem;
    padding-top: 1.125rem;
    padding-bottom: 1.125rem;

    inset: auto;
    right: -108px;
    bottom: 62px;
    transform: translateY(10px) scale(0.95);
    box-shadow: 0 10px 10px 0 var(--shadow);
  }

  .share_panel.active {
    transform: translateY(0) scale(1);
  }

  .share_panel::after {
    content: "";
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--slate-600);
  }

  .share_panel .share_btn {
    display: none;
  }
}

@media (min-width: 1248px) {
  .container {
    max-width: 46rem;
  }

  .card {
    grid-template-columns: 284px 1fr;
  }

  .content {
    padding: 1.875rem 2.5rem;
  }
}
