@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&family=Libre+Baskerville:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  --pink: #e8325a;
  --pink-light: #fce8ed;
  --pink-pale: #fff5f7;
  --pink-mid: #f9d0da;
  --gold: #f5a623;
  --text: #2c1a22;
  --text-muted: #8a6070;
  --white: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(232,50,90,0.10);
  --font-main: "Libre Baskerville";
  --font-display: "Google Sans";
}
[popovertarget] {
	position: relative;
}
[popover] {
	position-area: block-end span-inline-end;
	position-try-fallbacks: flip-inline;
	margin: initial;
	border: 0;
	opacity: 0;
  transform: scale(0.9) translateY(-6px);
  transition: opacity 200ms, transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
              overlay 200ms allow-discrete, display 200ms allow-discrete;
}
[popover]:popover-open {
	opacity: 1;
  transform: scale(1) translateY(0);
}
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: #fff;
  color: var(--text);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
a {
  text-decoration: none;
  font: inherit;
  color: inherit;
}
section {
	flex: 1;
}
/* logo img */

section#hero {
  /*background: #fef8ed;*/
  position: relative;
  /*overflow: hidden;*/

  &::before {
    content: "";
    position: absolute;
    inset: 0; /* Stretches the pseudo-element to fit 100% width and height */
    /*background-image: url(/images/bg_bookiuthero-1.webp);*/
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    background-color: #fef8ed;
    
    /* Apply the blur here so it doesn't affect the text */
    filter: blur(40rem); 
    transform: scale(1.1); /* Tip: Scale slightly up to hide ugly unblurred edges */
    z-index: -1; /* Pushes the blurred image behind the text */
     background-blend-mode: hard-light; 
  }

  &>div {
    display: grid;
    grid-template-columns: 2fr 1fr;
    padding: 3rem 5rem;
    gap: 5rem;
  }
  h1 {
    font: 700 3rem/3.5rem var(--font-main);
    text-align: left;
    color: oklch(0 0 1 / 0.7);
  }
  .bk_buy button {
    background: var(--pink);
    color: white;
    border-radius: 0.4rem;
    padding: 1rem 2rem;
    span {
      margin-left: 0.5rem;
    }
  }
}

#hero-meta {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  
  p {
    font: 400 1rem/1.5rem var(--font-display);
  }
  i {
    color: var(--pink);
    font-weight: 400;
    margin-right: 1rem;
  }
  p.authors {
    font: 600 1.1rem var(--font-display);
    color: var(--pink);
  }
}
#hero-cover {
  max-width: 300px;
  margin: auto;
  img {
    width: 100%;
    height: auto;
  }
}
#logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

#logo img {
    height: 40px;
    width: auto;
}

#logo span {
    font-size: 1.2rem;
    font-weight: bold;
}
.toggle-input {
  display: none;
}
#excerpt {
  max-height: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}
/* ==========================================
   HERO RESPONSIVE MOBILE
========================================== */

@media (max-width: 768px) {

  /* Hero container */
  section#hero {
    text-align: center;

    &::before {
      background-position: left center;
    }
  }

  section#hero > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2rem;
    padding: 2.5rem 1.5rem;
  }


  /* Book cover on top */
  #hero-cover {
    order: -1;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
  }

  #hero-cover img {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
  }


  /* Text content */
  #hero-meta {
    order: 2;
    width: 100%;
    align-items: center;
    text-align: center;
    gap: 1.3rem;
  }


  /* Title */
  section#hero h1 {
    font-size: 2rem;
    line-height: 2.5rem;
    text-align: center;
  }


  /* Description */
  #hero-meta p {
    font-size: 0.95rem;
    line-height: 1.5rem;
    text-align: center;
  }


  /* Author */
  #hero-meta p.authors {
    font-size: 1rem;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
  }


  #hero-meta i {
    margin-right: .5rem;
  }

  #excerpt {
    position: relative;
    max-height: 100px;
    overflow: hidden;
    line-height: 1.5;
    color: transparent;
    background: linear-gradient(to bottom, #000 0%, #000 60%, transparent 100%);
    -webkit-background-clip: text;
    background-clip: text;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .toggle-input:checked ~ #excerpt {
    max-height: 60rem;
    color: #000;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
  }
  .toggle-label {
    display: inline-block;
    cursor: pointer;
    color: #2563eb;
    font-weight: 800;
    font-size: 1.5rem;
    color: oklch(0 0 1 / 0.8);
  }
  .toggle-label::after {
    content: "\203A";
    display: inline-block;
    transform: rotate(90deg);
  }
  .toggle-input:checked ~ .toggle-label::after {
    content: "\203A";
    display: inline-block;
    transform: rotate(-90deg);
  }


  /* Buy button container */
  .bk_buy {
    width: 100%;
    display: flex;
    justify-content: center;
  }


  .bk_buy button {
    width: auto;
    max-width: 280px;
    padding: .9rem 1.8rem;
    font-size: .9rem;
  }

}


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

@media (max-width: 480px) {


  section#hero > div {
    padding: 2rem 1rem;
    gap: 1.5rem;
  }


  #hero-cover {
    max-width: 170px;
  }


  #hero-cover img {
    max-width: 170px;
  }


  section#hero h1 {
    font-size: 1.7rem;
    line-height: 2.1rem;
  }


  #hero-meta p {
    font-size: .9rem;
  }


  #hero-meta p.authors {
    font-size: .9rem;
  }


  .bk_buy button {
    width: 100%;
    max-width: 250px;
  }

}



/* ── SECTION ── */
section.section {
  background: oklch(1 0 0 / 0.5);
}
.section {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 56px;
  
}

.section h1 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 28px 0 20px;
  text-align: center;
}

/* BARU AND AKAN DATANG BADGE */
.imgpx {
    position: relative;
    display: block;
    overflow: hidden;
}

.book-badge {
    position: absolute;
    top: 14px;
    right: -38px;

    width: 140px;
    padding: 6px 0;

    background: #d91f3d;
    color: #fff;

    text-align: center;
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;

    transform: rotate(45deg);
    box-shadow: 0 3px 10px rgba(0,0,0,.25);

    z-index: 20;
}

.badge-coming{
    background:#f5a623;
}

.booklist {
	flex-wrap: wrap;
}
.booklist>div {
	width: 100%;
  	max-width: 200px;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
    text-align: center;
}

/* ── BOOK CARDS (inside carousel) ── */
.booklist.carousel > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-wrap: nowrap;
}

.imgpx {
  display: block;
  width: 100%;
  line-height: 0;
  position: relative;
}

.bk_cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(44,26,34,0.12);
  display: block;
  transition: transform .3s ease;
}

.imgpx:hover .bk_cover {
  transform: scale(1.03);
}

.bk_buy {
  margin-top: 10px;
  width: fit-content;
  display: flex;
  justify-content: center;
  position: relative;
}

.bk_buy button {
  border: none;
  background: var(--pink-pale);
  color: var(--pink);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .2s, transform .2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Nunito', sans-serif;
  position: relative;
}

.bk_buy button:hover {
  background: var(--pink-mid);
  transform: translateY(-1px);
}

.bk_buy button span::after {
  content: ' ▾';
  font-size: 1.0em;
  opacity: 0.7;
}

.bk_buy button:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.bk_info {
  margin-top: 8px;
  width: 100%;
  padding: 0 4px;
}

.bk_info .title {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bk_info .title a {
  color: var(--text);
  text-decoration: none;
}

.bk_info .title a:hover {
  color: var(--pink);
}

.bk_info .authors {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bk_info .authors a {
  color: var(--text-muted);
  text-decoration: none;
}

.bk_info .authors a:hover {
  color: var(--pink);
}

/* ── BUY POPOVER ── */
.buy-popover {
  margin: 0;
  border: 1.5px solid var(--pink-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(44,26,34,0.12);
  padding: 10px;
  min-width: 180px;
}

.buy-popover::backdrop {
  background: transparent;
}

.buy-popover a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.buy-popover a:hover {
  background: var(--pink-pale);
  color: var(--pink);
}

.buy-popover a img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.buy-popover a span {
  font-family: 'Nunito', sans-serif;
}

/* ── CAROUSEL BUTTONS ── */
.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.carousel-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--pink-mid);
  background: var(--white);
  color: var(--pink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(232,50,90,0.12);
  transition: all .2s ease;
  padding: 0;
}

.carousel-btn:hover {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
  box-shadow: 0 4px 14px rgba(232,50,90,0.3);
}

.carousel-btn svg {
  width: 22px;
  height: 22px;
}

/* ── 5 BOOKS PER ROW ── */
.booklist {
  display: flex;
  gap: max(3rem);
  padding: 8px 0;
  flex: 1;
  justify-content: center;
}

.booklist.carousel > div {
  flex: 0 0 calc(20% - 13px);
  min-width: 0;
}

/* ── SCROLL DOTS ── */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink-mid);
  cursor: pointer;
  transition: background .2s, width .2s;
  border: none;
}

.dot.active {
  background: var(--pink);
  width: 20px;
  border-radius: 4px;
}

/* ── FOOTER LOGO ── */
.logo {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--pink);
  gap: 8px;
  text-decoration: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: var(--pink);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.logo-icon img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

/* ── FOOTER ── */
footer {
  background: var(--pink-pale);
  border-top: 1px solid var(--pink-mid);
  padding: 48px 0 28px;
  margin-top: 40px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  margin-bottom: 12px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.83rem;
  line-height: 1.65;
  max-width: 280px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 36px;
  height: 36px;
  background: var(--white);
  border: 1.5px solid var(--pink-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
  color: var(--pink);
}

.social-link:hover {
  background: var(--pink);
  color: #fff;
  border-color: var(--pink);
  transform: translateY(-2px);
}

.footer-col h4 {
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 14px;
  color: var(--text);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid var(--pink-mid);
  padding: 20px 20px 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p {
    max-width: none;
  }

  .social-links {
    justify-content: center;
  }
}

/* ── UTILITY ── */
.show {
  display: flex !important;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .booklist.carousel > div {
    flex: 0 0 calc(33.333% - 11px);
  }
}

@media (max-width: 640px) {
  .booklist.carousel > div {
    flex: 0 0 calc(50% - 8px);
  }

  .section {
    padding: 0 12px 40px;
  }

  .section h1 {
    margin: 20px 0 16px;
    font-size: 1.1rem;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
  }

  .carousel-btn svg {
    width: 18px;
    height: 18px;
  }

  .bk_info .title {
    font-size: 0.82rem;
  }
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pink-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 max(20px, calc(50% - 640px));
  height: 64px;
}

#logo {
  display: flex;
  align-items: center;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--pink);
  text-decoration: none;
  flex-shrink: 0;

  > span {
    display: none;
  }
}

#menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
}

#menu > a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color .2s;
}

#menu > a:hover {
  color: var(--pink);
}

details {
  position: relative;
}

details summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.92rem;
  transition: color .2s;
}

details summary:hover {
  color: var(--pink);
}

details summary::after {
  content: '▾';
  font-size: 1.0em;
  transition: transform 0.2s ease;
}

details[open] summary::after {
  transform: rotate(180deg);
}

details ul {
  list-style: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 220px;
  background: white;
  border: 1px solid var(--pink-mid);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  z-index: 999;
}

details ul a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}

details ul a:hover {
  background: var(--pink-pale);
  color: var(--pink);
}

/* ==========================
   Search Bar
========================== */

#searchbar {
    flex-shrink: 0;
}

#searchbar form {
    display: flex;
    align-items: center;
    position: relative;
}

/* Search input */
#searchbar input[type="text"] {
    width: 200px;
    height: 32px;
    padding: 0 16px;
    border: 1px solid var(--pink-mid);
    border-radius: 999px;
    background: #fff7f9;
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all .2s ease;
}

#searchbar input[type="text"]::placeholder {
    color: #b8a2ab;
}

#searchbar input[type="text"]:focus {
    border-color: var(--pink);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(232,50,90,.08);
}

#searchbar button {
    position:absolute;
    right:12px;
    top:50%;
    transform:translateY(-50%);
    border:none;
    background:transparent;
    color:#b38b97;
    cursor:pointer;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
}

/* Mobile */
@media (max-width:768px) {

    #searchbar input[type="text"] {
        width: 160px;
    }

}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  position: relative;
}

.hamburger span {
  display: block;
  position: absolute;
  top: 50%;
  left: 0;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: background .3s;
}

.hamburger span::before,
.hamburger span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s;
}

.hamburger span::before {
  top: -7px;
}

.hamburger span::after {
  top: 7px;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  #searchbar {
    display: none;
  }

  #searchbar.show {
    display: none;
  }

  #menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 20px;
    border-top: 1px solid var(--pink-mid);
    z-index: 999;
    gap: 0;
  }

  #menu.show {
    display: flex;
  }

  #menu > a {
    display: block;
    padding: 10px 0;
  }

  details summary {
    padding: 10px 0;
  }

  details ul {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    padding-left: 12px;
    background: transparent;
  }

  details ul a {
    padding: 8px 0;
  }
}
