/* ===== Header ===== */
.hdr {
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
  /* iOS Safariでのstickyサポート */
  -webkit-position: sticky;
}

.hdr__inner {
  display: grid;
  align-items: center;
  column-gap: 12px;
  grid-template-columns: auto 1fr auto;
  height: var(--hdr-h);
  margin-inline: auto;
  max-width: var(--max-width);
  padding-inline: var(--pad-x);
}

/* Logo */
.hdr__brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.hdr__logo {
  height: 36px;
  width: auto;
}

/* SNS Links */
.hdr__sns {
  display: flex;
  align-items: center;
  gap: var(--gap);
  justify-content: center;
  min-width: 0;
}

.sns__link {
  display: inline-grid;
  height: 24px;
  place-items: center;
  width: 24px;
}

.sns__link:hover {
  opacity: 0.7;
}

.sns__link img {
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.hdr__subtitle,
.hdr__title {
  display: none;
}

.hdr__menu {
  display: none;
}

/* Hamburger Button */
.hdr__burger {
  display: grid;
  background: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  height: 44px;
  padding: 0;
  place-items: center;
  width: 44px;
}

.burger {
  background: linear-gradient(#7a7a7a 0 0) center/100% 2px no-repeat;
  height: 12px;
  position: relative;
  width: 20px;
  transition: background 0.3s ease;
}

.burger::before,
.burger::after {
  background: #7a7a7a;
  border-radius: 2px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
  transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
}

.burger::before {
  top: 0;
}

.burger::after {
  bottom: 0;
}

.hdr__burger[aria-expanded="true"] .burger {
  background: transparent;
}

.hdr__burger[aria-expanded="true"] .burger::before {
  top: 5px;
  transform: rotate(45deg);
}

.hdr__burger[aria-expanded="true"] .burger::after {
  bottom: 5px;
  transform: rotate(-45deg);
}

/* ===== Hamburger Menu ===== */
.hdr__burger-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dcdad3;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hdr__burger-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.hdr__burger-menu a {
  color: var(--ink);
  text-decoration: none;
}

.hdr__burger-top-logo {
  width: 80px;
  height: auto;
}

.hdr__burger-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

/* Search Box */
.hdr__burger-search {
  position: relative;
  padding: 15px;
  width: 100%;
}

.hdr__burger-search input {
  width: 100%;
  height: 45px;
  line-height: normal;
  padding: 0 48px 0 16px;
  border: 1px solid #2b2b2b;
  border-radius: 30px;
  outline: none;
  font-family: "Zen Maru Gothic", "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.hdr__burger-search input:focus {
  border-color: #999;
}

.hdr__burger-search input::placeholder {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  font-family: "Zen Maru Gothic", "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.hdr__burger-search button {
  position: absolute;
  top: 34%;
  right: 35px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
}

/* Menu Container */
.hdr__burger__inner-menu {
  margin: 0 15px 15px;
  background-color: #ffffff;
  border-radius: 30px;
  border: 1px solid #2b2b2b;
}

.hdr__burger-menu ul {
  margin: 0;
  padding: 0;
}

.hdr__burger-menu ul li {
  list-style: none;
  padding: 5px 0 5px 25px;
}

/* Menu Items */
.hdr__burger-list li {
  border-bottom: 1px solid #2b2b2b;
}

.hdr__burger-list li:last-child {
  border-bottom: none;
}

.hdr__burger-list li div {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hdr__burger-list li a {
  display: flex;
  align-items: center;
  gap: 25px;
  width: 100%;
}

.hdr__burger-list li img {
  width: 30px;
  height: 30px;
}

.hdr__burger-list li p {
  flex: 1;
  font-size: 20px;
  font-weight: bold;
  color: var(--text-secondary);
}

/* Category Backgrounds */
.hdr__burger-tired {
  background-color: #e6dec8;
}

.hdr__burger-rest {
  background-color: #f8e2c9;
}

.hdr__burger-rest img,
.hdr__burger-money img,
.hdr__burger-return img,
.hdr__burger-lifehack img,
.hdr__burger-media img {
  width: 40px;
  height: 40px;
}

.hdr__burger-money {
  background-color: #f7e7ac;
}

.hdr__burger-return {
  background-color: #efc7c0;
}

.hdr__burger-lifehack {
  background-color: #dee8d5;
}

.hdr__burger-media {
  background-color: #bccdcc;
}

/* Tags Section */
.hdr__burger__tag-wrap {
  padding: 25px;
  border-top: 1px solid #2b2b2b;
  border-bottom: 1px solid #2b2b2b;
  color: var(--text-secondary);
}

.hdr__burger__tag-wrap h2 {
  margin: 0 0 5px;
}

.hdr__burger__tag-wrap .hdr__burger__tag-inner {
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 5px;
}

.hdr__burger__tag-wrap .hdr__burger__tag-inner a {
  background-color: #c3c3c3;
  border-radius: 10px;
  padding: 0 15px;
}

.hdr__burger__tag-wrap .hdr__burger__tag-inner a p {
  margin: 0;
}

.hdr__burger__tag-wrap .hdr__burger__tag-link {
  display: block;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hdr__burger__tag-wrap .hdr__burger__tag-link::before {
  content: "+";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer Links */
.hdr__burger__footer {
  padding: 25px;
}

.hdr__burger__footer ul {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hdr__burger__footer ul li {
  margin: 0;
  padding: 0;
}

.hdr__burger__footer ul li a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== Desktop Styles ===== */
@media (min-width: 1024px) {
  .hdr__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    width: 100%;
    max-width: 1300px;
    padding: 10px 50px 0;
  }

  .hdr__brand {
    width: 131px;
    height: 100px;
  }

  .hdr__brand .hdr__logo {
    width: 100%;
    height: auto;
  }

  .hdr__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .hdr__subtitle {
    display: block;
    font-size: 18px;
  }

  .hdr__title {
    display: block;
    font-weight: bold;
    font-size: 24px;
  }

  .hdr__subtitle,
  .hdr__title {
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
    padding: 0;
  }

  .hdr__sns {
    justify-content: space-between;
  }

  .hdr__burger {
    display: none;
  }

  .hdr__menu {
    display: flex;
    gap: 10px;
  }

  .hdr__menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    text-decoration: none;
    width: auto;
    height: auto;
    color: var(--text-secondary);
  }

  .hdr__menu a:hover p {
    text-decoration: underline;
  }

  .hdr__menu__icon-bg {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: clamp(80px, 10vw, 107px);
    height: clamp(80px, 10vw, 107px);
    border-radius: 50%;
  }

  .hdr__menu a p {
    margin: 0;
    padding: 0;
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: bold;
  }

  /* Category Backgrounds */
  .hdr__menu-tired .hdr__menu__icon-bg {
    background-color: #e6dec8;
  }

  .hdr__menu-tired .hdr__menu__icon-bg img {
    width: 40px;
    height: 40px;
  }

  .hdr__menu-rest .hdr__menu__icon-bg {
    background-color: #f8e2c9;
  }

  .hdr__menu-rest .hdr__menu__icon-bg img,
  .hdr__menu-money .hdr__menu__icon-bg img,
  .hdr__menu-return .hdr__menu__icon-bg img,
  .hdr__menu-lifehack .hdr__menu__icon-bg img,
  .hdr__menu-media .hdr__menu__icon-bg img,
  .hdr__menu-search .hdr__menu__icon-bg img {
    width: 40px;
    height: 40px;
  }

  .hdr__menu-money .hdr__menu__icon-bg {
    background-color: #f7e7ac;
  }

  .hdr__menu-return .hdr__menu__icon-bg {
    background-color: #efc7c0;
  }

  .hdr__menu-lifehack .hdr__menu__icon-bg {
    background-color: #dee8d5;
  }

  .hdr__menu-media .hdr__menu__icon-bg {
    background-color: #bccdcc;
  }

  .hdr__menu-search .hdr__menu__icon-bg {
    background-color: #ffffff;
  }

  .hdr__burger-menu {
    display: none;
  }
}