/* === Variabel Font CSS ===*/
@font-face {
  font-family: 'Quicksand';
  src: url('/assets/font/Quicksand.ttf') format('truetype');
}

@font-face {
  font-family: 'Fira Code';
  src: url('/assets/font/FiraCode.ttf') format('truetype');
}

:root {
  /* Main Colors */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-gray: #808080;
  --color-light: #f5f5f5;

  /* Font families */
  --font-quicksand: 'Quicksand';
  --font-fira-code: 'Fira Code';

  /* Font weights */
  --font-300: 300;
  --font-400: 400;
  --font-600: 600;

  /* Line heights */
  --line-1-5: 1.5;
  --line-1: 1;

  /* Spacing scale (based on 1rem = 10px) */
  --size-root: 62.5%;
  --size-42-dvh: 42dvh;
  --size-100-dvh: 100dvh;

  --size-0: 0;
  --size-5: 0.5rem;
  --size-10: 1rem;
  --size-12: 1.2rem;
  --size-14: 1.4rem;
  --size-16: 1.6rem;
  --size-18: 1.8rem;
  --size-20: 2rem;
  --size-24: 2.4rem;
  --size-30: 3rem;
  --size-32: 3.2rem;
  --size-34: 3.4rem;
  --size-50: 5rem;
  --size-55: 5.5rem;

  --size-100: 10rem;
  --size-110: 11rem;
  --size-160: 16rem;
  --size-200: 20rem;
  --size-210: 21rem;
  --size-280: 28rem;
  --size-560: 56rem;
  --size-570: 57rem;
  /* width */
  --width-null: 0;
  --width-full: 100%;
  /* opacity */
  --opacity-0: 0;
  --opacity-0-5: 0.5;
  --opacity-1: 1;
  /* Flex number */
  --flex: 1;
  /* grid-template-columns-1 */
  --grid-template-columns-1: 1;
  --grid-template-columns-2: 2;
  --grid-template-columns-3: 3;
  /* transition */
  --transition-normal: all 0.3s ease-in;
  --transition-sidebar: transform 0.3s ease-in-out;
  /* animation-slide-in */
  --animation-slide-in: slideIn 0.4s forwards;
  /* transform */
  --transform-sidebar: translateX(-100%);
  /* box-shadow */
  --box-shadow-header: 0 4px 6px #0000001a;
  --box-shadow-normal: #32325d40 0px 2px 5px -1px, #0000004d 0px 1px 3px -1px;
  /* border */
  --border-line: 1px solid #e0e0e0;
  /* z-index */
  --z-index--1: -1;
  --z-index-999: 999;
  --z-index-9999: 9999;
  /* order */
  --order-1: 1;
  --order-2: 2;
  --order-3: 3;
}

html {
  scroll-behavior: smooth;
  font-size: var(--size-root);
}

body {
  font-family: var(--font-quicksand);
  font-weight: var(--font-400);
  margin: var(--size-0);
  padding: var(--size-0);
  box-sizing: border-box;
}

a {
  text-decoration: none;
  outline: none;
  color: var(--color-black);
}

a:hover {
  color: var(--color-gray);
}

button {
  color: var(--color-black);
  padding: var(--size-10);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
}

button:disabled {
  opacity: var(--opacity-0-5);
  cursor: not-allowed;
  pointer-events: none;
}

button:hover {
  box-shadow: var(--box-shadow-normal);
}

a,
button,
.header,
.header-menu,
.burger,
.link-header-menu .dropdown,
.link-header-menu .dropdown a,
.search-container {
  transition: var(--transition-normal);
}

button,
.header,
.link-header-menu .dropdown a {
  background-color: var(--color-white);
}

.hidden {
  display: none !important;
}

/* === Header CSS ===*/
.header {
  position: fixed;
  display: flex;
  top: var(--size-0);
  padding: var(--size-0) var(--size-280);
  width: calc(var(--width-full) - var(--size-560));
  height: var(--size-50);
  z-index: var(--z-index-9999);
  align-items: center;
  justify-content: space-between;
}

#header.shadow {
  box-shadow: var(--box-shadow-header);
}

/* === Header CSS => Logo & Title ===*/
.header-logo {
  padding: var(--size-5);
}

.header-logo .header-logo-link {
  display: flex;
  align-items: center;
  gap: var(--size-5);
  cursor: pointer;
}

.header-logo .header-logo-link:hover {
  color: var(--color-black);
}

.header-logo img {
  width: var(--size-20);
  height: var(--size-20);
}

.header-logo span {
  font-size: var(--size-16);
  font-weight: var(--font-600);
}

/* === Header CSS => Menu ===*/
.link-header-menu {
  display: flex;
  gap: var(--size-20);
  list-style: none;
  padding-right: var(--size-5);
}

.link-header-menu li {
  position: relative;
}

.link-header-menu li a {
  display: block;
  font-size: var(--size-14);
  font-weight: var(--font-600);
  text-decoration: none;
  cursor: pointer;
}

/* === Header CSS => Menu Burger ===*/
.burger {
  display: none;
  cursor: pointer;
}

/* === Header CSS => Menu Close ===*/
.close-btn {
  display: none;
  position: absolute;
}

/* === Header CSS => Menu Dropdown ===*/
.link-header-menu .dropdown {
  background-color: var(--color-white);
  display: none;
  position: absolute;
  flex-direction: column;
  top: var(--size-34);
  left: var(--size-0);
  min-width: var(--size-160);
  max-height: calc(var(--size-100-dvh) - var(--size-50));
  z-index: var(--z-index-9999);
  box-shadow: var(--box-shadow-normal);
  overflow-y: scroll;
}

.link-header-menu .dropdown::-webkit-scrollbar {
  width: var(--size-0);
}

.link-header-menu .dropdown a {
  display: block;
  font-size: var(--size-14);
  font-weight: var(--font-300);
  text-decoration: none;
  padding: var(--size-12) var(--size-16);
}

.link-header-menu .dropdown a:hover {
  color: var(--color-black);
  background-color: var(--color-light);
}

.link-header-menu li.show .dropdown {
  display: flex;
}

.search-container {
  font-weight: var(--font-300);
  width: auto;
  right: var(--size-0);
  overflow: hidden;
  display: flex;
  align-items: center;
  z-index: var(--z-index--1);
}

.search-container.expanded {
  width: var(--size-280);
}

@keyframes slideIn {
  from {
    transform: translateX(var(--width-full));
    opacity: var(--opacity-0);
  }

  to {
    transform: translateX(var(--width-null));
    opacity: var(--opacity-1);
  }
}

.search-input {
  background-color: transparent;
  border: none;
  outline: none;
  flex: var(--flex);
  padding: var(--size-5);
  display: none;
  animation: var(--animation-slide-in);
}

input[type="text"] {
  font-family: var(--font-quicksand);
  font-size: var(--size-14);
  font-weight: var(--font-light);
  padding: var(--size-5) var(--size-0);
}

.search-container.expanded .search-input {
  display: block;
}

.search-icon,
.close-icon {
  cursor: pointer;
  font-size: var(--size-18);
  margin: var(--size-0) var(--size-5);
}

.search-icon {
  display: flex;
  align-items: center;
}

.search-icon img {
  width: var(--size-18);
  height: var(--size-18);
}

.search-container.expanded .search-icon,
.close-icon {
  display: none;
}

.search-container.expanded .close-icon {
  display: inline;
}

/* === Main CSS ===*/
.main {
  margin: var(--size-50) var(--size-280) var(--size-0);
  padding: var(--size-5);
}

/* === Main CSS => Highlight ===*/
.highlight-artikel {
  line-height: var(--line-1-5);
}

.highlight-thumbnail {
  width: var(--width-full);
  object-fit: cover;
  border-radius: var(--size-12);
}

.highlight-item {
  margin-bottom: var(--size-20);
  line-height: var(--line-1-5);
}

.highlight-title {
  font-size: var(--size-18);
}

.highlight-preview {
  font-size: var(--size-14);
}

.highlight-tanggal {
  font-size: var(--size-12);
  color: var(--color-gray);
}

/* === Main CSS => Search ===*/
.main-search {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--size-14);
}

/* === Main CSS => Content ===*/
#judul-container {
  display: grid;
  grid-template-columns: repeat(var(--grid-template-columns-3), auto);
  gap: var(--size-20);
  line-height: var(--line-1-5);
  margin-bottom: var(--size-20);
}

.thumbnail-artikel {
  width: var(--width-full);
  min-height: var(--size-160);
  display: block;
  border-radius: var(--size-12);
}

.item-artikel {
  overflow: hidden;
}

.title-artikel {
  font-size: var(--size-16);
}

.preview {
  font-size: var(--size-14);
}

.tanggal-artikel {
  font-size: var(--size-12);
  color: var(--color-gray);
}

/* === Main CSS => Total Content & Pagination ===*/
.main-total-pencarian {
  font-size: var(--size-12);
  text-align: center;
  padding-top: var(--size-20);
  border-top: var(--border-line);
}

.main-pagination {
  font-size: var(--size-14);
  font-weight: var(--font-600);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: var(--size-20);
  margin-top: var(--size-20);
}

#btn-prev,
#btn-next {
  font-family: var(--font-quicksand);
  font-size: var(--size-14);
  border-radius: var(--size-10);
}

/* === Footer CSS => Service & Copyright ===*/
.footer-about {
  font-size: var(--size-12);
  text-align: center;
  padding: var(--size-0) var(--size-280);
  margin: var(--size-20) var(--size-0);
  border-top: var(--border-line);
}

.footer-copyright {
  text-align: center;
  margin-bottom: var(--size-20);
}

.footer-copyright span {
  font-size: var(--size-14);
  font-weight: var(--font-600);
}


/* ======= Main CSS / Artikel CSS / Responsive =======*/
@media (max-width: 1200px) {
  .header {
    padding: var(--size-0) var(--size-100);
    width: calc(var(--width-full) - var(--size-200));
    z-index: var(--z-index-9999);
  }

  .main {
    margin: var(--size-50) var(--size-100) var(--size-0);
  }

  #judul-container {
    grid-template-columns: repeat(var(--grid-template-columns-3), auto);
  }

  .footer-about {
    padding: var(--size-0) var(--size-100);
  }
}

@media (max-width: 976px) {
  .header-logo {
    order: var(--order-2);
  }

  .burger {
    order: var(--order-1);
  }

  .search-container {
    order: var(--order-3);
  }

  .header {
    padding: var(--size-0) var(--size-50);
    width: calc(var(--width-full) - var(--size-100));
  }

  .header-logo span {
    font-size: var(--size-16);
    font-weight: var(--font-600);
  }

  .link-header-menu {
    background-color: var(--color-white);
    position: absolute;
    top: var(--size-0);
    left: var(--size-0);
    width: var(--width-full);
    height: var(--size-100-dvh);
    flex-direction: column;
    margin-top: var(--size-0);
    padding-top: var(--size-50);
    transition: var(--transition-sidebar);
    transform: var(--transform-sidebar);
  }

  .link-header-menu.active {
    transform: translateX(var(--size-0));
  }

  .burger {
    font-size: var(--size-18);
    display: block;
    font-weight: var(--font-600);
    padding: var(--size-5);
    order: var(--order-1);
  }

  .close-btn {
    display: block;
    right: var(--size-55);
    top: var(--size-16);
    font-size: var(--size-18);
    font-weight: var(--font-600);
    padding: var(--size-5);
    cursor: pointer;
  }

  .header-menu ul {
    padding-left: var(--size-0);
  }

  .link-header-menu {
    gap: var(--size-10);
  }

  .link-header-menu li {
    padding-left: var(--size-50);
  }

  .link-header-menu li a {
    font-size: var(--size-16);
    padding: var(--size-16) var(--size-0);
  }

  .link-header-menu .dropdown {
    position: static;
    width: calc(var(--width-full) - var(--size-50));
    box-shadow: none;
    border-left: var(--border-line);
  }

  .main {
    margin: var(--size-50) var(--size-50) var(--size-0);
  }

  #judul-container {
    grid-template-columns: repeat(var(--grid-template-columns-2), auto);
  }

  .footer-about {
    padding: var(--size-0) var(--size-50);
  }
}

@media (max-width: 657px) {
  .header {
    padding: var(--size-0) var(--size-10);
    width: calc(var(--width-full) - var(--size-20));
  }

  .link-header-menu {
    width: calc(var(--width-full) - var(--size-10));
  }

  .link-header-menu li {
    padding-left: var(--size-10);
  }

  .close-btn {
    right: var(--size-16);
  }

  .header-menu ul {
    padding-left: var(--size-5);
  }

  .link-header-menu .dropdown {
    margin-left: var(--size-5);
    width: calc(var(--width-full) - var(--size-20));
  }

  .main {
    margin: var(--size-50) var(--size-10) var(--size-0);
  }

  .footer-about {
    padding: var(--size-0) var(--size-10);
  }

  .footer-copyright p {
    margin: var(--size-0) var(--size-5);
  }
}

@media (max-width: 567px) {
  #judul-container {
    grid-template-columns: repeat(var(--grid-template-columns-1), auto);
  }

  .search-container.expanded {
    width: calc(var(--width-full) - var(--size-32));
    ;
  }
}

@media (max-width: 330px) {
  .main-search span {
    display: none;
  }

  #search {
    width: var(--width-full);
  }

  .main-pagination {
    flex-direction: column;
    justify-content: center;
    gap: var(--size-0);
  }
}

@media (max-width: 250px) {
  .header-logo img {
    display: none;
  }
}
