/**
 * File: base.css
 * Description: Base CSS
 * @version 1.0.0
 */

/* =========================================
   RESET
   ========================================= */

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

/* =========================================
   FOCUS STYLES
   ========================================= */

button:focus,
input:focus,
select:focus,
textarea:focus,
.app-navigation-toggle:focus,
.btn-trigger:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn-trigger:focus-visible {
  outline: 1px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* =========================================
   DOCUMENT FOUNDATION
   ========================================= */

html,
body {
  font-family: Arial, Helvetica, "Noto Sans JP", "Hiragino Sans", "Yu Gothic",
    sans-serif;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-base);
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
}

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

/* =========================================
   BACKGROUND UTILITIES
   ========================================= */

.dot-background {
  background: var(--color-dot-surface);
  background-image: radial-gradient(circle, var(--color-dot) 1px, transparent 1px);
  background-position: 0 0;
  background-size: 3px 3px;
}

.dot-background-dark {
  background: var(--color-dot-surface-dark);
  background-image: radial-gradient(circle, var(--color-dot-dark) 1px, transparent 1px);
  background-position: 0 0;
  background-size: 3px 3px;
}

/* =========================================
   HEADER
   ========================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--layout-header-height);
  display: flex;
  align-items: center;
  background: var(--color-surface-header);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-header);
}

.header-content {
  height: 100%;
  width: 100%;
  max-width: var(--layout-max-width);
  padding: 0 var(--layout-content-padding);
  display: flex;
  align-items: center;
  margin: 0 auto;
}

h1 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -1px;
}

/* =========================================
   SIDEBAR
   ========================================= */

.sidebar {
  width: var(--layout-sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 160;
  overflow-y: auto;
  background: var(--color-surface-sidebar);
  border-right: 1px solid var(--color-border);
  padding: var(--layout-header-height) var(--layout-content-padding) var(--layout-content-padding);
  font-size: var(--font-size-sidebar);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-title {
  font-size: calc(var(--font-size-sidebar) - 2px);
  color: var(--color-text-muted);
  font-weight: normal;
  margin-bottom: calc(var(--layout-content-padding) / 3);
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-section {
  margin-bottom: var(--layout-content-padding);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-button {
  width: 100%;
  padding: 8px 0;
  border: none;
  display: flex;
  font-size: var(--font-size-sidebar);
  background: none;
  text-align: left;
  cursor: pointer;
  position: relative;
  color: var(--color-text);
  appearance: none;
  align-items: center;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-button::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 100%;
}

.sidebar-button:hover::before,
.sidebar-button.active::before {
  background: var(--color-border);
}

.sidebar-button:not(:is(.category-item, .type-item, .view-item)) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 24px;
  font-size: calc(var(--font-size-sidebar) - 1px);
  font-weight: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='4 4 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23111111' d='M7.8 10a2.2 2.2 0 0 0 4.4 0 2.2 2.2 0 0 0-4.4 0z'/%3E%3C/svg%3E");
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
}

.sidebar-btn-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-count {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 12px;
  font-weight: 100;
  display: inline-block;
}


/* =========================================
   SIDEBAR SEARCH BOX
   ========================================= */

.search-box {
  position: sticky;
  top: 0;
  background: var(--color-surface-sidebar);
  z-index: 20;
  padding: 20px 0;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--color-border);
  border-radius: 0;
  background-color: var(--color-surface);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='-0.45 -0.45 24.9 24.9' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='currentColor' stroke-miterlimit='10' stroke-width='1.91'%3E%3Ccircle cx='9.14' cy='9.14' r='7.64'/%3E%3Cline x1='22.5' y1='22.5' x2='14.39' y2='14.39'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 18px 18px;
  color: var(--color-text);
  font-family: inherit;
  font-size: calc(var(--font-size-sidebar) - 2px);
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

/* =========================================
   GO TO TOP BUTTON
   ========================================= */

.go-to-top {
  position: fixed;
  right: var(--layout-content-padding);
  bottom: 0;
  z-index: 1002;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 28px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: 0.5s;
}

.go-to-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.go-to-top::before {
  content: "";
  width: 0;
  height: 0;
  border-right: 14px solid transparent;
  border-bottom: 18px solid var(--color-accent-primary);
  border-left: 14px solid transparent;
}

/* =========================================
   MOBILE DRAWER BUTTON
   ========================================= */

.btn-trigger {
  display: inline-block;
  position: absolute;
  right: var(--layout-content-padding);
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 24px;
  cursor: pointer;
}

.btn-trigger,
.btn-trigger span {
  transition: all 0.5s;
}

.btn-trigger span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-accent-primary);
  border-radius: 3px;
}

.btn-trigger span:nth-of-type(1) {
  top: 0;
}

.btn-trigger span:nth-of-type(2) {
  top: 10.5px;
}

.btn-trigger span:nth-of-type(3) {
  bottom: 0;
}

#btn08.active span:nth-of-type(1) {
  transform: translateY(10.5px) rotate(-315deg);
}

#btn08.active span:nth-of-type(2) {
  opacity: 0;
}

#btn08.active span:nth-of-type(3) {
  transform: translateY(-10.5px) rotate(315deg);
}

/* =========================================
   DRAWER OVERLAY
   ========================================= */

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--color-overlay);
}

.drawer-overlay.open {
  display: block;
}

/* =========================================
   MAIN PAGE LAYOUT
   ========================================= */

.container {
  display: flex;
  margin-top: var(--layout-header-height);
}

/* =========================================
   CONTENT AREA
   ========================================= */

.content {
  flex: 1;
  min-width: 0;
  height: calc(100dvh - var(--layout-header-height));
  padding: 0 var(--layout-content-padding) calc(var(--layout-content-padding) * 2);
  overflow-y: auto;
  background: var(--color-surface);
}

.content-upper-section {
  height: 56px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}

.current-view-label {
  display: flex;
  gap: 10px;
}

.result-detail {
  display: flex;
  gap: 10px;
}

/* =========================================
   GRID LAYOUT
   ========================================= */

.content-grid {
  display: grid;
}

.grid-item {
  display: flex;
  position: relative;
}

/* =========================================
   GRID IMAGE
   ========================================= */

.grid-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.grid-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.grid-image img.visible {
  opacity: 1;
}

.grid-image-placeholder {
  color: var(--color-text-muted);
  width: 60%;
  height: 60%;
}

.grid-image:has(.grid-image-placeholder) {
  background-color: var(--color-surface-subtle);
}

@media (prefers-reduced-motion: reduce) {
  .grid-image img {
    opacity: 1;
    transition: none;
  }
}

/* =========================================
   GRID CONTENT
   ========================================= */

.grid-item-content {
  display: flex;
}

.grid-item-content-lower,
.grid-item-content-upper {
  display: flex;
}

/* =========================================
   RESPONSIVE : LARGE PHONE
   ========================================= */

@media (min-width: 430px) {

}

/* =========================================
   RESPONSIVE : TABLET PORTRAIT
   ========================================= */

@media (min-width: 768px) {
}

/* =========================================
   RESPONSIVE : TABLET LANDSCAPE
   ========================================= */

@media (min-width: 1024px) {
  .btn-trigger {
    display: none;
  }

  .drawer-overlay,
  .drawer-overlay.open {
    display: none;
  }

  .sidebar {
    z-index: 120;
    transform: none;
    transition: none;
  }

  .content {
    margin-left: var(--layout-sidebar-width);
  }
}

/* =========================================
   RESPONSIVE : SMALL LAPTOP
   ========================================= */

@media (min-width: 1366px) {
  .content-upper-section {
    height: 66px;
  }

  .search-box {
    padding: 22px 0;
  }

  .search-input {
    height: 42px;
  }
}

/* =========================================
   RESPONSIVE : LARGE LAPTOP
   ========================================= */

@media (min-width: 1536px) {

}

/* =========================================
   RESPONSIVE : DESKTOP
   ========================================= */

@media (min-width: 1920px) {

}

