/* Storyfulls Summer Reading List - Exact Prototype Match */

@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@500;600;700&family=Nunito+Sans:wght@700&display=swap');

/* Apply background color to body to fill the entire viewport */
body.path-reading-list {
  background-color: #fcfae4 !important;
}

/* Ensure header and footer are transparent on this page */
body.path-reading-list .site-header--internal,
body.path-reading-list .site-footer {
  background: transparent !important;
  border: none !important;
}

body.path-reading-list .site-footer {
  margin-top: 0;
  padding-top: 2rem;
}

.summer-reading-page {
  color: #1c1c0f;
  min-height: 100vh;
  font-family: 'Quicksand', sans-serif;
  overflow-x: hidden;
  margin-top: -150px;
  position: relative;
  z-index: 5;
}

/* Wavy Decorative Background */
.wavy-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,50 C150,150 350,-50 500,50 C650,150 850,-50 1000,50 L1000,0 L0,0 Z' fill='%23f1efd9' opacity='0.5' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: top;
}

/* Hero Section */
.summer-reading-hero {
  position: relative;
  padding: 5.9rem 1.25rem 0.85rem;
  text-align: center;
  z-index: 10;
}

.summer-reading-hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -10;
  border-bottom-left-radius: 3rem;
  border-bottom-right-radius: 3rem;
}

.summer-reading-hero__inner {
  max-width: 58rem;
  margin: 0.35rem auto 0;
}

.summer-reading-hero h1 {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  font-weight: 700;
  color: #9e4039;
  margin-bottom: 0.75rem;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.summer-reading-hero p {
  max-width: 42rem;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #564240;
}

.summer-reading-hero__cta {
  display: inline-block;
  background: #ff8a80; /* primary-container */
  color: #76221e; /* on-primary-container */
  text-decoration: none;
  border-radius: 999px;
  padding: 0.6rem 1.75rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.summer-reading-hero__cta:hover {
  transform: scale(1.05);
}

/* Bento Grid */
.summer-reading-grid-container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 4rem;
}

.summer-reading-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem; /* gutter */
}

@media (min-width: 768px) {
  .summer-reading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .summer-reading-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .summer-reading-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Card Styling */
.summer-card {
  background: #ffffff; /* surface-container-lowest */
  border-radius: 1rem; /* DEFAULT rounded */
  padding: 1.15rem;
  position: relative;
  border: 1px solid #d2e6ef; /* secondary-container */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(210, 230, 239, 0.4), 0 2px 8px rgba(210, 230, 239, 0.2); /* shadow-ambient */
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.summer-card:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(210, 230, 239, 0.5), 0 4px 12px rgba(210, 230, 239, 0.3); /* shadow-ambient-hover */
}

.summer-card.is-featured {
  grid-column: span 1;
}

@media (min-width: 1024px) {
  .summer-card.is-featured {
    grid-column: span 2;
  }
}

/* Faint Background Icon */
.summer-card__bg-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0.2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.summer-card:hover .summer-card__bg-icon {
  opacity: 0.4;
}

.summer-card__bg-icon span {
  font-size: 40px;
}

/* Card Header */
.summer-card__title {
  font-size: 1.125rem; /* text-body-lg */
  color: #9e4039; /* primary */
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e5e3ce; /* surface-variant */
  font-weight: 500;
}

/* Layout for featured card */
.summer-card__layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1; /* Take up available space to push footer down */
}

@media (min-width: 768px) {
  .is-featured .summer-card__layout {
    flex-direction: row;
  }
  
  .summer-card__quote-col {
    width: 33.333%;
  }
  
  .summer-card__content-col {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
}

.summer-card__content-col {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.summer-card__quote {
  font-style: italic;
  color: #564240; /* on-surface-variant */
  font-size: 1rem;
  line-height: 1.5rem;
}

/* Books List */
.summer-card__books {
  list-style: none;
  margin: 0 0 0.25rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 112px;
  overflow: hidden;
  padding-right: 0.5rem;
  transition: max-height 0.3s ease;
}

.summer-card.is-expanded .summer-card__books {
  overflow-y: auto;
}

/* Custom Scrollbar for the book list - only visible when expanded */
.summer-card.is-expanded .summer-card__books::-webkit-scrollbar {
  width: 5px;
}

.summer-card.is-expanded .summer-card__books::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.summer-card.is-expanded .summer-card__books::-webkit-scrollbar-thumb {
  background: #d2e6ef;
  border-radius: 10px;
}

.summer-card.is-expanded .summer-card__books::-webkit-scrollbar-thumb:hover {
  background: #9eafae;
}

.summer-card__books.is-split {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .summer-card__books.is-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }
}

.summer-card__book a {
  color: #564240; /* on-surface-variant */
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  text-decoration-color: transparent;
  transition: all 0.2s ease;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
}

.summer-card__book a:hover {
  color: #9e4039; /* primary */
  text-decoration-color: #9e4039;
}

.summer-card__book.is-extra {
  display: none;
}

.summer-card.is-expanded .summer-card__book.is-extra {
  display: list-item;
}

/* Toggle Button */
.summer-card__toggle {
  margin-top: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(210, 230, 239, 0.5); /* secondary-container / 50 */
  color: #374951; /* on-secondary-fixed-variant */
  border: none;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 0.875rem; /* label-lg */
  transition: background-color 0.2s ease;
  align-self: flex-start; /* Prevent stretching */
}

.summer-card__toggle:hover {
  background-color: #d2e6ef; /* secondary-container */
}

.summer-card__toggle span.material-symbols-outlined {
  font-size: 18px;
}

/* Footer */
.summer-card__footer {
  margin-top: auto; /* Push to the very bottom */
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.summer-card__avatar-link {
  text-decoration: none;
  transition: transform 0.2s ease;
}

.summer-card__avatar-link:hover {
  transform: scale(1.1);
}

.summer-card__avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem; /* headline-md */
  font-weight: 600;
  overflow: hidden;
}

.summer-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.summer-card__name-link {
  text-decoration: none;
}

.summer-card__name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: #1c1c0f; /* on-background */
}

.summer-card__badge {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .summer-reading-hero {
    padding-top: 5.4rem;
  }

  .summer-card {
    min-height: 0;
  }
}

/* Category Themes */
.theme-secondary .summer-card__bg-icon { color: #4f6169; }
.theme-secondary .summer-card__avatar { background: #d2e6ef; color: #4f6169; }
.theme-secondary .summer-card__badge { background: #d2e6ef; color: #55676f; }

.theme-tertiary .summer-card__bg-icon { color: #9eafae; }
.theme-tertiary .summer-card__avatar { background: #d4e6e5; color: #0e1e1e; }
.theme-tertiary .summer-card__badge { background: #d4e6e5; color: #0e1e1e; }

.theme-primary .summer-card__bg-icon { color: #ff8a80; }
.theme-primary .summer-card__avatar { background: #ffdad6; color: #410003; }
.theme-primary .summer-card__badge { background: #ffdad6; color: #410003; }

/* Accessible Focus Ring */
.summer-card__book a:focus-visible,
.summer-card__toggle:focus-visible,
.summer-reading-hero__cta:focus-visible,
.summer-card__avatar-link:focus-visible,
.summer-card__name-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px #fcfae4, 0 0 0 8px #9e4039;
  border-radius: 4px;
}

.summer-reading-hero__cta:focus-visible,
.summer-card__toggle:focus-visible {
  border-radius: 999px;
}

/* Breadcrumbs */
.summer-reading-breadcrumb {
  margin-bottom: 1.5rem;
}

.summer-reading-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #564240;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.summer-reading-breadcrumb a:hover {
  background: #ffffff;
  color: #9e4039;
  transform: translateX(-4px);
}

.summer-reading-breadcrumb span.material-symbols-outlined {
  font-size: 1.2rem;
}

/* User List Specific Grid */
.summer-reading-user-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .summer-reading-user-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .summer-reading-user-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.summer-user-book-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid #d2e6ef;
  box-shadow: 0 4px 20px rgba(210, 230, 239, 0.4), 0 2px 8px rgba(210, 230, 239, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.summer-user-book-card:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 32px rgba(210, 230, 239, 0.5), 0 4px 12px rgba(210, 230, 239, 0.3);
}

.summer-user-book-cover-wrap {
  flex-shrink: 0;
  display: block;
  text-decoration: none;
}

.summer-user-book-cover {
  width: 90px;
  height: 130px;
  border-radius: 0.75rem;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
}

.summer-user-book-cover--placeholder {
  width: 90px;
  height: 130px;
  border-radius: 0.75rem;
  background: #f1efd9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9eafae;
}

.summer-user-book-cover--placeholder span {
  font-size: 2.5rem;
}

.summer-user-book-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summer-user-book-meta h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  font-family: 'Quicksand', sans-serif;
}

.summer-user-book-meta h3 a {
  color: #1c1c0f;
  text-decoration: none;
}

.summer-user-book-meta h3 a:hover {
  color: #9e4039;
}

.summer-user-book-author {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: #564240;
  margin: 0 0 0.75rem;
}

.summer-user-book-author span.material-symbols-outlined {
  font-size: 1.1rem;
  color: #9eafae;
}

.summer-user-book-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  background: #d2e6ef;
  color: #55676f;
  border-radius: 999px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Empty State */
.summer-card--empty {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
  background: white;
  border-radius: 1.5rem;
  border: 1px dashed #d2e6ef;
}

.summer-card--empty p {
  font-size: 1.25rem;
  color: #564240;
  margin-bottom: 2rem;
}

/* User Profile Card at Bottom */
.user-profile-card-bottom {
  background: #fff;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 10px 40px rgba(210, 230, 239, 0.5);
  margin-top: 5rem;
  border: 1px solid #d2e6ef;
}

.user-card-content {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.user-avatar-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #E8F4FF 0%, #F0F9FF 100%);
  padding: 4px;
  border: 2px solid #d2e6ef;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-info-text {
  flex: 1;
}

.user-name-display {
  font-family: 'Quicksand', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #1c1c0f;
  margin: 0 0 0.25rem 0;
}

.user-age-display {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1.1rem;
  color: #55676f;
  margin: 0;
  font-weight: 600;
}

.user-action-buttons {
  display: flex;
  gap: 1.5rem;
  flex-shrink: 0;
}

.view-profile-btn-user {
  font-family: 'Quicksand', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.85rem 2.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  background: #ff8a80;
  color: #76221e;
  box-shadow: 0 4px 12px rgba(255, 138, 128, 0.3);
}

.view-profile-btn-user:hover {
  background: #ff766b;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(255, 138, 128, 0.4);
}

@media (max-width: 768px) {
  .user-card-content {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .user-action-buttons {
    width: 100%;
  }

  .view-profile-btn-user {
    width: 100%;
  }
  
  .user-name-display {
    font-size: 1.5rem;
  }
}
