/* Shared styles: homepage, admin and PDF reader. Responsive overrides are intentional. */
:root {
  --orange:  #ff671e;
  --ink:  #222b31;
  --muted:  #657078;
  --line:  #e4e7e9
;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: Arial,Helvetica,sans-serif;
  font-size: 16px;
}

button,input,a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible,a:focus-visible,input:focus-visible {
  outline: 3px solid #ff671e;
  outline-offset: 4px;
}

a {
  color: inherit;
  text-decoration: none;
}

header {
  max-width: 1440px;
  margin: auto;
  height: 100px;
  padding: 0 64px;
  display: flex;
  align-items: center;
  gap: 30px;
  border-bottom: 1px solid var(--line);
}

.site-header {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100px;
  padding-top: 0;
  padding-bottom: 0;
}

.site-header .brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: auto;
  min-width: 0;
  max-width: none;
  gap: 16px;
}

.site-header .brand img {
  display: block;
  width: 200px;
  height: auto;
  max-height: 100px;
  object-fit: contain;
}

.site-header .header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.site-header .demo {
  margin-left: 0;
}

.site-header .admin-link {
  white-space: nowrap;
}

html {
  scrollbar-gutter: stable;
}

@media (max-width:650px) {
  .site-header .brand img {
  width: 150px;
  max-height: 80px;
}

  .site-header .brand span {
    display: none;
  }

  .site-header .header-actions {
    gap: 10px;
  }

}

.brand {
  max-width: 150px;
}

.brand span {
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  color: var(--ink);
  font-weight: 600;
  max-width: 150px;
}

.demo {
  background: #fff2eb;
  color: #a43e0c;
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: 1px;
}

main {
  max-width: 1440px;
  margin: auto;
  padding: 0 64px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: bolder;
  color: var(--orange);
}

h1 {
  font-size: clamp(32px,4vw,52px);
  line-height: 1.13;
  letter-spacing: -1.7px;
  margin: 18px 0 17px;
  font-weight: bolder;
}

.intro p {
  color: var(--muted);
  max-width: 450px;
  line-height: 1.6;
}

.collection {
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}

h2 {
  font-size: 24px;
  font-weight: 500;
  margin: 0;
}

.search {
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 12px 16px;
  align-items: center;
  max-width: 400px;
  width: 38%;
  border-radius: 4px;
}

.search span {
  font-size: 26px;
  line-height: 1;
}

.search input {
  font: inherit;
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
  min-width: 0;
}

.note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 25px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 36px 28px;
  padding-bottom: 64px;
}

.card {
  background: none;
  text-align: left;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  min-width: 0;
}

.cover {
  aspect-ratio: 3/4;
  width: 100%;
  position: relative;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--cover);
  color: var(--text);
  box-shadow: 3px 4px 0#dfe3e5;
  overflow: hidden;
  transition: transform .2s;
}

.card:hover .cover {
  transform: translateY(-5px);
}

.cover-brand {
  font-size: 25px;
  letter-spacing: -1px;
  font-weight: 700;
}

.cover-meta {
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-top: 10px;
  line-height: 1.5;
}

.cover-title {
  font-family: Georgia,serif;
  font-size: clamp(20px,1.8vw,29px);
  line-height: 1.16;
  font-weight: 400;
  padding-top: 20px;
  z-index: 1;
  overflow-wrap: break-word;
}

.cover-rule {
  height: 1px;
  background: currentColor;
  opacity: .35;
  margin-bottom: 18px;
}

.cover-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 1px;
}

.cover-index {
  position: absolute;
  right: 14px;
  bottom: 28px;
  font-size: 125px;
  opacity: .055;
  font-weight: 700;
  letter-spacing: -8px;
}

.card-category {
  overflow-wrap: anywhere;
  font-size: 12px;
  color: #ad481a;
  margin: 20px 0 8px;
  letter-spacing: .8px;
}

.card h3 {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
  margin: 0 0 7px;
}

.author {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.card-end {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

footer {
  border-top: 1px solid var(--line);
  padding: 30px 64px;
  display: flex;
  align-items: center;
  gap: 25px;
  font-size: 13px;
  color: var(--muted);
}

footer b {
  font-size: 27px;
  color: var(--orange);
  letter-spacing: -2px;
}

footer a {
  margin-left: auto;
}

dialog {
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
}

dialog::backdrop {
  background: #15242bd9;
  backdrop-filter: blur(4px);
}

#detail {
  width: min(850px,92vw);
  max-height: 90dvh;
}

.close {
  position: absolute;
  right: 15px;
  top: 15px;
  border: 0;
  background: #f1f3f4;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  z-index: 2;
}

.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 38px;
  padding: 48px;
}

.detail-text {
  padding-top: 25px;
}

.detail-text h2 {
  font-family: Georgia,serif;
  font-size: 31px;
  line-height: 1.2;
  margin: 15px 0;
}

.detail-text p {
  line-height: 1.65;
  color: var(--muted);
}

.detail-text .author {
  font-size: 16px;
}

.primary {
  background: var(--orange);
  color: white;
  border: 0;
  padding: 14px 25px;
  border-radius: 3px;
  margin-top: 15px;
  font-weight: 600;
}

#reader {
  border-radius: 0;
  background: #e7eaec;
  overflow: hidden;
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  margin: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  outline: none;
  border: 0;
}

.reader-head {
  height: 86px;
  background: white;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #d5dadd;
}

.reader-head h2 {
  font-size: 16px;
  line-height: 1.4;
  margin-top: 6px;
}

.reader-head button {
  border: 0;
  background: #f2f3f4;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.reader-viewport {
  height: calc(100% - 178px);
  overflow: auto;
  padding: 30px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.pages {
  display: flex;
  gap: 2px;
  transform-origin: top center;
  transition: opacity .2s;
  box-shadow: 0 8px 35px #26394426;
  color: #222b31;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

.reader-controls {
  height: 60px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.reader-controls button {
  border: 1px solid var(--line);
  background: white;
  min-width: 38px;
  height: 36px;
  border-radius: 4px;
  font-size: 22px;
}

.reader-controls button:disabled {
  opacity: .3;
  cursor: default;
}

.reader-controls span {
  font-size: 14px;
}

.divider {
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 10px;
}

.reader-note {
  height: 32px;
  text-align: center;
  padding: 8px;
  background: white;
  font-size: 12px;
  color: var(--muted);
}

#empty {
  text-align: center;
  padding: 50px;
}

#reset {
  padding: 10px 20px;
  border: 0;
  background: var(--orange);
  color: white;
  border-radius: 4px;
}

@media (max-width:1000px) {
  header,main {
    padding-left: 32px;
    padding-right: 32px;
  }

  .grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }

  .cover-title {
    font-size: 24px;
  }

  .detail-layout {
    grid-template-columns: 230px 1fr;
    gap: 25px;
    padding: 40px;
  }

}

@media (max-width:650px) {
  header {
    height: 78px;
    padding: 0 20px;
    gap: 15px;
  }

  .brand {
    font-size: 36px;
    gap: 18px;
  }

  .brand span {
    font-size: 10px;
    letter-spacing: 1px;
    max-width: 120px;
  }

  .demo {
    margin-left: auto;
    font-size: 10px;
    padding: 6px;
  }

  main {
    padding: 0 20px;
  }

  .intro {
    padding: 32px 0 22px;
  }

  .intro h1 {
    font-size: 34px;
    font-weight: bolder;
    letter-spacing: -1px;
  }

  .intro p {
    font-size: 14px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .search {
    width: 100%;
    max-width: none;
  }

  .grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 28px 18px;
  }

  .cover {
    padding: 16px;
  }

  .cover-title {
    font-size: 20px;
    padding-top: 10px;
  }

  .cover-brand {
    font-size: 21px;
  }

  .cover-meta {
    font-size: 8px;
  }

  .cover-bottom {
    font-size: 9px;
  }

  .card h3 {
    font-size: 15px;
  }

  .card-category {
  overflow-wrap: anywhere;
    font-size: 11px;
  }

  .author {
    font-size: 13px;
  }

  footer {
    padding: 22px 20px;
    flex-wrap: wrap;
    gap: 14px;
  }

  footer span {
    max-width: 220px;
    line-height: 1.5;
  }

  footer a {
    margin-left: 0;
  }

  .detail-layout {
    display: flex;
    flex-direction: column;
    padding: 40px 25px;
    gap: 15px;
  }

  .detail-layout .cover {
    width: 200px;
    align-self: center;
  }

  .detail-text {
    padding-top: 10px;
  }

  .detail-text h2 {
    font-size: 26px;
  }

  .reader-head {
    padding: 12px 16px;
  }

  .reader-head h2 {
    font-size: 14px;
  }

  .reader-viewport {
    padding: 20px 12px;
  }

  .reader-controls {
    gap: 8px;
  }

  .divider {
    margin: 0 3px;
  }

  .reader-note {
    font-size: 10px;
  }

}

.pdf-error {
  padding: 40px;
  background: white;
  line-height: 1.6;
}

body.reader-open {
  overflow: hidden;
  overscroll-behavior: none;
}

#reader[hidden] {
  display: none;
}

#reader .reader-head {
  flex-shrink: 0;
  height: auto;
  min-height: 86px;
  padding-top: max(18px,env(safe-area-inset-top));
  padding-left: max(20px,env(safe-area-inset-left));
  padding-right: max(20px,env(safe-area-inset-right));
}

#reader .reader-viewport {
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 12px 16px;
  align-items: center;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

#bookMount {
  margin: auto;
  flex-shrink: 0;
  position: relative;
  min-width: 0;
}

#reader .pages {
  display: block;
  position: relative;
  gap: 0;
  margin: 0;
  transform: none;
  box-shadow: none;
  transition: none;
  flex-shrink: 0;
}

.flip-page {
  background: white;
  overflow: hidden;
  box-shadow: 0 1px 8px #1a293024;
  user-select: none;
}

.stf__parent {
  touch-action: none;
  user-select: none;
}

#reader .reader-controls {
  flex-shrink: 0;
  height: auto;
  min-height: 60px;
  padding: 10px max(10px,env(safe-area-inset-right)) 10px max(10px,env(safe-area-inset-left));
  gap: 12px;
}

#reader .reader-controls button {
  min-height: 40px;
  min-width: 40px;
}

#sound {
  font-size: 12px;
  font-weight: 700;
  width: 48px;
  color: #3a4850;
}

#sound[aria-pressed="false"] {
  color: #8b969d;
}

#reader .reader-note {
  height: auto;
  min-height: 32px;
  flex-shrink: 0;
  padding-bottom: max(8px,env(safe-area-inset-bottom));
  font-size: 12px;
  line-height: 1.4;
}

#readerNotice:empty {
  display: none;
}

#readerNotice {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 40px);
  background: #243942;
  color: white;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.5;
  pointer-events: none;
  box-shadow: 0 5px 25px #0002;
}

#reader.immersive .reader-head {
  min-height: 55px;
  padding-top: max(8px,env(safe-area-inset-top));
  padding-bottom: 8px;
  background: #e7eaec;
}

#reader.immersive .reader-head .eyebrow {
  display: none;
}

#reader.immersive .reader-note {
  display: none;
}

#reader.immersive .reader-head h2 {
  margin: 0;
  max-width: min(650px,75vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-loading {
  padding: 35px;
  text-align: center;
  color: #58636a;
  line-height: 1.6;
}

@media (max-width:650px) {
  #reader .reader-controls {
    gap: 5px;
    flex-wrap: wrap;
  }

  #reader .reader-controls button {
    min-width: 36px;
    min-height: 40px;
  }

  #reader .reader-controls #sound {
    width: 43px;
  }

  #reader .reader-controls span {
    font-size: 12px;
  }

  #reader .reader-head {
    min-height: 75px;
  }

  #reader .reader-viewport {
    padding: 12px;
  }

  #reader .reader-note {
    font-size: 11px;
  }

  .divider {
    margin: 0 1px;
  }

}

.flip-page img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: contain;
  background: white;
}

[hidden] {
  display: none !important;
}

.admin-link {
  font-size: 14px;
  font-weight: 600;
  color: #ab4210;
}

.uploaded-cover {
  padding: 0;
  background: #f0f2f3;
}

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

.abstract {
  white-space: pre-line;
}

#reloadCollection {
  background: #ff671e;
  color: white;
  padding: 12px 18px;
  border: 0;
  border-radius: 4px;
  margin-top: 16px;
}

.collection .toolbar {
  justify-content: flex-end;
}

.collection .search {
  width: 100%;
  max-width: 400px;
}

.collection #collectionNote:empty {
  display: none;
}

@media (max-width:650px) {
  .collection .search {
    max-width: none;
  }

}

#reader .reader-viewport::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background-image: linear-gradient(90deg,rgba(255,255,255,0.95) 0%,rgba(255,255,255,0.7) 45%,rgba(255,255,255,0) 100%),url(./assets/images/banner.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 340px;
  padding: 48px 40px;
  margin: 28px 0;
  border-radius: 8px;
}

.intro>div {
  position: relative;
  max-width: 550px;
}

@media (max-width:650px) {
  .intro {
    min-height: 280px;
    padding: 28px 20px;
    margin: 20px 0;
    background-position: center;
  }

}

@media (max-width:650px) {
  .site-header {
    height: auto;
    min-height: 78px;
    padding: 12px 16px;
    gap: 12px;
    flex-wrap: wrap;
  }

  .site-header .brand img {
  width: 150px;
  max-height: 80px;
}

  .site-header .header-actions {
    gap: 8px;
  }

  .site-header .demo {
    margin-left: 0;
  }

}


/* Pilihan baca dan download pada detail paper. */
.paper-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
}
.paper-actions .primary { margin-top: 0; }
.download-paper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 25px;
  border: 1px solid var(--orange);
  border-radius: 3px;
  color: var(--orange);
  background: white;
  font-weight: 600;
  text-decoration: none;
}
.download-paper:hover { background: #fff3ec; }
@media (max-width: 650px) {
  .paper-actions > * { flex: 1 1 100%; text-align: center; }
}


/* GEMINTANG MEDIA LIBRARY */
.brand-text{
  display:flex;
  align-items:center;
  gap:12px;
  max-width:none;
}
.brand-text strong{
  font-size:22px;
  letter-spacing:.12em;
  line-height:1;
}
.brand-text span{
  max-width:none;
  font-size:10px;
  letter-spacing:.18em;
  white-space:nowrap;
}
.card{ cursor:pointer; }
.card-category{ text-transform:uppercase; }

@media (max-width:650px){
  .brand-text strong{ font-size:18px; }
  .brand-text span{
    display:block;
    font-size:9px;
  }
}
